Strange toolbar in xbap app for Firefox

I have an xbap application, which is basically a Windows Form hosted in a WPF control. When I launch it with Firefox, I get a toolbar that I cannot remove. This toolbar does not appear with IE if I execute xbap directly, but it appears if I insert xbap in iframe.

alt text

Any ideas how to remove this?

+3
source share
2 answers

Use the Page.ShowsNavigationUI property to hide it. From the MSDN documentation you can do this in 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>

or in code:

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

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

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

, , WPF XBAP:

WPF Microsoft Internet Explorer 6, , , ShowsNavigationUI. WPF Windows Internet Explorer 7, ShowsNavigationUI Windows Internet Explorer 7 .

+3

+1 .

, , ascx, ...

public Whatever()
{
    this.Navigated += new NavigatedEventHandler(Whatever_Navigated);
}

private void Whatever_Navigated(object sender, NavigationEventArgs e)
{
    NavigationWindow ws = (e.Navigator as NavigationWindow);
    ws.ShowsNavigationUI = false;
}
0

Source: https://habr.com/ru/post/1728816/


All Articles