Scott Nimrod
Scott Nimrod

Reputation: 11570

Why would one set the Style property of a control to a template binding referring to just another style?

Why would one set the Style property of a control to a template binding referring to just another style?

I saw the following in a Silverlight book:

<charting_primitives:EdgePanel x:Name="ChartArea" Style="{TemplateBinding ChartAreaStyle}">
   <Grid Style="{TemplateBinding PlotAreaStyle}" />
</charting_primitives:EdgePanel>

Upvotes: 1

Views: 144

Answers (1)

Rachel
Rachel

Reputation: 132618

The style could contain properties that need to be set in both the EdgePanel and the Grid. For example, perhaps both should have a border and a margin of 20

Upvotes: 2

Related Questions