xaml - How to link Property value to a Property of a Style in Blend 4? -
I have created a style template in Blend 4 for a button, but I'm not sure how to link the content of the label. The property of the button's content.
The style is XAM here:
& lt; Style x: key = "navbutton" targettype = "button" & gt; & Lt; Setter Property = "Background" Value = "# FF1F3B53" /> & Lt; Setter Property = "Foreground" Value = "# FF 2000000" /> & Lt; Setter property = "padding" value = "3" /> & Lt; Setter property = "borderline" value = "1" /> & Lt; Setter Estates = "Borderbrush" & gt; & Lt; Setter.Value & gt; & Lt; LinearGradientBrush EndPoint = "0.5,1" Start Page = "0.5,0" & gt; & Lt; GradientStop color = "#FFA3AEB9" offset = "0" /> & Lt; GradientStop color = "# FF839 9A9" offset = "0.375" /> & Lt; GradientStop color = "# FF718597" offset = "0.375" /> & Lt; GradientStop color = "# FF617584" offset = "1" /> & Lt; / LinearGradientBrush & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "Button" & gt; & Lt; Grid & gt; & Lt; VisualStateManager.VisualStateGroups & gt; & Lt; VisualState Group x: Name = "General Location" & gt; & Lt; VisualState X: Name = "Disabled" /> & Lt; VisualState X: Name = "General" /> & Lt; VisualState X: Name = "mouseover" /> & Lt; VisualState X: Name = "Pressed" /> & Lt; / VisualStateGroup & gt; & Lt; /VisualStateManager.VisualStateGroups> & Lt; Rectangle stroke = "# FF0E1AD2" RadiusY = "7" RadiusX = "7" stroke = "4" & gt; & Lt; Rectangle.Fill & gt; & Lt; LinearGradientBrush EndPoint = "0.517.1.07" Start Page = "0.511,0.001" & gt; & Lt; GradientStop color = "# FF1828AB" offset = "1" /> & Lt; GradientStop color = "#FFFBEDEDA" /> & Lt; / LinearGradientBrush & gt; & Lt; /Rectangle.Fill> & Lt; / Rectangles & gt; & Lt; Rectangle margin = "15,6,11,15" radius Y = "7" radius X = "7" stroke = "# FF0E11D2" strokectination = "0" & gt; & Lt; Rectangle.Fill & gt; & Lt; Solid color brush color = "white" opacity = "0.3" /> & Lt; /Rectangle.Fill> & Lt; / Rectangles & gt; & Lt; Sdk: label margin = "8" RenderTransformOrigin = "1.567, -0.25" horizontal conference alignment = "center" content = "button" /> & Lt; / Grid & gt; & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt;
You use template bindings to control the properties of control They are templates for example:
& lt; Label content = "{TemplateBinding content}" />
Comments
Post a Comment