From 15679951bcb208d8e82f553fdf6a97170528a2d3 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 752a608..1b6f6e2 100644 --- a/PolyChat/MainPage.xaml.cs +++ b/PolyChat/MainPage.xaml.cs @@ -213,33 +213,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()