Sunday, September 09, 2007
Automatic Window Title Updates on Navigation
Here is a small but nice tweak: When using navigation UIs, in particular the Office application forms, or the Developer Express application forms, Milos now supports automatic updates of the windows title (the secondary title, actually), from the pane's caption (the pane the user navigates to). This behavior is optional, and can be controlled by means of the UpdateWindowSubTitleFromNavigation property, which can be found on all app form classes.
Note: Related to this change is an update to the INavigationHost interface, which now features a NavigationCompleted event. If you implement this interface somewhere, you simply need to add that event to your implementation as well. The code required to do so is simple:
/// <summary>
/// Occurs after a navigation.
/// </summary>
public event System.EventHandler NavigationComplete;
Whether you actually use the event or not is up to you. However, we recommend you call if after navigating, which is done in the Navigate() method that goes with the same interface. Here is the new standard implementation for that method:
/// <summary>
/// Triggers a navigation based on the specified URI
/// </summary>
/// <param name="uri">URI to navigate to</param>
/// <param name="ignoreNavigationHistory">Defines whether the current navigation needs
/// to be added to the navigation history. For instance, a go-back operation is already
/// in the history and thus does not have to be added, while a navigation to a new location
/// has to be added to the history.</param>
/// <returns>True if navigation is successful</returns>
public bool Navigate(string uri, bool ignoreNavigationHistory)
{
bool retVal = NavigationHelper.Navigate(uri, this.History, this, ignoreHistory,
this.ForwardControls, this.BackwardControls, this);
if (this.NavigationComplete != null)
{
this.NavigationComplete(this, new EventArgs());
}
return retVal;
}
That's it! Small change, but nice to have.
Posted @ 3:09 AM by Egger, Markus (markus@code-magazine.com)