如果两个值都符合预期,我MultiDataTrigger
应该更改 a 的属性。TabItem
其中一个值Property
来自TabItem
,另一个是Properties.Settings.Default
属性。
<!--<App xmlns:prop="clr-namespace:MyApp.Properties"... -->
<DropShadowEffect x:Key="Glow.Foreground.Large" ShadowDepth="0" Color="WhiteSmoke"
Opacity="1" BlurRadius="10" RenderingBias="Quality"/>
<Style TargetType="{x:Type TabItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid Name="Panel" Background="Transparent">
<Border Name="ContentBorder"
BorderBrush="#FFD4D4D4" BorderThickness="0">
<ContentPresenter x:Name="ContentSite"
VerticalAlignment="Center" Effect="{x:Null}"
HorizontalAlignment="Center"
ContentSource="Header"
Margin="10,2"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Panel"
Property="Background"
Value="#FFFAFAFA" />
<Setter Property="Foreground"
Value="#FF2B579A" />
<Setter TargetName="ContentBorder"
Property="BorderThickness"
Value="1,1,1,0" />
</Trigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Property="IsSelected" Value="False"/>
<Condition Binding="{Binding
Source={x:Static prop:Settings.Default},
Path=EditorExtendChrome}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter TargetName="ContentBorder"
Property="Effect"
Value="{StaticResource Glow.Foreground.Large}" />
<Setter TargetName="ContentBorder"
Property="Background"
Value="#7FFFFFFF"/>
</MultiDataTrigger>
<Trigger Property="IsMouseOver" Value="True"
SourceName="Panel">
<Setter Property="Foreground"
Value="#FF2B579A" />
<Setter Property="Background"
Value="#FFFAFAFA" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<!--Default Values-->
<Setter Property="FontFamily" Value="Segoe UI Semilight"/>
</Style>
我正在关注这篇文章,但错误“您必须为 'Binding' 提供非空值”仍然存在。