How can I remove the little 'Configure buttons' popup menu on the XamOutlookBar or at least disable it?
The one containing the items " Show More buttons, Show Fewer buttons, etc..." Thanks,
You would need to retemplate the GroupOverflowArea. We ship the default xaml as part of the install so you can use the default style for that element from the DefaultStyles directory as the basis for creating your custom style. I would recommend not entirely removing the PART_OverflowMenu since that menu should be available in case there are more groups than can fit in the overflow area or else your end user will not be able to select any groups that don't fit in the overflow area. Instead you may want to just remove the menu items that you don't want to be there (e.g. ShowMoreButtonsMenuItemHeader).
We put in a support request for exactly this (CAS-30587-IP5QDZ). Could you please provide an exact example of how to achieve this?
Joe Koolipurackal
Licensed user for NetAdvantage for WPF
Well if you submitted this to the support group then they will handle your issue. That being said, you may want to familiarize yourself with retemplating elements since you will likely come across a need to do this for other things. As I mentioned we ship the default xaml for the controls in the DefaultStyles directory so you can use that as the basis for any custom templates/styles you would create for that element. In this case I mentioned that the element in question is the GroupOverflowArea so you would take the Style for that from the default styles and then modify it as needed. So you could copy the Style for that element. Then find the MenuItem instances within the PART_OverflowMenu named MenuItem in that style's ControlTemplate and remove them (there are 4 child menu items in our default template that you probably want to remove - the more buttons, less buttons, options and add/remove menu items). And put that modified Style into the Resources of your xamOutlookBar.
I tried many attempts at customizing the style, but they did not work. Something like:
<Window.Resources> <Style TargetType="{x:Type igOutlookBar:GroupOverflowArea}"> <Setter Property="Visibility" Value="Collapsed" /> </Style>
Perhaps the default style is being applied after my custom style. In any case, if a style can be applied that would have solved this issue, a simple example would have been very useful.
The final solution that worked in code was as follows: // Find and hide the Customize MenuItem of the OutlookBar FrameworkElement overflowArea = Infragistics.Windows.Utilities.GetDescendantFromName(outlookBar, "PART_OverflowArea"); if (overflowArea != null) { overflowArea.Visibility = Visibility.Collapsed; }
Best regards,Joe Koolipurackal
On one final attempt, the following achieved the same results and hides the overflow area, so I thought I'd post it here:
<igOutlookBar:XamOutlookBar.Resources>
<Style TargetType="{x:Type igOutlookBar:GroupOverflowArea}"> <Setter Property="Visibility" Value="Collapsed" /> </Style>
</igOutlookBar:XamOutlookBar.Resources>
Best regards,
If you want to just get rid of the extended menu, we have found that the following works for us.
<IgOutlookBar:XamOutlookBar.Resources>
<Style x:Key="{x:Static IgOutlookBar:XamOutlookBar.OverflowMenuButtonStyleKey}" TargetType="MenuItem">
<Setter Property="Visibility" Value="Hidden" />
</Style>
</IgOutlookBar:XamOutlookBar.Resources>
This way we can still access the overflow area, but don't get the menu.
Yes putting the Style into the outlookbar's resources would be necessary if you have set the Theme since setting the Theme puts resources for that theme into the control's resources and therefore that would be the local style that WPF would locate/apply.
Note, the reason why I didn't recommend changing the Visibility of this area is that the overflow area is needed to show the groups when either there isn't enough room to show the group headers and the selected group's content or when the user drags the splitter bar above the group headers down - forcing them into the overflow area. By collapsing the overflow area, you will prevent your end users from being able to access those. Perhaps you have only one group or perhaps this is acceptable for your application but I thought I should mention in case you didn't notice this or in case any one else is considering doing this.