Open KevHoff2020 opened 4 years ago
While maybe not elegant or proper I was able to overcome by setting the IsEnabled property of the main window to false before calling DialogHost.Show. It also violates the ViewModel not knowing about the View!
// TODO: Need a way to prevent mainmenu from switching while this is open!
var mw = (Views.MainWindow)Application.Current.MainWindow;
mw.dh_RootDialog.IsEnabled = false;
object result = await MaterialDesignThemes.Wpf.DialogHost.Show(model, "Inventory");
Hi,
I started using DialogHost to popup a dialog to edit some properties of a currently selected item. However if I switch dialogs while the Edit dialog is displayed, and then return back the Edit dialog disappears and all I see is the gray parent dialog and no way to recover.
In MainWindows.xaml I have:
In InventoryViewControl.xaml I have another DialogHost so I can popup edit controls for selected items.
In the ViewModel for the InventoryViewControl I have:
In the picture below, showing the RootDialog Drawer menu, the Inventory in the background and the Owner Information from the OwnerViewControl showing.
If I select "Billing" it switches to Billing, and then when I come back to "Inventory" all I see is the gray inventory and the OwnerViewControl is not showing and no way to get it.
Is there an event that I can use to make it pop back up, or would it better to try to prevent the RootDialog from being able to select a different item?
Thoughts?