예제 #1
0
        public void SetContent(int Column, int Row, SaveItemInfo children)
        {
            ToolboxItem toolBoxItem;

            UIElement txt = (from model in this.Children.OfType <UIElement>() where Grid.GetColumn(model) == Column && Grid.GetRow(model) == Row select model).FirstOrDefault();

            if (txt != null)
            {
                Children.Remove(txt);
            }
            if (IsEdit == true)
            {
                toolBoxItem = ToolboxItem.GetToolBoxItem(children);
            }
            else
            {
                toolBoxItem = ToolboxItem.GetGridChildrenPreview(children);
            }

            Grid.SetRow(toolBoxItem, Row);
            Grid.SetColumn(toolBoxItem, Column);
            Children.Add(toolBoxItem);
        }