From ba51b4fdbe3d6862a4cde866f2118c91cca35ac8 Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Mon, 16 Mar 2020 00:09:31 +0800 Subject: [PATCH] UWP: make initialization more similar to other platforms --- ZXing.Net.Mobile.Forms/Platform.uwp.cs | 13 +++++++++++++ readme.md | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 ZXing.Net.Mobile.Forms/Platform.uwp.cs diff --git a/ZXing.Net.Mobile.Forms/Platform.uwp.cs b/ZXing.Net.Mobile.Forms/Platform.uwp.cs new file mode 100644 index 0000000..545491f --- /dev/null +++ b/ZXing.Net.Mobile.Forms/Platform.uwp.cs @@ -0,0 +1,13 @@ +using System; + +namespace ZXing.Net.Mobile.Forms.WindowsUniversal +{ + public static class Platform + { + public static void Init() + { + ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingScannerViewRenderer.Init(); + ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingBarcodeImageViewRenderer.Init(); + } + } +} diff --git a/readme.md b/readme.md index 7a085f8..0a2f120 100644 --- a/readme.md +++ b/readme.md @@ -72,7 +72,7 @@ ZXing.Net.Mobile.Forms.iOS.Platform.Init(); In your main `Page`'s constructor, you should add: ```csharp -ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingScannerViewRenderer.Init(); +ZXing.Net.Mobile.Forms.WindowsUniversal.Platform.Init(); ``` If you notice that finishing scanning or pressing the back button is causing your Page to jump back further than you'd like, or if you're having trouble updating the UI of a Page after scanning is completed, you may need to set `NavigationCacheMode="Enabled"` within your Page's XAML `` element.