English 中文(简体)
• 如何将财产价值与Blend 4型不动产联系起来?
原标题:How to link Property value to a Property of a Style in Blend 4?

我在Blend 4中为纽芬兰创造了一个风格模板,但我无法确定拉贝尔的内容如何与布顿的内容财产联系起来。

这里指的是XAML:

<Style x:Key="NavButton" TargetType="Button">
    <Setter Property="Background" Value="#FF1F3B53"/>
    <Setter Property="Foreground" Value="#FF000000"/>
    <Setter Property="Padding" Value="3"/>
    <Setter Property="BorderThickness" Value="1"/>
    <Setter Property="BorderBrush">
        <Setter.Value>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFA3AEB9" Offset="0"/>
                <GradientStop Color="#FF8399A9" Offset="0.375"/>
                <GradientStop Color="#FF718597" Offset="0.375"/>
                <GradientStop Color="#FF617584" Offset="1"/>
            </LinearGradientBrush>
        </Setter.Value>
    </Setter>
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="Button">
                <Grid>
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Disabled"/>
                            <VisualState x:Name="Normal"/>
                            <VisualState x:Name="MouseOver"/>
                            <VisualState x:Name="Pressed"/>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                    <Rectangle Stroke="#FF0E1AD2" RadiusY="7" RadiusX="7" StrokeThickness="4">
                        <Rectangle.Fill>
                            <LinearGradientBrush EndPoint="0.517,1.07" StartPoint="0.511,0.001">
                                <GradientStop Color="#FF1828AB" Offset="1"/>
                                <GradientStop Color="#FFFBDEDE"/>
                            </LinearGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <Rectangle Margin="15,6,11,15" RadiusY="7" RadiusX="7" Stroke="#FF0E11D2" StrokeThickness="0">
                        <Rectangle.Fill>
                            <SolidColorBrush Color="White" Opacity="0.3"/>
                        </Rectangle.Fill>
                    </Rectangle>
                    <sdk:Label Margin="8" RenderTransformOrigin="1.567,-0.25" HorizontalContentAlignment="Center" Content="Button"/>
                </Grid>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>
最佳回答

贵方使用具有约束力的模板,将控制模板内的控制与与其相对应的控制性质联系起来。 例如:

<Label Content="{TemplateBinding Content}"/>
问题回答

暂无回答




相关问题
Allow user to change the default web part styles

I have a web part which uses many SharePoint controls like menu, SPGrid, tool bar etc. I want the user to be able to change the style by specifying an external CSS file. Can somebody tell me how I ...

using jqgrid style for usual Table in asp.net mvc

I d prefer using Table and td instead of JqGrid but i like JqGrid styles. has anyone used jqgrid style for usual Grid of asp.net MVC(i mean Table and td) before?

热门标签