summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069.cs
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-01-12 21:05:41 +0100
committerJason Smith <jason.smith@xamarin.com>2017-01-12 12:05:41 -0800
commitb6cb64e4930de9b16309f2d30c6bb0a2177048fd (patch)
treeae15f36d3e0e60cac6305f90520ad778de9c6ee3 /Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069.cs
parent3af99cbbe145a876cc9839af0adead83695b5445 (diff)
downloadxamarin-forms-b6cb64e4930de9b16309f2d30c6bb0a2177048fd.tar.gz
xamarin-forms-b6cb64e4930de9b16309f2d30c6bb0a2177048fd.tar.bz2
xamarin-forms-b6cb64e4930de9b16309f2d30c6bb0a2177048fd.zip
[C] new OnPlatform mechanism (#658)
* [C] Obsolete TargetPlatform * [Xaml] support and test the new syntax * blind fix windows platforms
Diffstat (limited to 'Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069.cs')
-rw-r--r--Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069.cs b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069.cs
index 7abfa5d3..d4de5aa3 100644
--- a/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069.cs
+++ b/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Bugzilla42069.cs
@@ -19,11 +19,16 @@ namespace Xamarin.Forms.Controls
if (!Application.Current.Resources.ContainsKey("SomeSmallImage"))
{
- var smallImage = new OnPlatform<ImageSource> {
- Android = ImageSource.FromFile("coffee.png"),
- WinPhone = ImageSource.FromFile("bank.png"),
- iOS = ImageSource.FromFile("coffee.png")
- };
+ ImageSource smallImage;
+ switch (Device.RuntimePlatform) {
+ default:
+ smallImage = "coffee.png";
+ break;
+ case Device.WinPhone:
+ case Device.Windows:
+ smallImage = "bank.png";
+ break;
+ }
Application.Current.Resources.Add("SomeSmallImage", smallImage);
}