public Window CreateWindow() { // Create a window object and set its size to the // size of the display. mainWindow = new MyWindow(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; mainWindow.AddHandler(Buttons.ButtonUpEvent, new RoutedEventHandler(OnButtonUp), false); // Set the window visibility to visible. mainWindow.Visibility = Visibility.Visible; // Attach the button focus to the window. Buttons.Focus(mainWindow); TimeService.SystemTimeChanged += new SystemTimeChangedEventHandler(TimeService_SystemTimeChanged); TimeService.TimeSyncFailed += new TimeSyncFailedEventHandler(TimeService_TimeSyncFailed); mainWindow.Dispatcher.Invoke(new TimeSpan(0, 0, 5), new DispatcherOperationCallback(CleanWindow), null); return(mainWindow); }
/// <summary> /// Creates a window that has button focus. /// </summary> /// <returns></returns> public Window CreateWindow() { // Create a window object and set its size to the size of the // display. mainWindow = new MyWindow(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; // Connect the button handler to all of the buttons. mainWindow.AddHandler(Buttons.ButtonUpEvent, new RoutedEventHandler(OnButtonUp), false); // Set the window visibility to Visible. mainWindow.Visibility = Visibility.Visible; // Attach the button focus to the window. Buttons.Focus(mainWindow); return(mainWindow); }
/// <summary> /// Creates a window that has button focus. /// </summary> /// <returns></returns> public Window CreateWindow() { // Create a window object and set its size to the size of the // display. mainWindow = new MyWindow(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; // Connect the button handler to all of the buttons. mainWindow.AddHandler(Buttons.ButtonUpEvent, new RoutedEventHandler(OnButtonUp), false); // Set the window visibility to Visible. mainWindow.Visibility = Visibility.Visible; // Attach the button focus to the window. Buttons.Focus(mainWindow); return mainWindow; }
public Window CreateWindow() { // Create a window object and set its size to the // size of the display. mainWindow = new MyWindow(); mainWindow.Height = SystemMetrics.ScreenHeight; mainWindow.Width = SystemMetrics.ScreenWidth; mainWindow.AddHandler(Buttons.ButtonUpEvent, new RoutedEventHandler(OnButtonUp), false); // Set the window visibility to visible. mainWindow.Visibility = Visibility.Visible; // Attach the button focus to the window. Buttons.Focus(mainWindow); TimeService.SystemTimeChanged += new SystemTimeChangedEventHandler(TimeService_SystemTimeChanged); TimeService.TimeSyncFailed += new TimeSyncFailedEventHandler(TimeService_TimeSyncFailed); mainWindow.Dispatcher.Invoke(new TimeSpan(0, 0, 5), new DispatcherOperationCallback(CleanWindow), null); return mainWindow; }