async void OnPageActionSheet(Page sender, ActionSheetArguments options) { var list = new System.Windows.Controls.ListView { Style = (System.Windows.Style)System.Windows.Application.Current.Resources["ActionSheetList"], ItemsSource = options.Buttons }; var dialog = new LightContentDialog { Content = list, }; if (options.Title != null) { dialog.Title = options.Title; } list.SelectionChanged += (s, e) => { if (list.SelectedItem != null) { dialog.Hide(); options.SetResult((string)list.SelectedItem); } }; /*_page.KeyDown += (window, e) => * { * if (e.Key == System.Windows.Input.Key.Escape) * { * dialog.Hide(); * options.SetResult(LightContentDialogResult.None.ToString()); * } * };*/ if (options.Cancel != null) { dialog.IsSecondaryButtonEnabled = true; dialog.SecondaryButtonText = options.Cancel; } if (options.Destruction != null) { dialog.IsPrimaryButtonEnabled = true; dialog.PrimaryButtonText = options.Destruction; } LightContentDialogResult result = await dialog.ShowAsync(); if (result == LightContentDialogResult.Secondary) { options.SetResult(options.Cancel); } else if (result == LightContentDialogResult.Primary) { options.SetResult(options.Destruction); } }