私はUWPアプリケーションのc#コードでWebビューを作成しています。私はそれにLoadCompletedイベントを添付しました。このイベントがトリガーActaulHeightを取得し、ActualWidthが0の場合、MinWidthとMinHeightを500に設定しようとしましたが、動作しません。WebviewのActualHeightとActualWidth
私は、XAMLでのWebViewコントロールを作成することによって、同じことをしましたが、その場合にはActualHeightとActualWidthは、ここ500
あるコードです:
public WebView _webView { get; set; }
public ViewPage()
{
this.InitializeComponent();
_webView = new WebView
{
HorizontalAlignment = HorizontalAlignment.Stretch,
VerticalAlignment = VerticalAlignment.Top,
Source = new Uri(@"https://www.google.com"),
MinHeight = 500,
MinWidth = 500
};
}
private void _webView_LoadCompleted(object sender, NavigationEventArgs e)
{
// Here, when I debug _webview ActualHeight and ActaulWidth is zero.
}