Browse Source

Don't think exceptions in carousel panel.

`VirtualizingCarouselPanel` can't bring items into view (it can't scroll) or get a control in a direction (it only hosts one control) but we shouldn't throw `NotImplementedException` as these methods can still be called. Just make them a no-op.

Fixes #10374
pull/10470/head
Steven Kirk 4 years ago
parent
commit
bab5e74027
  1. 12
      src/Avalonia.Controls/VirtualizingCarouselPanel.cs

12
src/Avalonia.Controls/VirtualizingCarouselPanel.cs

@ -80,16 +80,8 @@ namespace Avalonia.Controls
remove => _scrollInvalidated -= value;
}
bool ILogicalScrollable.BringIntoView(Control target, Rect targetRect)
{
throw new NotImplementedException();
}
Control? ILogicalScrollable.GetControlInDirection(NavigationDirection direction, Control? from)
{
throw new NotImplementedException();
}
bool ILogicalScrollable.BringIntoView(Control target, Rect targetRect) => false;
Control? ILogicalScrollable.GetControlInDirection(NavigationDirection direction, Control? from) => null;
void ILogicalScrollable.RaiseScrollInvalidated(EventArgs e) => _scrollInvalidated?.Invoke(this, e);
protected override Size MeasureOverride(Size availableSize)

Loading…
Cancel
Save