void ExecuteTripCommandMethod() { //do not execute not fully created trips if (!Trip.IsCreated) { return; } //another trip in execution if (IoC.ExecuteTripViewModel.IsExecuting && IoC.ExecuteTripViewModel.Trip != Trip) { return; } //trip date does not match current date if (Trip.Date.Date.CompareTo(DateTime.UtcNow.Date) != 0) { return; } //show trip execution frame; need to do this BEFORE trip gets set FrameHistory.OpenFrame(IoC.ExecuteTripViewModel); //not already executing a trip... if (!IoC.ExecuteTripViewModel.IsExecuting) { //set trip to be executed IoC.ExecuteTripViewModel.Trip = Trip; } }
void ResetCommandMethod() { //reset states to unhandled ApplyToVisitPurposeSelectionVMs(vp => vp.ResetState()); IoC.ExecuteTripViewModel.UpdateStateOfDestination(DestinationVM.Destination, true); FrameHistory.CloseFrame(); }
void FinishCommandMethod() { //set states based on their temporal values ApplyToVisitPurposeSelectionVMs(vp => vp.ApplyState()); IoC.ExecuteTripViewModel.UpdateStateOfDestination(DestinationVM.Destination); FrameHistory.CloseFrame(); //if there are further destinations to proceed with, re-open this frame IoC.ExecuteTripViewModel.ProceedWithNextDestination(); }
void ViewTripCommandMethod() { IoC.ViewTripViewModel.Trip = Trip; FrameHistory.OpenFrame(IoC.ViewTripViewModel); }
protected virtual void CloseCommandMethod() { FrameHistory.CloseFrame(); }