public PublicGistsViewModel(IApplicationService applicationService) { Title = "Public Gists"; LoadCommand = ReactiveCommand.CreateAsyncTask(t => GistsCollection.SimpleCollectionLoad(applicationService.Client.Gists.GetPublicGists(), t as bool?)); LoadCommand.ExecuteIfCan(); }
public UserGistsViewModel(IApplicationService applicationService) { _applicationService = applicationService; Username = _applicationService.Account.Username; GoToCreateGistCommand = ReactiveCommand.Create(); GoToCreateGistCommand.Subscribe(_ => { var vm = CreateViewModel <GistCreateViewModel>(); ShowViewModel(vm); }); this.WhenAnyValue(x => x.Username).Subscribe(x => { if (IsMine) { Title = "My Gists"; } else if (x == null) { Title = "Gists"; } else if (x.EndsWith("s", StringComparison.OrdinalIgnoreCase)) { Title = x + "' Gists"; } else { Title = x + "'s Gists"; } }); LoadCommand = ReactiveCommand.CreateAsyncTask(t => GistsCollection.SimpleCollectionLoad(applicationService.Client.Users[Username].Gists.GetGists(), t as bool?)); }
public UserGistsViewModel(IApplicationService applicationService) { _applicationService = applicationService; Username = _applicationService.Account.Username; GoToCreateGistCommand = ReactiveCommand.Create(); GoToCreateGistCommand.Subscribe(_ => { var vm = CreateViewModel <GistCreateViewModel>(); ShowViewModel(vm); }); LoadCommand = ReactiveCommand.CreateAsyncTask(t => GistsCollection.SimpleCollectionLoad(applicationService.Client.Users[Username].Gists.GetGists(), t as bool?)); }
public StarredGistsViewModel(IApplicationService applicationService) { Title = "Starred Gists"; LoadCommand = ReactiveCommand.CreateAsyncTask(t => GistsCollection.SimpleCollectionLoad(applicationService.Client.Gists.GetStarredGists(), t as bool?)); }