예제 #1
0
        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;
            }
        }
예제 #2
0
        void ResetCommandMethod()
        {
            //reset states to unhandled
            ApplyToVisitPurposeSelectionVMs(vp => vp.ResetState());

            IoC.ExecuteTripViewModel.UpdateStateOfDestination(DestinationVM.Destination, true);

            FrameHistory.CloseFrame();
        }
예제 #3
0
        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();
        }
예제 #4
0
 void ViewTripCommandMethod()
 {
     IoC.ViewTripViewModel.Trip = Trip;
     FrameHistory.OpenFrame(IoC.ViewTripViewModel);
 }
예제 #5
0
 protected virtual void CloseCommandMethod()
 {
     FrameHistory.CloseFrame();
 }