public PassengerStudentEditViewModel()
        {
            AgeGroup = new AgeGroupCapabilities();

            passengerService = (App.Current as App).Container.GetService <IPassengerService>();

            // Cast object to StudentModel and assign
            studentModelToEdit = passengerService.GetPassengerToEdit() as StudentModel;

            // Set passenger name for label
            PassengerNameToDisplay = studentModelToEdit.FirstName + " " + studentModelToEdit.LastName;

            PublishEditStudentPassengerCommand = new RelayCommand(
                async() =>
            {
                var messageDialog = new MessageDialog("Are you sure you want to commit these changes?", "Accept Student Changes");
                messageDialog.Commands.Add(new UICommand("Yes", null));
                messageDialog.Commands.Add(new UICommand("No", null));
                messageDialog.DefaultCommandIndex = 0;
                messageDialog.CancelCommandIndex  = 1;
                var cmd = await messageDialog.ShowAsync();

                if (cmd.Label == "Yes")
                {
                    studentModelToEdit.FirstName   = FirstName;
                    studentModelToEdit.LastName    = LastName;
                    studentModelToEdit.ClassName   = ClassName;
                    studentModelToEdit.ParentName  = ParentName;
                    studentModelToEdit.ParentEmail = ParentEmail;
                    studentModelToEdit.AgeGroup    = AgeGroup;
                }

                NavigationService.Navigate(typeof(PassengersPage));
            });
        }
Esempio n. 2
0
 public StudentModel()
 {
     AgeGroup = new AgeGroupCapabilities();
 }
Esempio n. 3
0
 public Specs()
 {
     Capabilities = new AgeGroupCapabilities();
 }