public SavedItemPageViewModel([NotNull] SavedStreamManager savedStreamManager) { if (savedStreamManager == null) { throw new ArgumentNullException("savedStreamManager"); } _savedStreamManager = savedStreamManager; }
public SavedPageViewModel([NotNull] SavedStreamManager savedStreamManager, INavigationService navigationService) { if (savedStreamManager == null) { throw new ArgumentNullException("savedStreamManager"); } if (navigationService == null) { throw new ArgumentNullException("navigationService"); } _savedStreamManager = savedStreamManager; _navigationService = navigationService; }
protected override async Task OnInitializeAsync(IActivatedEventArgs args) { await base.OnInitializeAsync(args); _container.RegisterInstance <ISessionStateService>(SessionStateService); _container.RegisterInstance <INavigationService>(NavigationService); _container.RegisterType <ICredentialService, CredentialService>(new ContainerControlledLifetimeManager()); _container.RegisterType <NetworkManager>(new ContainerControlledLifetimeManager()); _container.RegisterType <TileManager>(new ContainerControlledLifetimeManager()); _container.RegisterInstance(_appSettingsService); _container.RegisterInstance(_telemetryClient); _container.RegisterType <ImageManager>(new ContainerControlledLifetimeManager()); var uri = new Uri("ms-appx:///Assets/ApiAuth.json"); var file = await StorageFile.GetFileFromApplicationUriAsync(uri); var strData = await FileIO.ReadTextAsync(file); var data = JObject.Parse(strData); var appId = data["AppId"].ToString(); var appKey = data["AppKey"].ToString(); _apiClient = new ApiClient(appId, appKey); _container.RegisterInstance(_apiClient); var localStorageManager = new LocalStorageManager(_telemetryClient); localStorageManager.Init(); _container.RegisterInstance(localStorageManager); var savedStreamManager = new SavedStreamManager(localStorageManager); _container.RegisterInstance(savedStreamManager); _tagsManager = _container.Resolve <TagsManager>(); _container.RegisterInstance(_tagsManager); _tagsManager.ProcessQueue(); Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = _appSettingsService.DisplayCulture; var unityServiceLocator = new UnityServiceLocator(_container); ServiceLocator.SetLocatorProvider(() => unityServiceLocator); ViewModelLocationProvider.SetDefaultViewModelFactory(ViewModelFactory); ViewModelLocationProvider.SetDefaultViewTypeToViewModelTypeResolver(ViewModelTypeResolver); }
public ListStreamPageViewModel([NotNull] ApiClient apiClient, [NotNull] INavigationService navigationService, [NotNull] TelemetryClient telemetryClient, [NotNull] TagsManager tagsManager, [NotNull] AppSettingsService settingsService, [NotNull] SavedStreamManager savedStreamManager, [NotNull] LocalStorageManager localStorageManager, [NotNull] NetworkManager networkManager) : base(apiClient, navigationService, telemetryClient, tagsManager, settingsService, savedStreamManager, localStorageManager, networkManager) { }
protected override async Task OnInitializeAsync(IActivatedEventArgs args) { await base.OnInitializeAsync(args); _container.RegisterInstance<ISessionStateService>(SessionStateService); _container.RegisterInstance<INavigationService>(NavigationService); _container.RegisterType<ICredentialService, CredentialService>(new ContainerControlledLifetimeManager()); _container.RegisterType<NetworkManager>(new ContainerControlledLifetimeManager()); _container.RegisterType<TileManager>(new ContainerControlledLifetimeManager()); _container.RegisterInstance(_appSettingsService); _container.RegisterInstance(_telemetryClient); _container.RegisterType<ImageManager>(new ContainerControlledLifetimeManager()); var uri = new Uri("ms-appx:///Assets/ApiAuth.json"); var file = await StorageFile.GetFileFromApplicationUriAsync(uri); var strData = await FileIO.ReadTextAsync(file); var data = JObject.Parse(strData); var appId = data["AppId"].ToString(); var appKey = data["AppKey"].ToString(); _apiClient = new ApiClient(appId, appKey); _container.RegisterInstance(_apiClient); var localStorageManager = new LocalStorageManager(_telemetryClient); localStorageManager.Init(); _container.RegisterInstance(localStorageManager); var savedStreamManager = new SavedStreamManager(localStorageManager); _container.RegisterInstance(savedStreamManager); _tagsManager = _container.Resolve<TagsManager>(); _container.RegisterInstance(_tagsManager); _tagsManager.ProcessQueue(); Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = _appSettingsService.DisplayCulture; var unityServiceLocator = new UnityServiceLocator(_container); ServiceLocator.SetLocatorProvider(() => unityServiceLocator); ViewModelLocationProvider.SetDefaultViewModelFactory(ViewModelFactory); ViewModelLocationProvider.SetDefaultViewTypeToViewModelTypeResolver(ViewModelTypeResolver); }