public ViewModelMain() { var personas = db.Personas.Take(10).ToList(); People = new ObservableCollection<ListPerson> { }; foreach (var p in personas) { ListPerson listPerson = new ListPerson { Nombre = p.PrimerNombre, TipoDocumento = p.TipoDocumento, Documento = p.NoDocumento, Departamento = p.Departamento, Ciudad = p.Ciudad, Telefono = p.Telefono, Celular = p.Celular }; People.Add(listPerson); } TextProperty1 = "Type here"; AddUserCommand = new RelayCommand(AddUser); }
public ViewModelWindow4() { People = new List<PocoPerson> { new PocoPerson { Id="ff", PrimerNombre="ff", SegundoNombre="ff", PrimerApellido="ff", SegundoApellido="ff", Sexo="ff", TipoDocumento="ff", NoDocumento="ff", RepetirNoDocumento="ff", FechaNacimiento="ff", Usuario="ff", Contrasena="ff", Departamento="ff", Ciudad="ff", Direccion="ff", Barrio="ff", Telefono="ff", Celular="ff", CorreoElectronico="ff", CorreoElectronicoRepeat="ff", CentroEmpleo="ff" }, new PocoPerson {Id="ff", PrimerNombre="ff", SegundoNombre="ff", PrimerApellido="ff", SegundoApellido="ff", Sexo="ff", TipoDocumento="ff", NoDocumento="ff", RepetirNoDocumento="ff", FechaNacimiento="ff", Usuario="ff", Contrasena="ff", Departamento="ff", Ciudad="ff", Direccion="ff", Barrio="ff", Telefono="ff", Celular="ff", CorreoElectronico="ff", CorreoElectronicoRepeat="ff", CentroEmpleo="ff" }, new PocoPerson {Id="ff", PrimerNombre="ff", SegundoNombre="ff", PrimerApellido="ff", SegundoApellido="ff", Sexo="ff", TipoDocumento="ff", NoDocumento="ff", RepetirNoDocumento="ff", FechaNacimiento="ff", Usuario="ff", Contrasena="ff", Departamento="ff", Ciudad="ff", Direccion="ff", Barrio="ff", Telefono="ff", Celular="ff", CorreoElectronico="ff", CorreoElectronicoRepeat="ff", CentroEmpleo="ff" }, }; TextProperty1 = "This will now update"; NextExampleCommand = new RelayCommand(NextExample); AddUserCommand = new RelayCommand(AddUser); timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += new EventHandler(timer_Tick); timer.Start(); }
//This ViewModel is just to duplicate the last, but showing binding in code behind public ViewModelEditPersona(string Identificacion ) { NextExampleCommand = new RelayCommand(NextExample); }
//This ViewModel is just to duplicate the last, but showing binding in code behind public ViewModelDetallePersona(string NoIdentificacion) { NextExampleCommand = new RelayCommand(NextExample); }
public ViewModelWindow5() { personnel = new PersonnelBusinessObject(); personnel.PeopleChanged += new EventHandler(personnel_PeopleChanged); CancelCommand = new RelayCommand(DoCancel); SaveCommand = new RelayCommand(DoSave); AddUserCommand = new RelayCommand(AddUser); DeleteUserCommand = new RelayCommand(DeleteUser); UpdateBindingGroup = new BindingGroup { Name = "Group1" }; checkStatusTimer = new DispatcherTimer(); checkStatusTimer.Interval = TimeSpan.FromMilliseconds(500); checkStatusTimer.Tick += new EventHandler(CheckStatus); checkStatusTimer.Start(); CheckStatus(null, null); }