private void DialogHost_OnDialogClosing(object sender, DialogClosingEventArgs e) { if (e.Parameter.GetType() == typeof(Word)) { if (e.Parameter == null) { return; } var word = (Word)e.Parameter; _client.EnqueueDataForWrite(new PickedWordPackage(new Word(word.Id, word.Value), _viewModel.MatchUid, App.Uid, Router.ServerWildcard)); } else //if(e.Parameter == "QuitMatch") { //Quit-Match clicked ProfileClipQuitMatch_OnClick(sender, e); _viewModel.Reset(); var gameBrowser = new GameBrowserWindow(_client, this); gameBrowser.ShowDialog(); ProgressBarLoading.Visibility = Visibility.Visible; } }
private void ProfileClipQuitMatch_OnClick(object sender, RoutedEventArgs e) { _client.EnqueueDataForWrite(new LeaveMatchPackage(_viewModel.MatchUid, App.Uid, Router.ServerWildcard)); _viewModel.Reset(); var gameBrowser = new GameBrowserWindow(_client, this); gameBrowser.ShowDialog(); ProgressBarLoading.Visibility = Visibility.Visible; }
private void OnConnectionSucceed(object sender, EventArgs e) { InvokeGui(() => { IsEnabled = true; LoginWindow loginWindow = new LoginWindow(_client); loginWindow.ShowDialog(); GameBrowserWindow gameBrowser = new GameBrowserWindow(_client, this); gameBrowser.ShowDialog(); ProgressBarLoading.Visibility = Visibility.Collapsed; DialogHostConnecting.IsOpen = false; }); }