mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-13 07:11:56 +01:00
Added: Connection failed Message
This commit is contained in:
parent
aab362b2c0
commit
aba074c263
@ -1,16 +1,27 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="Borepin.Page.AddServerProcess.HostSelectPage">
|
x:Class="Borepin.Page.AddServerProcess.HostSelectPage"
|
||||||
|
xmlns:converters="clr-namespace:Borepin.Converter">
|
||||||
<NavigationPage.TitleView>
|
<NavigationPage.TitleView>
|
||||||
<Label Text="FabAccess" Style="{StaticResource Style_Label_Header}"/>
|
<Label Text="FabAccess" HorizontalOptions="End" Margin="0, 0, 10, 0" VerticalOptions="CenterAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
|
||||||
</NavigationPage.TitleView>
|
</NavigationPage.TitleView>
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<StackLayout Padding="20">
|
<StackLayout Padding="20">
|
||||||
|
<StackLayout IsVisible="{Binding IsBusy}">
|
||||||
|
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
|
||||||
<Label Text="Host" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
<Label Text="Host" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
||||||
<Entry Text="{Binding Host}"/>
|
<Entry Text="{Binding Host}"/>
|
||||||
<Button Text="Detect local host" Command="{Binding DetectHostCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
<Button Text="Demo Host Address" Command="{Binding DetectHostCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||||
<Button Text="Select Host" Command="{Binding UseHostCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
<Button Text="Select Host" Command="{Binding UseHostCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
</StackLayout>
|
||||||
</ContentPage.Content>
|
</ContentPage.Content>
|
||||||
</ContentPage>
|
</ContentPage>
|
@ -1,12 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="Borepin.Page.AddServerProcess.LoginChoosePage">
|
x:Class="Borepin.Page.AddServerProcess.LoginChoosePage"
|
||||||
|
xmlns:converters="clr-namespace:Borepin.Converter">
|
||||||
<NavigationPage.TitleView>
|
<NavigationPage.TitleView>
|
||||||
<Label Text="FabAccess" FontAttributes="Bold" HorizontalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" VerticalOptions="FillAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
|
<Label Text="FabAccess" HorizontalOptions="End" Margin="0, 0, 10, 0" VerticalOptions="CenterAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
|
||||||
</NavigationPage.TitleView>
|
</NavigationPage.TitleView>
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<StackLayout Padding="20">
|
<StackLayout Padding="20">
|
||||||
|
<StackLayout IsVisible="{Binding IsBusy}">
|
||||||
|
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
|
||||||
<Label Text="Sign In:" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
<Label Text="Sign In:" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
||||||
<Button Text="Login with Password" Command="{Binding LoginPasswordCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
<Button Text="Login with Password" Command="{Binding LoginPasswordCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||||
<Label Text="or" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
<Label Text="or" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
||||||
@ -15,5 +25,6 @@
|
|||||||
<Label Text="Sign Up:" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
<Label Text="Sign Up:" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
||||||
<Button Text="Register" Style="{StaticResource Style_Button_Primary}" IsEnabled="False"/>
|
<Button Text="Register" Style="{StaticResource Style_Button_Primary}" IsEnabled="False"/>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
</StackLayout>
|
||||||
</ContentPage.Content>
|
</ContentPage.Content>
|
||||||
</ContentPage>
|
</ContentPage>
|
@ -1,12 +1,22 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
|
||||||
x:Class="Borepin.Page.AddServerProcess.LoginPasswordPage">
|
x:Class="Borepin.Page.AddServerProcess.LoginPasswordPage"
|
||||||
|
xmlns:converters="clr-namespace:Borepin.Converter">
|
||||||
<NavigationPage.TitleView>
|
<NavigationPage.TitleView>
|
||||||
<Label Text="FabAccess" FontAttributes="Bold" HorizontalOptions="FillAndExpand" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" VerticalOptions="FillAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
|
<Label Text="FabAccess" HorizontalOptions="End" Margin="0, 0, 10, 0" VerticalOptions="CenterAndExpand" FontSize="Medium" TextColor="{StaticResource FirstColor}"/>
|
||||||
</NavigationPage.TitleView>
|
</NavigationPage.TitleView>
|
||||||
|
<ContentPage.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<converters:InvertBoolConverter x:Key="InvertBoolConverter"/>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ContentPage.Resources>
|
||||||
<ContentPage.Content>
|
<ContentPage.Content>
|
||||||
<StackLayout Padding="20">
|
<StackLayout Padding="20">
|
||||||
|
<StackLayout IsVisible="{Binding IsBusy}">
|
||||||
|
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
|
||||||
|
</StackLayout>
|
||||||
|
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
|
||||||
<Label Text="Username" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
<Label Text="Username" Style="{StaticResource Style_Label_Property_Title}"></Label>
|
||||||
<Entry Text="{Binding Username}"/>
|
<Entry Text="{Binding Username}"/>
|
||||||
|
|
||||||
@ -15,5 +25,6 @@
|
|||||||
|
|
||||||
<Button Text="Login" Command="{Binding AuthenticateCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
<Button Text="Login" Command="{Binding AuthenticateCommand}" Style="{StaticResource Style_Button_Primary}"/>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
|
</StackLayout>
|
||||||
</ContentPage.Content>
|
</ContentPage.Content>
|
||||||
</ContentPage>
|
</ContentPage>
|
@ -1,6 +1,7 @@
|
|||||||
using Borepin.Service.BFFH;
|
using Borepin.Base;
|
||||||
using Prism.Mvvm;
|
using Borepin.Service.BFFH;
|
||||||
using Prism.Navigation;
|
using Prism.Navigation;
|
||||||
|
using Prism.Services;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -9,27 +10,36 @@ using Xamarin.Forms;
|
|||||||
|
|
||||||
namespace Borepin.PageModel.AddServerProcess
|
namespace Borepin.PageModel.AddServerProcess
|
||||||
{
|
{
|
||||||
public class HostSelectPageModel : BindableBase
|
public class HostSelectPageModel : PageModelBase
|
||||||
{
|
{
|
||||||
private readonly INavigationService _NavigationService;
|
#region Private Properties
|
||||||
private readonly IBFFHService _BFFHService;
|
private readonly IBFFHService _BFFHService;
|
||||||
|
private readonly IPageDialogService _PageDialogService;
|
||||||
|
#endregion
|
||||||
|
|
||||||
public HostSelectPageModel(INavigationService navigationService, IBFFHService bffhService)
|
#region Constructors
|
||||||
|
public HostSelectPageModel(INavigationService navigationService, IBFFHService bffhService, IPageDialogService pageDialogService) : base(navigationService)
|
||||||
{
|
{
|
||||||
_NavigationService = navigationService;
|
|
||||||
_BFFHService = bffhService;
|
_BFFHService = bffhService;
|
||||||
|
_PageDialogService = pageDialogService;
|
||||||
|
|
||||||
UseHostCommand = new Command(UseHostCommandExecuted);
|
UseHostCommand = new Command(UseHostCommandExecuted);
|
||||||
DetectHostCommand = new Command(DetectHostCommandExecuted);
|
DetectHostCommand = new Command(DetectHostCommandExecuted);
|
||||||
|
|
||||||
Task.Run(LoadData);
|
Task.Run(LoadData);
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
private void LoadData()
|
#region LoadData
|
||||||
|
public override Task LoadData()
|
||||||
{
|
{
|
||||||
|
IsBusy = false;
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
private string _Host;
|
private string _Host;
|
||||||
public string Host
|
public string Host
|
||||||
{
|
{
|
||||||
@ -43,7 +53,9 @@ namespace Borepin.PageModel.AddServerProcess
|
|||||||
get => _KnownHost_List;
|
get => _KnownHost_List;
|
||||||
set => SetProperty(ref _KnownHost_List, value);
|
set => SetProperty(ref _KnownHost_List, value);
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Commands
|
||||||
private ICommand _UseHostCommand;
|
private ICommand _UseHostCommand;
|
||||||
public ICommand UseHostCommand
|
public ICommand UseHostCommand
|
||||||
{
|
{
|
||||||
@ -53,6 +65,8 @@ namespace Borepin.PageModel.AddServerProcess
|
|||||||
|
|
||||||
private async void UseHostCommandExecuted()
|
private async void UseHostCommandExecuted()
|
||||||
{
|
{
|
||||||
|
IsBusy = true;
|
||||||
|
|
||||||
UriBuilder builder = new UriBuilder(Host);
|
UriBuilder builder = new UriBuilder(Host);
|
||||||
if(builder.Port == 80)
|
if(builder.Port == 80)
|
||||||
{
|
{
|
||||||
@ -68,9 +82,18 @@ namespace Borepin.PageModel.AddServerProcess
|
|||||||
{
|
{
|
||||||
await _BFFHService.Disconnect();
|
await _BFFHService.Disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
await _BFFHService.Connect(connection);
|
await _BFFHService.Connect(connection);
|
||||||
|
}
|
||||||
|
catch (Capnp.Rpc.RpcException exception) when (exception.Message == "TcpRpcClient is unable to connect")
|
||||||
|
{
|
||||||
|
await _PageDialogService.DisplayAlertAsync("Connection failed", "Unable to connect to server.", "Ok");
|
||||||
|
|
||||||
|
IsBusy = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
INavigationResult result = await _NavigationService.NavigateAsync("AddServerProcess_LoginChoosePage");
|
INavigationResult result = await _NavigationService.NavigateAsync("AddServerProcess_LoginChoosePage");
|
||||||
if(!result.Success)
|
if(!result.Success)
|
||||||
@ -91,5 +114,18 @@ namespace Borepin.PageModel.AddServerProcess
|
|||||||
// Use Demo Host
|
// Use Demo Host
|
||||||
Host = "127.0.0.1:59661";
|
Host = "127.0.0.1:59661";
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region INavigationAware
|
||||||
|
public override void OnNavigatedFrom(INavigationParameters parameters)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnNavigatedTo(INavigationParameters parameters)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,30 @@
|
|||||||
using Prism.Mvvm;
|
using Borepin.Base;
|
||||||
using Prism.Navigation;
|
using Prism.Navigation;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
|
|
||||||
namespace Borepin.PageModel.AddServerProcess
|
namespace Borepin.PageModel.AddServerProcess
|
||||||
{
|
{
|
||||||
public class LoginChoosePageModel : BindableBase
|
public class LoginChoosePageModel : PageModelBase
|
||||||
{
|
{
|
||||||
private INavigationService _NavigationService;
|
#region Contructors
|
||||||
|
public LoginChoosePageModel(INavigationService navigationService) : base(navigationService)
|
||||||
public LoginChoosePageModel(INavigationService navigationService)
|
|
||||||
{
|
{
|
||||||
_NavigationService = navigationService;
|
|
||||||
|
|
||||||
LoginPasswordCommand = new Command(LoginPasswordCommandExecuted);
|
LoginPasswordCommand = new Command(LoginPasswordCommandExecuted);
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region LoadData
|
||||||
|
public override Task LoadData()
|
||||||
|
{
|
||||||
|
IsBusy = false;
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Commands
|
||||||
private ICommand _LoginPasswordCommand;
|
private ICommand _LoginPasswordCommand;
|
||||||
public ICommand LoginPasswordCommand
|
public ICommand LoginPasswordCommand
|
||||||
{
|
{
|
||||||
@ -31,5 +40,18 @@ namespace Borepin.PageModel.AddServerProcess
|
|||||||
System.Diagnostics.Debugger.Break();
|
System.Diagnostics.Debugger.Break();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region INavigationAware
|
||||||
|
public override void OnNavigatedFrom(INavigationParameters parameters)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnNavigatedTo(INavigationParameters parameters)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
using Borepin.Model;
|
using Borepin.Base;
|
||||||
|
using Borepin.Model;
|
||||||
using Borepin.Service.BFFH;
|
using Borepin.Service.BFFH;
|
||||||
using Borepin.Service.Connections;
|
using Borepin.Service.Connections;
|
||||||
using Prism.Commands;
|
using Prism.Commands;
|
||||||
using Prism.Mvvm;
|
|
||||||
using Prism.Navigation;
|
using Prism.Navigation;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@ -10,15 +10,16 @@ using System.Windows.Input;
|
|||||||
|
|
||||||
namespace Borepin.PageModel.AddServerProcess
|
namespace Borepin.PageModel.AddServerProcess
|
||||||
{
|
{
|
||||||
public class LoginPasswordPageModel : BindableBase
|
public class LoginPasswordPageModel : PageModelBase
|
||||||
{
|
{
|
||||||
private readonly INavigationService _NavigationService;
|
#region Private Properties
|
||||||
private readonly IBFFHService _BFFHService;
|
private readonly IBFFHService _BFFHService;
|
||||||
private readonly IConnectionService _ConnectionService;
|
private readonly IConnectionService _ConnectionService;
|
||||||
|
#endregion
|
||||||
|
|
||||||
public LoginPasswordPageModel(INavigationService navigationService, IBFFHService bffhService, IConnectionService connectionService)
|
#region Constructors
|
||||||
|
public LoginPasswordPageModel(INavigationService navigationService, IBFFHService bffhService, IConnectionService connectionService) : base(navigationService)
|
||||||
{
|
{
|
||||||
_NavigationService = navigationService;
|
|
||||||
_BFFHService = bffhService;
|
_BFFHService = bffhService;
|
||||||
_ConnectionService = connectionService;
|
_ConnectionService = connectionService;
|
||||||
|
|
||||||
@ -26,12 +27,18 @@ namespace Borepin.PageModel.AddServerProcess
|
|||||||
|
|
||||||
Task.Run(LoadData);
|
Task.Run(LoadData);
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
private void LoadData()
|
#region LoadData
|
||||||
|
public override Task LoadData()
|
||||||
{
|
{
|
||||||
|
IsBusy = false;
|
||||||
|
|
||||||
|
return Task.CompletedTask;
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Properties
|
||||||
private string _Username;
|
private string _Username;
|
||||||
public string Username
|
public string Username
|
||||||
{
|
{
|
||||||
@ -45,7 +52,9 @@ namespace Borepin.PageModel.AddServerProcess
|
|||||||
get => _Password;
|
get => _Password;
|
||||||
set => SetProperty(ref _Password, value);
|
set => SetProperty(ref _Password, value);
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Commands
|
||||||
private ICommand _AuthenticateCommand;
|
private ICommand _AuthenticateCommand;
|
||||||
public ICommand AuthenticateCommand
|
public ICommand AuthenticateCommand
|
||||||
{
|
{
|
||||||
@ -79,5 +88,18 @@ namespace Borepin.PageModel.AddServerProcess
|
|||||||
System.Diagnostics.Debugger.Break();
|
System.Diagnostics.Debugger.Break();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region INavigationAware
|
||||||
|
public override void OnNavigatedFrom(INavigationParameters parameters)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnNavigatedTo(INavigationParameters parameters)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,6 +5,7 @@ using Borepin.Service.Connections;
|
|||||||
using Borepin.Service.Credentials;
|
using Borepin.Service.Credentials;
|
||||||
using Prism.Commands;
|
using Prism.Commands;
|
||||||
using Prism.Navigation;
|
using Prism.Navigation;
|
||||||
|
using Prism.Services;
|
||||||
using Prism.Services.Dialogs;
|
using Prism.Services.Dialogs;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
@ -18,16 +19,18 @@ namespace Borepin.PageModel
|
|||||||
private readonly IConnectionService _ConnectionService;
|
private readonly IConnectionService _ConnectionService;
|
||||||
private readonly IBFFHService _BFFHService;
|
private readonly IBFFHService _BFFHService;
|
||||||
private readonly ICredentialService _CredentialService;
|
private readonly ICredentialService _CredentialService;
|
||||||
|
private readonly IPageDialogService _PageDialogService;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
public ServerPageModel(INavigationService navigationService, IDialogService dialogService, IConnectionService connectionService, IBFFHService bffhService, ICredentialService credentialService) : base(navigationService)
|
public ServerPageModel(INavigationService navigationService, IDialogService dialogService, IConnectionService connectionService, IBFFHService bffhService, ICredentialService credentialService, IPageDialogService pageDialogService) : base(navigationService)
|
||||||
{
|
{
|
||||||
_DialogService = dialogService;
|
_DialogService = dialogService;
|
||||||
|
|
||||||
_ConnectionService = connectionService;
|
_ConnectionService = connectionService;
|
||||||
_BFFHService = bffhService;
|
_BFFHService = bffhService;
|
||||||
_CredentialService = credentialService;
|
_CredentialService = credentialService;
|
||||||
|
_PageDialogService = pageDialogService;
|
||||||
|
|
||||||
ConnectCommand = new DelegateCommand(async () => await ConnectCommandExecuted());
|
ConnectCommand = new DelegateCommand(async () => await ConnectCommandExecuted());
|
||||||
DeleteCommand = new DelegateCommand(DeleteCommandExecuted);
|
DeleteCommand = new DelegateCommand(DeleteCommandExecuted);
|
||||||
@ -76,8 +79,18 @@ namespace Borepin.PageModel
|
|||||||
IsConnected = false;
|
IsConnected = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
await _BFFHService.Connect(Connection_Item);
|
await _BFFHService.Connect(Connection_Item);
|
||||||
|
}
|
||||||
|
catch(Capnp.Rpc.RpcException exception) when (exception.Message == "TcpRpcClient is unable to connect")
|
||||||
|
{
|
||||||
|
await _PageDialogService.DisplayAlertAsync("Connection failed", "Unable to connect to server.", "Ok");
|
||||||
|
|
||||||
|
IsBusy = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
await _BFFHService.Authenticate();
|
await _BFFHService.Authenticate();
|
||||||
|
|
||||||
IsConnected = true;
|
IsConnected = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user