modif for the scoreboard databinding ; does not work atm
continuous-integration/drone/push Build is passing Details

test_old_branch
rportet 11 months ago
parent d575f0f998
commit 933a18e5aa

@ -8,7 +8,7 @@
<Label <Label
Grid.Column="0" Grid.Column="0"
Text="Player" Text="{Binding playerName}"
Style="{StaticResource ContentTab}"/> Style="{StaticResource ContentTab}"/>
<Rectangle <Rectangle
@ -17,7 +17,7 @@
<Label <Label
Grid.Column="2" Grid.Column="2"
Text="Points" Text="{Binding nbPoints}"
Style="{StaticResource ContentTab}"/> Style="{StaticResource ContentTab}"/>
</Grid> </Grid>

@ -1,5 +1,8 @@
using QwirkleClassLibrary.Games;
using QwirkleClassLibrary.Players;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -8,8 +11,23 @@ namespace Qwirkle.Views;
public partial class ScoreboardLine : ContentView public partial class ScoreboardLine : ContentView
{ {
public ReadOnlyDictionary<Player, int> scoreboard = ((App)App.Current!).Game.ScoreBoard;
List<string> nameTags = scoreboard.Keys.ToList();
List<int> nbPoints = scoreboard.Values.ToList();
Dictionary<Player, int> modifiableDictionary = new Dictionary<Player, int>(scoreboard);
public static readonly BindableProperty ScoreboardLineProperty = BindableProperty.Create("ScoreBLine", typeof(ScoreboardLine), typeof(object));
public ScoreboardLine() public ScoreboardLine()
{ {
InitializeComponent(); InitializeComponent();
BindingContext = scoreboard;
} }
} }
Loading…
Cancel
Save