From fbb6dfbe1a75ac0fb1d74d6744266b4401a76ca9 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 4 Feb 2016 11:56:35 +0100 Subject: [PATCH 1/4] Added Window.WindowState. To allow minimize/maximize/restore of Window from code. --- src/Gtk/Perspex.Gtk/WindowImpl.cs | 33 ++++++++++++ src/Perspex.Controls/Perspex.Controls.csproj | 1 + src/Perspex.Controls/Platform/IWindowImpl.cs | 6 +++ .../Platform/PlatformManager.cs | 11 ++-- src/Perspex.Controls/Window.cs | 9 ++++ src/Perspex.Controls/WindowState.cs | 26 +++++++++ .../Perspex.Win32/Interop/UnmanagedMethods.cs | 53 +++++++++++++++++++ src/Windows/Perspex.Win32/WindowImpl.cs | 41 ++++++++++++++ 8 files changed, 175 insertions(+), 5 deletions(-) create mode 100644 src/Perspex.Controls/WindowState.cs diff --git a/src/Gtk/Perspex.Gtk/WindowImpl.cs b/src/Gtk/Perspex.Gtk/WindowImpl.cs index 2c732c84e0..bba8d040cf 100644 --- a/src/Gtk/Perspex.Gtk/WindowImpl.cs +++ b/src/Gtk/Perspex.Gtk/WindowImpl.cs @@ -75,6 +75,39 @@ namespace Perspex.Gtk } } + public Perspex.Controls.WindowState WindowState + { + get + { + switch (GdkWindow.State) + { + case Gdk.WindowState.Iconified: + return Controls.WindowState.Minimized; + case Gdk.WindowState.Maximized: + return Controls.WindowState.Maximized; + default: + return Controls.WindowState.Normal; + } + } + + set + { + switch (value) + { + case Controls.WindowState.Minimized: + GdkWindow.Iconify(); + break; + case Controls.WindowState.Maximized: + GdkWindow.Maximize(); + break; + case Controls.WindowState.Normal: + GdkWindow.Deiconify(); + GdkWindow.Unmaximize(); + break; + } + } + } + IPlatformHandle ITopLevelImpl.Handle => this; [DllImport("libgdk-win32-2.0-0.dll", CallingConvention = CallingConvention.Cdecl)] diff --git a/src/Perspex.Controls/Perspex.Controls.csproj b/src/Perspex.Controls/Perspex.Controls.csproj index 1c2d72190e..33619435d3 100644 --- a/src/Perspex.Controls/Perspex.Controls.csproj +++ b/src/Perspex.Controls/Perspex.Controls.csproj @@ -163,6 +163,7 @@ + diff --git a/src/Perspex.Controls/Platform/IWindowImpl.cs b/src/Perspex.Controls/Platform/IWindowImpl.cs index cb266a9153..5d85fcb707 100644 --- a/src/Perspex.Controls/Platform/IWindowImpl.cs +++ b/src/Perspex.Controls/Platform/IWindowImpl.cs @@ -2,6 +2,7 @@ // Licensed under the MIT license. See licence.md file in the project root for full license information. using System; +using Perspex.Controls; namespace Perspex.Platform { @@ -15,6 +16,11 @@ namespace Perspex.Platform /// Size MaxClientSize { get; } + /// + /// Gets or sets the minimized/maximized state of the window. + /// + WindowState WindowState { get; set; } + /// /// Sets the title of the window. /// diff --git a/src/Perspex.Controls/Platform/PlatformManager.cs b/src/Perspex.Controls/Platform/PlatformManager.cs index 6cec6cfadf..0945e6ff18 100644 --- a/src/Perspex.Controls/Platform/PlatformManager.cs +++ b/src/Perspex.Controls/Platform/PlatformManager.cs @@ -135,8 +135,6 @@ namespace Perspex.Controls.Platform public Action Paint { get; set; } public Action Resized { get; set; } - - public Action Activated { get { return _tl.Activated; } @@ -155,6 +153,12 @@ namespace Perspex.Controls.Platform set { _tl.Deactivated = value; } } + public WindowState WindowState + { + get { return _window.WindowState; } + set { _window.WindowState = value; } + } + public void Dispose() => _tl.Dispose(); public IPlatformHandle Handle => _tl.Handle; @@ -163,9 +167,6 @@ namespace Perspex.Controls.Platform public void SetCursor(IPlatformHandle cursor) => _tl.SetCursor(cursor); - - - public void SetTitle(string title) => _window.SetTitle(title); public void Show() => _tl.Show(); diff --git a/src/Perspex.Controls/Window.cs b/src/Perspex.Controls/Window.cs index 12f646f4cd..22307ab97e 100644 --- a/src/Perspex.Controls/Window.cs +++ b/src/Perspex.Controls/Window.cs @@ -133,6 +133,15 @@ namespace Perspex.Controls set { SetValue(HasSystemDecorationsProperty, value); } } + /// + /// Gets or sets the minimized/maximized state of the window. + /// + public WindowState WindowState + { + get { return this.PlatformImpl.WindowState; } + set { this.PlatformImpl.WindowState = value; } + } + /// Size ILayoutRoot.MaxClientSize => _maxPlatformClientSize; diff --git a/src/Perspex.Controls/WindowState.cs b/src/Perspex.Controls/WindowState.cs new file mode 100644 index 0000000000..f5f671c3d0 --- /dev/null +++ b/src/Perspex.Controls/WindowState.cs @@ -0,0 +1,26 @@ +// Copyright (c) The Perspex Project. All rights reserved. +// Licensed under the MIT license. See licence.md file in the project root for full license information. + +namespace Perspex.Controls +{ + /// + /// Defines the minimized/maximized state of a . + /// + public enum WindowState + { + /// + /// The window is neither minimized or maximized. + /// + Normal, + + /// + /// The window is minimized. + /// + Minimized, + + /// + /// The window is maximized. + /// + Maximized, + } +} diff --git a/src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs b/src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs index 02aefb4106..5bb2038813 100644 --- a/src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs +++ b/src/Windows/Perspex.Win32/Interop/UnmanagedMethods.cs @@ -602,6 +602,9 @@ namespace Perspex.Win32.Interop [DllImport("user32.dll", SetLastError = true)] public static extern uint SetWindowLong(IntPtr hWnd, int nIndex, uint value); + [DllImport("user32.dll", SetLastError = true)] + public static extern bool GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT lpwndpl); + [DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect); @@ -787,6 +790,56 @@ namespace Perspex.Win32.Interop public int dwHoverTime; } + [StructLayout(LayoutKind.Sequential)] + public struct WINDOWPLACEMENT + { + /// + /// The length of the structure, in bytes. Before calling the GetWindowPlacement or SetWindowPlacement functions, set this member to sizeof(WINDOWPLACEMENT). + /// + /// GetWindowPlacement and SetWindowPlacement fail if this member is not set correctly. + /// + /// + public int Length; + + /// + /// Specifies flags that control the position of the minimized window and the method by which the window is restored. + /// + public int Flags; + + /// + /// The current show state of the window. + /// + public ShowWindowCommand ShowCmd; + + /// + /// The coordinates of the window's upper-left corner when the window is minimized. + /// + public POINT MinPosition; + + /// + /// The coordinates of the window's upper-left corner when the window is maximized. + /// + public POINT MaxPosition; + + /// + /// The window's coordinates when the window is in the restored position. + /// + public RECT NormalPosition; + + /// + /// Gets the default (empty) value. + /// + public static WINDOWPLACEMENT Default + { + get + { + WINDOWPLACEMENT result = new WINDOWPLACEMENT(); + result.Length = Marshal.SizeOf(result); + return result; + } + } + } + [StructLayout(LayoutKind.Sequential)] public struct WNDCLASSEX { diff --git a/src/Windows/Perspex.Win32/WindowImpl.cs b/src/Windows/Perspex.Win32/WindowImpl.cs index c749b495ff..c786592a78 100644 --- a/src/Windows/Perspex.Win32/WindowImpl.cs +++ b/src/Windows/Perspex.Win32/WindowImpl.cs @@ -126,6 +126,47 @@ namespace Perspex.Win32 } } + public WindowState WindowState + { + get + { + var placement = default(UnmanagedMethods.WINDOWPLACEMENT); + UnmanagedMethods.GetWindowPlacement(_hwnd, ref placement); + + switch (placement.ShowCmd) + { + case UnmanagedMethods.ShowWindowCommand.Maximize: + return WindowState.Maximized; + case UnmanagedMethods.ShowWindowCommand.Minimize: + return WindowState.Minimized; + default: + return WindowState.Normal; + } + } + + set + { + UnmanagedMethods.ShowWindowCommand command; + + switch (value) + { + case WindowState.Minimized: + command = UnmanagedMethods.ShowWindowCommand.Minimize; + break; + case WindowState.Maximized: + command = UnmanagedMethods.ShowWindowCommand.Maximize; + break; + case WindowState.Normal: + command = UnmanagedMethods.ShowWindowCommand.Restore; + break; + default: + throw new ArgumentException("Invalid WindowState."); + } + + UnmanagedMethods.ShowWindow(_hwnd, command); + } + } + public void Activate() { UnmanagedMethods.SetActiveWindow(_hwnd); From 8caf0d77bdac2e2daefc64ce4aaac90cb5fa9bad Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 4 Feb 2016 20:04:17 +0100 Subject: [PATCH 2/4] Changes from VS. --- .../Perspex.Skia.Android.TestApp.csproj | 2 +- src/Skia/Perspex.Skia.Android/Perspex.Skia.Android.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Skia/Perspex.Skia.Android.TestApp/Perspex.Skia.Android.TestApp.csproj b/src/Skia/Perspex.Skia.Android.TestApp/Perspex.Skia.Android.TestApp.csproj index 614b0210bb..36cb4b0e0b 100644 --- a/src/Skia/Perspex.Skia.Android.TestApp/Perspex.Skia.Android.TestApp.csproj +++ b/src/Skia/Perspex.Skia.Android.TestApp/Perspex.Skia.Android.TestApp.csproj @@ -16,7 +16,7 @@ Resources\Resource.Designer.cs Off True - v6.0 + v5.0 Properties\AndroidManifest.xml diff --git a/src/Skia/Perspex.Skia.Android/Perspex.Skia.Android.csproj b/src/Skia/Perspex.Skia.Android/Perspex.Skia.Android.csproj index 2916c4059e..2160eb2592 100644 --- a/src/Skia/Perspex.Skia.Android/Perspex.Skia.Android.csproj +++ b/src/Skia/Perspex.Skia.Android/Perspex.Skia.Android.csproj @@ -15,7 +15,7 @@ Resources\Resource.Designer.cs Off True - v6.0 + v5.0 true From b1f0ac8c979ac55bb395f24696c43f3a8ffed764 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 4 Feb 2016 20:04:28 +0100 Subject: [PATCH 3/4] Revert "Added InputRoot to all raw input events." This reverts commit ae747c6dc753a95566c15793c58c14771568d794. --- src/Gtk/Perspex.Gtk/WindowImpl.cs | 11 +++++------ src/Perspex.Input/Raw/RawInputEventArgs.cs | 13 +++---------- src/Perspex.Input/Raw/RawKeyEventArgs.cs | 3 +-- src/Perspex.Input/Raw/RawMouseEventArgs.cs | 4 ++-- src/Perspex.Input/Raw/RawMouseWheelEventArgs.cs | 4 ++-- src/Perspex.Input/Raw/RawTextInputEventArgs.cs | 11 +++-------- src/Windows/Perspex.Win32/WindowImpl.cs | 14 ++++++-------- tests/Perspex.Controls.UnitTests/TopLevelTests.cs | 1 - 8 files changed, 22 insertions(+), 39 deletions(-) diff --git a/src/Gtk/Perspex.Gtk/WindowImpl.cs b/src/Gtk/Perspex.Gtk/WindowImpl.cs index bba8d040cf..b64945c82e 100644 --- a/src/Gtk/Perspex.Gtk/WindowImpl.cs +++ b/src/Gtk/Perspex.Gtk/WindowImpl.cs @@ -264,8 +264,8 @@ namespace Perspex.Gtk var e = new RawMouseEventArgs( GtkMouseDevice.Instance, - _inputRoot, evnt.Time, + _inputRoot, evnt.Button == 1 ? RawMouseEventType.LeftButtonDown : evnt.Button == 3 ? RawMouseEventType.RightButtonDown : RawMouseEventType.MiddleButtonDown, @@ -286,7 +286,7 @@ namespace Perspex.Gtk delta = new Vector(-step, 0); if (evnt.Direction == ScrollDirection.Left) delta = new Vector(step, 0); - var e = new RawMouseWheelEventArgs(GtkMouseDevice.Instance, _inputRoot, evnt.Time, new Point(evnt.X, evnt.Y), delta, GetModifierKeys(evnt.State)); + var e = new RawMouseWheelEventArgs(GtkMouseDevice.Instance, evnt.Time, _inputRoot, new Point(evnt.X, evnt.Y), delta, GetModifierKeys(evnt.State)); Input(e); return base.OnScrollEvent(evnt); } @@ -295,8 +295,8 @@ namespace Perspex.Gtk { var e = new RawMouseEventArgs( GtkMouseDevice.Instance, - _inputRoot, evnt.Time, + _inputRoot, evnt.Button == 1 ? RawMouseEventType.LeftButtonUp : evnt.Button == 3 ? RawMouseEventType.RightButtonUp : RawMouseEventType.MiddleButtonUp, @@ -329,7 +329,6 @@ namespace Perspex.Gtk return true; var e = new RawKeyEventArgs( GtkKeyboardDevice.Instance, - _inputRoot, evnt.Time, evnt.Type == EventType.KeyPress ? RawKeyEventType.KeyDown : RawKeyEventType.KeyUp, GtkKeyboardDevice.ConvertKey(evnt.Key), GetModifierKeys(evnt.State)); @@ -343,7 +342,7 @@ namespace Perspex.Gtk private void ImContext_Commit(object o, Gtk.CommitArgs args) { - Input(new RawTextInputEventArgs(GtkKeyboardDevice.Instance, _inputRoot, _lastKeyEventTimestamp, args.Str)); + Input(new RawTextInputEventArgs(GtkKeyboardDevice.Instance, _lastKeyEventTimestamp, args.Str)); } protected override bool OnExposeEvent(EventExpose evnt) @@ -365,8 +364,8 @@ namespace Perspex.Gtk var e = new RawMouseEventArgs( GtkMouseDevice.Instance, - _inputRoot, evnt.Time, + _inputRoot, RawMouseEventType.Move, position, GetModifierKeys(evnt.State)); Input(e); diff --git a/src/Perspex.Input/Raw/RawInputEventArgs.cs b/src/Perspex.Input/Raw/RawInputEventArgs.cs index 583032041a..7708165a14 100644 --- a/src/Perspex.Input/Raw/RawInputEventArgs.cs +++ b/src/Perspex.Input/Raw/RawInputEventArgs.cs @@ -7,23 +7,16 @@ namespace Perspex.Input.Raw { public class RawInputEventArgs : EventArgs { - public RawInputEventArgs( - IInputDevice device, - IInputRoot root, - uint timestamp) + public RawInputEventArgs(IInputDevice device, uint timestamp) { Contract.Requires(device != null); - Contract.Requires(root != null); Device = device; - Root = root; Timestamp = timestamp; } - public IInputDevice Device { get; } + public IInputDevice Device { get; private set; } - public IInputRoot Root { get; } - - public uint Timestamp { get; } + public uint Timestamp { get; private set; } } } diff --git a/src/Perspex.Input/Raw/RawKeyEventArgs.cs b/src/Perspex.Input/Raw/RawKeyEventArgs.cs index 02ce86d59a..8f54a10a68 100644 --- a/src/Perspex.Input/Raw/RawKeyEventArgs.cs +++ b/src/Perspex.Input/Raw/RawKeyEventArgs.cs @@ -13,11 +13,10 @@ namespace Perspex.Input.Raw { public RawKeyEventArgs( IKeyboardDevice device, - IInputRoot root, uint timestamp, RawKeyEventType type, Key key, InputModifiers modifiers) - : base(device, root, timestamp) + : base(device, timestamp) { Key = key; Type = type; diff --git a/src/Perspex.Input/Raw/RawMouseEventArgs.cs b/src/Perspex.Input/Raw/RawMouseEventArgs.cs index 6fd6fef94d..154515085b 100644 --- a/src/Perspex.Input/Raw/RawMouseEventArgs.cs +++ b/src/Perspex.Input/Raw/RawMouseEventArgs.cs @@ -22,11 +22,11 @@ namespace Perspex.Input.Raw { public RawMouseEventArgs( IInputDevice device, - IInputRoot root, uint timestamp, + IInputRoot root, RawMouseEventType type, Point position, InputModifiers inputModifiers) - : base(device, root, timestamp) + : base(device, timestamp) { Contract.Requires(device != null); Contract.Requires(root != null); diff --git a/src/Perspex.Input/Raw/RawMouseWheelEventArgs.cs b/src/Perspex.Input/Raw/RawMouseWheelEventArgs.cs index 919026aac3..1684766d14 100644 --- a/src/Perspex.Input/Raw/RawMouseWheelEventArgs.cs +++ b/src/Perspex.Input/Raw/RawMouseWheelEventArgs.cs @@ -10,11 +10,11 @@ namespace Perspex.Input.Raw { public RawMouseWheelEventArgs( IInputDevice device, - IInputRoot root, uint timestamp, + IInputRoot root, Point position, Vector delta, InputModifiers inputModifiers) - : base(device, root, timestamp, RawMouseEventType.Wheel, position, inputModifiers) + : base(device, timestamp, root, RawMouseEventType.Wheel, position, inputModifiers) { Delta = delta; } diff --git a/src/Perspex.Input/Raw/RawTextInputEventArgs.cs b/src/Perspex.Input/Raw/RawTextInputEventArgs.cs index 1c6b19983f..810f9599a2 100644 --- a/src/Perspex.Input/Raw/RawTextInputEventArgs.cs +++ b/src/Perspex.Input/Raw/RawTextInputEventArgs.cs @@ -5,16 +5,11 @@ namespace Perspex.Input.Raw { public class RawTextInputEventArgs : RawInputEventArgs { - public RawTextInputEventArgs( - IKeyboardDevice device, - IInputRoot root, - uint timestamp, - string text) - : base(device, root, timestamp) + public string Text { get; set; } + + public RawTextInputEventArgs(IKeyboardDevice device, uint timestamp, string text) : base(device, timestamp) { Text = text; } - - public string Text { get; set; } } } diff --git a/src/Windows/Perspex.Win32/WindowImpl.cs b/src/Windows/Perspex.Win32/WindowImpl.cs index c786592a78..b6fc9f3f86 100644 --- a/src/Windows/Perspex.Win32/WindowImpl.cs +++ b/src/Windows/Perspex.Win32/WindowImpl.cs @@ -407,7 +407,6 @@ namespace Perspex.Win32 case UnmanagedMethods.WindowsMessage.WM_SYSKEYDOWN: e = new RawKeyEventArgs( WindowsKeyboardDevice.Instance, - _owner, timestamp, RawKeyEventType.KeyDown, KeyInterop.KeyFromVirtualKey((int)wParam), WindowsKeyboardDevice.Instance.Modifiers); @@ -417,7 +416,6 @@ namespace Perspex.Win32 case UnmanagedMethods.WindowsMessage.WM_SYSKEYUP: e = new RawKeyEventArgs( WindowsKeyboardDevice.Instance, - _owner, timestamp, RawKeyEventType.KeyUp, KeyInterop.KeyFromVirtualKey((int)wParam), WindowsKeyboardDevice.Instance.Modifiers); @@ -426,7 +424,7 @@ namespace Perspex.Win32 // Ignore control chars if (wParam.ToInt32() >= 32) { - e = new RawTextInputEventArgs(WindowsKeyboardDevice.Instance, _owner, timestamp, + e = new RawTextInputEventArgs(WindowsKeyboardDevice.Instance, timestamp, new string((char)wParam.ToInt32(), 1)); } @@ -451,8 +449,8 @@ namespace Perspex.Win32 case UnmanagedMethods.WindowsMessage.WM_MBUTTONDOWN: e = new RawMouseEventArgs( WindowsMouseDevice.Instance, - _owner, timestamp, + _owner, msg == (int)UnmanagedMethods.WindowsMessage.WM_LBUTTONDOWN ? RawMouseEventType.LeftButtonDown : msg == (int)UnmanagedMethods.WindowsMessage.WM_RBUTTONDOWN @@ -466,8 +464,8 @@ namespace Perspex.Win32 case UnmanagedMethods.WindowsMessage.WM_MBUTTONUP: e = new RawMouseEventArgs( WindowsMouseDevice.Instance, - _owner, timestamp, + _owner, msg == (int) UnmanagedMethods.WindowsMessage.WM_LBUTTONUP ? RawMouseEventType.LeftButtonUp : msg == (int) UnmanagedMethods.WindowsMessage.WM_RBUTTONUP @@ -492,8 +490,8 @@ namespace Perspex.Win32 e = new RawMouseEventArgs( WindowsMouseDevice.Instance, - _owner, timestamp, + _owner, RawMouseEventType.Move, PointFromLParam(lParam), GetMouseModifiers(wParam)); @@ -502,8 +500,8 @@ namespace Perspex.Win32 case UnmanagedMethods.WindowsMessage.WM_MOUSEWHEEL: e = new RawMouseWheelEventArgs( WindowsMouseDevice.Instance, - _owner, timestamp, + _owner, ScreenToClient(PointFromLParam(lParam)), new Vector(0, ((int)wParam >> 16) / wheelDelta), GetMouseModifiers(wParam)); break; @@ -512,8 +510,8 @@ namespace Perspex.Win32 _trackingMouse = false; e = new RawMouseEventArgs( WindowsMouseDevice.Instance, - _owner, timestamp, + _owner, RawMouseEventType.LeaveWindow, new Point(), WindowsKeyboardDevice.Instance.Modifiers); break; diff --git a/tests/Perspex.Controls.UnitTests/TopLevelTests.cs b/tests/Perspex.Controls.UnitTests/TopLevelTests.cs index 445e6747d7..9999630b85 100644 --- a/tests/Perspex.Controls.UnitTests/TopLevelTests.cs +++ b/tests/Perspex.Controls.UnitTests/TopLevelTests.cs @@ -266,7 +266,6 @@ namespace Perspex.Controls.UnitTests var input = new RawKeyEventArgs( new Mock().Object, - new Mock().Object, 0, RawKeyEventType.KeyDown, Key.A, InputModifiers.None); From b984e7bb7f8cbe75a14f36d8139d49a72941d6f3 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Thu, 4 Feb 2016 20:15:10 +0100 Subject: [PATCH 4/4] Added WindowState for mobile platforms. They always return Normal. --- .../Platform/SkiaPlatform/MainWindowImpl.cs | 7 +++++++ .../Perspex.Android/Platform/SkiaPlatform/WindowImpl.cs | 5 +++++ src/iOS/Perspex.iOS/PerspexView.cs | 5 +++++ 3 files changed, 17 insertions(+) diff --git a/src/Android/Perspex.Android/Platform/SkiaPlatform/MainWindowImpl.cs b/src/Android/Perspex.Android/Platform/SkiaPlatform/MainWindowImpl.cs index 330cd45d50..624116ddf7 100644 --- a/src/Android/Perspex.Android/Platform/SkiaPlatform/MainWindowImpl.cs +++ b/src/Android/Perspex.Android/Platform/SkiaPlatform/MainWindowImpl.cs @@ -1,5 +1,6 @@ using Android.Views; using Perspex.Android.Platform.Specific; +using Perspex.Controls; using Perspex.Input; using Perspex.Platform; @@ -13,6 +14,12 @@ namespace Perspex.Android.Platform.SkiaPlatform { } + public WindowState WindowState + { + get { return WindowState.Normal; } + set { } + } + protected override void Init() { base.Init(); diff --git a/src/Android/Perspex.Android/Platform/SkiaPlatform/WindowImpl.cs b/src/Android/Perspex.Android/Platform/SkiaPlatform/WindowImpl.cs index ed853a4353..b2b44aa0d9 100644 --- a/src/Android/Perspex.Android/Platform/SkiaPlatform/WindowImpl.cs +++ b/src/Android/Perspex.Android/Platform/SkiaPlatform/WindowImpl.cs @@ -61,6 +61,11 @@ namespace Perspex.Android.Platform.SkiaPlatform _keyboardHelper.HandleEvents = _handleEvents; } } + public WindowState WindowState + { + get { return WindowState.Normal; } + set { } + } public virtual Point GetPerspexPointFromEvent(MotionEvent e) => new Point(e.GetX(), e.GetY()); diff --git a/src/iOS/Perspex.iOS/PerspexView.cs b/src/iOS/Perspex.iOS/PerspexView.cs index a22e272388..ab8185c32c 100644 --- a/src/iOS/Perspex.iOS/PerspexView.cs +++ b/src/iOS/Perspex.iOS/PerspexView.cs @@ -74,6 +74,11 @@ namespace Perspex.iOS public IPlatformHandle Handle => PerspexPlatformHandle; + public WindowState WindowState + { + get { return WindowState.Normal; } + set { } + } public override void LayoutSubviews() => Resized?.Invoke(ClientSize);