Samples.csproj: WebviewSection.cs: track api changes for WebView2
This commit is contained in:
parent
79cd86eaa5
commit
48e2c06649
1 changed files with 5 additions and 14 deletions
|
@ -31,29 +31,20 @@ namespace Samples
|
||||||
Hexpand = true
|
Hexpand = true
|
||||||
};
|
};
|
||||||
|
|
||||||
webView.LoadString(
|
webView.LoadHtml($"This is a <b>{nameof(WebView)}</b> showing html text");
|
||||||
$"This is a <b>{nameof(WebView)}</b> showing html text",
|
|
||||||
"text/html", "UTF-8", null
|
|
||||||
);
|
|
||||||
|
|
||||||
return ($"{nameof(WebView)} show html text:", webView);
|
return ($"{nameof(WebView)} show html text:", webView);
|
||||||
}
|
}
|
||||||
|
|
||||||
public (string, Widget) ShowUri()
|
public (string, Widget) ShowUri()
|
||||||
{
|
{
|
||||||
var webView = new WebView {ViewMode = WebViewViewMode.Floating};
|
var webView = new WebView {
|
||||||
|
Vexpand = true,
|
||||||
var scroll = new ScrolledWindow {
|
Hexpand = true,
|
||||||
Child = webView,
|
|
||||||
Vexpand = true,
|
|
||||||
Hexpand = true,
|
|
||||||
PropagateNaturalHeight = true,
|
|
||||||
PropagateNaturalWidth = true
|
|
||||||
};
|
};
|
||||||
|
|
||||||
webView.LoadUri("https://github.com/GtkSharp/GtkSharp#readme");
|
webView.LoadUri("https://github.com/GtkSharp/GtkSharp#readme");
|
||||||
|
|
||||||
return ($"{nameof(WebView)} show uri:", scroll);
|
return ($"{nameof(WebView)} show uri:", webView);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue