From 4f39c25803bafe8be74b32384b9507787dee2a36 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 27 Sep 2020 12:13:41 +0100 Subject: [PATCH 1/3] Update README.md --- README.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/README.md b/README.md index fc000d2..5c54338 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,74 @@ A library and client app to view the visual heirarchy of your Xamarin app pages as an interactive tree diagram ![Preview](https://github.com/Pepsi1x1/XamarinForms.VisualDebug/raw/master/final-5f6f58c13e5b3e0061bb6cf9-6.gif "Preview") + +# Getting Started + +Install the XamarinForms.VisualDebug Nuget packages into your Core AND platform specific projects + +Install-Package XamarinForms.VisualDebug -Version 0.0.1 +dotnet add package XamarinForms.VisualDebug --version 0.0.1 + +## Core project + +For the simplest use case in App.xaml.cs include the following + +```c# + public App() + { + InitializeComponent(); + + MainPage = new NavigationPage(new MainPage()); + + //Add this line + Current.PageAppearing += Current_PageAppearing; + } + + private static XamarinForms.VisualDebug.Core.Sender Sender = new XamarinForms.VisualDebug.Core.Sender(); + + private void Current_PageAppearing(object sender, Page e) + { + var rep = XamarinForms.VisualDebug.Core.TreeRenderer.RenderVisualHeirarchyToJson(e); + + System.Threading.Tasks.Task.Run(async () => + { + var response = await Sender.SendToServer(rep).ConfigureAwait(false); + if (response.IsSuccessStatusCode) + { + Console.WriteLine("Success!"); + } + else + { + Console.WriteLine(response.ReasonPhrase); + } + }); + } +``` + +## iOS + +Add the following line to FinishedLaunching in AppDelegate.cs somehwher after the Xamarin.Forms.Forms.Init call + +```c# + XamarinForms.VisualDebug.iOS.VisualDebug.Init(); +``` + +## Android + +Add the following line to FinishedLaunching in AppDelegate.cs somehwher after the Xamarin.Forms.Forms.Init call + +```c# + XamarinForms.VisualDebug.Droid.VisualDebug.Init(); +``` + +## Electron app + +Run the client before starting the simluator/emulator for your Xamarin app + +```sh +$ cd XamarinForms.VisualDebug.App +# Install dependencies +$ npm install +# Run the app +$ npm start +``` From 1b84ad25c9a66fbd2468beb05320a28b533ac4d8 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 27 Sep 2020 12:14:08 +0100 Subject: [PATCH 2/3] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c54338..7036f13 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # XamarinForms.VisualDebugger -A library and client app to view the visual heirarchy of your Xamarin app pages as an interactive tree diagram +A library and client app to view the visual heirarchy of your Xamarin app pages as an interactive tree diagram at runtime ![Preview](https://github.com/Pepsi1x1/XamarinForms.VisualDebug/raw/master/final-5f6f58c13e5b3e0061bb6cf9-6.gif "Preview") From e01403838d579f558a206ee41cb822ea302725bc Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 27 Sep 2020 12:14:57 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7036f13..fe1893d 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,10 @@ A library and client app to view the visual heirarchy of your Xamarin app pages Install the XamarinForms.VisualDebug Nuget packages into your Core AND platform specific projects +```sh Install-Package XamarinForms.VisualDebug -Version 0.0.1 dotnet add package XamarinForms.VisualDebug --version 0.0.1 +``` ## Core project