title: Xamarin.Forms RelativeLayout Constraints generating exception on Android device
body: <p>I am trying to construct a simple Xamarin.Forms page using StackLayout and RelativeLayout with this markup below, trying to accomplish a label on the left mirroring the value of the slider with 80% width on the right. This is the markup of the whole page:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="XamarinAds.OptionsPage" Title="Options"&gt;
      &lt;ContentPage.Content&gt;
          &lt;StackLayout Padding="10"&gt;
              &lt;Label Text="Rooms:" VerticalOptions="CenterAndExpand" /&gt;
              &lt;RelativeLayout&gt;
                  &lt;Slider x:Name="roomsSlider" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.80}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.10}" /&gt;
                  &lt;Label BindingContext="{x:Reference Name=roomsSlider}" Text="{Binding Value, StringFormat='{0:F0}'}" /&gt;
              &lt;/RelativeLayout&gt;
              &lt;Label Text="Maximum price (M SEK):" VerticalOptions="CenterAndExpand" /&gt;
              &lt;RelativeLayout&gt;
                  &lt;Slider x:Name="priceSlider" Value="1" Minimum="0" Maximum="10" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.80}" RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.10}" /&gt;
                  &lt;Label BindingContext="{x:Reference Name=priceSlider}" Text="{Binding Value, StringFormat='{0:F0}'}" /&gt;
              &lt;/RelativeLayout&gt;
              &lt;Button Text="Filter" /&gt;
              &lt;Button Text="Default values" /&gt;
          &lt;/StackLayout&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>This should be valid markup and it also executes without problems in the Android emulator. However, when trying to run this on an actual Android device (HTC One with Android 4.4) I get exceptions. Turns out it is the RelativeLayout.WidthConstraint and RelativeLayout.XConstraint that is causing the error.</p>
  
  <p>When using this markup:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="XamarinAds.OptionsPage" Title="Options"&gt;
      &lt;ContentPage.Content&gt;
          &lt;StackLayout Padding="10"&gt;
              &lt;RelativeLayout&gt;
                  &lt;Slider x:Name="roomsSlider" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.80}" /&gt;
              &lt;/RelativeLayout&gt;
          &lt;/StackLayout&gt;
      &lt;/ContentPage.Content&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  
  <p>I get the following exceptions:</p>
  
  <pre><code>[MonoDroid] UNHANDLED EXCEPTION: System.FormatException: Unknown char
  [MonoDroid] at double.Parse (string,System.Globalization.NumberStyles,System.IFormatProvider) &lt;0x00078&gt;
  [MonoDroid] at double.Parse (string) &lt;0x0001b&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.TypeConversionExtensions.ConvertTo (object,System.Type,System.Func`1&lt;System.Reflection.MemberInfo&gt;) &lt;0x00123&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.MarkupExtensionParser.SetPropertyValue (string,string,object) &lt;0x000e7&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.MarkupExpressionParser.HandleProperty (string,System.IServiceProvider,string&amp;) &lt;0x00183&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.MarkupExtensionParser.Parse (string,string&amp;,System.IServiceProvider) &lt;0x002f7&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.MarkupExpressionParser.ParseExpression (string&amp;,System.IServiceProvider) &lt;0x001cf&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.MarkupNode.ApplyTo (object,Xamarin.Forms.Xaml.XmlName,Xamarin.Forms.INameScope) &lt;0x0021f&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.INodeExtension.ApplyProperties (Xamarin.Forms.Xaml.IElementNode,object,Xamarin.Forms.INameScope) &lt;0x001d3&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.ElementNode.ApplyProperties (Xamarin.Forms.INameScope) &lt;0x0001f&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.ElementNode.Create (Xamarin.Forms.IElement,Xamarin.Forms.INameScope) &lt;0x0040f&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.ElementNode.ApplyTo (object,Xamarin.Forms.Xaml.XmlName,Xamarin.Forms.INameScope) &lt;0x00247&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.INodeExtension.ApplyProperties (Xamarin.Forms.Xaml.IElementNode,object,Xamarin.Forms.INameScope) &lt;0x001d3&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.ElementNode.ApplyProperties (Xamarin.Forms.INameScope) &lt;0x0001f&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.ElementNode.Create (Xamarin.Forms.IElement,Xamarin.Forms.INameScope) &lt;0x0040f&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.ListNode.ApplyTo (object,Xamarin.Forms.Xaml.XmlName,Xamarin.Forms.INameScope) &lt;0x0069b&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.INodeExtension.ApplyProperties (Xamarin.Forms.Xaml.IElementNode,object,Xamarin.Forms.INameScope) &lt;0x001d3&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.ElementNode.ApplyProperties (Xamarin.Forms.INameScope) &lt;0x0001f&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.ElementNode.Create (Xamarin.Forms.IElement,Xamarin.Forms.INameScope) &lt;0x0040f&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.ElementNode.ApplyTo (object,Xamarin.Forms.Xaml.XmlName,Xamarin.Forms.INameScope) &lt;0x00247&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.INodeExtension.ApplyProperties (Xamarin.Forms.Xaml.IElementNode,object,Xamarin.Forms.INameScope) &lt;0x001d3&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.RootNode.ApplyProperties (Xamarin.Forms.INameScope) &lt;0x0005f&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.VisualElement,string) &lt;0x000e7&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.XamlLoader.Load (Xamarin.Forms.VisualElement,System.Type) &lt;0x00053&gt;
  [MonoDroid] at Xamarin.Forms.Xaml.Extensions.LoadFromXaml&lt;XamarinAds.OptionsPage&gt; (XamarinAds.OptionsPage,System.Type) &lt;0x0001f&gt;
  [MonoDroid] at XamarinAds.OptionsPage.InitializeComponent () &lt;0x00023&gt;
  [MonoDroid] at XamarinAds.OptionsPage..ctor () &lt;0x0001b&gt;
  [MonoDroid] at XamarinAds.StartPage.OnOptionsButtonClicked (object,System.EventArgs) &lt;0x00033&gt;
  [MonoDroid] at Xamarin.Forms.Button.SendClicked () &lt;0x0006b&gt;
  [MonoDroid] at Xamarin.Forms.Platform.Android.ButtonRenderer/ButtonClickListener.OnClick (Android.Views.View) &lt;0x000a7&gt;
  [MonoDroid] at Android.Views.View/IOnClickListenerInvoker.n_OnClick_Landroid_view_View_ (intptr,intptr,intptr) &lt;0x0005f&gt;
  [MonoDroid] at (wrapper dynamic-method) object.0bd85240-ae6f-4264-9b6b-1f5e51891117 (intptr,intptr,intptr) &lt;0x00043&gt;
  
  [mono] 
  [mono] Unhandled Exception:
  [mono] System.FormatException: Unknown char
  [mono]   at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in &lt;filename unknown&gt;:0 
  [mono]   at System.Double.Parse (System.String s) [0x00000] in &lt;filename unknown&gt;:0 
  [mono]   at Xamarin.Forms.Xaml.TypeConversionExtensions.ConvertTo (System.Object value, System.Type toType, System.Func`1 minfoRetriever) [0x00000] in &lt;filename unknown&gt;:0 
  [mono]   at Xamarin.Forms.Xaml.MarkupExtensionParser.SetPropertyValue (System.String prop, System.String strValue, System.Object value) [0x00000] in &lt;filename unknown&gt;:0 
  [mono]   at Xamarin.Forms.Xaml.MarkupExpressionParser.HandleProperty (System.String prop, IServiceProvider serviceProvider, System.String&amp; remaining) [0x00000] in &lt;filename unknown&gt;:0 
  [mono]   at Xamarin.Forms.Xaml.MarkupExtensionParser.Parse (System.String match, System.String&amp; expression, IServiceProvider serviceProvider) [0x00000] in &lt;filename unknown&gt;:0 
  [mono]   at Xamarin.Forms.Xaml.MarkupExpressionParser.ParseExpression (System.String&amp; expre
  [mono-rt] [ERROR] FATAL UNHANDLED EXCEPTION: System.FormatException: Unknown char
  [mono-rt]   at System.Double.Parse (System.String s, NumberStyles style, IFormatProvider provider) [0x00000] in &lt;filename unknown&gt;:0 
  [mono-rt]   at System.Double.Parse (System.String s) [0x00000] in &lt;filename unknown&gt;:0 
  [mono-rt]   at Xamarin.Forms.Xaml.TypeConversionExtensions.ConvertTo (System.Object value, System.Type toType, System.Func`1 minfoRetriever) [0x00000] in &lt;filename unknown&gt;:0 
  [mono-rt]   at Xamarin.Forms.Xaml.MarkupExtensionParser.SetPropertyValue (System.String prop, System.String strValue, System.Object value) [0x00000] in &lt;filename unknown&gt;:0 
  [mono-rt]   at Xamarin.Forms.Xaml.MarkupExpressionParser.HandleProperty (System.String prop, IServiceProvider serviceProvider, System.String&amp; remaining) [0x00000] in &lt;filename unknown&gt;:0 
  [mono-rt]   at Xamarin.Forms.Xaml.MarkupExtensionParser.Parse (System.String match, System.String&amp; expression, IServiceProvider serviceProvider) [0x00000] in &lt;filename unknown&gt;:0 
  [mono-rt]   at Xamarin.Forms.Xaml.MarkupExpressionParser.ParseExpression (System.
  </code></pre>
  
  <p>Am I doing something wrong or did I catch a bug? Is there any other easy way to accomplish my page design?</p>