MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit

Changing the language of a window breaks displaying child nodes of a TreeView

未关闭
#3,154 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug evaluation required
主要语言
C#
星标
16.3k
派生
3.5k
平均合并
1 天 22 小时
30 天内合并 PR
8

描述

### Bug explanation

Changing the language of a window breaks displaying child nodes of a TreeView. I assume it has something to do with an UI update because it breaks in another app when different TreeViews are displayed. The only way I can reliably reproduce the issue is with the language change.

Here is a video demonstrating the issue. I also uploaded an [example app](https://github.com/reiseder/material-design-tree-view-bug).

https://user-images.githubusercontent.com/31562861/229203111-cf8afc11-aac1-4830-878d-4d41ee21e4e9.mp4

Using Snoop I figured out that this [binding](https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/master/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TreeView.xaml#L359) breaks as it somehow references the wrong `ItemsHost` element.

I temporarily fixed the issue by changing the line from

```xml

```

to

```xml

```

I don't think that is the proper solution though.

### Version

4.6.1, 4.8.0

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

Start with MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TreeView.xaml at the binding around line 359, then reproduce the problem using the linked example app and its language-change scenario. Investigate why the binding references the wrong ItemsHost after the UI update; done means TreeView child nodes display correctly after changing the window language.

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
desktop
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。