diff --git a/Borepin/Borepin.UWP/Package.appxmanifest b/Borepin/Borepin.UWP/Package.appxmanifest index 837242f..f509582 100644 --- a/Borepin/Borepin.UWP/Package.appxmanifest +++ b/Borepin/Borepin.UWP/Package.appxmanifest @@ -53,5 +53,7 @@ + + \ No newline at end of file diff --git a/Borepin/Borepin/App.xaml.cs b/Borepin/Borepin/App.xaml.cs index 400aa87..0ef9f00 100644 --- a/Borepin/Borepin/App.xaml.cs +++ b/Borepin/Borepin/App.xaml.cs @@ -12,6 +12,7 @@ using Borepin.PageModel.AddServerProcess; using System; using Borepin.Service.Storage; using NLog; +using Borepin.Service.ErrorMessage; namespace Borepin { @@ -69,6 +70,7 @@ namespace Borepin #region Register Service containerRegistry.RegisterSingleton(); + containerRegistry.RegisterSingleton(); // NEED PLATFORM SPECIFIC SERVICE // IPreferenceStorageService diff --git a/Borepin/Borepin/Base/ConnectionModelBase.cs b/Borepin/Borepin/Base/ConnectionModelBase.cs index aed8945..de1759a 100644 --- a/Borepin/Borepin/Base/ConnectionModelBase.cs +++ b/Borepin/Borepin/Base/ConnectionModelBase.cs @@ -42,11 +42,9 @@ namespace Borepin.Base { await LoadAPIData().ConfigureAwait(false); } - catch + catch(Exception exception) { - IsConnected = false; - await _API.Disconnect().ConfigureAwait(false); - _API.UnbindEventHandler(); + Log.Warn("Load API Data failed", exception); } break; case ConnectionStatusChanged.ConnectionLoss: @@ -101,10 +99,7 @@ namespace Borepin.Base } catch(Exception exception) { - IsConnected = false; - await _API.Disconnect().ConfigureAwait(false); - _API.UnbindEventHandler(); - Log.Error("LoadAPIData failed", exception); + Log.Warn("Load API Data failed", exception); } } } diff --git a/Borepin/Borepin/Base/ErrorMessages.cs b/Borepin/Borepin/Base/ErrorMessages.cs new file mode 100644 index 0000000..c53a915 --- /dev/null +++ b/Borepin/Borepin/Base/ErrorMessages.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Borepin.Base +{ + public static class ErrorMessages + { + + } +} diff --git a/Borepin/Borepin/Converter/AllTrueBoolConverter.cs b/Borepin/Borepin/Converter/AllTrueBoolConverter.cs new file mode 100644 index 0000000..0cfaae5 --- /dev/null +++ b/Borepin/Borepin/Converter/AllTrueBoolConverter.cs @@ -0,0 +1,35 @@ +using System; +using System.Globalization; +using Xamarin.Forms; + +namespace Borepin.Converter +{ + public class AllTrueBoolConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values == null || !targetType.IsAssignableFrom(typeof(bool))) + { + return false; + } + + foreach (var value in values) + { + if (!(value is bool b)) + { + return false; + } + else if (!b) + { + return false; + } + } + return true; + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotSupportedException(); + } + } +} diff --git a/Borepin/Borepin/Page/AddUserPage.xaml b/Borepin/Borepin/Page/AddUserPage.xaml index 9cdceb5..3ec8089 100644 --- a/Borepin/Borepin/Page/AddUserPage.xaml +++ b/Borepin/Borepin/Page/AddUserPage.xaml @@ -3,29 +3,30 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Borepin.Page.AddUserPage" xmlns:converters="clr-namespace:Borepin.Converter" - xmlns:resource_text="clr-namespace:Borepin.Resources.Text" + xmlns:resource_text="clr-namespace:Borepin.Resources.Text" + xmlns:views="clr-namespace:Borepin.View" Title="{x:Static resource_text:TextResource.TITLE_AddUser}"> + - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/Borepin/Borepin/Page/MachinePage.xaml b/Borepin/Borepin/Page/MachinePage.xaml index 3a0576f..99ebf23 100644 --- a/Borepin/Borepin/Page/MachinePage.xaml +++ b/Borepin/Borepin/Page/MachinePage.xaml @@ -3,51 +3,61 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="Borepin.Page.MachinePage" xmlns:converters="clr-namespace:Borepin.Converter" - xmlns:resource_text="clr-namespace:Borepin.Resources.Text" + xmlns:resource_text="clr-namespace:Borepin.Resources.Text" + xmlns:views="clr-namespace:Borepin.View" Title="{x:Static resource_text:TextResource.TITLE_Machine}"> - - + + - + + + - - - + + + + + + + + +