title: How to Bind Embedded Image with variable ImageSource that is specified by a string in C# code behind?
body: <p>I want to display variable Image in Xamarin Forms. I want to bind <code>ImageSource</code> in XAML. I have tried using <code>IMarkupExtension</code> as mentioned in the docs, but the limitation is I need to specify whole path in the XAML itself. I want to bind <code>ImageSource</code> that can be varied whenever required. I don't want to specify whole path in XAML.</p>
  <p><strong>Here is my working XAML code:</strong></p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Image Source=&quot;{local:ImageResource MyProject.Images.photo.jpg}&quot; /&gt;
  </code></pre>
  <p><strong>Here is XAML the code that is not working:</strong></p>
  <pre class="lang-xml prettyprint-override"><code>&lt;Image Source=&quot;{Binding imgSource StringFormat=local:ImageResource `MyProject.Images.{0}`&quot; /&gt;
  </code></pre>