我试图让一个按钮处于禁用状态,直到两个 DataGrids 至少有一个选定的项目。目前它仍处于启用状态。
<Button MaxWidth="200" Grid.Column="0" x:Name="Add" Content="{x:Static UiStrings:Labels.Add}" >
<Button.Style>
<Style TargetType="Button">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=SelectedIndex, ElementName=EconomicFactors}" Value="-1"></Condition>
<Condition Binding="{Binding Path=SelectedIndex, ElementName=TargetTypes}" Value="-1"></Condition>
</MultiDataTrigger.Conditions>
<Setter Property="IsEnabled" Value="False"/>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
问候,