我正在使用 XAML 代码,其中一部分是
<DataTrigger Binding="{Binding Path=Name}" Value="1">
<Setter Property="Header" TargetName="expanderHeader" Value="Course Text"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Name}" Value="2">
<Setter Property="Header" TargetName="expanderHeader" Value="Media Lecture"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Name}" Value="3">
<Setter Property="Header" TargetName="expanderHeader" Value="Assessment"/>
<DataTrigger Binding="{Binding Path=Name}" Value="4">
<Setter Property="Header" TargetName="expanderHeader" Value="Question"/>
</DataTrigger>
<DataTrigger Binding="{Binding Path=Name}" Value="5">
<Setter Property="Header" TargetName="expanderHeader" Value="General"/>
</DataTrigger>
现在我想使用一个 dataTrigger,它的值可以是 3、301、302 或 303。我该怎么做。我尝试使用 Multidatatrigger,但它不起作用。我尝试使用 Multidatatrigger 的代码是:
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=Name}" Value="301"/>
<Condition Binding="{Binding Path=Name}" Value="301"/>
<Condition Binding="{Binding Path=Name}" Value="302"/>
<Condition Binding="{Binding Path=Name}" Value="303"/>
</MultiDataTrigger.Conditions>
<Setter Property="Header" TargetName="expanderHeader" Value="Assessment"/>
</MultiDataTrigger>