How do you set the parent of a WPF window when you want to show it as a dialog? Both methods Show() and ShowDialog() don't seem to have that option.
This was possible in Java as you could pass the parent in the constructor. Is it possible in any way in WPF?
EDIT: I'm using C#
owner can be set but parent is a readonly property.
var w = new Window();
w.Owner = Window.GetWindow(this);
w.Show();
on your "Showdialog" object do:
templateWindow.Owner= System.Windows.Application.Current.MainWindow;
templateWindow.ShowDialog();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With