private static void OnSetCommandParameterCallback(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            TreeView tv = dependencyObject as TreeView;

            if (tv != null)
            {
                TreeViewSelectionChangedCommandBehavior behavior = GetOrCreateBehavior(tv);
                behavior.CommandParameter = e.NewValue;
            }
        }
        private static TreeViewSelectionChangedCommandBehavior GetOrCreateBehavior(TreeView treeView)
        {
            TreeViewSelectionChangedCommandBehavior behavior =
                treeView.GetValue(SelectCommandBehaviorProperty) as TreeViewSelectionChangedCommandBehavior;

            if (behavior == null)
            {
                behavior = new TreeViewSelectionChangedCommandBehavior(treeView);
                treeView.SetValue(SelectCommandBehaviorProperty, behavior);
            }
            return(behavior);
        }