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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
3 deletions
-
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); |
|
|
|
|