title: Retrieve image from SignaturePadView with MVVM architecture
body: <p>I'm developing a Xamarin.Forms application with Prism framework in a MVVM architecture.  I need to collect the signature from the screen, so I decided to include the SignaturePad library. With NuGet I included Xamarin.Controls.SignaturePad and Xamarin.Controls.SignaturePad.Forms packages.
  In page layout (built with XAML) I have the signature widget:</p>
  
  <pre><code>&lt;signature:SignaturePadView 
               x:Name="padView"
               HeightRequest="130"                                
               CaptionText="Sign"
               CaptionTextColor="Black"
               ClearText="Clean"
               ClearTextColor="Black"
               BackgroundColor="White"
               SignatureLineColor="Black"
               StrokeWidth="2"
               StrokeColor="Black"
               BindingContext="{Binding Sign, Mode=TwoWay}" /&gt;
  </code></pre>
  
  <p>In the ViewModel the widget binding:</p>
  
  <pre><code>private SignaturePadView _sign;
  public SignaturePadView Sign
  {
      get { return _sign; }
      set { SetProperty(ref _sign, value); }
  }
  </code></pre>
  
  <p>In the ViewModel constructor:</p>
  
  <pre><code>_sign = new SignaturePadView();
  </code></pre>
  
  <p>There is also a button, in the action of this button I need to read the sign image and save it to the database. I tried this:</p>
  
  <pre><code>Stream sig = await Sign.GetImageStreamAsync(SignatureImageFormat.Png);
  var signatureMemoryStream = sig as MemoryStream;
  byte[] data = signatureMemoryStream.ToArray();            
  </code></pre>
  
  <p>All this code is written in the portable project.
  Unfortunately it doesn't work because the sig object is always null. I think that the problem is the widget binding but I'm not sure.</p>