mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 23:01:52 +01:00
Added: QR Code in Page
This commit is contained in:
parent
d9af7a3730
commit
a4b6aa9da1
@ -47,7 +47,8 @@ namespace Borepin
|
|||||||
containerRegistry.RegisterForNavigation<MachineListPage, MachineListPageModel>();
|
containerRegistry.RegisterForNavigation<MachineListPage, MachineListPageModel>();
|
||||||
containerRegistry.RegisterForNavigation<ServerListPage, ServerListPageModel>();
|
containerRegistry.RegisterForNavigation<ServerListPage, ServerListPageModel>();
|
||||||
containerRegistry.RegisterForNavigation<ServerPage, ServerPageModel>();
|
containerRegistry.RegisterForNavigation<ServerPage, ServerPageModel>();
|
||||||
containerRegistry.RegisterForNavigation<ScanPage, ScanPageModel>();
|
containerRegistry.RegisterForNavigation<ScanPage, ScanPageModel>("ScanPage");
|
||||||
|
containerRegistry.RegisterForNavigation<ScanPage, ScanURNPageModel>("ScanURNPage");
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Register Sequence Navigation
|
#region Register Sequence Navigation
|
||||||
|
@ -9,7 +9,6 @@ using Borepin.Base;
|
|||||||
using FabAccessAPI.Schema;
|
using FabAccessAPI.Schema;
|
||||||
using Prism.Services.Dialogs;
|
using Prism.Services.Dialogs;
|
||||||
using Prism.Services;
|
using Prism.Services;
|
||||||
using Prism.AppModel;
|
|
||||||
using static FabAccessAPI.Schema.Machine;
|
using static FabAccessAPI.Schema.Machine;
|
||||||
using System;
|
using System;
|
||||||
using NaturalSort.Extension;
|
using NaturalSort.Extension;
|
||||||
@ -17,7 +16,7 @@ using System.Linq;
|
|||||||
|
|
||||||
namespace Borepin.PageModel
|
namespace Borepin.PageModel
|
||||||
{
|
{
|
||||||
public class MachineListPageModel : ConnectionModelBase, IPageLifecycleAware
|
public class MachineListPageModel : ConnectionModelBase
|
||||||
{
|
{
|
||||||
#region Private Fields
|
#region Private Fields
|
||||||
private readonly IDialogService _DialogService;
|
private readonly IDialogService _DialogService;
|
||||||
@ -142,60 +141,7 @@ namespace Borepin.PageModel
|
|||||||
{
|
{
|
||||||
IsBusy = true;
|
IsBusy = true;
|
||||||
|
|
||||||
NavigationParameters parameters = new NavigationParameters()
|
await _NavigationService.NavigateAsync("ScanURNPage").ConfigureAwait(false);
|
||||||
{
|
|
||||||
{"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()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@ -209,24 +155,6 @@ namespace Borepin.PageModel
|
|||||||
{
|
{
|
||||||
IsBusy = true;
|
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);
|
await LoadData().ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
x
Reference in New Issue
Block a user