Browse Source

Merge pull request #10177 from workgroupengineering/fixes/Warnings/CS0618/ListItemAutomationPeer-Missing

fix: Waring CS0618 ListItemAutomationPeer
pull/10411/head
Max Katz 3 years ago
committed by GitHub
parent
commit
0cda660b87
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  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;
using Avalonia.Controls.Primitives; using Avalonia.Controls.Primitives;
using Avalonia.Controls.Selection; using Avalonia.Controls.Selection;
@ -64,7 +63,7 @@ namespace Avalonia.Automation.Peers
if (Owner.Parent is ItemsControl parent && if (Owner.Parent is ItemsControl parent &&
parent.GetValue(ListBox.SelectionProperty) is ISelectionModel selectionModel) parent.GetValue(ListBox.SelectionProperty) is ISelectionModel selectionModel)
{ {
var index = parent.ItemContainerGenerator.IndexFromContainer(Owner); var index = parent.IndexFromContainer(Owner);
if (index != -1) if (index != -1)
selectionModel.Deselect(index); selectionModel.Deselect(index);

Loading…
Cancel
Save