title: How to avoid repeating blocks of XAML in a menu
body: <p>I have to create a menu. It has 10 entries and they differ by one parameter.</p>
  <p>Entry 1:</p>
  <pre><code>&lt;MenuItem Visibility=&quot;{Binding MenuSelected.Type, Converter={StaticResource TypeToVisibilityConverter}, ConverterParameter='PAZ', Mode=OneWay}&quot;&gt;
     &lt;i:Interaction.Triggers&gt;
        &lt;i:EventTrigger EventName=&quot;Click&quot;&gt;
           &lt;i:InvokeCommandAction Command=&quot;{Binding CmdContextMenu}&quot; CommandParameter=&quot;PAZ&quot; /&gt;
        &lt;/i:EventTrigger&gt;
     &lt;/i:Interaction.Triggers&gt;
     &lt;MenuItem.Header&gt;
        &lt;Grid&gt;
           &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width=&quot;Auto&quot; /&gt;
              &lt;ColumnDefinition Width=&quot;*&quot; /&gt;
           &lt;/Grid.ColumnDefinitions&gt;
           &lt;TextBlock
                                          Grid.Column=&quot;0&quot;
                                          HorizontalAlignment=&quot;Center&quot;
                                          VerticalAlignment=&quot;Center&quot;
                                          FontFamily=&quot;Segoe MDL2 Assets&quot;
                                          Foreground=&quot;{Binding MenuSelected.Type, Converter={StaticResource TypeToColorConverter}, ConverterParameter='PAZ', Mode=OneWay}&quot;
                                          Text=&quot;{Binding MenuSelected.Type, Converter={StaticResource TypeToIconConverter}, ConverterParameter='PAZ', Mode=OneWay}&quot; /&gt;
           &lt;TextBlock
                                          Grid.Column=&quot;1&quot;
                                          Margin=&quot;{StaticResource XSmallLeftMargin}&quot;
                                          HorizontalAlignment=&quot;Left&quot;
                                          VerticalAlignment=&quot;Center&quot;
                                          Text=&quot;PAZ&quot; /&gt;
        &lt;/Grid&gt;
     &lt;/MenuItem.Header&gt;
  &lt;/MenuItem&gt;
  </code></pre>
  <p>Entry 2:</p>
  <pre><code>&lt;MenuItem Visibility=&quot;{Binding MenuSelected.Type, Converter={StaticResource TypeToVisibilityConverter}, ConverterParameter='APP', Mode=OneWay}&quot;&gt;
     &lt;i:Interaction.Triggers&gt;
        &lt;i:EventTrigger EventName=&quot;Click&quot;&gt;
           &lt;i:InvokeCommandAction Command=&quot;{Binding CmdContextMenu}&quot; CommandParameter=&quot;APP&quot; /&gt;
        &lt;/i:EventTrigger&gt;
     &lt;/i:Interaction.Triggers&gt;
     &lt;MenuItem.Header&gt;
        &lt;Grid&gt;
           &lt;Grid.ColumnDefinitions&gt;
              &lt;ColumnDefinition Width=&quot;Auto&quot; /&gt;
              &lt;ColumnDefinition Width=&quot;*&quot; /&gt;
           &lt;/Grid.ColumnDefinitions&gt;
           &lt;TextBlock
                                          Grid.Column=&quot;0&quot;
                                          HorizontalAlignment=&quot;Center&quot;
                                          VerticalAlignment=&quot;Center&quot;
                                          FontFamily=&quot;Segoe MDL2 Assets&quot;
                                          Foreground=&quot;{Binding MenuSelected.Type, Converter={StaticResource TypeToColorConverter}, ConverterParameter='APP', Mode=OneWay}&quot;
                                          Text=&quot;{Binding MenuSelected.Type, Converter={StaticResource TypeToIconConverter}, ConverterParameter='APP', Mode=OneWay}&quot; /&gt;
           &lt;TextBlock
                                          Grid.Column=&quot;1&quot;
                                          Margin=&quot;{StaticResource XSmallLeftMargin}&quot;
                                          HorizontalAlignment=&quot;Left&quot;
                                          VerticalAlignment=&quot;Center&quot;
                                          Text=&quot;APP&quot; /&gt;
        &lt;/Grid&gt;
     &lt;/MenuItem.Header&gt;
  &lt;/MenuItem&gt;
  </code></pre>
  <p>As you can see, the only difference is between <code>PAZ</code> and <code>APP</code> in different points... and same goes on for all the others.
  Is there a way I can avoid to repeat it 10 times just changing the 3 letters?</p>
  <p>I do not want to use code-behind to create the menu dynamically... but to process it from XAML.</p>