In the XAML belonging to the Dialog:
<Window ... WindowStartupLocation="CenterOwner">
and in C# when you instantiate the Dialog:
MyDlg dlg = new MyDlg();
dlg.Owner = this;
if (dlg.ShowDialog() == true)
{
...
More Related Contents:
- Open directory dialog
- WPF showing dialog before main window
- ComboBox Dropdown when Mouse Enter WPF
- Binding Visibility for DataGridColumn in WPF
- INotifyPropertyChanged vs. DependencyProperty in ViewModel
- Keyboard shortcuts in WPF
- What is a ViewModelLocator and what are its pros/cons compared to DataTemplates?
- WPF vs Silverlight [duplicate]
- WPF ContextMenu woes: How do I set the DataContext of the ContextMenu?
- inherit style from default style
- WPF: Setting the Width (and Height) as a Percentage Value
- What are WPF Preview Events?
- WPF datagrid header text binding
- WPF Grid as ItemsPanel for a list dynamically bound to an ItemsControl
- How can I turn binding errors into runtime exceptions?
- How to disable highlighting on listbox but keep selection?
- WPF VirtualizingStackPanel for increased performance
- Select ListBoxItem if TextBox in ItemTemplate gets focus
- Create a BitmapImage from a byte array
- Highlight whole TreeViewItem line in WPF
- How do I suppress script errors when using the WPF WebBrowser control?
- How do I databind a ColumnDefinition’s Width or RowDefinition’s Height?
- Resize a WPF window, but maintain proportions?
- How do you make sure WPF releases large BitmapSource from Memory?
- How to make XmlnsDefinition work on the local assembly?
- Create flat button in WPF
- WPF MouseLeftButtonUp Not Firing
- Text vertical alignment in WPF TextBlock
- Can I bind HTML to a WPF Web Browser Control?
- Binding ElementName. Does it use Visual Tree or Logical Tree