public SettingsViewModel(IMvxNavigationService navigationService, IMvxLogProvider mvxLogProvider) : base(Resources.AppResources.SettingsPageTitle, mvxLogProvider, navigationService) { SettingClickedCommand = new MvxCommand <SettingModel>( (param) => NavigationTask = MvxNotifyTask.Create(NavigateToSettingAsync(param), onException: ex => LogException(ex)) ); }
public override Task Initialize() { LoadSuggestionsTask = MvxNotifyTask.Create(LoadSuggestions); LoadNewsTaks = MvxNotifyTask.Create(LoadNews); return(Task.FromResult(0)); }
public NewTripOverviewBasicViewModel(IMvxNavigationService navigationService, IMvxLogProvider mvxLogProvider, IUserDialogs userDialog, ILocalizeService localizeService) : base(Resources.AppResources.NewTripOverviewPageTitle, mvxLogProvider, navigationService, userDialog, localizeService) { CheckInToSpotCommand = new MvxCommand( () => NavigationTask = MvxNotifyTask.Create(CheckInToNewSpotAsync(), onException: ex => LogException(ex)) ); }
public SportsListViewModel(ISportDomainManager sportDomainManager, IMvxNavigationService navigationService) { _sportDomainManager = sportDomainManager; _navigationService = navigationService; GetSportsCommand = new MvxCommand(() => Sports = MvxNotifyTask.Create(() => OnGetSportsCommand(), onException: ex => OnException(ex))); }
private void RefreshPlanets() { _nextPage = null; LoadPlanetsTask = MvxNotifyTask.Create(LoadPlanets); RaisePropertyChanged(() => LoadPlanetsTask); }
private void AllPokemmon() { _IsVisibleAllPokemon = true; SetTitleAll(); LoadPokemonTask = MvxNotifyTask.Create(LoadPokemon); RaisePropertyChanged(() => LoadPokemonTask); }
public override void ViewAppeared() { MvxNotifyTask.Create(async() => { await ShowInitialViewModel(); await ShowDetailViewModel(); }); }
public BaseViewModel(string title, IMvxLogProvider mvxLogProvider, IMvxNavigationService navigationService, IUserDialogs userDialog, ILocalizeService localizeService) { NavigationService = navigationService; MvxLogProvider = mvxLogProvider; Log = mvxLogProvider.GetLogFor(GetType()); UserDialog = userDialog; LocalizeService = localizeService; Title = title; SaveCommand = new MvxCommand( () => SaveTask = MvxNotifyTask.Create(SaveAsync(), onException: ex => LogException(ex)) ); DeleteCommand = new MvxCommand( () => DeleteTask = MvxNotifyTask.Create(DeleteAsync, onException: ex => LogException(ex)) ); AddCommand = new MvxCommand( () => AddTask = MvxNotifyTask.Create(AddAsync(), onException: ex => LogException(ex)) ); }
private void RefreshPeople() { _nextPage = null; LoadPeopleTask = MvxNotifyTask.Create(LoadPeople); RaisePropertyChanged(() => LoadPeopleTask); }
public MainMenuViewModel(IMvxNavigationService navigationService, IMvxLogProvider mvxLogProvider) : base(Resources.AppResources.ApplicationName, mvxLogProvider, navigationService) { SettingTappedCommand = new MvxCommand <string>( (param) => NavigationTask = MvxNotifyTask.Create(NavigateAsync(param), onException: ex => LogException(ex)) ); }
public override void ViewAppeared() { MvxNotifyTask.Create(async() => { await NavigationService.Navigate <MenuViewModel>(); await NavigationService.Navigate <DashboardViewModel>(); }); }
public override void ViewAppeared() { base.ViewAppeared(); if (!_tabsLoaded) { MvxNotifyTask.Create(async() => await InitializeViewModels()); } }
public StartNewTripViewModel(IMvxNavigationService navigationService, IMvxLogProvider mvxLogProvider, IUserDialogs userDialog, ILocalizeService localizeService) : base(Resources.AppResources.NewTripPageTitle, mvxLogProvider, navigationService, userDialog, localizeService) { FishingAreaSelectedCommand = new MvxCommand( () => NavigationTask = MvxNotifyTask.Create(NavigateToFishingAreasSelectionAsync(), onException: ex => LogException(ex)) ); PreSetData(); }
protected override void InitFromBundle(IMvxBundle parameters) { Newsfeed s = parameters.Read <Newsfeed>(); if (!(s.UrlToNewsfeed is null)) { MvxNotifyTask.Create(LoadPage(s)); } }
public NewFishedSpotBasicViewModel(IMvxNavigationService navigationService, IMvxLogProvider mvxLogProvider, IUserDialogs userDialog, ILocalizeService localizeService) : base(Resources.AppResources.NewFishedSpotBasicPageTitle, mvxLogProvider, navigationService, userDialog, localizeService) { BiteCommand = new MvxCommand( () => NavigationTask = MvxNotifyTask.Create(NavigateToBite(), onException: ex => LogException(ex))); CatchCommand = new MvxCommand( () => NavigationTask = MvxNotifyTask.Create(NavigateToCatch(), onException: ex => LogException(ex))); }
public CustomerProfileViewModel(IMvxNavigationService navigationService , IProfileService profileService) { _profileService = profileService; _navigationService = navigationService; _profileService.UserUpdated += (sender, args) => { LoadProfileTask = MvxNotifyTask.Create(LoadProfile); }; }
public override void ViewAppearing() { base.ViewAppearing(); MvxNotifyTask.Create(async() => { await navigationService.Navigate <MasterViewModel>(); await navigationService.Navigate <MainViewModel>(); }); }
public override void ViewAppeared() { if (!_alreadyLoaded) { MvxNotifyTask.Create(async() => { await ShowMenuViewModel(); await ShowOperationRootTabbedViewModel(); }); } }
public override void ViewAppeared() { if (GenreSource == null) { MvxNotifyTask.Create(LoadMovieGenre()); } else { MvxNotifyTask.Create(LoadPageData()); } base.ViewAppeared(); }
public override void ViewAppearing() { base.ViewAppearing(); MyTask = MvxNotifyTask.Create( async() => { await Task.Delay(300); throw new Exception("Boom!"); }, exception => { }); }
/// <summary> /// View appearing /// </summary> public override void ViewAppeared() { if (viewAppeared) { return; } MvxNotifyTask.Create(async() => { this.viewAppeared = true; await NavigationService.Navigate <MenuViewModel>(); await NavigationService.Navigate <HomeViewModel>(); }); }
public FishingAreasViewModel(IMvxNavigationService navigationService, IMvxLogProvider mvxLogProvider) : base(Resources.AppResources.FishingAreasPageTitle, mvxLogProvider, navigationService) { FishingAreaSelectedCommand = new MvxCommand <FishingAreaModel>( (param) => NavigationTask = MvxNotifyTask.Create(NavigateToFishingAreaAsync(param), onException: ex => LogException(ex)) ); SearchFishingAreasCommand = new MvxCommand <string>((param) => { SearchString = param; RaisePropertyChanged(nameof(FishingAreas)); } ); }
public SpotViewModel(IMvxNavigationService navigationService, IMvxLogProvider mvxLogProvider, IUserDialogs userDialog, ILocalizeService localizeService) : base(Resources.AppResources.SpotPageTitle, mvxLogProvider, navigationService, userDialog, localizeService) { MapClickedCommand = new MvxCommand <Position?>(ExecuteMapClicked); RefreshSpotCommand = new MvxCommand( () => RefreshSpotTask = MvxNotifyTask.Create(() => RefreshSpotAsync(), onException: ex => LogException(ex)) ); SpotTypeChangedCommand = new MvxCommand( () => RefreshSpotTypeTask = MvxNotifyTask.Create(() => RefreshSpotTypeAsync(), onException: ex => LogException(ex)) ); }
public InitViewModel(IFileService fileService, IDataPackManager dataPackManager, IMvxNavigationService navigationService) { _fileService = fileService; _dataPackManager = dataPackManager; InitializePackTask = MvxNotifyTask.Create(Task.FromException(new Exception())); PickDataPackCommand = new MvxAsyncCommand(PickFileAndInitPackAsync, () => _canExecuteInit); NavigateToMainViewModelCommand = new MvxAsyncCommand(async() => { await navigationService.Close(this); await navigationService.Navigate <MainViewModel>(); }); _message = "Select a data pack file"; }
public SpotsViewModel(IMvxNavigationService navigationService, IMvxLogProvider mvxLogProvider) : base(Resources.AppResources.SpotsPageTitle, mvxLogProvider, navigationService) { SpotSelectedCommand = new MvxCommand <SpotModel>( (param) => NavigationTask = MvxNotifyTask.Create(NavigateToSpot(param), onException: ex => LogException(ex)) ); SearchSpotsCommand = new MvxCommand <string>((param) => { SearchString = param; RaisePropertyChanged(nameof(Spots)); } ); }
public DashboardViewModel(IMvxNavigationService navigationService) { _navigationService = navigationService; DashboardItems = new MvxObservableCollection <IDashboardItem>(); //DashboardItemSelectedCommand = new MvxAsyncCommand<IDashboardItem>(DashboardItemSelected); FetchItemsCommand = new MvxCommand( () => { FetchItemsTask = MvxNotifyTask.Create(LoadItems); RaisePropertyChanged(() => FetchItemsTask); }); RefreshItemsCommand = new MvxCommand(RefreshItems); }
public static MvxNotifyTask Create(Func <Task> task) { return(MvxNotifyTask.Create( async() => { try { await task.Invoke(); } catch (Exception ex) { Console.WriteLine(ex.Message); } })); }
public EventDetailsInternalChatViewModel(IMvxLogProvider logProvider, IMvxNavigationService navigationService, IMediaService mvxPictureChooserTask, IHttpService networkService) : base(logProvider, navigationService) { _pictureChooserTask = mvxPictureChooserTask; _networkService = networkService; LoadPreviousMessage = new MvxCommand(() => { LoadPreviousMessageTask = MvxNotifyTask.Create(LoadPreviousChatMessages()); RaisePropertyChanged(() => LoadPreviousMessageTask); }); LoadNewMessage = new MvxAsyncCommand(async() => { LoadNewMessageTask = MvxNotifyTask.Create(LoadLatestChatMessages()); await RaisePropertyChanged(() => LoadPreviousMessageTask); }); }
public NewFishedSpotWeatherViewModel(IMvxNavigationService navigationService, IMvxLogProvider mvxLogProvider, IUserDialogs userDialog, ILocalizeService localizeService) : base(Resources.AppResources.NewFishedSpotWeatherPageTitle, mvxLogProvider, navigationService, userDialog, localizeService) { OverwriteChangedCommand = new MvxCommand( () => NavigationTask = MvxNotifyTask.Create(ConfirmRemoveWeatherFromBackgroundQueue(), onException: ex => LogException(ex)) ); MessagingCenter.Subscribe <ElementFinishedMessage>(this, MessageHelper.ELEMENT_FINISHED_MESSAGE, message => { if (message.BackgroundTask.ID_TaskType != (int)EnumHelper.TaskTypeEnum.WheaterTask || message.BackgroundTask.ID_ElementReference != FishedSpot.Id) { return; } SetWheaterDataFields(new JSONHelper <WeatherTaskResponseModel>().Deserialize(message.BackgroundTask.TaskResponse)); }); }
public AllPostsViewModel( IBlogService blogService, IMvxNavigationService navigationService) { _blogService = blogService; _navigationService = navigationService; AllPosts = new MvxObservableCollection <GetAllPostsBlogViewItem>(); AddPostCommand = new MvxAsyncCommand(AddPost); PostSelectedCommand = new MvxAsyncCommand <GetAllPostsBlogViewItem>(PostSelected); FetchPostCommand = new MvxCommand( () => { FetchPostsTask = MvxNotifyTask.Create(LoadPosts); RaisePropertyChanged(() => FetchPostsTask); }); RefreshPostsCommand = new MvxCommand(RefreshPosts); }