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

未關閉
#3,154 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
csharp
領域
desktop

研究方向

從 MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TreeView.xaml 中第 359 行附近的 binding 開始,然後使用連結的範例應用程式及其語言變更情境重現問題。調查 UI 更新後 binding 參照錯誤 ItemsHost 的原因;完成標準是變更視窗語言後 TreeView 子節點能夠正確顯示。

由索引模型根據 Issue 內容生成。

描述

bug evaluation required
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://user-images.githubusercontent.com/31562861/229203111-cf8afc11-aac1-4830-878d-4d41ee21e4e9.mp4

Using Snoop I figured out that this binding breaks as it somehow references the wrong ItemsHost element.

I temporarily fixed the issue by changing the line from

<Binding ElementName="ItemsHost" Path="ActualHeight" />

to

<Binding RelativeSource="{RelativeSource Mode=Self}" Path="Children[0].ActualHeight" />

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

Version

4.6.1, 4.8.0

主要語言
C#
星號
16.3k
分支
3.5k
平均合併
4 小時 25 分鐘
30 天內合併 PR
4

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

MaterialDesignInXAML/MaterialDesignInXamlToolkit 的其他 Issue

查看 MaterialDesignInXAML/MaterialDesignInXamlToolkit 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。