views:

168

answers:

3

I am using the Frame navigation control. Programmatically, I specify the page to fill the frame (like "Views\Home.xaml"). The browser is currently using string specified in the Frame control as the name of the page; in other words, the browser displays "Views\Home.xaml" as the name of the page.

I tried setting the "Name" property on the frame control, but that does not effect the name displayed by the browser.

+1  A: 

Try setting the title property of the page.

funwithcoding
Actually, with Silverlight and user controls there isn't a page per se, so simply setting the title won't work (and doesn't exist). The tricky part here is in the navigation control; it is outputting the title for the entire "page", since the user control displayed in the navigation control is somehow setting the page title, not the hosting shell page.
chrome
+1  A: 

If you are using the navigation control, you do have access to (e.g. navigation:Page) and that contains a Title property.

Now, you say that you programmatically specify the page to fill the frame, however you do not specify if you are simply browsing there programmatically.

If you set up your UriMapper to contain something like the following:

<uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml" />

Then you can navigate to any page from the code-behind by simply using the Uri Format. For example:

ContentFrame.Navigate(new Uri("/About", UriKind.Relative));

will browse to /Views/About.xaml but will provide a page name of:

http://localhost:2568/FileDownloadNavigationTestPage.aspx#/About

Johannes
I am simply navigating there programmatically. string routeUrl = String.Format("/Views/{0}", wizardPages[3].CurrentPage); centerContentPresenter.Navigate(new Uri(routeUrl, UriKind.Relative));Yes, using the UriMapper that will allow me to set the name of the object, and not show the full path. What I truly need to do, though, is to always show (as the title in the browser, in tabs) the same title, regardless of what is in the frame...so, regardless of what is displayed in the frame, the title is always the same.Mebbe I will wrap the whole thing in a master page.
chrome
A: 

The Silverlight navigation framework consists of two main visual parts.

The System.Windows.Controls.Navigation.Frame which will host each page. Now the frame can host a UserControl but what it should be given is a page of type System.Windows.Controls.Navigation.Page which has a property on it called Title. The frame then uses the Title property as the title for the browser to use.

Graeme Bradbury