private void Button_Click(object sender, RoutedEventArgs e) { string result = host.runScript(JsInput.Text); JsOutput.Text = JsOutput.Text + "\n> " + JsInput.Text + "\n" + result; JsOutput.UpdateLayout(); JsOutputScroll.ChangeView(null, double.MaxValue, null); }
private void Button_Click(object sender, RoutedEventArgs e) { host.NKevaluateJavaScript(JsInput.Text).ContinueWith(task => { JsOutput.Text = JsOutput.Text + "\n> " + JsInput.Text + "\n" + task.Result; JsOutput.UpdateLayout(); JsOutputScroll.ChangeView(null, double.MaxValue, null); }, TaskScheduler.FromCurrentSynchronizationContext()); }