我有一個用戶控件複選框:綁定的屬性總是返回false但WPF綁定的CheckBox還是檢查
<CheckBox Content="Existing" IsChecked="{Binding Path=IsExistingTemplate, Mode=TwoWay}"/>
這勢必會帶有屬性IsExistingTemplate的DataContext總是返回False。 (在我的真實應用程序中,它並不總是返回False!)。 DataContext實現INotifyPropertyChanged。
public bool? IsExistingTemplate { 得到 { return false; } 設置 { OnPropertyChanged( 「IsExistingTemplate」) } }
當用戶點擊該複選框,複選框總是顯示蜱。
如何強制CheckBox在用戶點擊時不顯示勾號?
請發佈您的IsExistingTemplate代碼。 – 2009-09-29 10:53:47
很抱歉 - 現在糾正。 – hayrob 2009-09-29 11:13:56