我有一个 xbap 应用程序,它基本上是托管在 WPF 控件中的 Windows 窗体。当我用 Firefox 运行它时,我得到了工具栏,但我似乎无法删除它。如果我直接执行 xbap,此工具栏不会在 IE 中出现,但如果我将 xbap 嵌入到 iframe
中,它就会出现。
有什么想法如何删除它吗?
最佳答案
使用 Page.ShowsNavigationUI 属性将其隐藏。来自 MSDN Documentation ,您可以在 XAML 中执行此操作:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="HomePage"
ShowsNavigationUI="False"
>
...
</Page>
,或代码:
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;
}
}
}
此外,在 WPF 集成允许 native 浏览器导航 UI 控制 XBAP 应用程序的浏览器中,工具栏不会出现:
Because WPF does not integrate with the navigation UI for Microsoft Internet Explorer 6, it provides its own navigation UI, which can be shown or hidden by setting ShowsNavigationUI. WPF does integrate with the Windows Internet Explorer 7 navigation UI, so setting ShowsNavigationUI on pages in Windows Internet Explorer 7 has no effect.
关于firefox - Firefox 托管的 xbap 应用程序中的奇怪工具栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2081245/