Esempio n. 1
0
        public HomePageViewModel(INavigationService navigationService, ICategoriesDataService categoriesDataService, IDialogService dialogService, IRecipeDataService recipeDataService)
        {
            _navigationService     = navigationService;
            _categoriesDataService = categoriesDataService;
            _dialogService         = dialogService;
            _recipeDataService     = recipeDataService;

            _categories           = new ObservableCollection <Categories>();
            _recipes              = new ObservableCollection <Recipe>();
            isCategoryListVisible = true;
            isRecipeListVisible   = false;

            CategorySelectedCommand = new Command <Categories>(OnCategorySelectedCommand);
            GoToReceipe             = new Command <ObservableCollection <Categories> >(GotoRecipe);
            RecipeSelectedCommand   = new Command <Recipe>(OnRecipeSelectedCommand);
            Logout = new Command(OnLogout);

            MessagingCenter.Subscribe <AddCategoryViewModel>(this, MessageNames.CategoryChangedMessage, OnCategoryChanges);
            MessagingCenter.Subscribe <CategoryDetailViewModel>(this, MessageNames.CategoryChangedMessage, OnCategoryUpdate);
            MessagingCenter.Subscribe <AddNewReceipeViewModel>(this, MessageNames.RecipeAdded, UpdateMessageAboutRecipe);
            MessagingCenter.Subscribe <RecipeDetailViewModel>(this, MessageNames.RecipeDeleted, OnRecipeChange);
            MessagingCenter.Subscribe <RecipeDetailViewModel>(this, MessageNames.RecipeUpdate, OnRecipeChange);
            MessagingCenter.Subscribe <CategoryDetailViewModel>(this, MessageNames.CategoryDeleted, UpdateMessageAboutCategory);
            MessagingCenter.Subscribe <LoginPageViewModel, User>(this, MessageNames.TakeTheUser, OnGetUser);
        }
 public CategoriesViewModel(ICategoriesDataService categoriesDataService,
                            MoneySpentDialogViewModel moneySpentDialogViewModel, INavigationService navigationService)
 {
     _categoriesDataService     = categoriesDataService;
     _moneySpentDialogViewModel = moneySpentDialogViewModel;
     _navigationService         = navigationService;
 }
 public CategoriesSummaryViewModel(
     ICategoriesDataService categoriesDataService,
     IExpendituresDataService expendituresDataService)
 {
     _categoriesDataService   = categoriesDataService;
     _expendituresDataService = expendituresDataService;
     CategorySummaries        = new CategorySummary[0];
 }
Esempio n. 4
0
        public AddCategoryViewModel(INavigationService navigationService, ICategoriesDataService categoriesDataService, IDialogService dialogService)
        {
            _navigationService     = navigationService;
            _categoriesDataService = categoriesDataService;
            _dialogService         = dialogService;

            AddNewCategory      = new Command(OnAddNewCategoryAsync);
            AddCategoryImageURL = new Command(OnAddCategoryImageURL);

            _category = new Categories();
        }
Esempio n. 5
0
 public ExternalSourcePageViewModel(IConnectionService connectionService,
                                    INavigationService navigationService,
                                    IDialogService dialogService,
                                    ISettingsService settingsService,
                                    ICategoriesDataService categoriesDataService,
                                    IAddExtraAmountService addExtraAmountService)
     : base(connectionService, navigationService, dialogService)
 {
     _settingsService       = settingsService;
     _categoriesDataService = categoriesDataService;
     _addExtraAmountService = addExtraAmountService;
 }
Esempio n. 6
0
 public SetExpensePageViewModel(IConnectionService connectionService,
                                INavigationService navigationService,
                                IDialogService dialogService,
                                ICategoriesDataService categoriesDataService,
                                ISettingsService settingsService,
                                IWeeklyLimitService weeklyLimitService)
     : base(connectionService, navigationService, dialogService)
 {
     _categoriesDataService = categoriesDataService;
     _settingsService       = settingsService;
     _weeklyLimitService    = weeklyLimitService;
     ExpenseList            = new ObservableCollection <SetExpenseModel>();
 }
Esempio n. 7
0
 public ProductsController(
     IProductsDataService productsData,
     ICategoriesDataService categoriesData,
     ISellersDataService sellersData,
     IImagesDataService imagesData,
     IReviewsDataService reviewsData,
     IHostingEnvironment appEnvironment)
 {
     this.productsData   = productsData;
     this.categoriesData = categoriesData;
     this.sellersData    = sellersData;
     this.imagesData     = imagesData;
     this.reviewsData    = reviewsData;
     this.appEnvironment = appEnvironment;
 }
Esempio n. 8
0
 public SavingsCategoriesViewModel(IConnectionService connectionService,
                                   INavigationService navigationService,
                                   IDialogService dialogService,
                                   ISettingsService settingsService,
                                   ICategoriesDataService categoriesDataService,
                                   IGraphWeeklyDataService graphWeeklyDataService,
                                   IGraphMonthlyDataService graphMonthlyDataService)
     : base(connectionService, navigationService, dialogService)
 {
     _settingsService         = settingsService;
     _categoriesDataService   = categoriesDataService;
     _graphWeeklyDataService  = graphWeeklyDataService;
     _graphMonthlyDataService = graphMonthlyDataService;
     //WeeklySavings = new ObservableCollection<SavingsWeekly>();
     WeeklySavings  = new ObservableCollection <SavingsCategory>();
     MonthlySavings = new ObservableCollection <SavingsMonthly>();
     SavingsSummary = new SavingsSummary();
 }
        public CategoryDetailViewModel(INavigationService navigationService, ICategoriesDataService categoriesDataService, IRecipeDataService recipeDataService, IDialogService dialogService)
        {
            _navigationService     = navigationService;
            _categoriesDataService = categoriesDataService;
            _recipeDataService     = recipeDataService;
            _dialogService         = dialogService;

            RecipeSelectedCommand = new Command <Recipe>(OnRecipeSelectedCommand);
            DeleteCategory        = new Command(OnDeleteCategory);
            EditCategory          = new Command(OnEditCategory);
            SaveCategory          = new Command(OnSaveCategory);
            AddCategoryImageURL   = new Command(OnAddCategoryImageURL);

            MessagingCenter.Subscribe <RecipeDetailViewModel>(this, MessageNames.RecipeDeleted, UpdateRecipies);
            MessagingCenter.Subscribe <RecipeDetailViewModel>(this, MessageNames.RecipeUpdate, UpdateRecipie);
            MessagingCenter.Subscribe <LoginPageViewModel, User>(this, MessageNames.TakeTheUser, OnReceiveLoggedUser);

            InitialStateOfPage();
        }
Esempio n. 10
0
        public TransactionsController(
            ICategoriesDataService categoriesDataService,
            ILogger <TransactionsController> logger,
            ITransactionsDataService transactionsDataService)
        {
            if (categoriesDataService is null)
            {
                throw new ArgumentNullException(nameof(categoriesDataService));
            }

            if (logger is null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            if (transactionsDataService is null)
            {
                throw new ArgumentNullException(nameof(transactionsDataService));
            }

            _categoriesDataService = categoriesDataService;
            _logger = logger;
            _transactionsDataService = transactionsDataService;
        }
Esempio n. 11
0
 public CategoriesController(ICategoriesDataService categoriesData)
 {
     this.categoriesData = categoriesData;
 }
Esempio n. 12
0
 public CategoriesController(IProductsDataService productsData, ICategoriesDataService categoriesData)
 {
     this.productsData   = productsData;
     this.categoriesData = categoriesData;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="CategoriesController"/> class.
 /// </summary>
 /// <param name="categoriesDataService">Categories data service</param>
 /// <param name="loggerFactory">Logger factory</param>
 public CategoriesController(ICategoriesDataService categoriesDataService, ILoggerFactory loggerFactory)
 {
     _categoriesDataService = categoriesDataService ?? throw new ArgumentNullException(nameof(categoriesDataService));
     _logger = loggerFactory?.CreateLogger(nameof(CategoriesController)) ?? throw new ArgumentNullException(nameof(loggerFactory));
 }