예제 #1
0
        public MainWindow()
        {
            InitializeComponent();

            writeAutostart();
            initializeIni();

            ThemeEngine.applyTheme(StorageHolder.readSetting(MainWindow.Key_AppTheme));

            // Set up buttons
            TitlebarCloseButton.Click    += TitlebarCloseButton_Click;
            TitlebarSettingsButton.Click += TitlebarSettingsButton_Click;
            TitlebarResizeButton.Click   += TitlebarHideButton_Click;

            // Set up window properties
            this.AllowsTransparency = true;
            this.Topmost            = true;
            this.WindowState        = System.Windows.WindowState.Normal;
            this.Show();

            this.Left      = ScreenWidth - this.ActualWidth;
            this.Top       = 0;
            this.MinHeight = ScreenHeight;
            this.MaxHeight = ScreenHeight;

            // Set up animations
            Animation_Hide_Move.To   = Animation_Show_Move.From = ScreenWidth;
            Animation_Hide_Move.From = Animation_Show_Move.To = ScreenWidth - this.ActualWidth;
            Animation_Close_Move.To  = ScreenHeight;

            // Timers
            KeyHookTimer.Interval = TimeSpan.FromSeconds(0.1);
            KeyHookTimer.Tick    += KeyHookTimerTick;
            KeyHookTimer.Start();

            QuickSaveTimer.Tick    += QuickSaveTimerTick;
            QuickSaveTimer.Interval = new TimeSpan(0, 0, 20);
            QuickSaveTimer.Start();

            // Load window content
            loadTextBox();

            // Set up the settings window
            SettingsWindow = new SideNote.SettingsWindow();
            SettingsWindow.Show();
            SettingsWindow.WindowState = System.Windows.WindowState.Normal;
            SettingsWindow.Hide();
        }
예제 #2
0
 private void AppThemeDrop_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     StorageHolder.writeSetting(MainWindow.Key_AppTheme, AppThemeDrop.SelectedValue.ToString());
     ThemeEngine.applyTheme(AppThemeDrop.SelectedValue.ToString());
 }