Ejemplo n.º 1
0
 private async void ShowGallery(ArticleCategory category)
 {
     PageDataContext.CurrentArticleGallery = category;
     var parameters = new OverviewParameter()
     {
         StartOver = true, Category = category, Paging = -1
     };
     await Task.Factory.StartNew(() => Searcher.ExecuteGaleryScrape(this, context, parameters), source.Token);
 }
 private async void ShowGallery(ArticleCategory category)
 {
     //Core.Track.Telemetry.Instance.Action("Filter", new Dictionary<string, string>() { { "filter", category.ToString() } });
     PageDataContext.CurrentArticleGallery = category;
     var parameters = new OverviewParameter()
     {
         StartOver = true, Category = category, Paging = 0
     };
     await Task.Factory.StartNew(() => Searcher.ExecuteGaleryScrape(this, context, parameters), source.Token);
 }
Ejemplo n.º 3
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            OverviewParameter parameter = (OverviewParameter)e.Parameter;

            string categoryName = parameter.CategoryKey.IsEmpty
                ? "All"
                : await queryDispatcher.QueryAsync(new GetCategoryName(parameter.CategoryKey));

            categoryKey = parameter.CategoryKey;
            object period = null;

            if (parameter.Month != null)
            {
                month  = parameter.Month;
                period = parameter.Month;
            }

            if (parameter.Year != null)
            {
                year   = parameter.Year;
                period = parameter.Year;
            }

            ViewModel         = new OverviewViewModel(navigator, parameter.CategoryKey, categoryName, period);
            ViewModel.Reload += OnViewModelReload;

            handlers.Add(eventHandlers.AddUiThread <OutcomeCreated>(ViewModel, Dispatcher));
            handlers.Add(eventHandlers.AddUiThread <OutcomeAmountChanged>(ViewModel, Dispatcher));
            handlers.Add(eventHandlers.AddUiThread <OutcomeDescriptionChanged>(ViewModel, Dispatcher));
            handlers.Add(eventHandlers.AddUiThread <OutcomeWhenChanged>(ViewModel, Dispatcher));

            if (userPreferences.TryLoad("Overview.SortDescriptor", out SortDescriptor <OverviewSortType> sortDescriptor))
            {
                SortDescriptor = sortDescriptor;
            }
            else
            {
                SortDescriptor = new SortDescriptor <OverviewSortType>(OverviewSortType.ByDate, SortDirection.Ascending);
            }

            await ReloadAsync();

            ContentLoaded?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 4
0
        private void OpenOverview(IKey categoryKey)
        {
            OverviewParameter parameter = null;

            MonthModel month = SelectedItem as MonthModel;

            if (month != null)
            {
                parameter = new OverviewParameter(categoryKey, month);
            }

            YearModel year = SelectedItem as YearModel;

            if (year != null)
            {
                parameter = new OverviewParameter(categoryKey, year);
            }

            navigator
            .Open(parameter)
            .Show();
        }
Ejemplo n.º 5
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            OverviewParameter parameter = (OverviewParameter)e.Parameter;

            string categoryName = parameter.CategoryKey.IsEmpty
                ? "All"
                : await queryDispatcher.QueryAsync(new GetCategoryName(parameter.CategoryKey));

            object period = null;
            IEnumerable <OutcomeOverviewModel> models = null;

            if (parameter.Month != null)
            {
                month  = parameter.Month;
                period = parameter.Month;
                models = await queryDispatcher.QueryAsync(new ListMonthOutcomeFromCategory(parameter.CategoryKey, parameter.Month));
            }

            if (parameter.Year != null)
            {
                year   = parameter.Year;
                period = parameter.Year;
                models = await queryDispatcher.QueryAsync(new ListYearOutcomeFromCategory(parameter.CategoryKey, parameter.Year));
            }

            ViewModel = new OverviewViewModel(navigator, parameter.CategoryKey, categoryName, period);
            if (models != null)
            {
                foreach (OutcomeOverviewModel model in models)
                {
                    ViewModel.Items.Add(new OutcomeOverviewViewModel(model));
                }
            }
        }
Ejemplo n.º 6
0
 private async void ShowGallery(ArticleCategory category)
 {
     PageDataContext.CurrentArticleGallery = category;
     var parameters = new OverviewParameter() { StartOver = true, Category = category, Paging = -1 };
     await Task.Factory.StartNew(() => Searcher.ExecuteGaleryScrape(this, context, parameters), source.Token);
 }