Mercurial > silverbladetech
view Chronosv2/source/Shell.xaml.cs @ 15:060f02cd4591
Initial commit, pre airport work
author | stevenh7776 stevenhollidge@hotmail.com |
---|---|
date | Mon, 12 Mar 2012 23:05:21 +0800 |
parents | 741981715d94 |
children |
line wrap: on
line source
using System; using System.Windows; using System.Windows.Input; using Chronos.Interop; using Chronos.ViewModel; using WinInterop = System.Windows.Interop; namespace Chronos { /// <summary> /// Shell Window /// </summary> public partial class Shell : Window { #region · Constructors · /// <summary> /// Initializes a new instance of the <see cref="Shell"/> class. /// </summary> public Shell() { InitializeComponent(); } #endregion #region · Event Handlers · protected override void OnPreviewKeyDown(KeyEventArgs e) { if (e.SystemKey == Key.Space && e.Key == Key.System) { // Disable Window's ControlBox Menu e.Handled = true; } base.OnPreviewKeyDown(e); } protected override void OnSourceInitialized(EventArgs e) { base.OnSourceInitialized(e); IntPtr handle = (new WinInterop.WindowInteropHelper(this)).Handle; WinInterop.HwndSource.FromHwnd(handle).AddHook(new WinInterop.HwndSourceHook(Win32Interop.WindowProc)); ShellViewModel vm = new ShellViewModel(); vm.WindowState = System.Windows.WindowState.Maximized; this.DataContext = vm; } #endregion } }