Thursday, February 7, 2008

Hide Navigation UI (back, forward button) of Xbap application

Xbap application can be used directly in browser or can be used in a iframe in a web page. when you use directly in browser, browsers nagivation ui is used as xbap navigation UI . But if you use xbap in a iframe xbap host automatically add two back forward button and add a navigation header to your xbap application. if you are using the xbap in a existing web page and in a iframe this cause a little bit problem.

but we can hide the navigation ui very easyly... all we have to do is to set the wpf page object's ShowsNavigationUI property to false... thats all... you are done. But if you are using an "user control" as startup object there is no way to set the property. This works only in case of WPF Page project item template.

But you can still hide the navigation UI... on application's contractor subscribe the navigated event ..

public App()
this.Navigated += new NavigatedEventHandler(App_Navigated);

void App_Navigated(object sender, NavigationEventArgs e)
NavigationWindow ws = (e.Navigator as NavigationWindow);
ws.ShowsNavigationUI = false;

No comments:

Post a Comment