title: WPF OnMouse Up from Template
body: <p>Okay so I have modified the tab control template to add two buttons, one which opens and one which saves along with the other tabs.</p>
  
  <p>What I need to do is have the button run OpenSave/CloseSave function which is inside of the window. Each window will have their own open and save function as they will be different which is why I need it to use the function from within the Window.</p>
  
  <pre><code>&lt;Style x:Key="EditorTabControl" TargetType="{x:Type TabControl}"&gt;
      &lt;Setter Property="SnapsToDevicePixels" Value="True" /&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type TabControl}"&gt;
                  &lt;Grid SnapsToDevicePixels="True"&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition Height="*" /&gt;
                          &lt;RowDefinition Height="0" /&gt;
                          &lt;RowDefinition Height="auto" /&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;Border Grid.Row="2" Panel.ZIndex="1" Background="#fafafa" Padding="10" BorderBrush="#ededed" BorderThickness="0 1 0 0"&gt;
                          &lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Center"&gt;
                              &lt;Button Content="Open" Style="{StaticResource EditorButtonStyle}"/&gt;
                              &lt;Button Content="Save" Style="{StaticResource EditorButtonStyle}"/&gt;
                              &lt;TabPanel IsItemsHost="True"/&gt;
                          &lt;/StackPanel&gt;
                      &lt;/Border&gt;
                      &lt;Border Grid.Row="0" BorderThickness="0" BorderBrush="#696969" Background="#FFF"&gt;
                          &lt;ContentPresenter Content="{TemplateBinding SelectedContent}" /&gt;
                      &lt;/Border&gt;
                  &lt;/Grid&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>So how would I be able to make the control template run a function which is in the Window it is used in?</p>