diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Controls/ConnectionCell.xaml b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Controls/ConnectionCell.xaml
index 55315c8..1219f18 100644
--- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Controls/ConnectionCell.xaml
+++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Controls/ConnectionCell.xaml
@@ -5,16 +5,9 @@
xmlns:fonts="clr-namespace:Xamarin.Neo4j.Fonts;assembly=Xamarin.Neo4j"
x:Class="Xamarin.Neo4j.Controls.ConnectionCell">
-
-
-
-
-
-
-
-
+
-
+
diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Controls/ConnectionCell.xaml.cs b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Controls/ConnectionCell.xaml.cs
index 3ddb2d8..1ab5a8c 100644
--- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Controls/ConnectionCell.xaml.cs
+++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Controls/ConnectionCell.xaml.cs
@@ -15,21 +15,6 @@ namespace Xamarin.Neo4j.Controls
public ConnectionCell()
{
InitializeComponent();
-
- isActiveIndicator.SetBinding(VisualElement.IsVisibleProperty, new Binding(nameof(IsActive), source: this));
}
-
- #region Bindable Properties
-
- public bool IsActive
- {
- get => (bool)GetValue(IsActiveProperty);
- set => SetValue(IsActiveProperty, value);
- }
-
- public static BindableProperty IsActiveProperty = BindableProperty.Create("IsActive", typeof(bool),
- typeof(ConnectionCell), false, BindingMode.OneWay);
-
- #endregion
}
}
diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/ConnectionsPage.xaml b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/ConnectionsPage.xaml
index da7d65e..5f7fe1d 100644
--- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/ConnectionsPage.xaml
+++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/ConnectionsPage.xaml
@@ -4,47 +4,20 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:fonts="clr-namespace:Xamarin.Neo4j.Fonts;assembly=Xamarin.Neo4j"
xmlns:controls="clr-namespace:Xamarin.Neo4j.Controls;assembly=Xamarin.Neo4j"
- xmlns:converters="clr-namespace:Xamarin.Neo4j.Converters;assembly=Xamarin.Neo4j"
- x:Class="Xamarin.Neo4j.Pages.ConnectionsPage"
+x:Class="Xamarin.Neo4j.Pages.ConnectionsPage"
x:Name="connectionsPage"
- Title="Connections">
-
-
-
-
-
-
-
-
-
+ Title="PocketGraph">
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
+
@@ -58,18 +31,30 @@
+
+
+
diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/ConnectionsPage.xaml.cs b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/ConnectionsPage.xaml.cs
index 4028435..702f330 100644
--- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/ConnectionsPage.xaml.cs
+++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/Pages/ConnectionsPage.xaml.cs
@@ -26,14 +26,25 @@ namespace Xamarin.Neo4j.Pages
protected override void OnAppearing()
{
+ App.ThemeChanged += OnThemeChanged;
ViewModel.LoadConnectionStrings();
-
base.OnAppearing();
}
- private void SetActive(object sender, ItemTappedEventArgs e)
+ protected override void OnDisappearing()
{
- ViewModel.SetActiveConnectionString((Neo4jConnectionString)e.Item);
+ App.ThemeChanged -= OnThemeChanged;
+ base.OnDisappearing();
+ }
+
+ private void OnThemeChanged(object sender, EventArgs e)
+ {
+ ViewModel.LoadConnectionStrings();
+ }
+
+ private void OpenSession(object sender, ItemTappedEventArgs e)
+ {
+ ViewModel.OpenSession((Neo4jConnectionString)e.Item);
}
}
}
diff --git a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/ConnectionsViewModel.cs b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/ConnectionsViewModel.cs
index 8fdb6ce..17b1c7b 100644
--- a/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/ConnectionsViewModel.cs
+++ b/Xamarin.Neo4j/Xamarin.Neo4j/Xamarin.Neo4j/ViewModels/ConnectionsViewModel.cs
@@ -50,16 +50,9 @@ namespace Xamarin.Neo4j.ViewModels
LoadConnectionStrings();
}));
- Commands.Add("StartSession", new Command(async () =>
+ Commands.Add("OpenSettings", new Command(async () =>
{
- if (ConnectionStringManager.ActiveConnectionString == null)
- {
- await Application.Current.MainPage.DisplayAlert("", "Please select a connection before starting a session.", "OK");
-
- return;
- }
-
- await Navigation.PushAsync(new SessionPage(ConnectionStringManager.ActiveConnectionString));
+ await Navigation.PushAsync(new SettingsPage());
}));
}
@@ -74,11 +67,11 @@ namespace Xamarin.Neo4j.ViewModels
ConnectionStrings = await ConnectionStringManager.GetConnectionStrings();
}
- public void SetActiveConnectionString(Neo4jConnectionString connectionString)
+ public async void OpenSession(Neo4jConnectionString connectionString)
{
- ConnectionStringManager.ActiveConnectionString = ConnectionStringManager.ActiveConnectionString?.Id == connectionString.Id ? null : connectionString;
-
+ ConnectionStringManager.ActiveConnectionString = connectionString;
LoadConnectionStrings();
+ await Navigation.PushAsync(new SessionPage(connectionString));
}
#region Bindable Properties