public ChangingCollectionViewModel() { _Items = new ObservableCollection<int>(new int[]{1,2,3,4,5}); Replace = new RelayCommand(DoReplace); Add = new RelayCommand(DoAdd); }
public SkillsViewModel() { RemoveSkill = new RelayCommand<Skill>(s => this.Skills.Remove(s)); AddSkill = new RelayCommand<Skill>(s => { MainSkill = new Skill() {Type="Type",Name="New skill" }; this.Skills.Add(MainSkill); }); Skills = new ObservableCollection<Skill>(); SelectedSkills = new ObservableCollection<Skill>(); }
public Person(ICommand forTest=null) { Skills = new ObservableCollection<Skill>(); TestCommand = forTest; Command = new ToogleRelayCommand(DoCommand); RemoveSkill = new RelayCommand<Skill>(s=> this.Skills.Remove(s)); ChangeSkill = new RelayCommand<Skill>(s => MainSkill = (this.Skills.Count>0)?this.Skills[0] : null); RemoveSkills = new RelayCommand<Skill>(s => Skills.Clear()); }
public Nav() { DoNav = new RelayCommand(() => { Navigation?.NavigateAsync(this); }); }
public Couple() { MakeSelf = new RelayCommand(_ => DoMakeSelf()); Duplicate = new RelayCommand(_ => DoDuplicate()); }
public Person() { GoCouple = new RelayCommand(() => { Navigation?.NavigateAsync(Couple); }); }
public Couple() : base() { GoOne = new RelayCommand(() => Goto(One)); GoTwo = new RelayCommand(() => Goto(Two)); }