XAML-从资源中定义的样式绑定到资源中定义的值

XAML-从资源中定义的样式绑定到资源中定义的值,xaml,uwp,xaml-resources,Xaml,Uwp,Xaml Resources,我有一个已定义资源的用户控件。 下面是一些用于说明的代码 <UserControl.Resources> <SolidColorBrush x:Key="foregroundColor" Color="Red"/> <Style x:Key="buttonFontIconStyle" TargetType="FontIcon"> <Setter Property="FontFamily" Value="Segoe MDL

我有一个已定义资源的用户控件。 下面是一些用于说明的代码

<UserControl.Resources>
    <SolidColorBrush x:Key="foregroundColor" Color="Red"/>

    <Style x:Key="buttonFontIconStyle" TargetType="FontIcon">
        <Setter Property="FontFamily" Value="Segoe MDL2 Assets"></Setter>
        <Setter Property="Foreground" Value="{Binding ???}"></Setter>
    </Style>

    <Style x:Key="menuItemLabelStyle" TargetType="TextBlock">
        <Setter Property="VerticalAlignment" Value="Center"></Setter>
        <Setter Property="Foreground" Value="{Binding ???}"></Setter>
    </Style>     
</UserControl.Resources>
现在,我希望使用前景色中定义的值来表示ButtonInfonticonstyle、menuItemLabelStyle和许多其他样式。是否可以通过某种方式绑定到资源中资源的值,或者是否有一种方法可以优先在xaml中指定一次颜色并在多个资源样式中使用它?

您可以使用StaticResource:


使用{StaticResource foregroundColor}我被intellisense键入愚弄了-该选项不可用。这实际上是我尝试过的第一件事。在抄袭了你的建议后,我发现它起作用了,而不是intellisense:-。非常感谢你。
<Style x:Key="buttonFontIconStyle" TargetType="FontIcon">
    <Setter Property="FontFamily" Value="Segoe MDL2 Assets"></Setter>
    <Setter Property="Foreground" Value="{StaticResource foregroundColor}"></Setter>
</Style>

<Style x:Key="menuItemLabelStyle" TargetType="TextBlock">
    <Setter Property="VerticalAlignment" Value="Center"></Setter>
    <Setter Property="Foreground" Value="{StaticResource foregroundColor}"></Setter>
</Style>