WPF 相依性屬性 (DP) 設值來源多樣(Style、Animation、Binding、Trigger、直接賦值),優先級機制複雜。RadioButton 為實現單選,會自動將同群組其他項的 IsChecked 設為 False,但其內部設值方式導致綁定失效。
兩個 Person 物件 (Bill Gates, Steve Ballmer) 實作 INotifyPropertyChanged,IsCeo 屬性雙向綁定至兩個 RadioButton。
<RadioButton DataContext="{StaticResource First}" IsChecked="{Binding IsCeo}" Content="{Binding Name}" GroupName="ceo"/>
<RadioButton DataContext="{StaticResource Second}" IsChecked="{Binding IsCeo}" Content="{Binding Name}" GroupName="ceo"/>
截圖:

RadioButton 內部自動清除選取的實作方式破壞了雙向綁定,嚴重影響 MVVM 開發模式。開發者需改用單向綁定配合命令或行為 手動同步。