Skip to content

Commit

Permalink
Ensure adorner isn't rendered when ListBox height is too small
Browse files Browse the repository at this point in the history
  • Loading branch information
r-smith committed Mar 11, 2022
1 parent 0d19be1 commit c412495
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion vmPing/Controls/AutoScrollListBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ protected override void OnRender(DrawingContext drawingContext)

private void Scroll_ScrollChanged(object sender, ScrollChangedEventArgs e)
{
const double MinimumAdornerHeight = 11.0;
ScrollViewer scrollViewer = (ScrollViewer)sender;
if (scrollViewer.VerticalOffset == scrollViewer.ScrollableHeight)
if (scrollViewer.VerticalOffset == scrollViewer.ScrollableHeight || scrollViewer.ActualHeight < MinimumAdornerHeight)
{
_adornerLayer.Remove(_autoScrollAdorner);

Expand Down

0 comments on commit c412495

Please sign in to comment.