Q: WPF Window minimize / maximize behavior not consistent I am dabbling in WPF for the first time and decided I wanted to create a basic application to run in the system tray. I added a winforms NotifyIcon and am able to minimize to the tray and hide the window, so that all is working fine.
Here is where things get weird.
I decided to hide the application from the task bar at all times and to show the notifyicon in the system tray at all times. I added click event handlers so that clicking the notifyicon when the window was up would cause it to hide, and then clicking when it was down would cause it to display, pretty standard stuff.
Lastly, the window starts off minimized to the tray.
So, I start my application and all i have is a system tray icon. I click it, and the window displays as you'd expect. I click the notifyicon again and the window disappears, again just as you'd suspect. I click it a third time and instead of my window popping up, I get just the title bar (icon in the upper left, minimize / close buttons etc in the upper right) in the lower left corner. I believe this is the "collapsed" behavior. The last thing that makes this weird is that I am using WindowLayout = none so my window doesnt even have a title bar.. and yet one shows up in the lower left corner. 
If I click a 4th time, the bar disappears. And so on.
So the hiding / displaying is working the first time and after that it goes weird. 
Really scratching my head on this one. Anybody seen anything like this or have any suggestions?
https://stackoverflow.com/questions/12088892/impossible-to-restore-application-hidden-programmatically
This dude explains almost exactly the behavior I am seeing but unfortunately he didnt have his question answered.
Here is the XAML:
    <Window x:Class="Tagalong.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Tagalong Beta .1" Height="350" Width="500" Icon="content/tagalong_icon.ico"     
    ResizeMode="CanMinimize" Topmost="True"
    WindowStyle="None" Background="Transparent" AllowsTransparency="True" ShowInTaskbar="false" >
    <Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="250"  />
        <ColumnDefinition Width="250" />
    </Grid.ColumnDefinitions>
    <Border Name="LeftPane" Grid.Row="0" Grid.Column="0" BorderBrush="Black"
    BorderThickness="1.5" Height="350" Width="250" CornerRadius="10"  Background="Blue" >
        <Grid>
        </Grid>
    </Border>
    <Border Name="RightPane" BorderBrush="Black" Grid.Row="0" Grid.Column="1"  
    BorderThickness="1.5" Height="350" Width="250" CornerRadius="10" Background="Green">
        <Grid>
        </Grid>
    </Border>
    </Grid>
    </Window>

Here is the Code:
    void InitializeSystemTrayOptions()
    {
        notifyIcon = new NotifyIcon();
        notifyIcon.Icon = new System.Drawing.Icon(@"C:\dev\desktop\Tagalong\Tagalong\tagalong_icon.ico");
        notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(notifyIcon_MouseClick);            
        notifyIcon.Visible = true;
        this.Visibility = Visibility.Hidden; 
        this.WindowState = WindowState.Minimized;
    }

    void notifyIcon_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)
    {
        if (e.Button == MouseButtons.Left)
        {
            if (this.WindowState == WindowState.Normal)
            {
                this.WindowState = WindowState.Minimized;
                this.Visibility = Visibility.Hidden;
            }
            else if (this.WindowState == WindowState.Minimized)
            {
                this.WindowState = WindowState.Normal;
                this.Visibility = Visibility.Visible;
            }
        }
    }

    private NotifyIcon notifyIcon;

