private void RedrawTiles() { //i hope you have tiles... cuz the UI is getting rebuilt //todo: maybe rename this property, it's confusing PlayerTiles.PlayerTiles.Clear(); //BUG:player.tiles is coming back with 10+ tiles in some cases foreach (Scrabble.Core.Types.Tile t in this.Player.Tiles) { PlayerTiles.PlayerTiles.Add(new Tile(t.Letter.ToString(), t.Score)); } PlayerTiles.Redraw(); UpdateScores(); }
void Tiles_Drop(object sender, DragEventArgs e) { Tile t = (Tile)e.Data.GetData("scTile"); if (UtilityFunctions.GetAncestorOfType <Canvas>(t) != null) { Canvas squareCnt = (Canvas)t.Parent; squareCnt.Children.Clear(); BoardSquare thisSquare = (BoardSquare)squareCnt.Parent; thisSquare.PlacedTile = null; UtilityFunctions.GetAncestorOfType <GameWindow>(thisSquare).WordInPlay.Remove(thisSquare.MyCoords); PlayerTiles.Add(t); Redraw(); } }