PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/Overthere/Overthere/Window1.xaml.cs

https://bitbucket.org/floAr/personal
C# | 61 lines | 49 code | 9 blank | 3 comment | 2 complexity | 4d4378c5a3a0d17abe9225e13344d1f0 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. using System.Windows.Threading;
  15. namespace Overthere
  16. {
  17. /// <summary>
  18. /// Interaction logic for Window1.xaml
  19. /// </summary>
  20. public partial class Window1 : Window
  21. {
  22. OverthereShell _overthere;
  23. public Window1()
  24. {
  25. InitializeComponent();
  26. _overthere = new OverthereShell(this);
  27. contentSpace.Content = _overthere;
  28. }
  29. protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
  30. {
  31. base.OnClosing(e);
  32. _overthere.Dispose();
  33. }
  34. protected override void OnPreviewKeyDown(KeyEventArgs e)
  35. {
  36. base.OnPreviewKeyDown(e);
  37. if (KeyboardEx.IsAltDown)
  38. {
  39. menu.Visibility = Visibility.Visible;
  40. }
  41. }
  42. protected override void OnPreviewKeyUp(KeyEventArgs e)
  43. {
  44. base.OnPreviewKeyUp(e);
  45. if (!KeyboardEx.IsAltDown)
  46. {
  47. menu.Visibility = Visibility.Collapsed;
  48. this.Focus();
  49. }
  50. }
  51. }
  52. }