title: How to change BackgroundColor using OnPlatform Xamarin
body: <p>I am trying to change the background of an entry depending on the device it's running on.
  I tried to do it based on information from: <a href="https://developer.xamarin.com/guides/xamarin-forms/xaml/passing-arguments/" rel="nofollow noreferrer">https://developer.xamarin.com/guides/xamarin-forms/xaml/passing-arguments/</a></p>
  <p>and got to this:</p>
  <pre><code>        &lt;Entry TextColor=&quot;White&quot;
              x:Name=&quot;entryTop&quot;
              HeightRequest=&quot;40&quot;
              WidthRequest=&quot;150&quot;
              RelativeLayout.XConstraint = &quot;{ConstraintExpression Type=RelativeToParent,
                  Property=Width,
                  Factor=.48,
                  Constant=10}&quot;
              RelativeLayout.YConstraint = &quot;{ConstraintExpression Type=RelativeToParent,
                  Property=Height,
                  Factor=0,
                  Constant=5}&quot; &gt;
              &lt;Entry.BackgroundColor&gt;
                  &lt;OnPlatform x:TypeArguments=&quot;x:String&quot;&gt;
                      &lt;On Platform=&quot;Android&quot; Value=&quot;Transparent&quot; /&gt;
                      &lt;On Platform=&quot;iOS&quot; Value=&quot;white&quot; /&gt;
                  &lt;/OnPlatform&gt;
              &lt;/Entry.BackgroundColor&gt;
          &lt;/Entry&gt;
  </code></pre>
  <p>When I try to build my project, I get this error: No property, bindable property, or event found for <code>BackgroundColor</code>, or mismatching type between value and property.</p>
  <p>I tried with color factory methods and several <code>TypeArguments</code>, but cannot seem to get the right ones.</p>