summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1888.cs
blob: 03f5135352ec057adde7a2586dbb9a393e7d4fdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms.Controls
{
	[Preserve (AllMembers=true)]
	[Issue (IssueTracker.Github, 1888, "Fix image resources not being freed after page is navigated away from ", PlatformAffected.iOS)]
	public class Issue1888: ContentPage
	{
		public Issue1888 ()
		{
			var btn = new Button
			{
				Text = "Click!"
			};
			btn.Clicked += (sender, e) => Navigation.PushAsync(new LeakPage());
			Content = btn;
		}
	}

	public class LeakPage : ContentPage
	{
		public LeakPage ()
		{
			var img = new Image
			{
				Source = new FileImageSource
				{
					File = "Default-568h@2x.png"
				}
			};
			Content = img;
		}
	}
}