public void RefreshBoardItem(int x, int y) { this.items[x, y] = null; if (this.Board != null) { RemoteItemViewModelBase item = this.Board.GetItem(x, y); if (item != null) { if (item is RemoteCommandItemViewModel) { this.items[x, y] = new RemoteCommandItemControlViewModel((RemoteCommandItemViewModel)item); } else if (item is RemoteFolderItemViewModel) { this.items[x, y] = new RemoteFolderItemControlViewModel((RemoteFolderItemViewModel)item); } else if (item is RemoteBackItemViewModel) { this.items[x, y] = new RemoteBackItemControlViewModel((RemoteBackItemViewModel)item, this.Board.ParentBoard); } else if (item is RemoteEmptyItemViewModel) { this.items[x, y] = new RemoteEmptyItemControlViewModel((RemoteEmptyItemViewModel)item); } } } this.NotifyPropertyChanged("Item" + x + y); }
public RemoteItemControlViewModelBase(RemoteItemViewModelBase item) { this.item = item; this.DeleteCommand = this.CreateCommand((parameter) => { MessageCenter.Send <RemoteItemViewModelBase>(RemoteItemControlViewModelBase.RemoteDeleteItemEventName, this.Item); return(Task.FromResult(0)); }); }
public void AddItem(RemoteItemViewModelBase item) { this.model.SetItem(item.GetModel(), item.XPosition, item.YPosition); this.BuildBoardItems(); }