From 0a27854331a9268aacb773259e4fbca77fd76c32 Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Wed, 12 Jan 2022 01:27:00 +0100 Subject: [PATCH 01/10] Fixed: Connection Exception --- Borepin/Borepin/PageModel/ServerPageModel.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Borepin/Borepin/PageModel/ServerPageModel.cs b/Borepin/Borepin/PageModel/ServerPageModel.cs index f2f18eb..52b5947 100644 --- a/Borepin/Borepin/PageModel/ServerPageModel.cs +++ b/Borepin/Borepin/PageModel/ServerPageModel.cs @@ -78,6 +78,11 @@ namespace Borepin.PageModel { IsBusy = true; + if(_BFFHService.IsConnected) + { + await _BFFHService.Disconnect().ConfigureAwait(true); + } + try { await _BFFHService.Connect(Connection_Item).ConfigureAwait(true); From 2334cbc20d651aec0af5d3997f0cb5840327d762 Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Wed, 12 Jan 2022 02:24:34 +0100 Subject: [PATCH 02/10] Start adding Show Machines from User --- .../Converter/ListNotEmptyConverter.cs | 25 +++++++++++++++ Borepin/Borepin/Page/MachineListPage.xaml | 32 ++++++++++++------- .../Borepin/PageModel/MachineListPageModel.cs | 28 +++++++++++++--- 3 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 Borepin/Borepin/Converter/ListNotEmptyConverter.cs diff --git a/Borepin/Borepin/Converter/ListNotEmptyConverter.cs b/Borepin/Borepin/Converter/ListNotEmptyConverter.cs new file mode 100644 index 0000000..dc48d65 --- /dev/null +++ b/Borepin/Borepin/Converter/ListNotEmptyConverter.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections; +using System.Globalization; +using Xamarin.Forms; + +namespace Borepin.Converter +{ + public class ListNotEmptyConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if(value != null && value is IList) + { + ICollection collection = value as ICollection; + return collection.Count > 0; + } + return false; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotSupportedException(); + } + } +} diff --git a/Borepin/Borepin/Page/MachineListPage.xaml b/Borepin/Borepin/Page/MachineListPage.xaml index 8940f48..cdc8d2d 100644 --- a/Borepin/Borepin/Page/MachineListPage.xaml +++ b/Borepin/Borepin/Page/MachineListPage.xaml @@ -8,6 +8,7 @@ + @@ -24,17 +25,26 @@ Android="true"/> - - - - - - - - - - - +