Skip to content

Commit 8a7d93d

Browse files
committed
2 parents 4bd28ab + e014038 commit 8a7d93d

File tree

1 file changed

+74
-1
lines changed

1 file changed

+74
-1
lines changed

README.md

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,78 @@
11
# XamarinForms.VisualDebugger
22

3-
A library and client app to view the visual heirarchy of your Xamarin app pages as an interactive tree diagram
3+
A library and client app to view the visual heirarchy of your Xamarin app pages as an interactive tree diagram at runtime
44

55
![Preview](https://github.com/Pepsi1x1/XamarinForms.VisualDebug/raw/master/final-5f6f58c13e5b3e0061bb6cf9-6.gif "Preview")
6+
7+
# Getting Started
8+
9+
Install the XamarinForms.VisualDebug Nuget packages into your Core AND platform specific projects
10+
11+
```sh
12+
Install-Package XamarinForms.VisualDebug -Version 0.0.1
13+
dotnet add package XamarinForms.VisualDebug --version 0.0.1
14+
```
15+
16+
## Core project
17+
18+
For the simplest use case in App.xaml.cs include the following
19+
20+
```c#
21+
public App()
22+
{
23+
InitializeComponent();
24+
25+
MainPage = new NavigationPage(new MainPage());
26+
27+
//Add this line
28+
Current.PageAppearing += Current_PageAppearing;
29+
}
30+
31+
private static XamarinForms.VisualDebug.Core.Sender Sender = new XamarinForms.VisualDebug.Core.Sender();
32+
33+
private void Current_PageAppearing(object sender, Page e)
34+
{
35+
var rep = XamarinForms.VisualDebug.Core.TreeRenderer.RenderVisualHeirarchyToJson(e);
36+
37+
System.Threading.Tasks.Task.Run(async () =>
38+
{
39+
var response = await Sender.SendToServer(rep).ConfigureAwait(false);
40+
if (response.IsSuccessStatusCode)
41+
{
42+
Console.WriteLine("Success!");
43+
}
44+
else
45+
{
46+
Console.WriteLine(response.ReasonPhrase);
47+
}
48+
});
49+
}
50+
```
51+
52+
## iOS
53+
54+
Add the following line to FinishedLaunching in AppDelegate.cs somehwher after the Xamarin.Forms.Forms.Init call
55+
56+
```c#
57+
XamarinForms.VisualDebug.iOS.VisualDebug.Init();
58+
```
59+
60+
## Android
61+
62+
Add the following line to FinishedLaunching in AppDelegate.cs somehwher after the Xamarin.Forms.Forms.Init call
63+
64+
```c#
65+
XamarinForms.VisualDebug.Droid.VisualDebug.Init();
66+
```
67+
68+
## Electron app
69+
70+
Run the client before starting the simluator/emulator for your Xamarin app
71+
72+
```sh
73+
$ cd XamarinForms.VisualDebug.App
74+
# Install dependencies
75+
$ npm install
76+
# Run the app
77+
$ npm start
78+
```

0 commit comments

Comments
 (0)