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>();
 }
Ejemplo n.º 3
0
        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); });
 }
Ejemplo n.º 5
0
 public Couple()
 {
     MakeSelf = new RelayCommand(_ => DoMakeSelf());
     Duplicate = new RelayCommand(_ => DoDuplicate());   
 }
Ejemplo n.º 6
0
 public Person()
 {
     GoCouple = new RelayCommand(() => { Navigation?.NavigateAsync(Couple); });
 }
Ejemplo n.º 7
0
 public Couple() : base()
 {
     GoOne = new RelayCommand(() => Goto(One));
     GoTwo = new RelayCommand(() => Goto(Two));
 }