Пример #1
0
        public BaseViewModel(BaseViewModel parentViewModel, ApplicationNavigationService navigationService, BaseRestService restService)
        {
            ParentViewModel = parentViewModel;
            ApplicationNavigationService = navigationService;
            RestService = restService;
            if (IsInDesignMode)
            {
                LoadSampleData();
            }
            else
            {
                if (RestService.IsAuthenticated)
                {
                    Refresh();
                }
            }

            Messenger.Default.Register<AuthenticationMessage>(RestService, (msg) =>
            {
                if (msg.LoggedIn)
                {
                    Refresh();
                }
            });
        }
 public RepositoryViewModel(ApplicationNavigationService navigationService, BaseRestService restService)
     : base(navigationService, restService)
 {
     // TODO: there has got to be a simpler way to do this!
     Messenger.Default.Register<PropertyChangedMessage<Repository>>(this, action =>
     {
         RaisePropertyChanged("ForkedFrom");
     });
 }
 public AuthenticationViewModel(ApplicationNavigationService navigationService, BaseRestService restService)
     : base(navigationService, restService)
 {
     Messenger.Default.Register<AuthenticationMessage>(RestService, (msg) => {
         if (msg.LoggedIn)
         {
             RaisePropertyChanged("IsLoggedIn", false, msg.LoggedIn, true);
         }
     });
 }
        public BasePivotViewModel(ApplicationNavigationService navigationService, BaseRestService restService)
            : base(navigationService, restService)
        {
            // when the user changes from one pivot item to another one, we take note of the new viewmodel
            // so we can invoke commands on it (e.g. refresh)
            PivotChangedCommand = new RelayCommand<SelectionChangedEventArgs>(action =>
            {
                if (action != null)
                {
                    PivotItem pivotItem = action.AddedItems[0] as PivotItem;
                    if (pivotItem != null)
                    {
                        CurrentViewModel = pivotItem.DataContext as BaseViewModel;
                    }
                }
            });

            RefreshCommand = new RelayCommand(() =>
            {
                RefreshCurrentViewModel();
            });
        }
Пример #5
0
 public WelcomeViewModel(ApplicationNavigationService navigationService, BaseRestService restService)
     : base(navigationService, restService)
 {
 }
 public FollowingUsersViewModel(ApplicationNavigationService navigationService, BaseRestService restService)
     : base(navigationService, restService)
 {
 }
 public RepositoriesViewModel(ApplicationNavigationService navigationService, BaseRestService restService)
     : base(navigationService, restService)
 {
 }
Пример #8
0
 public CommitsViewModel(RepositoryViewModel repositoryViewModel, ApplicationNavigationService navigationService, BaseRestService restService)
     : base(repositoryViewModel, navigationService, restService)
 {
 }
Пример #9
0
 public BaseViewModel(ApplicationNavigationService navigationService, BaseRestService restService)
     : this(null, navigationService, restService)
 {
 }