diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2017-04-20 21:06:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-20 21:06:00 +0200 |
commit | 8e567b9ad1669265d994c84acd5c49d43829a3da (patch) | |
tree | 05d761b74c86b85feed8ebfe649626b55c04341a /Xamarin.Forms.Xaml.UnitTests | |
parent | abdad979ce9de6f4d5f43774886f61f5e9e9e95f (diff) | |
download | xamarin-forms-8e567b9ad1669265d994c84acd5c49d43829a3da.tar.gz xamarin-forms-8e567b9ad1669265d994c84acd5c49d43829a3da.tar.bz2 xamarin-forms-8e567b9ad1669265d994c84acd5c49d43829a3da.zip |
[XamlC] support nested types type declarations (#872)
Diffstat (limited to 'Xamarin.Forms.Xaml.UnitTests')
-rw-r--r-- | Xamarin.Forms.Xaml.UnitTests/XStatic.xaml | 2 | ||||
-rw-r--r-- | Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml b/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml index 2627ae39..35f0f04d 100644 --- a/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml +++ b/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml @@ -24,5 +24,7 @@ Orientation="{x:Static ScrollOrientation.Both}"/> <Label x:Name="field2" Text="{x:Static local:MockxStatic.MockFieldRef}" /> + <Label x:Name="nestedField" + Text="{x:Static local:MockxStatic+Nested.Foo}" /> </StackLayout> </ContentPage>
\ No newline at end of file diff --git a/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs b/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs index 63854e1c..a545b4a5 100644 --- a/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs +++ b/Xamarin.Forms.Xaml.UnitTests/XStatic.xaml.cs @@ -17,6 +17,10 @@ namespace Xamarin.Forms.Xaml.UnitTests public static string MockFieldRef = Icons.CLOSE; public string InstanceProperty { get { return "InstanceProperty"; } } public static readonly Color BackgroundColor = Color.Fuchsia; + + public class Nested { + public static string Foo = "FOO"; + } } public enum MockEnum : long @@ -135,6 +139,15 @@ namespace Xamarin.Forms.Xaml.UnitTests var layout = new XStatic(useCompiledXaml); Assert.AreEqual("ic_close.png", layout.ToolbarItems[0].Icon.File); } + + [TestCase(false)] + [TestCase(true)] + // https://bugzilla.xamarin.com/show_bug.cgi?id=55096 + public void xStaticAndNestedClasses(bool useCompiledXaml) + { + var layout = new XStatic(useCompiledXaml); + Assert.AreEqual(MockxStatic.Nested.Foo, layout.nestedField.Text); + } } } }
\ No newline at end of file |