From 4c0413e7d838aa333860d4f4b01abc3cd801ba4a Mon Sep 17 00:00:00 2001 From: Patrick Hellebrand Date: Thu, 23 Sep 2021 14:54:25 +0200 Subject: [PATCH] removed ability to send empty messages --- PolyChat/MainPage.xaml.cs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/PolyChat/MainPage.xaml.cs b/PolyChat/MainPage.xaml.cs index b669e8e..c63d534 100644 --- a/PolyChat/MainPage.xaml.cs +++ b/PolyChat/MainPage.xaml.cs @@ -217,33 +217,19 @@ namespace PolyChat private void OnKeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e) { updateSendButtonEnabled(); - if (e.Key == Windows.System.VirtualKey.Enter) + if (buttonSend.IsEnabled && e.Key == Windows.System.VirtualKey.Enter) { OnSendMessage(); } } - public static IAsyncOperation SafelyOpenDialog(Dialog d) + public static IAsyncOperation SafelyOpenDialog(ContentDialog d) { if(VisualTreeHelper.GetOpenPopups(Window.Current).Count == 0) return d.ShowAsync(); return null; } - public static IAsyncOperation SafelyOpenDialog(NewChatDialog d) - { - if (VisualTreeHelper.GetOpenPopups(Window.Current).Count == 0) - return d.ShowAsync(); - return null; - } - - public static IAsyncOperation SafelyOpenDialog(EditUsernameDialog d) - { - if (VisualTreeHelper.GetOpenPopups(Window.Current).Count == 0) - return d.ShowAsync(); - return null; - } - // UPDATE FUNCTIONS FOR UI PLACEHOLDERS private void updateNoChatsPlaceholder()