Hey Everyone, I've run into a bit of a nutty issue.
For this Window:
<Window x:Class="Host.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStyle="ToolWindow" Top="-5000" Left="-5000" Width="0" Height="0"
ShowInTaskbar="False"
Loaded="Window_Loaded"
/>
The "Cannot set Visibility or call Show or ShowDialog after window has closed." Exception is being thrown between the .ctor, and Window_Loaded. This Only happens when it is run stand alone, not with VS. the .ctor is as follows:
public MainWindow()
{
InitializeComponent();
MessageBox.Show("1");
}
The Exception does not occur when the MessageBox is not there, the app just closes right after start up if it is not there, but it still doesn't make it to the Window_Loaded handler. It doesn't throw any exceptions from my code, it's coming from the app trying call Window.VerifyCanShow() from PresentationFramework.dll.
Any Ideas?