Exemplo n.º 1
0
 protected LevelGridButton AddItem(LevelGridItem item)
 {
     LevelGridButton button = new LevelGridButton() { DataContext = item };
     _buttons.Add(button);
     button.Delete += OnItemDelete;
     button.Edit += OnItemEdit;
     ButtonGrid.Children.Add(button);
     return button;
 }
Exemplo n.º 2
0
 protected void SetGrid(LevelGridButton button, LevelGridItem item)
 {
     Grid.SetRow(button, item.YCord);
     Grid.SetColumn(button, item.XCord);
     Grid.SetRowSpan(button, item.GridHeight);
     Grid.SetColumnSpan(button, item.GridWidth);
 }
Exemplo n.º 3
0
 protected void OnItemEdit(LevelGridItem button)
 {
     if (ItemEdit != null) ItemEdit(button as LevelGridItem);
 }
Exemplo n.º 4
0
 protected void OnItemDelete(LevelGridItem button)
 {
     if (ItemDelete != null) ItemDelete(button as LevelGridItem);
 }
Exemplo n.º 5
0
 protected void DeleteItem(LevelGridItem item)
 {
     LevelGridButton button = _buttons.Find(x => x.DataContext == item);
     ButtonGrid.Children.Remove(button);
     _buttons.Remove(button);
 }
Exemplo n.º 6
0
 protected void SetModel(object sender, DependencyPropertyChangedEventArgs e)
 {
     _model = DataContext as LevelGridItem;
     Initialise();
 }