Example #1
0
        private void TgNotify_Checked(object sender, RoutedEventArgs e)
        {
            if (tgNotify.IsChecked.Value)
            {
                notify.Visibility = Visibility.Visible;
            }
            else
            {
                notify.Visibility = Visibility.Hidden;
            }

            GlobalData.Config.NotifyIconIsShow = tgNotify.IsChecked.Value;
            GlobalData.Save();
        }
Example #2
0
        private void StackPanel_Click(object sender, RoutedEventArgs e)
        {
            if (e.OriginalSource is Button button && button.Tag is SkinType tag)
            {
                popupConfig.IsOpen = false;
                if (tag.Equals(GlobalData.Config.Skin))
                {
                    return;
                }

                GlobalData.Config.Skin = tag;
                GlobalData.Save();
                ((App)Application.Current).UpdateSkin(tag);
            }
        }
Example #3
0
 protected override void OnClosing(CancelEventArgs e)
 {
     if (GlobalData.Config.NotifyIconIsShow)
     {
         if (GlobalData.Config.FirstRun)
         {
             MessageBoxResult result = HandyControl.Controls.MessageBox.Show(new MessageBoxInfo
             {
                 MessageBoxText = "The tray icon is open and will hide the window instead of closing the program, do you want?",
                 Caption        = "Url Shotener",
                 Button         = MessageBoxButton.YesNo,
                 IconBrushKey   = ResourceToken.AccentBrush,
                 IconKey        = ResourceToken.InfoGeometry,
                 Style          = ResourceHelper.GetResource <Style>("MessageBoxCustom")
             });
             if (result == MessageBoxResult.Yes)
             {
                 Hide();
                 e.Cancel = true;
                 GlobalData.Config.FirstRun = false;
                 GlobalData.Save();
             }
             else
             {
                 base.OnClosing(e);
             }
         }
         else
         {
             Hide();
             e.Cancel = true;
         }
     }
     else
     {
         base.OnClosing(e);
     }
 }
Example #4
0
 private void ToggleButton_Checked(object sender, RoutedEventArgs e)
 {
     Topmost = tgTop.IsChecked.Value;
     GlobalData.Config.TopMost = tgTop.IsChecked.Value;
     GlobalData.Save();
 }
Example #5
0
 private void cmbService_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     GlobalData.Config.ServiceIndex = cmbService.SelectedIndex;
     GlobalData.Save();
 }