Propert圜hangedEventHandler handler = this. Protected virtual void OnPropert圜hanged(string propertyName) Public event Propert圜hangedEventHandler Propert圜hanged Also the user may close them (just like any other windows). Otherwise, they can change location of each other and exchange messages. The main window and the popup can freely read and modify each other if they have the same origin. Public class SampleViewModel : INotifyPropert圜hanged The popup may access the opener window using the window.opener property. / Interaction logic for MainWindow.xaml
#Codejock popup control example code#
Here’s some sample code that uses the Popup Control. I used DataTemplates inside of to define how the PopupContent should look. By default, the Escape key will hide the popup, and the EnterKe圜ommand will not fire if focus is in a TextBox with AllowsReturn=True Sample Code BackgroundOpacity determines how transparent the background should be, and Enter/Escape key commands determine what command to execute when the Enter/Escape key is pressed. The Background Opacity, EnterKey, and EscapeKey are all optional. The PopupParent is the Panel you want to host the Popup in, the Content is what is stored in the Content of the panel, and the IsPopupVisible determines if the popup is up or not. It can be used with the following bit of XAML So this is what I came up with my own UserControl to accomplish it. That could be placed within a panel on a form so that only part of the form is disabled.Would have a semi-transparent background so you could see the application in the background but not interact with it.Not be on top of other windows when my application was minimized.I never did like WPF’s built in Popup Control, so I decided to build my own.