Ejemplo n.º 1
0
        public MainViewModel(int visibleItems) : base()
        {
            PageTitle                 = "Windows 10 News";
            WhatsGoingOn              = ListViewModel.CreateNew(Singleton <WhatsGoingOnConfig> .Instance, visibleItems);
            RecentNews                = ListViewModel.CreateNew(Singleton <RecentNewsConfig> .Instance, visibleItems);
            Apps                      = ListViewModel.CreateNew(Singleton <AppsConfig> .Instance, visibleItems);
            Business                  = ListViewModel.CreateNew(Singleton <BusinessConfig> .Instance, visibleItems);
            InsiderProgram            = ListViewModel.CreateNew(Singleton <InsiderProgramConfig> .Instance, visibleItems);
            Devs                      = ListViewModel.CreateNew(Singleton <DevsConfig> .Instance, visibleItems);
            WhatArePeopleTalkingAbout = ListViewModel.CreateNew(Singleton <WhatArePeopleTalkingAboutConfig> .Instance, visibleItems);
            DoMore                    = ListViewModel.CreateNew(Singleton <DoMoreConfig> .Instance, visibleItems);

            Actions = new List <ActionInfo>();

            if (GetViewModels().Any(vm => !vm.HasLocalData))
            {
                Actions.Add(new ActionInfo
                {
                    Command    = new RelayCommand(Refresh),
                    Style      = ActionKnownStyles.Refresh,
                    Name       = "RefreshButton",
                    ActionType = ActionType.Primary
                });
            }
            Actions.Add(new ActionInfo
            {
                Command    = new RelayCommand(() => NavigationService.NavigateTo(new Uri("http://appstudio.windows.com/home/appprivacyterms", UriKind.Absolute))),
                Style      = ActionKnownStyles.Link,
                Name       = "PrivacyButton",
                ActionType = ActionType.Secondary
            });
        }
Ejemplo n.º 2
0
 public SearchViewModel() : base()
 {
     PageTitle                 = "Windows 10 News";
     WhatsGoingOn              = ListViewModel.CreateNew(Singleton <WhatsGoingOnConfig> .Instance);
     RecentNews                = ListViewModel.CreateNew(Singleton <RecentNewsConfig> .Instance);
     Apps                      = ListViewModel.CreateNew(Singleton <AppsConfig> .Instance);
     Business                  = ListViewModel.CreateNew(Singleton <BusinessConfig> .Instance);
     InsiderProgram            = ListViewModel.CreateNew(Singleton <InsiderProgramConfig> .Instance);
     Devs                      = ListViewModel.CreateNew(Singleton <DevsConfig> .Instance);
     WhatArePeopleTalkingAbout = ListViewModel.CreateNew(Singleton <WhatArePeopleTalkingAboutConfig> .Instance);
     DoMore                    = ListViewModel.CreateNew(Singleton <DoMoreConfig> .Instance);
 }