Created
August 13, 2021 15:44
-
-
Save SmashBrando/d4865d57abd0dfdbfd32ccff7a97bc93 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This event uses the bubbling routing strategy | |
public static readonly RoutedEvent CheckedEvent = EventManager.RegisterRoutedEvent( | |
"Checked", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(TreeView)); | |
public static void AddCheckedHandler(DependencyObject d, RoutedEventHandler handler) | |
{ | |
UIElement uie = d as UIElement; | |
if (uie != null) | |
{ | |
uie.AddHandler(CheckedTreeViewItem.CheckedEvent, handler); | |
} | |
} | |
public static void RemoveCheckedHandler(DependencyObject d, RoutedEventHandler handler) | |
{ | |
UIElement uie = d as UIElement; | |
if (uie != null) | |
{ | |
uie.RemoveHandler(CheckedTreeViewItem.CheckedEvent, handler); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment