summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.WinRT/EntryCellTextBox.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.WinRT/EntryCellTextBox.cs')
-rw-r--r--Xamarin.Forms.Platform.WinRT/EntryCellTextBox.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.WinRT/EntryCellTextBox.cs b/Xamarin.Forms.Platform.WinRT/EntryCellTextBox.cs
new file mode 100644
index 00000000..e280e18a
--- /dev/null
+++ b/Xamarin.Forms.Platform.WinRT/EntryCellTextBox.cs
@@ -0,0 +1,30 @@
+using Windows.System;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Input;
+
+#if WINDOWS_UWP
+
+namespace Xamarin.Forms.Platform.UWP
+#else
+
+namespace Xamarin.Forms.Platform.WinRT
+#endif
+{
+ public class EntryCellTextBox : TextBox
+ {
+ protected override void OnKeyUp(KeyRoutedEventArgs e)
+ {
+ if (e.Key == VirtualKey.Enter)
+ {
+ var cell = DataContext as EntryCell;
+ if (cell != null)
+ {
+ cell.SendCompleted();
+ e.Handled = true;
+ }
+ }
+
+ base.OnKeyUp(e);
+ }
+ }
+} \ No newline at end of file