From a4ae0a899964723a1e81ef00671c3d0fae40e98d Mon Sep 17 00:00:00 2001
From: Paul-Winpenny <92634321+Paul-Winpenny@users.noreply.github.com>
Date: Thu, 9 Jan 2025 11:31:54 +0000
Subject: [PATCH] Fixed the mobile version not updating position.

---
 .../Platforms/Windows/Package.appxmanifest         |  2 +-
 App/RobobinApp/Views/MainPage_Android.xaml.cs      | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/App/RobobinApp/Platforms/Windows/Package.appxmanifest b/App/RobobinApp/Platforms/Windows/Package.appxmanifest
index 04beb1a6..9dd8137d 100644
--- a/App/RobobinApp/Platforms/Windows/Package.appxmanifest
+++ b/App/RobobinApp/Platforms/Windows/Package.appxmanifest
@@ -6,7 +6,7 @@
   xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
   IgnorableNamespaces="uap rescap">
 
-	<Identity Name="maui-package-name-placeholder" Publisher="CN=paulw" Version="0.0.7.0" />
+	<Identity Name="maui-package-name-placeholder" Publisher="CN=paulw" Version="0.0.8.0" />
 
 	<mp:PhoneIdentity PhoneProductId="8646FF59-A3E1-4276-A8EA-36FBC95CCEAD" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
 
diff --git a/App/RobobinApp/Views/MainPage_Android.xaml.cs b/App/RobobinApp/Views/MainPage_Android.xaml.cs
index f7059f40..cedfdc3c 100644
--- a/App/RobobinApp/Views/MainPage_Android.xaml.cs
+++ b/App/RobobinApp/Views/MainPage_Android.xaml.cs
@@ -79,6 +79,20 @@ namespace RobobinApp.Views
                 {
                     var drawable = (GraphicsDrawable)Resources["drawable"];
                     drawable.SetGraph(viewModel.Graph);
+              
+                    GraphicsView.Invalidate(); // Redraw the GraphicsView
+                    Debug.WriteLine("Graph updated and redrawn.");
+                }
+
+            }
+            else if (e.PropertyName == nameof(MainPageViewModel.Location))
+            {
+                if (BindingContext is MainPageViewModel viewModel)
+                {
+                    var drawable = (GraphicsDrawable)Resources["drawable"];
+                    Debug.WriteLine($"VM Location  {viewModel.Location}");
+                    drawable.SetLocation(viewModel.Location);
+                    drawable.SetGraph(viewModel.Graph);
                     GraphicsView.Invalidate(); // Redraw the GraphicsView
                     Debug.WriteLine("Graph updated and redrawn.");
                 }
-- 
GitLab