示例#1
0
        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;
        }
示例#2
0
 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);
 }
示例#3
0
 public TableGridViewModel(TableGrid control)
 {
     this.Control          = control;
     this.ItemsForListView = new ObservableCollection <TableGridItem>();
     this.Add = new Command(async() => await this.AddExecuteAsync());
 }
示例#4
0
 public void DeleteItem(TableGridItem item)
 {
     this.Control.Items.Remove(item.Data);
     TableGrid.OnItemsSourceChanged(this.Control, this.Control.Items, this.Control.Items);
 }