30 lines
669 B
C#
30 lines
669 B
C#
namespace TestUI.ViewModels
|
|
{
|
|
using System.Collections.ObjectModel;
|
|
using System.Windows.Input;
|
|
|
|
internal class MainVM : BaseVM
|
|
{
|
|
public MainVM()
|
|
{
|
|
this.Add = new Command(this.AddCommand);
|
|
this.Items = new ObservableCollection<ItemsRowVM>();
|
|
}
|
|
|
|
public ICommand Add { get; }
|
|
|
|
public ObservableCollection<ItemsRowVM> Items { get; }
|
|
|
|
private void AddCommand()
|
|
{
|
|
var rowNr = this.Items.Count;
|
|
var row = new ItemsRowVM(rowNr);
|
|
|
|
row.Add($"{rowNr}.");
|
|
row.Add("816232411982");
|
|
|
|
this.Items.Add(row);
|
|
}
|
|
}
|
|
}
|