From 3e5fb021fee3b512d8163c53224e17b76c3789c2 Mon Sep 17 00:00:00 2001 From: Jonathan Peppers Date: Mon, 15 Apr 2024 16:12:50 -0500 Subject: [PATCH] Change to make C# leak --- MauiCollectionView/Views/PageCsOk.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/MauiCollectionView/Views/PageCsOk.cs b/MauiCollectionView/Views/PageCsOk.cs index f9f63c0..b20641f 100644 --- a/MauiCollectionView/Views/PageCsOk.cs +++ b/MauiCollectionView/Views/PageCsOk.cs @@ -9,18 +9,20 @@ public PageCsOk() var collectionView = new CollectionView(); collectionView.ItemsSource = new ObservableCollection { "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");