maui-linux/Xamarin.Forms.Platform.WinRT/EntryCellTextBox.cs

30 строки
509 B
C#

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 IEntryCellController;
if (cell != null)
{
cell.SendCompleted();
e.Handled = true;
}
}
base.OnKeyUp(e);
}
}
}