public AddVisitorViewModel() { StoreNewVisitor = new MyCommand(StoreVisitor, canStore); ObservableCollection <Visitor> visitors = new ObservableCollection <Visitor>(); visitors.Add(new Visitor { Name = "Hahahaha", Email = "*****@*****.**", Gender = "Male", Age = 50, }); Visitors = visitors; Test = Visitors.First().Name; }
private void StoreVisitor() { VisitorService VisitorManager = new VisitorService(); var visitor = Visitors.First(); ((ICRUDService)VisitorManager).Create( visitor.Name, visitor.Email, visitor.Age, visitor.Gender, visitor.Password ); }