views:

24

answers:

0

Hi,

I have the following Menu witch works to some point ... then I added the two MenuItems under the Binding Item ... so each binded item would get a Delete and Edit MenuItem.

<MenuItem x:Name="miUserList" Header="User" Click="miUserList_Click" >
    <MenuItem Header="Add new user"></MenuItem>
    <MenuItem.ItemTemplate>
        <DataTemplate>
            <ItemsControl>
                <MenuItem Header="{Binding DetailsName}" Tag="{Binding }" >
                    <MenuItem Header="Delete"/>
                    <MenuItem Header="Edit"/>
                </MenuItem>
            </ItemsControl>
        </DataTemplate>
    </MenuItem.ItemTemplate>
</MenuItem>

But, they dont show up in the code ... am I doing something wrong here ? I have been searching google without much luck, other than an other question here: link text

But I dont understand what they are doing and it does not seem to answer my question.

My menu structure should be something like this:

  • File
  • Show
    • Users
      • Add user
      • Seperation line - static - problem here, how can I add these 2 static items, when the users are bound ?
      • User 1
      • User 2 - Also, under each user I want 2 MenuItems, as described above
      • User 3
      • User 4
  • Help

The problem is also written in xaml above ... and described as good as possible, if there are any further question, please do ask, this is killing me ... thought this would be a simple task but its killing me ... :-(

Best regrards