Hi,
I want to use a context menu into my ListBox Items, I want to each item has a context menu and items in context menu will bring up a new window. I've bind the Menu with this code:
The question is how should I Bind my parameter to ContextMenu from my datasource, and then second how I open a new window and pass my parameter into it.
Regards
Mazdak
I want to use a context menu into my ListBox Items, I want to each item has a context menu and items in context menu will bring up a new window. I've bind the Menu with this code:
<
ListBox
Grid.Column
=
"0"
Grid.Row
=
"0"
HorizontalAlignment
=
"Stretch"
Margin
=
"0,0,0,0"
Name
=
"FileListBox"
VerticalAlignment
=
"Top"
BorderThickness
=
"0"
>
<
ListBox.ItemsPanel
>
<
ItemsPanelTemplate
>
<
toolkit:WrapPanel
Orientation
=
"Horizontal"
HorizontalAlignment
=
"Stretch"
Margin
=
"0,0,0,0"
Name
=
"FileWrapPanel"
VerticalAlignment
=
"Stretch"
Width
=
"490"
/>
</
ItemsPanelTemplate
>
</
ListBox.ItemsPanel
>
<
ListBox.ItemTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Vertical"
Margin
=
"10,0"
>
<
TextBlock
Text
=
"{Binding wisdom_files.file_name, Converter={StaticResource ImageSourceFormatter}}"
Name
=
"FileNameText1"
/>
<
TextBlock
Text
=
"{Binding wisdom_files.file_name}"
Name
=
"FileNameText"
/>
</
StackPanel
>
</
DataTemplate
>
</
ListBox.ItemTemplate
>
<
telerik:RadContextMenu.ContextMenu
>
<
telerik:RadContextMenu
x:Name
=
"ContextMenu"
>
<
telerik:RadMenuItem
Header
=
"Edit Competencies"
/>
<
telerik:RadMenuItem
Header
=
"Open File"
/>
</
telerik:RadContextMenu
>
</
telerik:RadContextMenu.ContextMenu
>
</
ListBox
>
The question is how should I Bind my parameter to ContextMenu from my datasource, and then second how I open a new window and pass my parameter into it.
Regards
Mazdak