I was playing with the samples.
One of the basic requirements is to be able to support context menus.
I did not see any examples with context menus. So I tried modifying the following, in the datadrilldown.xaml sample:
<TextBlock Grid.Column="1" x:Name="TextBlockRevenue" FontWeight="Bold" TextWrapping="Wrap" DataContext="{TemplateBinding DataContext}" Text="{Binding Path=Revenue, StringFormat='{}{0:C}'}" > <TextBlock.ContextMenu> <ContextMenu> <MenuItem Header="My ConextMenu">Foo_0</MenuItem>
</ContextMenu> </TextBlock.ContextMenu> </TextBlock>
I also added the following
<ig:XamTreemap.NodeBinders> <ig:NodeBinder TargetTypeName="Manufacturer" ValuePath="Revenue" TextPath="Name" ItemsSourcePath="Products" NodeStyle="{StaticResource ManufacturerNodeStyle}" > <ig:NodeBinder.ContextMenu> <ContextMenu IsEnabled="True" AllowDrop="True"> <ContextMenu.Items> <MenuItem Header="My New ContextMenu">Foo_1</MenuItem> </ContextMenu.Items> </ContextMenu> </ig:NodeBinder.ContextMenu> </ig:NodeBinder>
When I run the application, right-mouse-button click will not display the context menu.The intellisense shows that the object.ContextMenu is understood and the xaml compiles. it just does not display at runtime.
It would have been great if the treeMap examples also included some context menu sample.Would it be possible to get a simple complete example, ideally using the MVVM pattern.
Thank
Currently silverlight does not support a standart way to show context menus. You may try using our xamContextMenu control.
thanks for your reply.
I am not using the silverlight version/.
I'm analyzing the viability of using the WPF version. Does this change the answer?Thanks