Hi,
I have added some custom commands to my RadPane's HeaderTemplate and TitleTemplate as follows:
The DataContext for each Pane is being set programmatically to a business object and when the commands above fire I would like the business object passed as the CommandParameter. However the CommandParamter is always passed as the string value that the Title or Header property is being set to. I am binding the Header and Title properties to the relevant business object property programatically as follows:
pane.SetBinding(RadPane.HeaderProperty, new Binding() { Source = contentItem, Path = new PropertyPath("ContentName") });
pane.SetBinding(RadPane.TitleProperty, new Binding() { Source = contentItem, Path = new PropertyPath("ContentName") });
Any ideas how I can get the CommandParameter to pass the DataContext of the parent RadPane as opposed to the value of ContentName?
Regards,
Chris
I have added some custom commands to my RadPane's HeaderTemplate and TitleTemplate as follows:
<
telerikSchema:RadMenuItem
CommandTarget
=
"{Binding}"
CommandParameter
=
"{Binding}"
Command
=
"DashboardCommands:DashboardContentCommands.DeleteContentCommand"
Header
=
"{Binding Command.Text, RelativeSource={RelativeSource Self}}"
/>
The DataContext for each Pane is being set programmatically to a business object and when the commands above fire I would like the business object passed as the CommandParameter. However the CommandParamter is always passed as the string value that the Title or Header property is being set to. I am binding the Header and Title properties to the relevant business object property programatically as follows:
pane.SetBinding(RadPane.HeaderProperty, new Binding() { Source = contentItem, Path = new PropertyPath("ContentName") });
pane.SetBinding(RadPane.TitleProperty, new Binding() { Source = contentItem, Path = new PropertyPath("ContentName") });
Any ideas how I can get the CommandParameter to pass the DataContext of the parent RadPane as opposed to the value of ContentName?
Regards,
Chris