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(); } public ICommand Add { get; } public ObservableCollection 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); } } }