public ChangingCollectionViewModel()
        {
            _Items = new ObservableCollection<int>(new int[]{1,2,3,4,5});

            Replace = new RelayCommand(DoReplace);
            Add = new RelayCommand(DoAdd);
        }
Пример #2
0
 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>();
 }
Пример #3
0
  public Couple():base()
 {
     GoOne = new RelayCommand(() => 
         Navigation.NavigateAsync(One));
     GoTwo = new RelayCommand(() => 
         Navigation.NavigateAsync(Two));
 }
Пример #4
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);
        }
Пример #5
0
 public Couple()
 {
     MakeSelf = new RelayCommand(_ => DoMakeSelf());
 }
 public A1()
 {
     Change = new RelayCommand(() => Navigation.NavigateAsync(new A1()));
     GoTo1 = new RelayCommand(() => Navigation.NavigateAsync(new A2()));
 }
 public AA1()
 {
     Exception = new Exception();
     Change = new RelayCommand(() =>{ throw Exception;});
     GoTo1 = new RelayCommand(() => Navigation.NavigateAsync(new A2()));
 }
Пример #8
0
 public Person():base()
 {
     GoCouple = new RelayCommand(() => Navigation.NavigateAsync(Couple));
 }
Пример #9
0
 public Nav()
 {
     DoNav = new RelayCommand(() => Navigation.NavigateAsync(this));
 }