public MissionDetailsPageViewModel(INavigationService navigationService, IModalNavigationService modalNavigationService, IPageDialogService dialogService, IAppService appService)
            : base(navigationService, modalNavigationService, dialogService, appService)
        {
            Mission = new MissionDTO();
            Title   = "Mission";

            // Reload the page if the mission was edited
            MessagingCenter.Subscribe <NewMissionPageViewModel, MissionDTO>(this, MessagingCenterMessages.NewMission, async(sender, mission) =>
            {
                try
                {
                    IsBusy = true;
                    if (Mission?.Id == mission.Id)
                    {
                        await ReloadPage(mission.Id);
                    }
                }
                catch (Exception ex)
                {
                    base.DisplayExceptionMessage(ex);
                }
                finally
                {
                    IsBusy = false;
                }
            });
        }
예제 #2
0
 public ViewModelBase(
     INavigationService navigationService,
     IModalNavigationService modalNavigationService,
     IPageDialogService dialogService,
     IAppService appService)
 {
     NavigationService      = navigationService;
     ModalNavigationService = modalNavigationService;
     DialogService          = dialogService;
     AppService             = appService;
 }
        public NewMissionPageViewModel(INavigationService navigationService, IModalNavigationService modalNavigationService, IPageDialogService dialogService, IAppService appService)
            : base(navigationService, modalNavigationService, dialogService, appService)
        {
            try
            {
                IsBusy = true;

                MaxX  = Preferences.Get(Settings.GridMaxX, 0);
                MaxY  = Preferences.Get(Settings.GridMaxY, 0);
                Model = new MissionRequestDTO {
                    MaxX = MaxX, MaxY = MaxY
                };
            }
            catch (Exception ex)
            {
                base.DisplayExceptionMessage(ex);
            }
            finally
            {
                IsBusy = false;
            }
        }
예제 #4
0
        public MissionsPageViewModel(INavigationService navigationService, IModalNavigationService modalNavigationService, IPageDialogService dialogService, IAppService appService)
            : base(navigationService, modalNavigationService, dialogService, appService)
        {
            Missions = new ObservableCollection <MissionDTO>();

            // Reload the list if a new mission was created
            MessagingCenter.Subscribe <NewMissionPageViewModel, MissionDTO>(this, MessagingCenterMessages.NewMission, async(sender, mission) =>
            {
                try
                {
                    IsBusy = true;
                    await ReloadPage();
                }
                catch (Exception ex)
                {
                    base.DisplayExceptionMessage(ex);
                }
                finally
                {
                    IsBusy = false;
                }
            });
        }
예제 #5
0
 public MainMasterDetailPageViewModel(INavigationService navigationService, IModalNavigationService modalNavigationService, IPageDialogService dialogService, IAppService appService)
     : base(navigationService, modalNavigationService, dialogService, appService)
 {
 }
 public SettingsPageViewModel(INavigationService navigationService, IModalNavigationService modalNavigationService, IPageDialogService dialogService, IAppService appService)
     : base(navigationService, modalNavigationService, dialogService, appService)
 {
     MaxX = Preferences.Get(Settings.GridMaxX, 0);
     MaxY = Preferences.Get(Settings.GridMaxY, 0);
 }
예제 #7
0
 public LoginPageViewModel(INavigationService navigationService, IModalNavigationService modalNavigationService, IPageDialogService dialogService, IAppService appService)
     : base(navigationService, modalNavigationService, dialogService, appService)
 {
     Username = "******";
     Password = "******";
 }