Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As @Olwaro mentioned, you probably want to use a <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.usercontrol%28v=vs.100%29.aspx" rel="nofollow noreferrer">UserControl</a>.</p> <p>Given your example you can have a <code>UserControl</code> with this Xaml (where the user control is called ThreeButtonStack and resides in namespace WpfApplication2):</p> <pre><code>&lt;UserControl x:Class="WpfApplication2.ThreeButtonStack" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; &lt;UserControl.Resources&gt; &lt;Style TargetType="Button"&gt; &lt;Setter Property="Margin" Value="5" /&gt; &lt;Setter Property="Width" Value="75" /&gt; &lt;/Style&gt; &lt;/UserControl.Resources&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;Button Content="OK" /&gt; &lt;Button Content="Cancel" /&gt; &lt;Button Content="Retry" /&gt; &lt;/StackPanel&gt; &lt;/UserControl&gt; </code></pre> <p>Then you can call it in your main application like this:</p> <pre><code>&lt;Window x:Class="WpfApplication2.TabPageWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wpfApplication2="clr-namespace:WpfApplication2" Title="TabPageWindow" Height="300" Width="300"&gt; &lt;TabControl&gt; &lt;TabItem Header="Tab 1"&gt; &lt;DockPanel&gt; &lt;wpfApplication2:ThreeButtonStack DockPanel.Dock="Bottom" HorizontalAlignment="Right"/&gt; &lt;TextBlock&gt;Custom Content&lt;/TextBlock&gt; &lt;/DockPanel&gt; &lt;/TabItem&gt; &lt;TabItem Header="Tab 2"&gt; &lt;DockPanel&gt; &lt;wpfApplication2:ThreeButtonStack DockPanel.Dock="Bottom" HorizontalAlignment="Right"/&gt; &lt;TextBox&gt;Editing custom stuff&lt;/TextBox&gt; &lt;/DockPanel&gt; &lt;/TabItem&gt; &lt;/TabControl&gt; &lt;/Window&gt; </code></pre> <p>and result would be:</p> <p><img src="https://i.stack.imgur.com/TLq9E.png" alt="Screenshot"></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload