C# 是否可以在UWP中的弹出窗口中显示网络视图?
我想在a中显示一个简单的代码,我尝试了这段代码,但似乎不起作用C# 是否可以在UWP中的弹出窗口中显示网络视图?,c#,xaml,webview,uwp,popup,C#,Xaml,Webview,Uwp,Popup,我想在a中显示一个简单的代码,我尝试了这段代码,但似乎不起作用 <Popup x:Name="StandardPopup"> <Border BorderBrush="{StaticResource ApplicationForegroundThemeBrush}" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" BorderThickness="2"
<Popup x:Name="StandardPopup">
<Border BorderBrush="{StaticResource ApplicationForegroundThemeBrush}"
Background="{StaticResource ApplicationPageBackgroundThemeBrush}"
BorderThickness="2" Width="200" Height="200">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<WebView x:Name="webView1" Source="https://www.bing.com/" HorizontalAlignment="Center"/>
<Button Content="Close" Click="ClosePopupClicked" HorizontalAlignment="Center"/>
</StackPanel>
</Border>
</Popup>
在弹出控件中显示网站的WebView上没有问题。如果您在VisualStudio中检查visual树,则问题只是由于WebView的实际大小为零。您可以为它设置适当的大小,然后您将看到WebView运行良好
<Popup x:Name="StandardPopup">
<Border BorderBrush="{StaticResource ApplicationForegroundThemeBrush}"
Background="{StaticResource ApplicationPageBackgroundThemeBrush}"
BorderThickness="2" Width="200" Height="200">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<WebView x:Name="webView1" Source="https://www.bing.com/" Width="200" Height="200" HorizontalAlignment="Center" NavigationCompleted="WebView1_NavigationCompleted" />
<Button Content="Close" Click="ClosePopupClicked" HorizontalAlignment="Center" />
</StackPanel>
</Border>
</Popup>