diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Managers/ConnectionStringManager.cs b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Managers/ConnectionStringManager.cs
index ce4b15c..02da9eb 100644
--- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Managers/ConnectionStringManager.cs
+++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Managers/ConnectionStringManager.cs
@@ -69,6 +69,7 @@ namespace Xamarin.Neo4j.Managers
if (connectionStringToUpdate == null)
return;
+ connectionStringToUpdate.Name = connectionString.Name;
connectionStringToUpdate.Scheme = connectionString.Scheme;
connectionStringToUpdate.Host = connectionString.Host;
connectionStringToUpdate.Username = connectionString.Username;
diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/AddConnectionPage.xaml b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/AddConnectionPage.xaml
index 805cf20..342ca49 100644
--- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/AddConnectionPage.xaml
+++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/AddConnectionPage.xaml
@@ -9,7 +9,12 @@
-
+
+
+
+
+
+
@@ -25,17 +30,17 @@
-
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/AddConnectionViewModel.cs b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/AddConnectionViewModel.cs
index 729ec4f..4698463 100644
--- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/AddConnectionViewModel.cs
+++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/AddConnectionViewModel.cs
@@ -26,7 +26,7 @@ namespace Xamarin.Neo4j.ViewModels
{
private Guid? _id;
- private string _scheme, _host, _username, _password;
+ private string _name, _scheme, _host, _username, _password;
private readonly Neo4jService _neo4jService;
@@ -55,20 +55,13 @@ namespace Xamarin.Neo4j.ViewModels
{
var connectionString = BuildConnectionString();
+ if (string.IsNullOrWhiteSpace(connectionString.Name))
+ connectionString.Name = connectionString.Host;
+
if (_id.HasValue)
await ConnectionStringManager.UpdateConnectionString(_id.Value, connectionString);
-
else
- {
- var name = await Application.Current.MainPage.DisplayPromptAsync("Save Connection", "How do you want to name this connection?", "Save", "Cancel");
-
- if (string.IsNullOrWhiteSpace(name))
- return;
-
- connectionString.Name = name;
-
await ConnectionStringManager.AddConnectionString(connectionString);
- }
await Navigation.PopAsync();
}));
@@ -91,6 +84,7 @@ namespace Xamarin.Neo4j.ViewModels
{
_id = neo4JConnectionString.Id;
+ Name = neo4JConnectionString.Name;
Scheme = neo4JConnectionString.Scheme;
Host = neo4JConnectionString.Host;
Username = neo4JConnectionString.Username;
@@ -114,6 +108,7 @@ namespace Xamarin.Neo4j.ViewModels
return new Neo4jConnectionString
{
Id = Guid.NewGuid(),
+ Name = Name,
Scheme = Scheme,
Host = Host,
Username = Username,
@@ -123,6 +118,16 @@ namespace Xamarin.Neo4j.ViewModels
#region Bindable Properties
+ public string Name
+ {
+ get => _name;
+ set
+ {
+ _name = value;
+ OnPropertyChanged(nameof(Name));
+ }
+ }
+
public string Scheme
{
get => _scheme;
diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/SettingsViewModel.cs b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/SettingsViewModel.cs
index 207c209..316b0e1 100644
--- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/SettingsViewModel.cs
+++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/SettingsViewModel.cs
@@ -141,6 +141,26 @@ namespace Xamarin.Neo4j.ViewModels
}
}
+ public bool AutoCapitalize
+ {
+ get => Preferences.Default.Get("auto_capitalize", true);
+ set
+ {
+ Preferences.Default.Set("auto_capitalize", value);
+ OnPropertyChanged(nameof(AutoCapitalize));
+ }
+ }
+
+ public bool AutoZoom
+ {
+ get => Preferences.Default.Get("auto_zoom", true);
+ set
+ {
+ Preferences.Default.Set("auto_zoom", value);
+ OnPropertyChanged(nameof(AutoZoom));
+ }
+ }
+
#endregion
}
}