private void Game_Results_MenuItem_Click(object sender, RoutedEventArgs e) { ResultsWindow resultsWindow = new ResultsWindow() { ShowInTaskbar = false, Topmost = true, ResizeMode = ResizeMode.NoResize, Owner = ParentWindow.getParentWindow(), }; resultsWindow.Left = (Utils.getScreenWidth() / 2) - (resultsWindow.Width / 2); resultsWindow.Top = (Utils.getScreenHeight() / 2) - (resultsWindow.Height / 2); resultsWindow.ShowDialog(); }
private void startGame() { RequestWindow rw = new RequestWindow { ShowInTaskbar = false, // don't show the dialog on the taskbar Topmost = true, // ensure we're Always On Top ResizeMode = ResizeMode.NoResize, // remove excess caption bar buttons Owner = ParentWindow.getParentWindow(), }; rw.Left = (Utils.getScreenWidth() / 2) - (rw.Width / 2); rw.Top = (Utils.getScreenHeight() / 2) - (rw.Height / 2); rw.ShowDialog(); }
private void LeaderBoard_MenuItem_Click(object sender, RoutedEventArgs e) { LeaderBoard lb = new LeaderBoard() { ShowInTaskbar = false, Topmost = true, ResizeMode = ResizeMode.NoResize, Owner = ParentWindow.getParentWindow(), }; lb.Left = (Utils.getScreenWidth() / 2) - (lb.Width / 2); lb.Top = (Utils.getScreenHeight() / 2) - (lb.Height / 2); lb.ShowDialog();; }
private void Game_Request_Click(object sender, RoutedEventArgs e) { String nickName = (string)Application.Current.Resources["nickname"]; Dictionary <string, string>[] requests = serviceClient.GetGameRequests(nickName); PendingRequests pendingRequestsWindow = new PendingRequests(requests) { ShowInTaskbar = false, Topmost = true, ResizeMode = ResizeMode.NoResize, Owner = ParentWindow.getParentWindow(), }; pendingRequestsWindow.Left = (Utils.getScreenWidth() / 2) - (pendingRequestsWindow.Width / 2); pendingRequestsWindow.Top = (Utils.getScreenHeight() / 2) - (pendingRequestsWindow.Height / 2); pendingRequestsWindow.ShowDialog(); }