You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
989 B
39 lines
989 B
using CommunityToolkit.Maui.Views;
|
|
using QwirkleClassLibrary.Games;
|
|
using System.Collections.ObjectModel;
|
|
|
|
namespace Qwirkle;
|
|
|
|
public partial class PopUpEndGame : Popup
|
|
{
|
|
public PopUpEndGame()
|
|
{
|
|
InitializeComponent();
|
|
|
|
var scoreboard = game.ObservableScoreBoard.OrderByDescending(x => x.Value).ThenBy(x => x.Key);
|
|
ScoreboardList = new ObservableCollection<KeyValuePair<string, int>>(scoreboard);
|
|
}
|
|
|
|
private Game game = ((App)Application.Current!).Game;
|
|
|
|
private ObservableCollection<KeyValuePair<string, int>>? scoreboardList;
|
|
public ObservableCollection<KeyValuePair<string, int>>? ScoreboardList
|
|
{
|
|
get => scoreboardList;
|
|
set
|
|
{
|
|
if (scoreboardList != value)
|
|
{
|
|
scoreboardList = value;
|
|
OnPropertyChanged(nameof(ScoreboardList));
|
|
}
|
|
}
|
|
}
|
|
|
|
public async void OnButtonNextClick(object sender, EventArgs e)
|
|
{
|
|
await CloseAsync();
|
|
}
|
|
|
|
}
|