需求描述
1.按鈕的狀態(tài)需要根據(jù)多個(gè)數(shù)據(jù)源的內(nèi)容作出不同的組合判斷
2.每個(gè)數(shù)據(jù)源的判斷規(guī)則可定制
注:以下功能感覺只是簡(jiǎn)單粗暴的實(shí)現(xiàn),如果您了解更優(yōu)雅的解決方案,煩請(qǐng)告訴我下,感謝先!
按鈕XAML
代碼如下:
<Button Name="btnOK"
Grid.Column="2"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Command="{Binding Path=OKCommand}"
Content="{DynamicResource Common_Button_OK}"
IsDefault="True"
Style="{DynamicResource ButtonStyle}">
<Button.IsEnabled>
<MultiBinding Converter="{StaticResource InvalidMultiValidationRuleToBooleanMultiConverter}"
ConverterParameter="objectnull|greaterthanzerointeger|greaterthanzerointeger|greaterthanzerointeger">
<Binding ElementName="comboBoxFilter"
Mode="OneWay"
Path="SelectedItem" />
<Binding ElementName="textBoxFrameRate"
Mode="OneWay"
Path="Text" />
<Binding ElementName="textBoxSizeWidth"
Mode="OneWay"
Path="Text" />
<Binding ElementName="textBoxSizeHeight"
新聞熱點(diǎn)
疑難解答
圖片精選