/// <summary> /// Helper method that closes this popup window and opens popup about /// score calculation. /// </summary> /// <returns></returns> public async Task ShowInformation() { await PopupNavigation.Instance.PopAsync(true); KiviPopupWindow window = new KiviPopupWindow(); await PopupNavigation.Instance.PushAsync(window); }
/// <summary> /// Calculates players' scores when button (sender) is pressed. /// Calculating happens in GameBoard class. Points are then shown /// in a score window. /// </summary> /// <param name="sender">Button that is pressed to activate this method.</param> /// <param name="args">Event args, not used.</param> public void CalculateScores(object sender, EventArgs args) { var players = _gameBoard.CalculateScores(); if (_gameBoard.IsEmpty(players)) { // None of the players have scored OR user didn't give // any values to gameboard. Alert is shown to inform user. DependencyService.Get <IMessage>().ShowAlert(AppResources.GameboardEmpty); } else { // If even one player has scored we show score window that // presents scores. KiviPopupWindow window = new KiviPopupWindow(players); PopupNavigation.Instance.PushAsync(window); } }
/// <summary> /// Method that opens a popup window that explains how points are calculated /// in KIVI boardgame. /// </summary> public async void ShowInformation() { KiviPopupWindow window = new KiviPopupWindow(); await PopupNavigation.Instance.PushAsync(window); }