Browse Source

fix: Waring CS0618 ListItemAutomationPeer

pull/10177/head
Giuseppe Lippolis 3 years ago
parent
commit
84cd896cd8
  1. 5
      src/Avalonia.Controls/Automation/Peers/ListItemAutomationPeer.cs

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

@ -1,5 +1,4 @@
using System;
using Avalonia.Automation.Provider;
using Avalonia.Automation.Provider;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Selection;
@ -64,7 +63,7 @@ namespace Avalonia.Automation.Peers
if (Owner.Parent is ItemsControl parent &&
parent.GetValue(ListBox.SelectionProperty) is ISelectionModel selectionModel)
{
var index = parent.ItemContainerGenerator.IndexFromContainer(Owner);
var index = parent.IndexFromContainer(Owner);
if (index != -1)
selectionModel.Deselect(index);

Loading…
Cancel
Save