Exemplo n.º 1
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Window.SourceInitialized"/> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param>
        protected override void OnSourceInitialized(EventArgs e)
        {
            // Try to position application to first non-primary monitor
            System.Windows.Forms.Screen secondaryScreen = null;
            foreach (var screen in System.Windows.Forms.Screen.AllScreens)
            {
                if (!screen.Primary)
                {
                    secondaryScreen = screen;
                    break;
                }
            }

            //Debug.Assert(secondaryScreen != null);

            if (secondaryScreen != null)
            {
                System.Drawing.Rectangle workingArea = secondaryScreen.WorkingArea;
                this.Left = workingArea.Left;
                this.Top = workingArea.Top;
                this.Width = workingArea.Width;
                this.Height = workingArea.Height;
                this.WindowState = System.Windows.WindowState.Maximized;
            }

            inputProvider = new MultitouchInputProvider(PresentationSource.FromVisual(this));
            base.OnSourceInitialized(e);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Raises the <see cref="E:System.Windows.Window.Closing"/> event.
 /// </summary>
 /// <param name="e">A <see cref="T:System.ComponentModel.CancelEventArgs"/> that contains the event data.</param>
 protected override void OnClosing(CancelEventArgs e)
 {
     if (inputProvider != null)
     {
         inputProvider.Dispose();
         inputProvider = null;
     }
     base.OnClosing(e);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Raises the <see cref="E:System.Windows.Window.SourceInitialized"/> event.
 /// </summary>
 /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param>
 protected override void OnSourceInitialized(EventArgs e)
 {
     inputProvider = new MultitouchInputProvider(PresentationSource.FromVisual(this));
     base.OnSourceInitialized(e);
 }