Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Window"/> class.
 /// </summary>
 /// <param name="frame">Parent Frame for this Window</param>
 /// <param name="hwnd">Native window handle</param>
 /// <param name="notificationService">Instance of Notification Service</param>
 public Window(Frame frame, IntPtr hwnd, INotificationService notificationService)
 {
     this.cachedStyle = IntPtr.Zero;
     this.notificationService = notificationService;
     this.Frame = frame;
     this.Handle = hwnd;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Switch the window to a different frame.
        /// </summary>
        /// <param name="f">Target frame</param>
        public void SwitchFrame(Frame f)
        {
            if (!Interop.MoveWindow(this.Handle, f.Size.X, f.Size.Y, f.Size.Width, f.Size.Height, true))
            {
                this.notificationService.NotifyError(
                    string.Format("Window: Unable to move window. HWnd = {0}, Name = {1}", this.Handle, this.Name));
            }

            this.Size = f.Size;
        }