public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> suspensionState)
        {
            session           = SessionState["State"] as IXWingSessionState;
            SquadronViewModel = session.ActiveSquadron;
            LoadPilots(SquadronViewModel.Squadron.Faction);

            //if (suspensionState.Any())
            //{
            //    //Value = suspensionState[nameof(Value)]?.ToString();
            //}
            await Task.CompletedTask;
        }
예제 #2
0
        public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> suspensionState)
        {
            session = SessionState["State"] as IXWingSessionState;

            if (session.ActiveSquadron.Squadron is NullSquadron)
            {
                SquadronViewModel = new SquadronViewModel(SquadronFactory.CreateSquadron(parameter as IFaction));
                session.SetActiveSquadron(SquadronViewModel);
            }
            else
            {
                SquadronViewModel = session.ActiveSquadron;
            }

            //NavigationService.ClearHistory();
            await Task.CompletedTask;
        }
예제 #3
0
        public override async Task OnNavigatedToAsync(object parameter, NavigationMode mode, IDictionary <string, object> suspensionState)
        {
            session           = SessionState["State"] as IXWingSessionState;
            SquadronViewModel = session.ActiveSquadron;

            string shipname = parameter as string;

            Pilots = session.XWingRepository.GetPilotsForFaction(SquadronViewModel.Squadron.Faction)
                     .Where(x => x.ShipName == shipname)
                     .OrderByDescending(x => x.PilotSkill)
                     .ThenByDescending(x => x.Cost)
                     .ThenBy(x => x.Name)
                     .ToList();
            //if (suspensionState.Any())
            //{
            //    //Value = suspensionState[nameof(Value)]?.ToString();
            //}

            await Task.CompletedTask;
        }
예제 #4
0
 public void SetActiveSquadron(ISquadronViewModel squadron)
 {
     ActiveSquadron = squadron;
 }
예제 #5
0
 public void ClearActiveSquadron()
 {
     ActiveSquadron = new SquadronViewModel(new NullSquadron());
 }
예제 #6
0
 public SquadronBuilderViewModel()
 {
     SquadronViewModel = new SquadronViewModel(SquadronFactory.CreateSquadron());
 }