我有一個WinForms窗體,其中包含一個ElementHost控件(其中包含一個WPF UserControl)和一個保存按鈕。在ElementHost控件WPF驗證
在WPF UserControl中,我有一個文本框,其中包含一些驗證。像這樣...
<TextBox Name="txtSomething" ToolTip="{Binding ElementName=txtSomething, Path=(Validation.Errors).[0].ErrorContent}">
<Binding NotifyOnValidationError="True" Path="Something">
<Binding.ValidationRules>
<commonWPF:DecimalRangeRule Max="1" Min="0" />
</Binding.ValidationRules>
</Binding>
</TextBox>
這一切工作正常。然而,我想要做的是在窗體處於無效狀態時禁用「保存」按鈕。
任何幫助將不勝感激。