MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
Changing the language of a window breaks displaying child nodes of a TreeView
- Dominant language
- C#
- Stars
- 16.3k
- Forks
- 3.5k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 8
Description
### 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
Contributor guide
Research direction
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.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100