Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Pepsi1x1 committed Sep 27, 2020
2 parents 4bd28ab + e014038 commit 8a7d93d
Showing 1 changed file with 74 additions and 1 deletion.
75 changes: 74 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,78 @@
# 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")

# Getting Started

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

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
```

0 comments on commit 8a7d93d

Please sign in to comment.