title: Window Resize Handle Event
body: <p>Certain elements of my application have custom resizing events, which all work. However, they are messed up by one case:</p>
  
  <p>When hovering over the border of the window, so that the cursor becomes the resize handle, and you click (but do not drag), the elements resize incorrectly, and my handlers are not fired.</p>
  
  <p>I've looked for such an event but cannot find anything that matches. I'd like to simply make a handler for this event to avoid glitchy resizing of my elements.</p>
  
  <p>I'm using C#/WPF, with .NET 4</p>
  
  <p>xaml for the window:</p>
  
  <pre><code>&lt;Window x:Class="XHealth.MainWindow"
      Name="mainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:DataGridTemplateSample"
      xmlns:XH="clr-namespace:XHealth"
      xmlns:toolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
  
      SizeChanged="update_size"
      Title="XHealth"  Loaded="Window_Loaded" WindowState="Normal" WindowStartupLocation="CenterScreen" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"  SizeToContent="WidthAndHeight" WindowStyle="ThreeDBorderWindow"  MinWidth="650" MinHeight="648" Width="Auto"  VerticalAlignment="Top" DataContext="{Binding}" PreviewKeyDown="Window_KeyDown"&gt;
  </code></pre>
  
  <p>Event handler:</p>
  
  <pre><code>public void update_size(object sender, RoutedEventArgs e )
  {
          if (resultsTab.IsSelected){
            Grid.SetRowSpan(dataGrid1, 2);
            Grid.SetRowSpan(dataGrid2, 2);
          }
  }
  </code></pre>
  
  <p>This handler performs as intended, but does not trigger when the resize handle is not dragged, which leads me to believe clicking the resize handle is a different event.</p>
  
  <p>Also, this only happens once - once my resize handler takes effect, clicked the resize handle has no effect.</p>