override async public void ViewDidAppear(bool animated) { this.TabBarController.SelectedIndex = 1; if (ParentViewController != null) { CustomOverlayView customOverlay = new CustomOverlayView(); var scanner = new ZXing.Mobile.MobileBarcodeScanner(this); customOverlay.ButtonCancel.TouchUpInside += delegate { Console.WriteLine("cancelpresssed"); this.NavigationController.TabBarController.SelectedIndex = 0; }; //Tell our scanner to use our custom overlay scanner.UseCustomOverlay = true; //We can customize the top and bottom text of the default overlay scanner.TopText = "Hold camera up to barcode to scan"; scanner.BottomText = "Barcode will automatically scan"; //Start scanning var result = await scanner.Scan(true); HandleScanResult(result); } }
override async public void ViewDidAppear (bool animated) { base.ViewDidAppear (animated); if (ParentViewController != null) { CustomOverlayView customOverlay = new CustomOverlayView(); var scanner = new ZXing.Mobile.MobileBarcodeScanner (this); customOverlay.ButtonCancel.TouchUpInside += delegate { Console.WriteLine("cancelpresssed"); this.TabBarController.SelectedIndex = 1; }; //Tell our scanner to use our custom overlay scanner.UseCustomOverlay = true; //We can customize the top and bottom text of the default overlay scanner.TopText = "Hold camera up to barcode to scan"; scanner.BottomText = "Barcode will automatically scan"; //Start scanning var result = await scanner.Scan (true); HandleScanResult (result); } }