/Overthere/Overthere/Window1.xaml.cs
C# | 61 lines | 49 code | 9 blank | 3 comment | 2 complexity | 4d4378c5a3a0d17abe9225e13344d1f0 MD5 | raw file
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using System.Windows.Threading;
-
- namespace Overthere
- {
- /// <summary>
- /// Interaction logic for Window1.xaml
- /// </summary>
- public partial class Window1 : Window
- {
- OverthereShell _overthere;
-
- public Window1()
- {
- InitializeComponent();
-
- _overthere = new OverthereShell(this);
- contentSpace.Content = _overthere;
- }
-
- protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
- {
- base.OnClosing(e);
-
- _overthere.Dispose();
- }
-
- protected override void OnPreviewKeyDown(KeyEventArgs e)
- {
- base.OnPreviewKeyDown(e);
-
- if (KeyboardEx.IsAltDown)
- {
- menu.Visibility = Visibility.Visible;
- }
- }
-
- protected override void OnPreviewKeyUp(KeyEventArgs e)
- {
- base.OnPreviewKeyUp(e);
-
- if (!KeyboardEx.IsAltDown)
- {
- menu.Visibility = Visibility.Collapsed;
- this.Focus();
- }
- }
- }
- }