summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Xaml.UnitTests/Issues/Bz30074.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Issues/Bz30074.xaml.cs')
-rw-r--r--Xamarin.Forms.Xaml.UnitTests/Issues/Bz30074.xaml.cs41
1 files changed, 41 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz30074.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz30074.xaml.cs
new file mode 100644
index 00000000..e1c60feb
--- /dev/null
+++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz30074.xaml.cs
@@ -0,0 +1,41 @@
+using System;
+using System.Collections.Generic;
+
+using Xamarin.Forms;
+
+using NUnit.Framework;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public partial class Bz30074 : ContentPage
+ {
+ public Bz30074 ()
+ {
+ InitializeComponent ();
+ }
+
+ public Bz30074 (bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+ [TestFixture]
+ class Tests
+ {
+ [TestCase(true)]
+ [TestCase(false)]
+ public void DataTriggerInTemplates (bool useCompiledXaml)
+ {
+ var layout = new Bz30074 (useCompiledXaml);
+ Assert.Null (layout.image.Source);
+
+ layout.BindingContext = new {IsSelected = true};
+ Assert.AreEqual ("Add.png", ((FileImageSource)layout.image.Source).File);
+
+ layout.BindingContext = new {IsSelected = false};
+ Assert.Null (layout.image.Source);
+ }
+ }
+ }
+}
+