Browse Source

More fixing of provider resolution.

Found a few more places that were doing casts instead of calling `GetProvider<T>()`.
pull/12330/head
Steven Kirk 3 years ago
parent
commit
6b68a8e5c6
  1. 2
      src/Avalonia.Controls/Automation/Peers/ItemsControlAutomationPeer.cs
  2. 2
      src/Avalonia.Controls/Automation/Peers/ListItemAutomationPeer.cs

2
src/Avalonia.Controls/Automation/Peers/ItemsControlAutomationPeer.cs

@ -28,7 +28,7 @@ namespace Avalonia.Automation.Peers
if (!_searchedForScrollable)
{
if (Owner.GetValue(ListBox.ScrollProperty) is Control scrollable)
_scroller = GetOrCreate(scrollable) as IScrollProvider;
_scroller = GetOrCreate(scrollable).GetProvider<IScrollProvider>();
_searchedForScrollable = true;
}

2
src/Avalonia.Controls/Automation/Peers/ListItemAutomationPeer.cs

@ -22,7 +22,7 @@ namespace Avalonia.Automation.Peers
if (Owner.Parent is Control parent)
{
var parentPeer = GetOrCreate(parent);
return parentPeer as ISelectionProvider;
return parentPeer.GetProvider<ISelectionProvider>();
}
return null;

Loading…
Cancel
Save