Esempio n. 1
0
        /// <summary>
        /// Ajout au canvas d'un objet drawable
        /// </summary>
        /// <param name="position"></param>
        /// <param name="drawable"></param>
        public void AddDrawable(Point position, IDrawable drawable)
        {
            var gridPosition = _grid.GridPosition(position);

            if (!_drawables.ContainsKey(gridPosition))
            {
                drawable.SetWidth(_grid.Width);
                drawable.Draw(gridPosition);
                this.Children.Add(drawable.GetUIElement());

                _drawables.Add(gridPosition, drawable);
            }
        }