Browse Source

Fix SelectionChanged event unsubscribtions

That change fix very tricky bug. Our case:
We have DataTemplate that contains DataGrid inside it. And Datagrid has an AttachedProperty (that deserve us to observe changes in Datagrid's SelectedItems). which  work through event subscription. Memory leaks happen (and the logic for observe selected items breaks) when DataTemplate switches DataContext.
pull/9528/head
dif-sam 3 years ago
committed by GitHub
parent
commit
6750692af7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/Avalonia.Controls.DataGrid/DataGrid.cs

2
src/Avalonia.Controls.DataGrid/DataGrid.cs

@ -1296,7 +1296,7 @@ namespace Avalonia.Controls
public event EventHandler<SelectionChangedEventArgs> SelectionChanged
{
add { AddHandler(SelectionChangedEvent, value); }
remove { AddHandler(SelectionChangedEvent, value); }
remove { RemoveHandler(SelectionChangedEvent, value); }
}
/// <summary>

Loading…
Cancel
Save