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; }
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; }
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; }
public void SetActiveSquadron(ISquadronViewModel squadron) { ActiveSquadron = squadron; }
public void ClearActiveSquadron() { ActiveSquadron = new SquadronViewModel(new NullSquadron()); }
public SquadronBuilderViewModel() { SquadronViewModel = new SquadronViewModel(SquadronFactory.CreateSquadron()); }