private async Task OnCreate() { var result = await this.signatureService.Request(); if (result.Cancelled) { await App.Current.MainPage.DisplayAlert(null, "Canceled Signature", "Close"); } else { //Grab the configured image type var imageType = signatureService.GetConfiguration().ImageType; var fileName = String.Format(FILE_FORMAT, DateTime.Now, imageType.ToString().ToLower()); long fileSize; IFile file = await folder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting); using (var image = result.GetStream()) { using (System.IO.Stream stream = await file.OpenAsync(FileAccess.ReadAndWrite)) { using (MemoryStream ms = new MemoryStream()) { image.CopyTo(ms); byte[] buffer = ms.ToArray(); stream.Write(buffer, 0, buffer.Length); fileSize = buffer.Length; await stream.FlushAsync(); } } } this.List.Add(new Signature { FilePath = file.Path, FileName = file.Name, FileSize = fileSize }); await App.Current.MainPage.DisplayAlert(null, String.Format("Draw Points: {0}", result.Points.Count()), "Close"); this.NoData = !this.List.Any(); } }