This repository was archived by the owner on Jun 21, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
src/GitHub.InlineReviews/Tags Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ static Brush GetBackground(ResourceDictionary dictionary)
6969 public UIElement GenerateGlyph ( IWpfTextViewLine line , InlineCommentTag tag )
7070 {
7171 var glyph = CreateGlyph ( tag ) ;
72- glyph . Tag = tag ;
72+ glyph . DataContext = tag ;
7373
7474 glyph . MouseLeftButtonUp += ( s , e ) =>
7575 {
Original file line number Diff line number Diff line change @@ -16,19 +16,22 @@ public ShowInlineCommentGlyph()
1616
1717 protected override void OnToolTipOpening ( ToolTipEventArgs e )
1818 {
19- var tag = Tag as ShowInlineCommentTag ;
20- var comments = tag . Thread . Comments . Select ( comment => new PullRequestReviewCommentModel
19+ var tag = DataContext as ShowInlineCommentTag ;
20+ if ( tag != null )
2121 {
22- User = comment . User ,
23- Body = comment . Body ,
24- CreatedAt = comment . CreatedAt
25- } ) ;
22+ var comments = tag . Thread . Comments . Select ( comment => new PullRequestReviewCommentModel
23+ {
24+ User = comment . User ,
25+ Body = comment . Body ,
26+ CreatedAt = comment . CreatedAt
27+ } ) ;
2628
27- var viewModel = new TooltipCommentThreadViewModel ( comments ) ;
28- var view = new TooltipCommentThreadView ( ) ;
29- view . DataContext = viewModel ;
29+ var viewModel = new TooltipCommentThreadViewModel ( comments ) ;
30+ var view = new TooltipCommentThreadView ( ) ;
31+ view . DataContext = viewModel ;
3032
31- CommentToolTip . Content = view ;
33+ CommentToolTip . Content = view ;
34+ }
3235 }
3336
3437 protected override void OnToolTipClosing ( ToolTipEventArgs e )
You can’t perform that action at this time.
0 commit comments