title: Shared Images and Sounds in Xamarin with Xamarin Forms
body: <p>we are currently working on a multi platform app for a university project and decided on using Xamarin. Our Database with sqlite as well as the business logic and shared resources should lie in xamarin forms, where as the View Controller and View are in the native xamarin.android and xamarin.Ios.</p>
  
  <p>We can't seem to be able to use the Xamarin.Forms Images in the native ImageView on Android. </p>
  
  <p>When going through the EmbeddedImages Section in the Xamarin Documentation (<a href="https://docs.microsoft.com/de-de/xamarin/xamarin-forms/user-interface/images?tabs=windows" rel="nofollow noreferrer">https://docs.microsoft.com/de-de/xamarin/xamarin-forms/user-interface/images?tabs=windows</a>) 
  the following C# Code doesn't seem to work in our project.</p>
  
  <pre><code>var embeddedImage = new Image { Source = ImageSource.FromResource("WorkingWithImages.beach.jpg", typeof(EmbeddedImages).GetTypeInfo().Assembly) };
  </code></pre>
  
  <p>We can set the source to IamgeSource.FromResource("source") but typoeof(EmbeddeImages)... doesn't work. Even though the BuildAction is properly set to Embedded resource.</p>
  
  <p>Also we can't really get the point of the "Using XAML" Section, where to put the C# code, as well as the XAML.</p>
  
  <p>That's why we tried to convert the Xamarin.Forms.Image handed over from the logic into a bitmap using:
  <a href="https://medium.com/@hakimgulamali88/a-helper-for-converting-a-xamarin-forms-imagesource-to-the-respective-native-images-56a5aaf98156" rel="nofollow noreferrer">https://medium.com/@hakimgulamali88/a-helper-for-converting-a-xamarin-forms-imagesource-to-the-respective-native-images-56a5aaf98156</a></p>
  
  <p>But when debugging the app turns black and the console shows multiple threats being started and finished. App stays unresponsive.</p>
  
  <p>Are there any suggestions?</p>
  
  <p>We appreciate any help. Thank you.</p>