Posted 17 years ago
by Bryan Livingston
Version: 1.0.0348
Platform: .NET 3.5
Environment: Windows XP (32-bit)
![Avatar](https://secure.gravatar.com/avatar/f55330b6dda706e76732866182751ce0.jpg?s=64&d=identicon&r=g)
I've got an app that you can see at http://run.vectorstudio.com or http://install.vectorstudio.com
I'm using a context menu and the options on the menu are not initalizing correctly. When the app first starts all the context menu options are disabled, even though some of the same commands are enabled on the ribbon. The Paste and Gradient options should always be enabled.
They stay disabled until you create a new drawing and then close it. Running some other commands might also fix the menu. Once it's fixed it tends to stay fixed until the program is re-run.
Here is the xaml for the context menu:This problem isn't happening with the sample app. I'm not sure how to get you a clear repro or where to start. The drawings in my program are created after the ribbon control and the main window are initalized.
Perhaps a workaround would be to call some initalization of some kind manually. What should I try?
Thanks.
Bryan
I'm using a context menu and the options on the menu are not initalizing correctly. When the app first starts all the context menu options are disabled, even though some of the same commands are enabled on the ribbon. The Paste and Gradient options should always be enabled.
They stay disabled until you create a new drawing and then close it. Running some other commands might also fix the menu. Once it's fixed it tends to stay fixed until the program is re-run.
Here is the xaml for the context menu:
<UserControl.ContextMenu>
<ribbon:RibbonContextMenu Width="250">
<ribbon:Button Command="ApplicationCommands.Cut" />
<ribbon:Button Command="ApplicationCommands.Copy" />
<ribbon:Button Command="ApplicationCommands.Paste" />
<ribbon:Separator />
<ribbon:MenuButton Label="Grouping" >
<ribbon:Button Command="{x:Static v:GroupCommand.Command}" />
<ribbon:Button Command="{x:Static v:UngroupCommand.Command}" />
</ribbon:MenuButton>
<ribbon:MenuButton Label="Order" >
<ribbon:Button Command="{x:Static v:BringToFrontCommand.Command}" />
<ribbon:Button Command="{x:Static v:SendToBackCommand.Command}" />
<ribbon:Button Command="{x:Static v:BringForwardCommand.Command}" />
<ribbon:Button Command="{x:Static v:SendBackCommand.Command}" />
</ribbon:MenuButton>
<ribbon:MenuButton Label="Rotate" KeyTipAccessText="X">
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:RotateClockwiseCommand.Command}" />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:RotateCounterClockwiseCommand.Command}" />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:FlipVerticalCommand.Command}" />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:FlipHorizontalCommand.Command}" />
<ribbon:Separator />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:RotateCommand.Command}" />
</ribbon:MenuButton>
<ribbon:MenuButton Label="Align" >
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:AlignLeftEdgeCommand.Command}" />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:AlignHorizontalCentersCommand.Command}" />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:AlignRightEdgeCommand.Command}" />
<ribbon:Separator />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:AlignTopEdgeCommand.Command}" />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:AlignVerticalCentersCommand.Command}" />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:AlignBottomEdgeCommand.Command}" />
<ribbon:Separator />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:DistributeHorizontalCommand.Command}" />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:DistributeVerticalCommand.Command}" />
</ribbon:MenuButton>
<ribbon:Separator />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:ScaleCommand.Command}" />
<ribbon:Button KeyTipAccessText="X" Command="{x:Static v:SkewCommand.Command}" />
<ribbon:Button KeyTipAccessText="S" Command="{x:Static v:GradientTool.ToolCommand}" />
</ribbon:RibbonContextMenu>
</UserControl.ContextMenu>
Perhaps a workaround would be to call some initalization of some kind manually. What should I try?
Thanks.
Bryan