The following code creates MenuItems from a list inside another MenuItem. I'm recreating a recent files option but, it is creating a container inside another container when generating the sub-item.
<MenuItem Header="_Recent" Height="25" ItemsSource="{x:Static cl_resources:MenuActions.Recent}">
<MenuItem.Icon>
<Image Source="/Resources/Icons/MenuBar/list.ico" Height="25"/>
</MenuItem.Icon>
<MenuItem.ItemTemplate>
<DataTemplate>
<MenuItem Header="{Binding}" Click="MenuItem_Recent_Click" Height="25" Cursor="Hand">
<MenuItem.Icon>
<Image Source="/Resources/Icons/MenuBar/document.ico" Height="25"/>
</MenuItem.Icon>
</MenuItem>
</DataTemplate>
</MenuItem.ItemTemplate>
</MenuItem>
This is the Result that I get, I want to only display what's labeled as 1 and remove the part 2.
I hope the question was clear enough, thank you.