I am trying to create a custom style panel (StyledStackPanel
) which is identical to regular StackPanel, that has a custom style.
For example - if the style is simply to add an underline, by writing:
<StyledStackPanel>
<!--User content goes here-->
</StyledStackPanel>
I would like to receive the same appearance as if I wrote:
<StackPanel>
<!--User content goes here-->
</StackPanel>
<Border Height="1" BorderBrush="Blue"/>
If StackPanel
was a Control
, I could have replace the DataTemplate
of that control. However, it inherits Panel
which inherits FrameworkElement
.
Is there a way to change the template of a StackPanel
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…