private static async Task RunXAMLChanges() { using (var client = new HttpClient()) { HttpResponseMessage response = await client.GetAsync(UriString); response.EnsureSuccessStatusCode(); using (HttpContent content = response.Content) { var responseBody = await response.Content.ReadAsStringAsync(); var message = JsonConvert.DeserializeObject <XamlPayload>(responseBody, JsonSerializerSettingsConverter.Settings); if (!string.IsNullOrEmpty(message.XAML) || !string.IsNullOrEmpty(message.PreserveXML)) { if (XamlPayload.XAML == null) { XamlPayload = message; await LiveXamlHelper.PreviewXaml(message.XAML, ContentPageSync); } bool areXamlSame = XamlPayload.CompareTo(message) == 0; if (!areXamlSame) { XamlPayload = message; await LiveXamlHelper.PreviewXaml(message.XAML, ContentPageSync); } } } } }
public App() { InitializeComponent(); var playground = new Playground(); MainPage = playground; LiveXamlHelper.XamlSync(UriString, playground); }