Add Windows support for QR code scanning (#207)

* UWP: Add support for QR code scanning

Signed-off-by: Alistair Francis <alistair@alistair23.me>

* Pages: ScanPage: Set the close button on Windows

A previous commit mistakenly removed the close button, even though the
scan page is not modal. This means there is no way to navigate away if
running on Windows 10. Revert this change to add a back button.

We need to use a modal page here as we need it to pop up over the entire
view.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
This commit is contained in:
Alistair Francis 2017-12-13 05:57:49 -08:00 committed by Kyle Spearrin
parent b4e7fd6fa8
commit 177b48ac90
3 changed files with 6 additions and 1 deletions

View file

@ -68,7 +68,7 @@ namespace Bit.App.Pages
Children = { _zxing, _overlay }
};
if(Device.RuntimePlatform == Device.iOS)
if(Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.Windows)
{
ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Close));
}

View file

@ -35,6 +35,8 @@ namespace Bit.UWP
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingScannerViewRenderer.Init();
var rootFrame = Window.Current.Content as Frame;
if(rootFrame == null)
{

View file

@ -186,6 +186,9 @@
<PackageReference Include="XLabs.IoC.SimpleInjector">
<Version>2.0.5782</Version>
</PackageReference>
<PackageReference Include="ZXing.Net.Mobile.Forms">
<Version>2.3.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\App\App.csproj">