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()