How to force control ignore any gui events in Silverlight - silverlight

I have a simple page with canvas control.
Inside canvas I have some SL controls like buttons, textboxes etc.
Also I cover the controls by semi-transparent Image control. So, when I click on some button, the click message doesn't reach the button, because I click on Image.
Is there a way to say the Image that it must not handle any gui events ?
p.s I use SL4

You should add IsHitTestVisible="False" to your image.

Related

WPF Notification Balloon using a User Control

I am working in a WPF app in C# and it is really very very sad that WPF doesn't have a NotifyIcon like in the Win forms has. I have seen a lot of articles in the net for a wpf notifyicon balloon notification project. But none satisfied me. See, I have an idea but i don't know how to execute it.
Create a wpf user control with height and width same like the notifyicon.
Put a border control in it with corner radius 5. Put a grid inside that border control to place the textblocks and images.
Then position that user control to the system tray area. When we click a button from a window, this user control shows up just above the system tray and it hides when we click on outside area.
Is this possible to place the user control [this new "notifyicon" ] just above the system tray area ???
You can do this using an AdornerDecorater in you XAML.
Check this project out GitHub. It has a configurable notification toast popup control for WPF with a demo app.

WPF : Getting the sender of UserControl

I am having WPF MVVM application. I am having UserControl.
From few places in application I am calling this UserControl. User Control contains Image which show camera stream and back button.
The problem is when I click "Back" in UserControl I would like to know who called it.
Does anyone know how I can get sender?

How to show a WPF modal window over a WPF popup?

I have a WPF app where I make my screen dark and show the user a popup for him to fill in some data.
One of the controls hosted in that popup might raise a modal window asking the user to confirm some validation results, when that modal is raised it doesn't show because the popup takes precedence in the UI.
Is there a way to force the modal be shown over the popup?

WPF Window with Control in Full Screen Mode

I have a WPF window hosting a web browser control. I want this WPF window to always be on top. Now for example user surfs to a Youtube page and the web player plays a video. User clicks on the full screen button in the Youtube player and the video fills the screen. But my WPF window that hosts web browser control now is still on top of everything and it looks weird because in the background, the video plays fullscreen.
Is there any way an embedded control can tell WPF window that it's in fullscreen mode now so that the WPF is no longer on top, say maybe hidden?
Thanks for any advice!
Try to play with Topmost property. If you display content not in Popup than this should works:
window.Topmost = false;

How to prevent WebBrowser control from stealing focus from other text box in my WPF form

My WPF app has a window with various text boxes and a WebBrowser control.
The WebBrower control is used to show a web site (I doesn't own) and then a Login button in the WPF window fills the fields in the site from the text boxes.
The problem is that the web site calls focus() method on one of its input fields on load, and that still the focus from the text box in my WPF window. I want the focus to be on the WPF window field and not in the web page within the WebBrowser control.
I tryed calling MyTextBox.Focus() in the WebBrowser's LoadCompleted event, but to no avail. Setting the WebBrowser's IsEnabled or even Visibility properties didn't help either.
Does anyone have an idea how I can overcome this and move the focus to the WPF control instead of the web page input field?
Don't think you can extend the control site to add IProtectFocus to the site. Try interop the Windows Forms version of the webbrowser control and override the CreateWebBrowserSiteBase method to provide your own control site.

Resources