-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6732 from AvaloniaUI/fixes/6729-itemsrepeater-rea…
…ssign-items ItemsRepeater: unsubscribe from ItemsSourceView before disposing it.
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using System.Collections.ObjectModel; | ||
using Xunit; | ||
|
||
namespace Avalonia.Controls.UnitTests | ||
{ | ||
public class ItemsRepeaterTests | ||
{ | ||
[Fact] | ||
public void Can_Reassign_Items() | ||
{ | ||
var target = new ItemsRepeater(); | ||
target.Items = new ObservableCollection<string>(); | ||
target.Items = new ObservableCollection<string>(); | ||
} | ||
|
||
[Fact] | ||
public void Can_Reassign_Items_To_Null() | ||
{ | ||
var target = new ItemsRepeater(); | ||
target.Items = new ObservableCollection<string>(); | ||
target.Items = null; | ||
} | ||
} | ||
} |