public IEnumerable<Instruction> ProvideValue(VariableDefinitionReference vardefref, ModuleDefinition module, BaseNode node, ILContext context)
{
INode valueNode = null;
- if (!((IElementNode)node).Properties.TryGetValue(new XmlName("", "Value"), out valueNode) && ((IElementNode)node).CollectionItems.Count == 1)
+ if (!((IElementNode)node).Properties.TryGetValue(new XmlName("", "Value"), out valueNode) &&
+ !((IElementNode)node).Properties.TryGetValue(new XmlName("http://xamarin.com/schemas/2014/forms", "Value"), out valueNode) &&
+ ((IElementNode)node).CollectionItems.Count == 1)
valueNode = ((IElementNode)node).CollectionItems[0];
if (valueNode == null)
public IEnumerable<Instruction> ProvideValue(VariableDefinitionReference vardefref, ModuleDefinition module, BaseNode node, ILContext context)
{
INode valueNode = null;
- if (!((IElementNode)node).Properties.TryGetValue(new XmlName("", "Value"), out valueNode) && ((IElementNode)node).CollectionItems.Count == 1)
+ if (!((IElementNode)node).Properties.TryGetValue(new XmlName("", "Value"), out valueNode) &&
+ !((IElementNode)node).Properties.TryGetValue(new XmlName("http://xamarin.com/schemas/2014/forms", "Value"), out valueNode) &&
+ ((IElementNode)node).CollectionItems.Count == 1)
valueNode = ((IElementNode)node).CollectionItems[0];
if (valueNode == null)
--- /dev/null
+using System;
+using System.Collections.Generic;
+using NUnit.Framework;
+using Xamarin.Forms;
+using Xamarin.Forms.Core.UnitTests;
+
+namespace Xamarin.Forms.Xaml.UnitTests
+{
+ public partial class Unreported009 : ContentPage
+ {
+ public Unreported009()
+ {
+ InitializeComponent();
+ }
+
+ public Unreported009(bool useCompiledXaml)
+ {
+ //this stub will be replaced at compile time
+ }
+
+ [TestFixture]
+ class Tests
+ {
+ [SetUp]
+ public void Setup()
+ {
+ Device.PlatformServices = new MockPlatformServices();
+ }
+
+ [TearDown]
+ public void TearDown()
+ {
+ Device.PlatformServices = null;
+ }
+
+ [TestCase(true), TestCase(false)]
+ public void AllowSetterValueAsElementProperties(bool useCompiledXaml)
+ {
+ var p = new Unreported009(useCompiledXaml);
+ var s = p.Resources["Default"] as Style;
+ Assert.AreEqual("Bananas!", (s.Setters[0].Value as Label).Text);
+ }
+ }
+ }
+}
<Compile Include="Issues\Bz51567.xaml.cs">
<DependentUpon>Bz51567.xaml</DependentUpon>
</Compile>
+ <Compile Include="Issues\Bz42531.xaml.cs">
+ <DependentUpon>Bz42531.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Issues\Bz45299.xaml.cs">
+ <DependentUpon>Bz45299.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Issues\Bz43733.xaml.cs">
+ <DependentUpon>Bz43733.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Issues\Bz44213.xaml.cs">
+ <DependentUpon>Bz44213.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="DefaultCtorRouting.xaml.cs">
+ <DependentUpon>DefaultCtorRouting.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="DefaultCtorRouting2.xaml.cs">
+ <DependentUpon>DefaultCtorRouting2.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Issues\Bz43694.xaml.cs">
+ <DependentUpon>Bz43694.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Issues\Bz45891.xaml.cs">
+ <DependentUpon>Bz45891.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Issues\Bz44216.xaml.cs">
+ <DependentUpon>Bz44216.xaml</DependentUpon>
+ <DependentUpon>AcceptEmptyServiceProvider.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="AcceptEmptyServiceProvider.xaml.cs">
+ <DependentUpon>AcceptEmptyServiceProvider.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Issues\Unreported009.xaml.cs">
+ <DependentUpon>Unreported009.xaml</DependentUpon>
+ </Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\.nuspec\Xamarin.Forms.Debug.targets" />
<EmbeddedResource Include="Issues\Bz51567.xaml">
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
+ <EmbeddedResource Include="Issues\Bz42531.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Issues\Bz45299.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Issues\Bz43733.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Issues\Bz44213.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="DefaultCtorRouting.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="DefaultCtorRouting2.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Issues\Bz43694.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Issues\Bz45891.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Issues\Bz44216.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="AcceptEmptyServiceProvider.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
+ <EmbeddedResource Include="Issues\Unreported009.xaml">
+ <Generator>MSBuild:UpdateDesignTimeXaml</Generator>
+ </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />