title: WPF MVVM dynamic binding of UserControls and show records as per selected design
body: <p>I need a help in my project.Could not get any proper solution as I want. I explain you my scenario here.</p>
  
  <p>I am working on WPF project with MVVM pattern, where I have Main Windows screen, on load of Main Windows screen it should be load blank, and only one label is there. On Click of that Label I have to open new form that is Widget Screen and Widget Screen have multiple buttons(in number of 12) with Images. </p>
  
  <p>Now, on click of any button, I want that particular button name or parameter, so accordingly that name or parameter I have to find User Controls from views and render User Controls on Main Windows screen with collection of 20 records. If again I click on Main Windows label and select another button from widget screen then it should load another selected User Controls will be bind ob Main Windows screen.</p>
  
  <p>So, in short as per selected design from widget screen all records should be show in Main Windows using User Controls.
  This below is my widget screen and from that I can select design for my collection that shows in Main windows screen.
  <a href="https://i.stack.imgur.com/QpTU2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QpTU2.jpg" alt="enter image description here"></a></p>
  
  <p>this is my Main Windows screen code, currently it is binding static User Control that I mentioned directly into controls from that 12 user controls one of them is UserControlColumn1XL, How it should be dynamically changed with whole scenario?</p>
  
  <pre><code>&lt;Window x:Class="TechMedic.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:uc ="clr-namespace:TechMedic.View.UserControls"
      xmlns:local="clr-namespace:TechMedic"
      xmlns:controls="clr-namespace:TechMedic.View.UserControls"
      xmlns:data="clr-namespace:TechMedic.Data"
      mc:Ignorable="d"
      WindowStartupLocation="CenterScreen" Background="Black"
      Title="Main Window}" WindowState="Maximized" MinWidth="750" &gt;
  
  &lt;StackPanel&gt;    
      &lt;StackPanel Grid.Column="0" Background="Black" VerticalAlignment="Top" &gt;
          &lt;Border BorderThickness="1" Background="Black" BorderBrush="White"&gt;
              &lt;Button Style="{StaticResource TransparentStyle}" Command="{Binding OnClickNormalCommand}" CommandParameter="Normal" Foreground="LightSkyBlue" HorizontalAlignment="Center" FontSize="12pt" &gt;
                  &lt;TextBlock Text="{Binding NormalCollection.Count, StringFormat='Normal: {0}'}" Padding="0,5, 0, 5" Foreground="{Binding IsNormalColor}" /&gt;
              &lt;/Button&gt;
              &lt;/Border&gt;
              &lt;Border Name="UserControl1BorderNormal" BorderBrush="White" BorderThickness="0" &gt;
                  &lt;ItemsControl ItemsSource="{Binding NormalCollection}" Name="ListNormal" Margin="4,0" &gt;
                      &lt;ItemsControl.ItemsPanel&gt;
                          &lt;ItemsPanelTemplate&gt;
                              &lt;WrapPanel HorizontalAlignment="Left" /&gt;
                          &lt;/ItemsPanelTemplate&gt;
                      &lt;/ItemsControl.ItemsPanel&gt;
                      &lt;ItemsControl.ItemTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;controls:UserControlColumn1XL HorizontalAlignment="Left" Margin="2" /&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/ItemsControl.ItemTemplate&gt;
                  &lt;/ItemsControl&gt;
              &lt;/Border&gt;
          &lt;/StackPanel&gt;
  &lt;/StackPanel&gt;
  </code></pre>
  
  <p></p>