EventHandler<BoolEventArgs> NewTileHandler(DesignerItem item)
        {
            Rectangle rect=  new Rectangle();
            rect.IsHitTestVisible = false;
            rect.Fill = (Window.GetWindow(this) as MainWindow).Settings.NormalBrush;
            rect.MinHeight = 2;
            rect.MinWidth = 2;

            item.Content = rect;

            Tile t = new Tile();
            t.Type = Surface.Normal;
            t.Dimensions.Width = 50;
            t.Dimensions.Height = 50;

            TilePropertiesWindow tpw = new TilePropertiesWindow(t, item, Level);
            this.Children.Add(tpw);

            return tpw.SelectionHandler;
        }
        private void AddTile(Tile t)
        {
            Rectangle rect = new Rectangle();
            rect.IsHitTestVisible = false;
            rect.Fill = Settings.NormalBrush;

            DesignerItem item = new DesignerItem();
            item.Content = rect;
            item.MinHeight = item.MinWidth = 1;
            MyDesignerCanvas.Children.Add(item);

            PropertiesWindow pw = new TilePropertiesWindow(t, item, Level);
            MyDesignerCanvas.Children.Add(pw);

            item.OnSelected += pw.SelectionHandler;
            item.IsSelected = true;
        }