public Vm() { _buttonInfos = new ObservableCollection<ButtonInfo> { new ButtonInfo(new RelayCommand(o => MessageBox.Show("1")), "B1"), new ButtonInfo(new RelayCommand(o => MessageBox.Show("2")), "B2"), new ButtonInfo(new RelayCommand(o => MessageBox.Show("3")), "B3") }; AddItem= new RelayCommand(o=>Add()); }
public ButtonInfo(RelayCommand command, string text) { Command = command; Text = text; }