Esempio n. 1
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>();
 }
Esempio n. 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            var datacontext = new Person()
                {
                    Name = "O Monstro",
                    LastName = "Desmaisons",
                    Local = new Local() { City = "Florianopolis", Region = "SC" },
                    PersonalState = PersonalState.Married
                };

            _FirstSkill = new Skill() { Name = "Langage", Type = "French" };

            datacontext.Skills.Add(_FirstSkill);
            datacontext.Skills.Add(new Skill() { Name = "Info", Type = "C++" });

            Window w = sender as Window;
            w.DataContext = datacontext;
            _Person = datacontext;
        }