Example #1
0
        /// <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));
        }
Example #2
0
        /// <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));
        }
Example #3
0
        public static NotifierTrayIcon Init(NotificationWindow window)
        {
            NotifierTrayIcon factory = new NotifierTrayIcon(window);

            return(factory);
        }