diff options
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests/Issues/Bz24485.xaml.cs')
-rw-r--r-- | Xamarin.Forms.Xaml.UnitTests/Issues/Bz24485.xaml.cs | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/Issues/Bz24485.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz24485.xaml.cs new file mode 100644 index 00000000..8165e8f4 --- /dev/null +++ b/Xamarin.Forms.Xaml.UnitTests/Issues/Bz24485.xaml.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Globalization; + +using Xamarin.Forms; + +using NUnit.Framework; + +namespace Xamarin.Forms.Xaml.UnitTests +{ + public class Bz24485Converter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value == null) + return null; + + return new { + Date = DateTime.Now.ToString("dd MMMM yyyy"), + Object = new object () + }; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } + + public partial class Bz24485 : ContentPage + { + public Bz24485 () + { + InitializeComponent (); + } + + public Bz24485 (bool useCompiledXaml) + { + //this stub will be replaced at compile time + } + + [TestFixture] + class Tests + { + [TestCase(true)] + [TestCase(false)] + public void BindingContextWithConverter (bool useCompiledXaml) + { + var layout = new Bz24485 (useCompiledXaml); + layout.BindingContext = new { Data1 = new object ()}; + Assert.Pass (); + } + } + } +}
\ No newline at end of file |