Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 是否可以在UWP中的弹出窗口中显示网络视图?_C#_Xaml_Webview_Uwp_Popup - Fatal编程技术网

C# 是否可以在UWP中的弹出窗口中显示网络视图?

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"

我想在a中显示一个简单的代码,我尝试了这段代码,但似乎不起作用

<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>