I found a way to lock the screen in portrait mode. You can download it as a nuget and then use this code. Nuget is called: ZXing.Net.Mobile.
var result = await scanner.Scan(new MobileBarcodeScanningOptions
AutoRotate = false,
that will make it start and stay in portrait mode. My problem now is I want an option to scan in landscape if needed.