Beispiel #1
0
        public AppViewModel(INavigationService navigateService, GithubApiService ghservice, INotificationController notController, ICacheManager cache)
        {
            NavigationService = navigateService;
            GHService = ghservice;
            NotificationController = notController;

            //Autologin can be implemented here
            NavigationService.Navigate(AppPages.LoginPage);
        }
Beispiel #2
0
        public void GetUser(IObservable <User> user)
        {
            var request = new RestRequest("user", Method.GET);

            restClient.ExecuteAsync <User>(request, (response) =>
            {
                user = Observable.Return <User>(response.Data);

                GithubApiService.GetOrgs(response.Data);
            });
        }
Beispiel #3
0
        public LoginViewModel(INavigationService navigateService, GithubApiService ghservice, INotificationController notController, ICacheManager cache)
        {
            IsLogin = false;
            NavigationService = navigateService;
            GHService = ghservice;
            NotificationController = notController;
            _cache = cache;

            _loginCommand = new DelegateCommand(() =>
            {

                NotificationController.SplashScreen.IsVisible = true;
                cache.Add("username", User);
                cache.Add("password", Password);
                GHService.UseCredentials(User, Password);
                NavigationService.Navigate(AppPages.MainPage);
            });
        }
Beispiel #4
0
        public MainViewModel(INavigationService navigationService, GithubApiService ghSvc, INotificationController notController, OctocatsService octocatSvc, ICacheManager cache)
        {
            NotificationController = notController;
            GHService = ghSvc;
            OctocatService = octocatSvc;
            _settings = cache;

            this.NewsItems = new ObservableCollection<ItemViewModel>();

            /*            User.Subscribe(user =>
                {
                    user.Organizations.ForEach(org => GHService.GetReposForOrganization(org, RepositItems));
                });

            RepositItems = new ObservableCollection<ItemViewModel>();
            GHService.GetUserRepos(RepositItems);

            IssuesItems = new ObservableCollection<ItemViewModel>();
            GHService.GetIssues(IssuesItems);

            _navigationService = navigationService;*/
        }