summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla39378.xaml.cs
blob: 99e623eb70e662f41752a39f55d2ae780f5368f1 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
#if UITEST
using Xamarin.UITest;
using NUnit.Framework;
#endif


namespace Xamarin.Forms.Controls.Issues
{
	[Preserve(AllMembers = true)]
	[Issue(IssueTracker.Bugzilla, 39378, "Image binding with caching not operating as expected", PlatformAffected.All)]
	public partial class Bugzilla39378 : TestContentPage
	{
#if APP
		public Bugzilla39378()
		{
			InitializeComponent();
		}
#endif

		protected override void Init()
		{
			BindingContext = new ImageController();
		}

		class ImageController : ViewModelBase
		{
			
			public ImageController()
			{
				HomeImage = "http://xamarin.com/content/images/pages/forms/example-app.png";
				LocalBackgroundImage = "Default-568h@2x.png";
				BackgroundColor = "#00FF00";
			}

			public string BackgroundColor
			{
				get
				{ 
					return _backgroundColor;
				}

				set
				{
					_backgroundColor = value;
					OnPropertyChanged();
				}
			}

			public string HomeImage
			{
				get
				{ 
					return _homeImage;
				}

				set
				{
					_homeImage = value;
					OnPropertyChanged();
				}
			}

			public string LocalBackgroundImage
			{
				get
				{ 
					return _localBackgroundImage;
				}

				set
				{
					_localBackgroundImage = value;
					OnPropertyChanged();
				}
			}


			string _backgroundColor;
			string _homeImage;
			string _localBackgroundImage;
		}

#if UITEST
		[Test]
		public void ImageIsPresent()
		{
			RunningApp.WaitForElement(q => q.Marked("image1"));
			Assert.Inconclusive("Please verify image is present");
		}
#endif
	}
}