void cam_CaptureImageAvailable(object sender, Microsoft.Devices.ContentReadyEventArgs e) { try { e.ImageStream.Seek(0, SeekOrigin.Begin); MemoryStream ms1 = new MemoryStream(); e.ImageStream.CopyTo(ms1); // Write message to the UI thread. Deployment.Current.Dispatcher.BeginInvoke(delegate() { try { bool isPortait = (this.Orientation == PageOrientation.Portrait || this.Orientation == PageOrientation.PortraitDown || this.Orientation == PageOrientation.PortraitUp); PictureCache.Current.Save(ms1, Navigate.PictureFilename, Navigate.PictureFoodId, isPortait); Navigate.BackFromOther(); } catch (Exception ex) { LittleWatson.ReportException(ex); } finally { ms1.Dispose(); } }); } catch (Exception ex) { LittleWatson.ReportException(ex); } finally { // Close image stream e.ImageStream.Close(); } }
private void Submit_Click(object sender, EventArgs e) { try { (DataContext as LocalizationVM).Submit(); MessageBox.Show(AppResources.Localization_ThankYou); Navigate.BackFromOther(); } catch (Exception ex) { LittleWatson.ReportException(ex); } }
private void BuyNowTap(object sender, System.Windows.Input.GestureEventArgs e) { try { if (sale != null) { Navigate.StartBuyProduct(sale.productId); } else { Navigate.StartBuyPremium(); } Navigate.BackFromOther(); } catch (Exception ex) { LittleWatson.ReportException(ex); } }