Skip to content

Commit

Permalink
feat: (iOS) Add expose Raise Events
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpinedam committed Aug 11, 2022
1 parent 7e98596 commit 384a94b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/Uno.UWP/UI/Core/CoreWindow.iOS.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Foundation.Metadata;
using Windows.UI.Core;

namespace Windows.UI.Core
{
public partial class CoreWindow
public partial class CoreWindow : ICoreWindowEvents
{
public event TypedEventHandler<CoreWindow, KeyEventArgs> KeyDown;

Expand All @@ -19,5 +20,13 @@ public CoreWindow(UIWindow window) : this()
{
_window = window;
}

void ICoreWindowEvents.RaiseKeyDown(KeyEventArgs eventArgs) =>
KeyDown?.Invoke(this, eventArgs);


void ICoreWindowEvents.RaiseKeyUp(KeyEventArgs eventArgs) =>
KeyUp?.Invoke(this, eventArgs);

}
}
11 changes: 11 additions & 0 deletions src/Uno.UWP/UI/Core/ICoreWindowsEvents.iOS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;

namespace Windows.UI.Core
{
public interface ICoreWindowEvents
{
void RaiseKeyUp(KeyEventArgs args);
void RaiseKeyDown(KeyEventArgs args);
}
}

0 comments on commit 384a94b

Please sign in to comment.