MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
DialogHost Disappears Question
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 16.3k
- 派生
- 3.5k
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 8
描述
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:
Basically the same structure as the MaterialDesign demo, where I have a DrawerHost to popup
the main menu views that you can select from (Home, Inventory, Billing, etc.)
One of the menu items is "Inventory"
In InventoryViewControl.xaml I have another DialogHost so I can popup edit controls for selected items.
In the ViewModel for the InventoryViewControl I have:
private async void OnEditOwnerDialog(object _)
{
// The view associated with this model is defined in InventoryViewControl.xaml !!
var model = new OwnerViewControlModel(SelectedOwnerId);
object result = await MaterialDesignThemes.Wpf.DialogHost.Show(model, "Inventory");
SaveOrCancel answer = (SaveOrCancel)(result ?? SaveOrCancel.None);
switch(answer)
{
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?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 MainWindows.xaml 和 InventoryViewControl.xaml 开始,重点关注标识为 RootDialog 和 Inventory 的嵌套 DialogHost 元素。在 Inventory 和 Billing 视图之间切换时,跟踪 OnEditOwnerDialog 调用到 DialogHost.Show 的过程。Done 应定义并验证返回 Inventory 时的预期行为:所有者对话框仍可恢复,或适当地阻止导航。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- desktop
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100