public TableGridItem(object data, TableGrid tableGrid) { this.Edit = new Command(async() => await this.tableGrid.viewModel.EditItemAsync(this)); this.Delete = new Command(() => this.tableGrid.viewModel.DeleteItem(this)); this.Data = data; this.tableGrid = tableGrid; }
public void SaveItem(object item) { if (!this.Control.Items.Contains(item)) { this.Control.Items.Add(item); } ; TableGrid.OnItemsSourceChanged(this.Control, this.Control.Items, this.Control.Items); }
public TableGridViewModel(TableGrid control) { this.Control = control; this.ItemsForListView = new ObservableCollection <TableGridItem>(); this.Add = new Command(async() => await this.AddExecuteAsync()); }
public void DeleteItem(TableGridItem item) { this.Control.Items.Remove(item.Data); TableGrid.OnItemsSourceChanged(this.Control, this.Control.Items, this.Control.Items); }