Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Issue in MenuTool command.
posted

Hi,

Trying to display ToolMenuItem dynamically in MenuTool and wanted to hook the click event.

Following code giving two issues

(1) Click event is not firing (wanted to use System.Windows.Interactivity).

(2) Icon is displaying only in last item (not for all).

 

<igRibbon: MenuTool
igRibbon:RibbonGroup.MaximumSize="ImageAndTextLarge"
ButtonType="DropDown" Caption="Custom Items"
HorizontalAlignment="Left"
ItemsSource="{Binding Items}"
LargeImage="\Resources\Images\items-32x32.png"
SmallImage="\Resources\Images\items-16x16.png">

<i:Interaction.Triggers>
   <i:EventTrigger EventName="Click">
      <e2c:EventToCommand Command="{Binding MyCommand}" PassEventArgsToCommand="False" />
   </i:EventTrigger>
</i:Interaction.Triggers>


 <igRibbon:MenuTool.ItemContainerStyle>
 <Style TargetType="{x:Type igRibbon:ToolMenuItem}">
  <Setter Property="Icon">
   <Setter.Value>
   <Image Source="\Resources\Images\items-16x16.png" />
 </Setter.Value>

</Setter>

<Setter Property="ToolTip" Value="{Binding .}"/>
 </Style>
</igRibbon:MenuTool.ItemContainerStyle>
<igRibbon:MenuTool.ItemTemplate>
<DataTemplate>
 <TextBlock Text="{Binding .}" />
</DataTemplate>
</igRibbon:MenuTool.ItemTemplate>
</igRibbon:MenuTool>

 

 

Let me know if any mistake in the code.

Thanks,

Mani

Parents
No Data
Reply
  • 3255
    posted

    Hello Mani,

    I noticed that you have created this post a while ago. Please note, we are making efforts to ensure all posts are addressed by an Infragistics expert. We believe that the other community members could benefit from this thread as well.

    Regarding your request, I have created a sample for you but my sample is missing some dependent code.  You may modify my sample to show the issue; you would have to modify EventToCommand class in this sample.  My sample displays all the images in the menutool; you may take this as reference and see what your code is missing.

    XamRibbon_WindowsInteractivity.zip
Children
No Data