private void AddAbility(StackPanel panel) { AbilityBonusViewModel newVM = new AbilityBonusViewModel(2,-1); AbilityBonusViewModelList.Add(newVM); //MessageBox.Show(AbilityBonus); var children = panel.Children; //children.Add(new AbilityBonusView(newVM)); var eButton = children.OfType<Button>().First(); children.Remove(eButton); children.Add(eButton); }
public AbilityBonusView(AbilityBonusViewModel abvm) { DataContext = abvm; InitializeComponent(); }