RoutedCommand to EdgeControl

Aug 4, 2011 at 10:54 AM

I created a RoutedCommand in my ViewModel and want to bind it to a ContextMenueItem which belongs to graphsharp:EdgeControl

like here:

<Style TargetType="{x:Type graphsharp:EdgeControl}">
           
            <Style.Resources>
                <ContextMenu x:Key="EdgeContextMenue">
                    
<
MenuItem Header="_Edit" Command="{Binding EdgeClickCommandModel.Command}" CommandParameter="Test" local:CreateCommandBinding.Command="{Binding EdgeClickCommandModel}"/> <MenuItem Header="_Program" /> </ContextMenu> <ToolTip x:Key="ToolTipContent"> <StackPanel> <TextBlock FontWeight="Bold" Text="Edge Information"/> <!--EdgeDescript von PocEdge--> <TextBlock x:Name="edgeDescr" Text="{Binding EdgeDescript}"/> </StackPanel> </ToolTip> </Style.Resources> <Setter Property="ToolTip" Value="{StaticResource ToolTipContent}"/> <Setter Property="ContextMenu" Value="{StaticResource EdgeContextMenue}" /> </Style>

 

When I use that Binding in my main menue it works:

<MenuItem Header="_Edit" Command="{Binding EdgeClickCommandModel.Command}" CommandParameter="Test"
                          local:CreateCommandBinding.Command="{Binding EdgeClickCommandModel}"/>

Has anyone an idea how to get it connected?