I have MenuItem that uses ItemsSource.
<MenuItem Name="Profiles" Header="Profiles list" Background="{x:Null}" FontSize="12" DisplayMemberPath="Name"
ItemsSource="{Binding _profiles, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:MainWindow}}}">
When I try to access an item I get an item from ItemsSource... How can I get access in codebehind to MenuItems in foreach like below?
foreach (MenuItem mi in Profiles.Items)