Skip to content

Commit

Permalink
Merge pull request #874 from knocte/uwpConsistentInit
Browse files Browse the repository at this point in the history
UWP: make initialization more similar to other platforms
  • Loading branch information
Redth authored Mar 16, 2020
2 parents 5ddfa0e + ba51b4f commit 5ac732a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions ZXing.Net.Mobile.Forms/Platform.uwp.cs
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,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 `<Page ... />` element.
Expand Down

0 comments on commit 5ac732a

Please sign in to comment.