Shared styling in WPF -
I believe this can be done very easily, but I am a simple newbie, so bare with me .
What if I want to create all the If you keep it in your resources, then all your textboxes are the same. Alternatively, you can also sub-class from TextBlock elements of UserControl, or UserControl, then
FontWeight = "bold" and
TextAlignment = "Right"? Is there some style that I can set for a
TextBlock element within a certain radius, so I do not have to repeat all those properties?
style target type = "{x: type text block}" & gt; & Lt; Setter property = "fontwhite" value = "bold" /> & Lt; Setter Property = "Textilement" Value = "Right" /> & Lt; / Style & gt;
TextBlock (say,
BoldTextBlock ) and use it as the target type As can. This is because you can use regular text blocks in the same control as special text blocks
& gt; Style TargetType = "{x: Type BoldTextBlock}" & gt; & Lt; Setter property = "fontwhite" value = "bold" /> & Lt; Setter Property = "Textilement" Value = "Right" /> & Lt; / Style & gt;
Comments
Post a Comment