/// <summary> /// Initializes a new instance of the <see cref="LoginViewModel" /> class. /// </summary> /// <param name="mainFrameNavigationService">The main frame navigation service.</param> /// <param name="userProfilesAccess">The user profiles access.</param> /// <param name="currentUserModule">The current user module.</param> /// <param name="loadingIndicatiorModule">The loading indicatior module.</param> public LoginViewModel(IMainFrameNavigationService mainFrameNavigationService, IUserProfilesAccess userProfilesAccess, ICurrentUserModule currentUserModule, ILoadingIndicatiorModule loadingIndicatiorModule) { _mainFrameNavigationService = mainFrameNavigationService; _currentUserModule = currentUserModule; LoadingModule = loadingIndicatiorModule; }
/// <summary> /// Initializes a new instance of the <see cref="HomeViewModel" /> class. /// </summary> /// <param name="mainFrameNavigationService">The main frame navigation service.</param> /// <param name="pageBaseViewModel">The page base view model.</param> /// <param name="ingredientsAccess">The recipe components access.</param> /// <param name="loadingIndicatiorModule">The loading indicatior module.</param> /// <param name="recipesAccess">The recipes access.</param> public AddEditRecipeViewModel(IMainFrameNavigationService mainFrameNavigationService, IPageBaseViewModel pageBaseViewModel, IIngredientsAccess ingredientsAccess, ILoadingIndicatiorModule loadingIndicatiorModule, IRecipesAccess recipesAccess) { _mainFrameNavigation = mainFrameNavigationService; _ingredientsAccess = ingredientsAccess; _loadingIndicatiorModule = loadingIndicatiorModule; _recipesAccess = recipesAccess; PageBaseModel = pageBaseViewModel; MealTypesCollection = new ObservableCollection <MealTypes>(); foreach (MealTypes value in Enum.GetValues(typeof(MealTypes))) { MealTypesCollection.Add(value); } UnitTypesCollection = new ObservableCollection <UnitTypes>(); foreach (UnitTypes value in Enum.GetValues(typeof(UnitTypes))) { UnitTypesCollection.Add(value); } SelectedRecipe = new Recipe(); DispatcherHelper.RunAsync(async() => { _loadingIndicatiorModule.ShowLoadingIndicatior(); var components = await _ingredientsAccess.GetIngredientsList(x => true, x => x.Name); AllIngredients = new ObservableCollection <IIngredient>(components); FilteredIngredients = new ObservableCollection <IIngredient>(AllIngredients.Where(x => true)); _loadingIndicatiorModule.HideLoadingIndicator(); }); }
/// <summary> /// Initializes a new instance of the <see cref="PageBaseViewModel" /> class. /// </summary> /// <param name="mainFrameNavigationService">The main frame navigation service.</param> /// <param name="userModule">The user module.</param> /// <param name="loadingIndicatiorModule">The loading indicatior module.</param> public PageBaseViewModel(IMainFrameNavigationService mainFrameNavigationService, ICurrentUserModule userModule, ILoadingIndicatiorModule loadingIndicatiorModule) { MainFrameNavigation = mainFrameNavigationService; UserModule = userModule; LoadingModule = loadingIndicatiorModule; }
/// <summary> /// Initializes a new instance of the <see cref="RegisterUserViewModel" /> class. /// </summary> /// <param name="frameNavigation">The frame navigation.</param> /// <param name="userProfilesAccess">The user profiles access.</param> /// <param name="passwordProcessingService">The password processing service.</param> /// <param name="loadingIndicatiorModule">The loading indicatior module.</param> public RegisterUserViewModel(IMainFrameNavigationService frameNavigation, IUserProfilesAccess userProfilesAccess, IPasswordProcessingService passwordProcessingService, ILoadingIndicatiorModule loadingIndicatiorModule) { _frameNavigation = frameNavigation; ErrorStatus = new RehabilitationErrorStatus(); _userProfilesAccess = userProfilesAccess; _passwordProcessingService = passwordProcessingService; LoadingModule = loadingIndicatiorModule; }
/// <summary> /// Initializes a new instance of the <see cref="HomeViewModel"/> class. /// </summary> /// <param name="mainFrameNavigationService">The main frame navigation service.</param> /// <param name="pageBaseViewModel">The page base view model.</param> /// <param name="recipesAccess">The recipes access.</param> public RecipesViewModel(IMainFrameNavigationService mainFrameNavigationService, IPageBaseViewModel pageBaseViewModel, IRecipesAccess recipesAccess) { _mainFrameNavigation = mainFrameNavigationService; _recipesAccess = recipesAccess; PageBaseModel = pageBaseViewModel; DispatcherHelper.RunAsync(async() => { var recipes = await _recipesAccess.GetRecipesList(null, x => x.Name); RecipesCollection = new ObservableCollection <IRecipe>(recipes); FilteredRecipesCollection = new ObservableCollection <IRecipe>(RecipesCollection.Where(x => true)); }); //FilteredRecipesCollection.CollectionChanged += (sender, args) => //{ // RaisePropertyChanged(() => NoData); //}; }
/// <summary> /// Initializes a new instance of the <see cref="HomeViewModel" /> class. /// </summary> /// <param name="mainFrameNavigationService">The main frame navigation service.</param> /// <param name="pageBaseViewModel">The page base view model.</param> public CalendarViewModel(IMainFrameNavigationService mainFrameNavigationService, IPageBaseViewModel pageBaseViewModel) { _mainFrameNavigation = mainFrameNavigationService; PageBaseModel = pageBaseViewModel; }
/// <summary> /// Initializes a new instance of the <see cref="CurrentUserModule" /> class. /// </summary> /// <param name="passwordProcessingService">The password processing service.</param> /// <param name="userProfilesAccess">The user profiles access.</param> /// <param name="mainFrameNavigationService">The main frame navigation service.</param> public CurrentUserModule(IPasswordProcessingService passwordProcessingService, IUserProfilesAccess userProfilesAccess, IMainFrameNavigationService mainFrameNavigationService) { _passwordProcessingService = passwordProcessingService; _userProfilesAccess = userProfilesAccess; _mainFrameNavigationService = mainFrameNavigationService; }
/// <summary> /// Initializes a new instance of the <see cref="HomeViewModel" /> class. /// </summary> /// <param name="mainFrameNavigationService">The main frame navigation service.</param> /// <param name="pageBaseViewModel">The page base view model.</param> public StatisticsViewModel(IMainFrameNavigationService mainFrameNavigationService, IPageBaseViewModel pageBaseViewModel) { _mainFrameNavigation = mainFrameNavigationService; PageBaseModel = pageBaseViewModel; }
/// <summary> /// Initializes a new instance of the MainViewModel class. /// </summary> public MainViewModel(IMainFrameNavigationService navigationService) { //navigationService.NavigateTo(PageType.Login); navigationService.NavigateTo(PageType.AddEditRecipe); }