Exemple #1
0
        private static void OnTracesPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            EventsTreeBase traceTreeView = (EventsTreeBase)sender;

            if (traceTreeView != null)
            {
                traceTreeView.InitializeItems();
            }
        }
Exemple #2
0
        private static void OnSelectedEventPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            EventsTreeBase view = (EventsTreeBase)sender;

            if (view == null)
            {
                return;
            }
            IEvent oldEvent = e.OldValue as IEvent;
            IEvent newEvent = e.NewValue as IEvent;

            if (oldEvent == newEvent)
            {
                return;
            }
            IDictionary <IEvent, EventsTreeItem> eventsTable = view._eventsTable;

            if (oldEvent != null)
            {
                EventsTreeItem oldItem;
                if (eventsTable.TryGetValue(oldEvent, out oldItem))
                {
                    oldItem.SetIsSelectedInternal(false);
                }
            }
            if (view._navigateSelectedEvent)
            {
                view.Navigate(newEvent);
            }
            if (newEvent != null)
            {
                EventsTreeItem newItem;
                if (eventsTable.TryGetValue(newEvent, out newItem))
                {
                    newItem.SetIsSelectedInternal(true);
                }
            }
        }