private void MouseLeftButtonDownHandler(object sender, MouseButtonEventArgs e) { LogBorder border = sender as LogBorder; if (border != null) { Parent.State = BinComponentState.Log; UIElement element = Parent.Presentations[BinComponentState.Log]; LogVisual logVisual = (LogVisual)element; logVisual.SelectedLogs = logsTillReset.Where(a => a.Level == border.NotificationLevel); } }
private static void OnLogMessagesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { LogVisual l = (LogVisual)d; ObservableCollection <Log> newCollection = (ObservableCollection <Log>)e.NewValue; ObservableCollection <Log> oldCollection = (ObservableCollection <Log>)e.OldValue; if (newCollection != null) { newCollection.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(l.LogCollectionChangedHandler); } if (oldCollection != null) { newCollection.CollectionChanged -= new System.Collections.Specialized.NotifyCollectionChangedEventHandler(l.LogCollectionChangedHandler); } }