title: how to make ZxingScanner start scanning?
body: <p>I am trying to implement barcode scanning in my Xamarin form, but no success.<br />
  I am able to get the camera working, but I don't see the red line on the screen and it simply refuses to scan anything</p>
  <p>I tried <a href="https://stackoverflow.com/questions/67934028/zxing-zxingscannerpage-torch-flashlight-not-working-xamarin-forms">this answer</a>. I can see thru my camera, but no red line appears. But I can put the torch on and off</p>
  <p><strong>XAML code:</strong></p>
  <pre><code>&lt;Button  BackgroundColor=&quot;Chocolate&quot; Clicked=&quot;Button_Clicked&quot;/&gt;
  &lt;zxing:ZXingScannerView 
      x:Name=&quot;_scanView&quot; 
      OnScanResult=&quot;Handle_OnScanResult&quot; 
      IsScanning=&quot;true&quot; 
      IsAnalyzing=&quot;true&quot;
      WidthRequest=&quot;200&quot; 
      HeightRequest=&quot;200&quot; /&gt;
  </code></pre>
  <p><strong>C# Code:</strong></p>
  <pre><code>private void Button_Clicked(object sender, EventArgs e)
  {
      _scanView.ToggleTorch();
  }
  
  private void Handle_OnScanResult(ZXing.Result result)
  {
      ChassisEntry.Text = result.Text;
  }
  
  
  // this is in the constructor of the page
  MobileBarcodeScanningOptions options = new ZXing.Mobile.MobileBarcodeScanningOptions()
  {
      TryHarder = true,
      PossibleFormats = new List&lt;ZXing.BarcodeFormat&gt;() { ZXing.BarcodeFormat.All_1D }
  };
  _scanView.Options = options;
  </code></pre>
  <p>What am I missing ?</p>
  <p><strong>EDIT</strong></p>
  <p>I have this in my <code>MainActivity.cs</code></p>
  <pre><code>protected override void OnCreate(Bundle savedInstanceState)
  {
      base.OnCreate(savedInstanceState);
  
      Xamarin.Essentials.Platform.Init(this, savedInstanceState);
      global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
      ZXing.Net.Mobile.Forms.Android.Platform.Init();
      LoadApplication(new App());
  }
  
  public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
  {
     Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
     ZXing.Net.Mobile.Forms.Android.PermissionsHandler.OnRequestPermissionsResult(requestCode, permissions, grantResults);
  
     base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
  }
  </code></pre>
  <p><strong>Addition to the answer</strong></p>
  <p>@Rafeal 's answer is working for me, the only problem is that there is no red line on the scan view.<br />
  I found this <code>workaround</code> for that problem.<br />
  However, it is a workaround because I notice that the scan already happens if the barcode is anywhere in the view.<br />
  Though this might not appear a problem, in my case I have paper forms with up to 20 barcodes on it, and when the user wants to aim at a particular barcode he might get the wrong one.</p>
  <p>So if anybody knows a better solution I would like to hear it.<br />
  I will make a separate question on SO about this problem.</p>
  <p>This is the workaround I am using now</p>
  <pre><code>  &lt;Grid VerticalOptions=&quot;FillAndExpand&quot; HorizontalOptions=&quot;FillAndExpand&quot;&gt;
                  &lt;zxing:ZXingScannerView
                      x:Name=&quot;_scanView&quot;
                      OnScanResult=&quot;Handle_OnScanResult&quot;
                      IsScanning=&quot;true&quot;
                      WidthRequest=&quot;200&quot;
                      HeightRequest=&quot;200&quot;/&gt;
  
  
                  &lt;zxing:ZXingDefaultOverlay
                      x:Name=&quot;scannerOverlay&quot;                                                       
                      BottomText=&quot;Place the red line over the barcode you'd like to scan.&quot;&gt;
  
                  &lt;/zxing:ZXingDefaultOverlay&gt;
              &lt;/Grid&gt;
  </code></pre>