From a4b6aa9da1ee6c57c77504d6e0832af34ae1d9f6 Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Wed, 20 Apr 2022 20:30:46 +0200 Subject: [PATCH] Added: QR Code in Page --- Borepin/Borepin/App.xaml.cs | 3 +- .../Borepin/PageModel/MachineListPageModel.cs | 76 +------------------ 2 files changed, 4 insertions(+), 75 deletions(-) diff --git a/Borepin/Borepin/App.xaml.cs b/Borepin/Borepin/App.xaml.cs index 28165b3..177c56b 100644 --- a/Borepin/Borepin/App.xaml.cs +++ b/Borepin/Borepin/App.xaml.cs @@ -47,7 +47,8 @@ namespace Borepin containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); - containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation("ScanPage"); + containerRegistry.RegisterForNavigation("ScanURNPage"); #endregion #region Register Sequence Navigation diff --git a/Borepin/Borepin/PageModel/MachineListPageModel.cs b/Borepin/Borepin/PageModel/MachineListPageModel.cs index 6422af9..79bdd5a 100644 --- a/Borepin/Borepin/PageModel/MachineListPageModel.cs +++ b/Borepin/Borepin/PageModel/MachineListPageModel.cs @@ -9,7 +9,6 @@ using Borepin.Base; using FabAccessAPI.Schema; using Prism.Services.Dialogs; using Prism.Services; -using Prism.AppModel; using static FabAccessAPI.Schema.Machine; using System; using NaturalSort.Extension; @@ -17,7 +16,7 @@ using System.Linq; namespace Borepin.PageModel { - public class MachineListPageModel : ConnectionModelBase, IPageLifecycleAware + public class MachineListPageModel : ConnectionModelBase { #region Private Fields private readonly IDialogService _DialogService; @@ -142,60 +141,7 @@ namespace Borepin.PageModel { IsBusy = true; - NavigationParameters parameters = new NavigationParameters() - { - {"intance", null }, - }; - - await _NavigationService.NavigateAsync("ScanPage", parameters).ConfigureAwait(false); - } - - public async void ScanCode_Result(string value) - { - if (! _BFFHService.IsConnected) - { - IsConnected = false; - IsBusy = false; - return; - } - - IMachineSystem machineInterface = (await _BFFHService.GetSession().ConfigureAwait(false)).MachineSystem; - - - MachineSystem.IInfoInterface infoInterface = await machineInterface.Info().ConfigureAwait(false); - - Machine machine = await infoInterface.GetMachineURN(value).ConfigureAwait(false); - - if(machine == null) - { - IsBusy = false; - return; - } - - _NextMachine = machine; - IsBusy = false; - } - #endregion - - #region IPageLifecycleAware - public async void OnAppearing() - { - if(_NextMachine != null) - { - NavigationParameters parameters = new NavigationParameters - { - { "id", _NextMachine.Id}, - }; - - _NextMachine = null; - - await _NavigationService.NavigateAsync("MachinePage", parameters).ConfigureAwait(false); - } - } - - public void OnDisappearing() - { - + await _NavigationService.NavigateAsync("ScanURNPage").ConfigureAwait(false); } #endregion @@ -209,24 +155,6 @@ namespace Borepin.PageModel { IsBusy = true; - if (parameters["result"] != null) - { - if (parameters["result"].Equals("scanned")) - { - string urn = (string)parameters["value"]; - ScanCode_Result(urn); - - NavigationParameters parameters2 = new NavigationParameters - { - { "id", _NextMachine.Id}, - }; - - _NextMachine = null; - - await _NavigationService.NavigateAsync("MachinePage", parameters2).ConfigureAwait(false); - } - } - await LoadData().ConfigureAwait(false); } #endregion