Search code examples
silverlightstylestargettype

How to wrote style that will effect on all the items that are in same TargetType?


I define a style - targetType is 'Line' I define this style in some grid and i want to make this style effect on any line in this grid.

How can i do it without adding to each of the lines the "stype= {...} " ?


Solution

  • Add your style to resources section of your Grid or the containing UserControl as

    <Style TargetType="{x:Type Line}">