EventSetter in Style
Posted: 23 Aug 2022, 00:57
Hi there,
I was wondering if there is support for System.Windows.EventSetter?
I am currently trying to have an EventSetter inside of a Style. If EventSetter is not available, is there another simple way to do this inside of a style?
Code snippet:
Thank you!
I was wondering if there is support for System.Windows.EventSetter?
I am currently trying to have an EventSetter inside of a Style. If EventSetter is not available, is there another simple way to do this inside of a style?
Code snippet:
Code: Select all
<TreeView.ItemContainerStyle>
<Style TargetType="TreeViewItem" BasedOn="{StaticResource TreeViewItem}">
<EventSetter Event="Loaded" Handler="TreeViewItem_Loaded"/>
<EventSetter Event="PreviewMouseLeftButtonDown" Handler="PointTree_MouseLeftButtonDown"/>
<EventSetter Event="Expanded" Handler="PointTree_Expanded"/>
</Style>
</TreeView.ItemContainerStyle>