Custom context menu in ApplicationMenu.AdditionalContent

Ribbon for WPF Forum

Posted 2 years ago by Jane
Version: 22.1.1
Avatar

Hi, in v17 of Actipro, I was able to add a custom context menu within the additional content. That worked in v17 but starting v18, I'm not seeing the custom context menu anymore and I only see the default context menus of "Show Quick Access Toolbar..." and "Minimize the ribbon". Is there another way of doing this now? Here's my code:

<ribbon:ApplicationMenu>
    <ribbon:Button  Label="New" KeyTipAccessText="N" InputGestureText="Ctrl+N"/>
                  
    <ribbon:ApplicationMenu.AdditionalContent>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0" Text="Files:" Padding="5" FontWeight="Bold"/>

            <ListBox Grid.Row="1" ItemsSource="{Binding InternalList}">
                <!--Context Menu-->
                <ListBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Remove From List"/>
                        <MenuItem Header="Clear List" />
                    </ContextMenu>
                </ListBox.ContextMenu>
            </ListBox>

        </Grid>

    </ribbon:ApplicationMenu.AdditionalContent>

</ribbon:ApplicationMenu>

Comments (3)

Answer - Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thanks for reporting this.  We've fixed it for the next maintenance release v22.1.2.


Actipro Software Support

Posted 11 months ago by Procam
Avatar

Hello, has it been fixed with v22.1.2? I have that version and experience the same issue.

Posted 11 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

The note above says it was fixed for v22.1.2.  I tried pasting a ListBox with a ContextMenu in an ApplicationMenu.AdditionalContent and ran it in our latest v23.1 code and I saw the custom ContextMenu display.  Note that you do need the ContextMenu property set to a non-null value to avoid our built-in context menu from showing.  If you still see the problem happening in v23.1, please tell us exactly how to reproduce it in one of our samples.  Thank you!


Actipro Software Support

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.