diff --git a/Borepin/Borepin/App.xaml.cs b/Borepin/Borepin/App.xaml.cs index 58055cc..9c7347a 100644 --- a/Borepin/Borepin/App.xaml.cs +++ b/Borepin/Borepin/App.xaml.cs @@ -6,6 +6,7 @@ using Borepin.Dialog; using Borepin.DialogModel; using Borepin.Service.Connections; using Borepin.Service.BFFH; +using Borepin.Service.Credentials; namespace Borepin { @@ -49,7 +50,10 @@ namespace Borepin // Register Service IConnectionService connectionService = new ConnectionService(); containerRegistry.RegisterInstance(connectionService); - containerRegistry.RegisterInstance(new BFFHService(connectionService)); + ICredentialService credentialService = new CredentialService(); + containerRegistry.RegisterInstance(credentialService); + + containerRegistry.RegisterInstance(new BFFHService(connectionService, credentialService)); containerRegistry.RegisterInstance(new ConnectionService()); } } diff --git a/Borepin/Borepin/Converter/InvertBoolConverter.cs b/Borepin/Borepin/Converter/InvertBoolConverter.cs new file mode 100644 index 0000000..a107c22 --- /dev/null +++ b/Borepin/Borepin/Converter/InvertBoolConverter.cs @@ -0,0 +1,19 @@ +using System; +using System.Globalization; +using Xamarin.Forms; + +namespace Borepin.Converter +{ + public class InvertBoolConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + return !(bool)value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + return !(bool)value; + } + } +} diff --git a/Borepin/Borepin/Converter/IsNotNullBoolConverter.cs b/Borepin/Borepin/Converter/IsNotNullBoolConverter.cs index 8a1b71b..b062587 100644 --- a/Borepin/Borepin/Converter/IsNotNullBoolConverter.cs +++ b/Borepin/Borepin/Converter/IsNotNullBoolConverter.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using System.Globalization; -using System.Text; -using Borepin.Model; using Xamarin.Forms; namespace Borepin.Converter @@ -11,7 +8,7 @@ namespace Borepin.Converter { public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { - return value != null ? true : false; + return value != null; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) diff --git a/Borepin/Borepin/DialogModel/ConfirmDialogModel.cs b/Borepin/Borepin/DialogModel/ConfirmDialogModel.cs index 70500d0..7f0ea8e 100644 --- a/Borepin/Borepin/DialogModel/ConfirmDialogModel.cs +++ b/Borepin/Borepin/DialogModel/ConfirmDialogModel.cs @@ -8,6 +8,7 @@ namespace Borepin.DialogModel { public class ConfirmDialogModel : BindableBase, IDialogAware { + private object _Instance; public ConfirmDialogModel() { ConfirmCommand = new DelegateCommand(ConfirmCommandExecute); @@ -40,7 +41,14 @@ namespace Borepin.DialogModel } private void ConfirmCommandExecute() { - RequestClose(new DialogParameters { { "confirm", true } }); + IDialogParameters parameters = new DialogParameters() + { + { "result", "confirm" }, + { "instance", _Instance } + + }; + + RequestClose(parameters); } private ICommand _AbortCommand; @@ -71,6 +79,7 @@ namespace Borepin.DialogModel { Title = parameters.GetValue("title"); Message = parameters.GetValue("message"); + _Instance = parameters.GetValue("instance"); } } } diff --git a/Borepin/Borepin/Page/ServerListPage.xaml b/Borepin/Borepin/Page/ServerListPage.xaml index 4816e3e..292c178 100644 --- a/Borepin/Borepin/Page/ServerListPage.xaml +++ b/Borepin/Borepin/Page/ServerListPage.xaml @@ -8,6 +8,17 @@ +