Exemplo n.º 1
0
        private void Window_Closed(object sender, EventArgs e)
        {
            SettingsClosed?.Invoke(_current, EventArgs.Empty);

            if (ReferenceEquals(_current, this))
            {
                _current = null;
            }
        }
Exemplo n.º 2
0
        private void Window_Closed(object sender, EventArgs e)
        {
            SettingsClosed?.Invoke(_current, EventArgs.Empty);

            Settings.Current.SettingsWindowLastLocation = new WindowPosition((int)this.Left, (int)this.Top);
            Settings.Current.Save();

            if (ReferenceEquals(_current, this))
            {
                _current = null;
            }

            this.SetMouseHook(false);
        }
Exemplo n.º 3
0
 public static void Launch(ToastView toastView)
 {
     if (_current != null)
     {
         _current.Activate();
         _current.SetMouseHook(true);
     }
     else
     {
         SettingsView settingsView = new SettingsView(toastView);
         SettingsLaunched?.Invoke(_current, new SettingsViewLaunchedEventArgs(settingsView.Settings));
         settingsView.SetMouseHook(true);
         settingsView.ShowDialog();
     }
 }
Exemplo n.º 4
0
        private SettingsView(ToastView toastView)
        {
            Analytics.TrackEvent(Analytics.ToastifyEventCategory.General, Analytics.ToastifyEvent.SettingsLaunched);

            this.settingsViewModel = new SettingsViewModel();
            this.settingsViewModel.SettingsSaved += this.SettingsViewModel_SettingsSaved;

            this.toastView = toastView;

            this.InitializeComponent();

            this.DataContext           = this.settingsViewModel;
            this.WindowStartupLocation = this.StartupLocation;

            if (_current == null)
            {
                _current = this;
            }
        }