public ViewModel() { if (MyStrings == null) { MyStrings = new ObservableCollection <string>(); } for (int i = 0; i < 5; i++) { MyStrings.Add("string " + i); } AddStringCommand = new AddLabelCommand(AddString); }
public void AddString() { MyStrings.Add("string " + (MyStrings.Count)); }