/// <summary> /// Initializes the form /// </summary> public NotificationWindow() { InitializeComponent(); notifierTrayIcon = NotifierTrayIcon.Init(this); isDetailsExpanded = expand.IsExpanded; tglSkip.IsChecked = false; ChangeAdditionalButtonsVisibility((bool)tglSkip.IsChecked); if (Settings.Default.AccentColor != null) { Resources["AccentColorBrush"] = Settings.Default.AccentColor; } lstConnections.SelectionChanged += LstConnections_SelectionChanged; ((ObservableCollection <CurrentConn>)lstConnections.ItemsSource).CollectionChanged += NotificationWindow_CollectionChanged; lstConnections.SelectedIndex = 0; PropertyChanged += (sender, args) => { if (args.PropertyName == nameof(NbConnectionsAfter)) { CheckPendingConnections(); } }; // Overlay handling and re-calculate ExpectedTop Activated += (sender, args) => { CheckPendingConnections(); }; SizeChanged += (sender, args) => { Top = ExpectedTop; }; NotifyPropertyChanged(nameof(NbConnectionsAfter)); NotifyPropertyChanged(nameof(NbConnectionsBefore)); }
/// <summary> /// Initializes the form /// </summary> public NotificationWindow() { InitializeComponent(); notifierTrayIcon = NotifierTrayIcon.Init(this); isDetailsExpanded = expand.IsExpanded; if (Settings.Default.AccentColor != null) { Resources["AccentColorBrush"] = Settings.Default.AccentColor; } lstConnections.SelectionChanged += LstConnections_SelectionChanged; ((ObservableCollection <CurrentConn>)lstConnections.ItemsSource).CollectionChanged += NotificationWindow_CollectionChanged; lstConnections.SelectedIndex = 0; // Re-calculate ExpectedTop SizeChanged += (sender, args) => { Top = ExpectedTop; }; NotifyPropertyChanged(nameof(NbConnectionsAfter)); NotifyPropertyChanged(nameof(NbConnectionsBefore)); }
public static NotifierTrayIcon Init(NotificationWindow window) { NotifierTrayIcon factory = new NotifierTrayIcon(window); return(factory); }