Added: MachineList Connect Message

This commit is contained in:
TheJoKlLa 2021-09-19 21:33:42 +02:00
parent 78360a2d4c
commit ec482af4bc
3 changed files with 16 additions and 5 deletions

View File

@ -18,7 +18,7 @@
<ActivityIndicator IsRunning="{Binding IsBusy}"></ActivityIndicator>
</StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<ListView ItemsSource="{Binding MachineListItemViewModel_List}">
<ListView ItemsSource="{Binding MachineListItemViewModel_List}" IsVisible="{Binding IsConnected}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
@ -27,6 +27,7 @@
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
<Label Text="Please connect to Server" IsVisible="{Binding IsConnected, Converter={StaticResource InvertBoolConverter}}"></Label>
</StackLayout>
</StackLayout>
</ContentPage.Content>

View File

@ -4,6 +4,7 @@ using Borepin.Service.Connections;
using Prism.Commands;
using Prism.Mvvm;
using Prism.Navigation;
using System;
using System.Threading.Tasks;
using System.Windows.Input;
@ -28,7 +29,7 @@ namespace Borepin.PageModel.AddServerProcess
private void LoadData()
{
}
private string _Username;
@ -60,7 +61,15 @@ namespace Borepin.PageModel.AddServerProcess
await _BFFHService.Authenticate(connection_update, Password).ConfigureAwait(false);
await _ConnectionService.AddConnection(_BFFHService.ActiveConnection);
try
{
await _ConnectionService.AddConnection(_BFFHService.ActiveConnection);
}
catch (ArgumentException)
{
}
await _ConnectionService.LogConnect(_BFFHService.ActiveConnection);
var result = await _NavigationService.NavigateAsync("/MainPage/NavigationPage/MachineListPage");
@ -70,4 +79,5 @@ namespace Borepin.PageModel.AddServerProcess
System.Diagnostics.Debugger.Break();
}
}
}
}
}

View File

@ -13,7 +13,7 @@ namespace Borepin.PageModel
public class MachinePageModel : PageModelBase
{
#region Private Properties
private IBFFHService _BFFHService;
private readonly IBFFHService _BFFHService;
private string _Name;
private Machine _Machine;
#endregion