blob: 987858bc21f331e0563e24856827453b63e96526 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
using System;
using UIKit;
namespace Xamarin.Forms.Platform.iOS
{
internal static class KeyboardObserver
{
static KeyboardObserver()
{
UIKeyboard.Notifications.ObserveWillShow(OnKeyboardShown);
UIKeyboard.Notifications.ObserveWillHide(OnKeyboardHidden);
}
public static event EventHandler<UIKeyboardEventArgs> KeyboardWillHide;
public static event EventHandler<UIKeyboardEventArgs> KeyboardWillShow;
static void OnKeyboardHidden(object sender, UIKeyboardEventArgs args)
{
var handler = KeyboardWillHide;
if (handler != null)
handler(sender, args);
}
static void OnKeyboardShown(object sender, UIKeyboardEventArgs args)
{
var handler = KeyboardWillShow;
if (handler != null)
handler(sender, args);
}
}
}
|