UserRepositoriesViewModel.cs 879 B

1234567891011121314151617181920212223242526
  1. // Copyright (c) The Perspex Project. All rights reserved.
  2. // Licensed under the MIT license. See licence.md file in the project root for full license information.
  3. using System.Collections.Generic;
  4. using System.Threading.Tasks;
  5. using GitHubClient.ViewModels;
  6. using ReactiveUI;
  7. namespace Perspex.Xaml.Base.UnitTest.SampleModel
  8. {
  9. public class UserRepositoriesViewModel : ReactiveObject
  10. {
  11. private IReadOnlyList<Repository> _repositories;
  12. public async Task Load(string username)
  13. {
  14. Repositories = await new Task<IReadOnlyList<Repository>>(() => new List<Repository> { new Repository("Blah"), new Repository("Bleh") });
  15. }
  16. public IReadOnlyList<Repository> Repositories
  17. {
  18. get { return _repositories; }
  19. private set { this.RaiseAndSetIfChanged(ref _repositories, value); }
  20. }
  21. }
  22. }