示例#1
0
 internal FeedbackItemViewModel(Octokit.Issue issue, Action gotoAction)
 {
     Title         = issue.Title;
     ImageUrl      = issue.User.AvatarUrl;
     Created       = issue.CreatedAt;
     CreatedString = Created.Humanize();
     GoToCommand   = ReactiveCommand.Create().WithSubscription(_ => gotoAction());
 }
 internal FeedbackItemViewModel(string repositoryOwner, string repositoryName, Octokit.Issue issue)
 {
     RepositoryOwner = repositoryOwner;
     RepositoryName  = repositoryName;
     IssueId         = issue.Number;
     Title           = issue.Title;
     ImageUrl        = issue.User.AvatarUrl;
     Created         = issue.CreatedAt;
     CreatedString   = Created.Humanize();
 }
示例#3
0
 internal EventItemViewModel(
     EventModel eventModel,
     IReadOnlyCollection <BaseEventsViewModel.TextBlock> headerBlocks,
     IReadOnlyCollection <BaseEventsViewModel.TextBlock> bodyBlocks)
 {
     Event         = eventModel;
     HeaderBlocks  = headerBlocks ?? new BaseEventsViewModel.TextBlock[0];
     BodyBlocks    = bodyBlocks ?? new BaseEventsViewModel.TextBlock[0];
     GoToCommand   = ReactiveCommand.Create();
     Avatar        = eventModel.Actor != null ? new GitHubAvatar(eventModel.Actor.AvatarUrl) : GitHubAvatar.Empty;
     Created       = eventModel.CreatedAt;
     Type          = ChooseImage(eventModel);
     CreatedString = Created.Humanize();
 }