public partial class MainApplication: System.Windows.Application
protected override void OnLoadCompleted(NavigationEventArgs e)
// Set the Window title.
this.MainWindow.Title = "Application";
// Get the window to take the size of its content, and then allow
// it to be set by the user, and have the content take the size
// of the window.
this.MainWindow.SizeToContent = SizeToContent.WidthAndHeight;
this.MainWindow.SizeToContent = SizeToContent.Manual;
FrameworkElement root = this.MainWindow.Content as FrameworkElement;
if (root != null)
root.Height = double.NaN;
root.Width = double.NaN;
private bool IsWebBrowserApplication
PermissionSet testSet = new PermissionSet(PermissionState.None);
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
I am lucky enough to have won a few awards for Zany Crazy code articles over the years