@谢泽维尔-MSFT这是主页。xaml
<Page
x:Class="Project_Onome.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Project_Onome"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<WebView x:Name="OnomeWebContainer"/>
<WebView HorizontalAlignment="Center" VerticalAlignment="Center"/>
<WebView Source="ms-appx-web:///www/index.html"/>
<WebView DOMContentLoaded="OnomeWebContainer_DOMContentLoaded"/>
</Grid>
这是主页。xaml。cs公司
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
namespace Project_Onome
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
WebView OnomeWebContainer = new WebView();
OnomeWebContainer.DOMContentLoaded += OnomeWebContainer_DOMContentLoaded;
}
private void OnomeWebContainer_DOMContentLoaded(WebView sender, WebViewDOMContentLoadedEventArgs args)
{
if (args.Uri.LocalPath == "/security_auth.html")
{
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
}
else
{
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
}
}
}
}