Is this a good user control layout for WPF? Below is a code snippet of how I have been laying out my WPF control XAML. I do it mainly because I get intellisense in the editor and I can change the implementation of the viewmodel and push the layout into a resource file.

However, I am not sure whether you gurus have a better insight into why I should not do this?

I'm just after a critique really.

&lt;UserControl.Resources&gt;
&lt;ResourceDictionary&gt;
    &lt;ResourceDictionary.MergedDictionaries&gt;
        &lt;ResourceDictionary Source="../../Styles/BaseStyles.xaml"/&gt;
    &lt;/ResourceDictionary.MergedDictionaries&gt;

    &lt;DataTemplate x:Key="LayoutRoot" 
                  DataType="{x:Type ns:IViewModel}"&gt;

        &lt;Grid Height="200" Width="300"&gt;
            &lt;Grid.RowDefinitions&gt;
                &lt;RowDefinition Height="Auto" /&gt;
                &lt;RowDefinition Height="Auto" /&gt;
                &lt;RowDefinition Height="*"/&gt;
                &lt;RowDefinition Height="Auto" /&gt;
            &lt;/Grid.RowDefinitions&gt;

            &lt;Grid.ColumnDefinitions&gt;
                &lt;ColumnDefinition Width="Auto"/&gt;
                &lt;ColumnDefinition Width="*"/&gt;
            &lt;/Grid.ColumnDefinitions&gt;

            &lt;Label Content="Some Label" Style="{StaticResource BoldLabel}" Margin="5, 0" 
                   Target="{Binding ElementName=Lcb1}"/&gt;

            &lt;endorsements:LimitComboBox Grid.Row="0" Grid.Column="1" x:Name="Lcb1" 
                            Limit="{Binding SomeData}" /&gt;

            &lt;Label Grid.Row="1" Grid.Column="0" Content="Some Other Label" 
                   Style="{StaticResource BoldLabel}" Margin="5, 0" Target={Binding ElementName=Lcb2/&gt;

            &lt;endorsements:LimitComboBox Grid.Row="0" Grid.Column="1" x:Name="Lcb2" 
                            Limit="{Binding SomeOtherData}" /&gt;

            &lt;StackPanel Grid.Row="3" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right" Grid.ColumnSpan="2"&gt;
                &lt;Button Content="OK" Command="{Binding ApplyCommand}" IsDefault="True"/&gt;
                &lt;Button Content="Cancel" IsCancel="True"/&gt;
            &lt;/StackPanel&gt;
        &lt;/Grid&gt;
    &lt;/DataTemplate&gt;
&lt;/ResourceDictionary&gt;
There are 2 things that I could critisize on your code with the information you gave us:


Don't load style resources inside the usercontrol. Let the application hold control over how to style a usercontrol
Try not to use a grid in this context, because it prevents the control from adopting itself to new sizes of the window. StackPanels and Dockpanel are much better for this