protected override void OnResume() { // Handle when your app resumes base.OnResume(); DependencyLocator.Resolve <INavigationService>().InitAfterResumeApp(); }
public void SetViewModel <T>(object initialData = null) where T : BasePageViewModel { try { BindingContext = ViewModel = DependencyLocator.Resolve <T>(initialData); } catch (Exception e) { } }
protected override void OnSleep() { base.OnSleep(); BaseSingleton <GlobalSetting> .Instance.SaveState(); MessagingCenter.Unsubscribe <object, INotificationMessage>(this, NotificationService.RESIDENT_VEHICLE_DETAIL_RECEIVED_NOTIFICATION); DependencyLocator.Resolve <INavigationService>().UnsubscribeAfterSleepApp(); }
/// <summary> /// ctor(). /// </summary> public StepBaseViewModel() { _validationObjectFactory = DependencyLocator.Resolve <IValidationObjectFactory>(); ActionBarViewModel = DependencyLocator.Resolve <IdentityAccountingActionBarViewModel>(); ((IdentityAccountingActionBarViewModel)ActionBarViewModel).InitializeAsync(this); _mainInput = _validationObjectFactory.GetValidatableObject <string>(); ResetValidationObjects(); }
/// <summary> /// ctor(); /// </summary> public DriveAutoDetailsViewModel(IPickMediaService pickMediaService, IVisionService visionService, IDriveAutoService driveAutoService) { _visionService = visionService; _pickMediaService = pickMediaService; _driveAutoService = driveAutoService; ActionBarViewModel = DependencyLocator.Resolve <CommonActionBarViewModel>(); IsBackButtonAvailable = NavigationService.IsBackButtonAvailable; }
public NewPostViewModel( IPickMediaService pickMediaService, IValidationObjectFactory validationObjectFactory) { _pickMediaService = pickMediaService; _validationObjectFactory = validationObjectFactory; ResetValidationObjects(); AttachedPostMedias = new ObservableCollection <AttachedAnnounceMediaBase>(); ActionBarViewModel = DependencyLocator.Resolve <NewPostActionBarViewModel>(); }
/// <summary> /// ctor(). /// </summary> public App() { InitializeComponent(); InitApp(); #if DEBUG //TrackMemoryUsage(); #endif MessagingCenter.Subscribe <object, INotificationMessage>(this, NotificationService.RESIDENT_VEHICLE_DETAIL_RECEIVED_NOTIFICATION, (sender, args) => { DependencyLocator.Resolve <INotificationService>().InvokeReceivedResidentVehicleDetailInfo(args); }); }
/// <summary> /// ctor(). /// </summary> public VehicleDetailViewModel() { ActionBarViewModel = DependencyLocator.Resolve <CommonActionBarViewModel>(); IsBackButtonAvailable = NavigationService.IsBackButtonAvailable; }
public BaseViewModel() { navigationService = DependencyLocator.Resolve <INavigationService>(); userDialogService = DependencyLocator.Resolve <IUserDialogService>(); }
public MapPage() { InitializeComponent(); BindingContext = DependencyLocator.Resolve <MapViewModel>(); }
private Task InitNavigation() { var navigationService = DependencyLocator.Resolve <INavigationService>(); return(navigationService.InitializeAsync()); }
private void InitNavigation() { INavigationService navigationService = DependencyLocator.Resolve <INavigationService>(); navigationService.Initialize(); }
public PolandDriveAutoDetailsViewModel() { ActionBarViewModel = DependencyLocator.Resolve <CommonActionBarViewModel>(); ActionBarViewModel.InitializeAsync(this); Year.Spans.Add(BuildHeaderSpan(nameof(AppStrings.YearOfCreation))); Year.Spans.Add(BuildValueSpan()); Vin.Spans.Add(BuildHeaderSpan(nameof(AppStrings.VinUppercase))); Vin.Spans.Add(BuildValueSpan()); VehicleTechnicalInspection.Spans.Add(BuildHeaderSpan(nameof(AppStrings.VehicleTechnicalInspection))); VehicleTechnicalInspection.Spans.Add(BuildValueSpan()); LastOdometrData.Spans.Add(BuildHeaderSpan(nameof(AppStrings.LastRecordedOdometerReading))); LastOdometrData.Spans.Add(BuildValueSpan()); RegistrationStatus.Spans.Add(BuildHeaderSpan(nameof(AppStrings.RegistrationStatus))); RegistrationStatus.Spans.Add(BuildValueSpan()); EngineCapacity.Spans.Add(BuildHeaderSpan(nameof(AppStrings.EngineCapacity))); EngineCapacity.Spans.Add(BuildValueSpan()); EnginePower.Spans.Add(BuildHeaderSpan(nameof(AppStrings.EnginePower))); EnginePower.Spans.Add(BuildValueSpan()); FuelType.Spans.Add(BuildHeaderSpan(nameof(AppStrings.FuelType))); FuelType.Spans.Add(BuildValueSpan()); TotalCapacity.Spans.Add(BuildHeaderSpan(nameof(AppStrings.TotalСapacity))); TotalCapacity.Spans.Add(BuildValueSpan()); NumberOfSeats.Spans.Add(BuildHeaderSpan(nameof(AppStrings.NumberOfSeats))); NumberOfSeats.Spans.Add(BuildValueSpan()); CurbWeight.Spans.Add(BuildHeaderSpan(nameof(AppStrings.CurbWeight))); CurbWeight.Spans.Add(BuildValueSpan()); MaximumLadenMassOfBrakedTrailer.Spans.Add(BuildHeaderSpan(nameof(AppStrings.MaximumLadenMassOfBrakedTrailer))); MaximumLadenMassOfBrakedTrailer.Spans.Add(BuildValueSpan()); MaximumLadenMassOfUnbrakedTrailer.Spans.Add(BuildHeaderSpan(nameof(AppStrings.MaximumLadenMassOfUnbrakedTrailer))); MaximumLadenMassOfUnbrakedTrailer.Spans.Add(BuildValueSpan()); MaximumPermissibleTowableMass.Spans.Add(BuildHeaderSpan(nameof(AppStrings.MaximumPermissibleTowableMass))); MaximumPermissibleTowableMass.Spans.Add(BuildValueSpan()); NumberOfAxles.Spans.Add(BuildHeaderSpan(nameof(AppStrings.NumberOfAxles))); NumberOfAxles.Spans.Add(BuildValueSpan()); DateСurrentVehicleRegistrationCertificateIssued.Spans.Add(BuildHeaderSpan(nameof(AppStrings.DateСurrentVehicleRegistrationCertificateIssued))); DateСurrentVehicleRegistrationCertificateIssued.Spans.Add(BuildValueSpan()); DateVehicleRecordDocumentIssued.Spans.Add(BuildHeaderSpan(nameof(AppStrings.DateVehicleRecordDocumentIssued))); DateVehicleRecordDocumentIssued.Spans.Add(BuildValueSpan()); CivilLiabilityInsurance.Spans.Add(BuildHeaderSpan(nameof(AppStrings.CivilLiabilityInsurance))); CivilLiabilityInsurance.Spans.Add(BuildValueSpan()); Type.Spans.Add(BuildHeaderSpan(nameof(AppStrings.Type))); Type.Spans.Add(BuildValueSpan()); Number.Spans.Add(BuildHeaderSpan(nameof(AppStrings.Number))); Number.Spans.Add(BuildValueSpan()); }
protected override void OnStartListeningToHub() { _hubConnection.On <object>(UPDATE_POST_LIKES_COUNT, async(args) => { try { DrivenEventResponse drivenEventResponse = ParseResponseData <DrivenEventResponse>(args); if (drivenEventResponse.StatusCode == HttpStatusCode.OK) { DrivenEvent drivenEvent = ParseResponseData <DrivenEvent>(drivenEventResponse.Data); PostLikedBody postLikedBody = ParseResponseData <PostLikedBody>(drivenEvent.Data); Device.BeginInvokeOnMainThread(() => PostLikesCountReceived(this, postLikedBody)); } else if (drivenEventResponse.StatusCode == HttpStatusCode.Unauthorized) { await DependencyLocator.Resolve <IIdentityService>().LogOutAsync(); } } catch (Exception ex) { Debugger.Break(); Crashes.TrackError(ex); } }); _hubConnection.On <object>(REMOVE_POST, async(args) => { try { DrivenEventResponse drivenEventResponse = ParseResponseData <DrivenEventResponse>(args); if (drivenEventResponse.StatusCode == HttpStatusCode.OK) { DrivenEvent drivenEvent = ParseResponseData <DrivenEvent>(drivenEventResponse.Data); string postId = ParseResponseData <string>(drivenEvent.Data); Device.BeginInvokeOnMainThread(() => DeletedPostReceived(this, postId)); } else if (drivenEventResponse.StatusCode == HttpStatusCode.Unauthorized) { await DependencyLocator.Resolve <IIdentityService>().LogOutAsync(); } } catch (Exception ex) { Debugger.Break(); Crashes.TrackError(ex); } }); _hubConnection.On <object>(NEW_POST_COMMENT, async(args) => { try { DrivenEventResponse drivenEventResponse = ParseResponseData <DrivenEventResponse>(args); if (drivenEventResponse.StatusCode == HttpStatusCode.OK) { DrivenEvent drivenEvent = ParseResponseData <DrivenEvent>(drivenEventResponse.Data); Comment comment = ParseResponseData <Comment>(drivenEvent.Data); Device.BeginInvokeOnMainThread(() => NewPostCommentReceived(this, comment)); } else if (drivenEventResponse.StatusCode == HttpStatusCode.Unauthorized) { await DependencyLocator.Resolve <IIdentityService>().LogOutAsync(); } } catch (Exception ex) { Debugger.Break(); Crashes.TrackError(ex); } }); _hubConnection.On <object>(UPDATE_POST_COMMENTS_C0UNT, async(args) => { try { DrivenEventResponse drivenEventResponse = ParseResponseData <DrivenEventResponse>(args); if (drivenEventResponse.StatusCode == HttpStatusCode.OK) { DrivenEvent drivenEvent = ParseResponseData <DrivenEvent>(drivenEventResponse.Data); CommentCountBody commentCountBody = ParseResponseData <CommentCountBody>(drivenEvent.Data); Device.BeginInvokeOnMainThread(() => PostCommentsCountReceived(this, commentCountBody)); } else if (drivenEventResponse.StatusCode == HttpStatusCode.Unauthorized) { await DependencyLocator.Resolve <IIdentityService>().LogOutAsync(); } } catch (Exception ex) { Debugger.Break(); Crashes.TrackError(ex); } }); _hubConnection.On <object>(NEW_ANNOUNCE, async(args) => { try { Console.WriteLine("===> AnnouncementHubService.NewPostHubEndpoint <==="); DrivenEventResponse drivenEventResponse = ParseResponseData <DrivenEventResponse>(args); if (drivenEventResponse.StatusCode == HttpStatusCode.OK) { DrivenEvent drivenEvent = ParseResponseData <DrivenEvent>(drivenEventResponse.Data); Announce announce = ParseResponseData <Announce>(drivenEvent.Data); if (announce != null && announce.AnnounceBody != null && announce.ImageUrl != null) { Device.BeginInvokeOnMainThread(() => NewAnnounceReceived(this, announce)); } else { announce = new Announce(); AnnounceBody announceBody = ParseResponseData <AnnounceBody>(drivenEvent.Data); announce.AnnounceBody = announceBody; Device.BeginInvokeOnMainThread(() => NewAnnounceReceived(this, announce)); } } else if (drivenEventResponse.StatusCode == HttpStatusCode.Unauthorized) { await DependencyLocator.Resolve <IIdentityService>().LogOutAsync(); } } catch (Exception exc) { Debugger.Break(); Crashes.TrackError(exc); } }); }
private async void InitializeNavigation() { var navigation = DependencyLocator.Resolve <INavigationService>(); await navigation.InitializeAsync(); }
protected override void OnBindingContextChanged() { base.OnBindingContextChanged(); _sideMenuView.BindingContext = DependencyLocator.Resolve <SideMenuViewModel>(); }
protected override void OnSleep() { DependencyLocator.Resolve <INavigationService>().UnsubscribeAfterSleepApp(); }
protected override void OnResume() { DependencyLocator.Resolve <INavigationService>().InitAfterResumeApp(); }