Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 88d9af7

Browse files
Adjusting view
1 parent 769125c commit 88d9af7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/GitHub.InlineReviews/Views/InlineCommentPeekView.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
VerticalScrollBarVisibility="Auto"
106106
Background="{DynamicResource GitHubPeekViewBackground}">
107107
<StackPanel Orientation="Vertical" Margin="0 0 0 4">
108-
<ItemsControl ItemsSource="{Binding Annotations}">
108+
<ItemsControl x:Name="annotationsView" ItemsSource="{Binding Annotations}">
109109
<ItemsControl.ItemTemplate>
110110
<DataTemplate>
111111
<ghfvs:InlineAnnotationView />

src/GitHub.InlineReviews/Views/InlineCommentPeekView.xaml.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ public InlineCommentPeekView()
1515
InitializeComponent();
1616

1717
desiredHeight = new Subject<double>();
18-
threadView.LayoutUpdated += ThreadViewLayoutUpdated;
18+
threadView.LayoutUpdated += ChildLayoutUpdated;
19+
annotationsView.LayoutUpdated += ChildLayoutUpdated;
1920
threadScroller.PreviewMouseWheel += ScrollViewerUtilities.FixMouseWheelScroll;
2021
}
2122

2223
public IObservable<double> DesiredHeight => desiredHeight;
2324

24-
void ThreadViewLayoutUpdated(object sender, EventArgs e)
25+
void ChildLayoutUpdated(object sender, EventArgs e)
2526
{
2627
var otherControlsHeight = ActualHeight - threadScroller.ActualHeight;
2728
var threadViewHeight = threadView.DesiredSize.Height + threadView.Margin.Top + threadView.Margin.Bottom;
28-
desiredHeight.OnNext(threadViewHeight + otherControlsHeight);
29+
var annotationsViewHeight = annotationsView.DesiredSize.Height + annotationsView.Margin.Top + annotationsView.Margin.Bottom;
30+
desiredHeight.OnNext(threadViewHeight + annotationsViewHeight + otherControlsHeight);
2931
}
3032
}
3133
}

0 commit comments

Comments
 (0)