Validation rule is not fired when control is loaded with binding

未關閉
#2,797 4 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
csharp
領域
desktop

研究方向

從連結的示範專案 WpfValidationProblem 開始,重現直接在 XAML 中加入使用者控制項與透過 view-model 繫結載入使用者控制項之間的差異。比較這兩種載入路徑,以找出驗證規則未觸發的原因,然後確認在回報的 4.5.0 設定下,這兩種情況的驗證都能正常運作。

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

描述

bug evaluation required
Bug explanation

when a userControl is added with xaml directly, the validation rules used inside the UC works just fine, but when the same UC is loaded via binding of view model, the validation does not work. Here is an screenshot
image

and here is a demo project reproducing the problem: repo
I struggled a lot with this but just couldn't find a way to fix this. Also I don't know if this is something wrong with my code, or it is really a bug.

Version

4.5.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 摘要。