Sim*_*ons 1 wpf mvvm multibinding c#-4.0
备用行样式定义为:
<Style TargetType="telerik:GridViewRow">
<Setter Property="Background" Value="{Binding Color,Converter={StaticResource dataToColorConverter}}">
</Style>
Run Code Online (Sandbox Code Playgroud)
但我想在多个值上更新rowstyle depedninng.我希望实现这样的目标.
<Style>
<Setter Property="Background" >
<MultiBinding Converter={StaticResource dataToColorConverter}>
<Binding Path="Color"/>
<Binding ElementName="myListBox" Path="SelectedItem"/>
</MultiBinding>
</Setter>
</Style>
Run Code Online (Sandbox Code Playgroud)
但是得到错误"类型'Setter'不支持直接内容."
由于该Setter元素不支持直接内容,因此必须指定要设置Value属性(在XAML中包含"<Setter.Value>"):
<Setter Property="Background" >
<Setter.Value>
<MultiBinding Converter="{StaticResource dataToColorConverter}" >
<Binding Path="Color" />
<Binding ElementName="myListBox" Path="SelectedItem" />
</MultiBinding>
</Setter.Value>
</Setter>
Run Code Online (Sandbox Code Playgroud)