我有一个控件,当鼠标越过它时它会改变它的颜色。我试图通过使用控件的样式来解决它:
<Style TargetType="{x:Type local:Control}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="{x:Null}" />
<Setter Property="MouseHoverBackgroundColor" Value="#FFFFEFBB" />
<Setter Property="MouseHoverBorderColor" Value="#FFE5C365" />
<Setter Property="MouseHoverBorderThickness" Value="2" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background">
<Setter.Value>
<!-- Here I have to get the Value of the current "MouseHoverBackgroundColor"-DependencyProperty. -->
</Setter.Value>
</Setter>
<Setter Property="BorderBrush">
<Setter.Value>
<!-- MouseHoverBorderColor -->
</Setter.Value>
</Setter>
<Setter Property="BorderThickness">
<Setter.Value>
<!-- MouseHoverBorderColor -->
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
我实际上不知道如何访问 DependencyProperty 的当前值。
真挚地
用户1574054