iframe中嵌套.xbap文件,去掉上部导航栏

当我们在iframe标签中嵌套一个.xbap的时候,页面上部会显示出一个导航栏,如何去掉它呢?

有两种方式:

(1)我们可以加在xaml中:

<Page
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="HomePage"
    ShowsNavigationUI="False"
>

(2)也可以加在后台代码中:

using System;
using System.Windows;
using System.Windows.Controls;

namespace CSharp
{
    public partial class HomePage : Page
    {
        public HomePage()
        {
            InitializeComponent();

            // Hide host's navigation UI
            this.ShowsNavigationUI = false;
        }
    }
}

亲测有效,棒,棒,棒!

 

posted on 2017-07-05 19:01  kimi1908  阅读(268)  评论(0编辑  收藏  举报

导航