I got a user control:
<UserControl x:Class="NeocClinic.WPFSystem.Templatas.FunctionButtonsUserControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" >
<Grid Name="GridFunctionButtons" Margin="5" >
<Grid.ColumnDefinitions >
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button Name="btnExecute" Content="Execute" MinHeight="50" MinWidth="120" Grid.Column="0"/>
<Button Name="btnUndo" Content="Undo" MinHeight="50" MinWidth="120" Grid.Column="1"/>
<Button Name="btnBack" Content="Back" MinHeight="50" MinWidth="120" Grid.Column="2"/>
<Button Name="btnDelete" Content="Delete" MinHeight="50" MinWidth="120" Grid.Column="3"/>
</Grid>
</UserControl>
I used it in my Windows form XAML:
<windowsControls:FunctionButtonsUserControl x:Name="UserControlFunctionButtons" Grid.Row="5" Grid.Column="0" />
I can now see the buttons in my C# code, but the problem is the events. The four buttons must have each events but differs with each form that I deployed it, so I can't put the events in the usercontrol.xaml.