public void Initialize(IEntityGroupingController controller) { myController = controller; var template = LoadDataTemplate(); template.ItemsSource = new Binding(GroupingBindingPath); template.GroupNameChanged += OnGroupNameChanged; myTree.ItemTemplate = template; myTree.DataContext = DataContext; myTree.ItemsSource = ItemsSource; myTree.Items.SortDescriptions.Add(new SortDescription(SortingDescription, ListSortDirection.Ascending)); myTree.Drop += myRelationshipTree_Drop; myTree.DragOver += myRelationshipTree_DragOver; myTree.AddHandler(TreeViewItem.PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler(myRelationshipTree_MouseLeftButtonDown)); myTree.AddHandler(TreeViewItem.PreviewKeyUpEvent, new KeyEventHandler(myRelationshipTree_KeyUp)); }
public void Initialize( IEntityGroupingController controller ) { myController = controller; var template = LoadDataTemplate(); template.ItemsSource = new Binding( GroupingBindingPath ); template.GroupNameChanged += OnGroupNameChanged; myTree.ItemTemplate = template; myTree.DataContext = DataContext; myTree.ItemsSource = ItemsSource; myTree.Items.SortDescriptions.Add( new SortDescription( SortingDescription, ListSortDirection.Ascending ) ); myTree.Drop += myRelationshipTree_Drop; myTree.DragOver += myRelationshipTree_DragOver; myTree.AddHandler( TreeViewItem.PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler( myRelationshipTree_MouseLeftButtonDown ) ); myTree.AddHandler( TreeViewItem.PreviewKeyUpEvent, new KeyEventHandler( myRelationshipTree_KeyUp ) ); }