Skip to content

Commit

Permalink
Change to make C# leak
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpeppers committed Apr 15, 2024
1 parent 3991885 commit 3e5fb02
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions MauiCollectionView/Views/PageCsOk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,20 @@ public PageCsOk()
var collectionView = new CollectionView();
collectionView.ItemsSource = new ObservableCollection<string> { "1", "2", "3" };

collectionView.ItemTemplate = new DataTemplate(() =>
{
var label = new Label
{
Text = "Test"
};
return label;
});
collectionView.ItemTemplate = new DataTemplate(InstanceMethod);

Content = collectionView;
}

object InstanceMethod()
{
var label = new Label
{
Text = "Test"
};
return label;
}

~PageCsOk()
{
Console.WriteLine("~PageCsOk() called");
Expand Down

0 comments on commit 3e5fb02

Please sign in to comment.