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 +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ public sealed class InlineCommentPeekViewModel : ReactiveObject, IDisposable
4040 ITrackingPoint triggerPoint ;
4141 string relativePath ;
4242 DiffSide side ;
43+ bool availableForComment ;
4344
4445 /// <summary>
4546 /// Initializes a new instance of the <see cref="InlineCommentPeekViewModel"/> class.
@@ -87,6 +88,12 @@ public InlineCommentPeekViewModel(IInlineCommentPeekService peekService,
8788 Observable . Return ( previousCommentCommand . Enabled ) ) ;
8889 }
8990
91+ public bool AvailableForComment
92+ {
93+ get { return availableForComment ; }
94+ private set { this . RaiseAndSetIfChanged ( ref availableForComment , value ) ; }
95+ }
96+
9097 /// <summary>
9198 /// Gets the annotations displayed.
9299 /// </summary>
@@ -186,6 +193,11 @@ async Task UpdateThread()
186193 var lineAndLeftBuffer = peekService . GetLineNumber ( peekSession , triggerPoint ) ;
187194 var lineNumber = lineAndLeftBuffer . Item1 ;
188195 var leftBuffer = lineAndLeftBuffer . Item2 ;
196+
197+ AvailableForComment =
198+ file . Diff . Any ( chunk => chunk . Lines
199+ . Any ( line => line . NewLineNumber == lineNumber ) ) ;
200+
189201 var thread = file . InlineCommentThreads ? . FirstOrDefault ( x =>
190202 x . LineNumber == lineNumber &&
191203 ( ( leftBuffer && x . DiffLineType == DiffChangeType . Delete ) || ( ! leftBuffer && x . DiffLineType != DiffChangeType . Delete ) ) ) ;
Original file line number Diff line number Diff line change 113113 </ItemsControl .ItemTemplate>
114114 </ItemsControl >
115115
116- <ghfvs : CommentThreadView x : Name =" threadView" DataContext =" {Binding Thread}" />
116+ <ghfvs : CommentThreadView x : Name =" threadView"
117+ Visibility =" {Binding DataContext.AvailableForComment, Converter={ghfvs:BooleanToVisibilityConverter}, ElementName=annotationsView}"
118+ DataContext =" {Binding Thread}" />
117119 </StackPanel >
118120 </ScrollViewer >
119121 </DockPanel >
You can’t perform that action at this time.
0 commit comments