We are developing an out-of-browser Silverlight 4 application and want to change the title after the application loads.
Example:
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(MainPage_Loaded);
}
public string UserName { get; set; }
public string VersionNumber { get; set; }
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
string title = string.Format("MyApplication {0} {1} ", this.VersionNumber, this.UserName);
HtmlPage.Window.Eval(string.Format("document.title='{0}'", title));
}
}
Three things I have tried:
The above example does not work and throws an InvalidOperationException "The DOM/scripting bridge is disabled." All the references I found, example, said the HTML bridge is disabled in OOB mode.
Create a custom OOB Window, example, but I would prefer a more elegant solution.
Adjust the OutOfBrowserSettings.xml file, but it doesn't appear that I can get access to it after Load.
Any ideas on how to adjust the title after the application has loaded?