Hi all,
I am creating some RibbonGroup with different number of ButtonTools inside. One of the features of my application is the possibility for the user to show/hide this buttons. Depending of the number os ButtonTools shown in each RibbonGroup I would like to change aligment of the ToolVerticalWrapPanel: in case there are three or more ButtonTools shown it should be 'Top'; and in case the user only shows one or two ButtonTools in the RibbonGorup, the ToolVerticalWrapPanel should be 'Center'.
This is how the ToolVerticalWrapPanel is defined in xaml:
<igWPF:RibbonGroup.ItemsPanel>
<ItemsPanelTemplate>
<igWPF:ToolVerticalWrapPanel Name="AligmentTest" VerticalToolAlignment="Top" />
</ItemsPanelTemplate>
</igWPF:RibbonGroup.ItemsPanel>
This is how I am trying to change the property in the code if the number of ButtonTools shown are less than three:
AligmentTest.VerticalToolAlignment = RibbonPanelVerticalToolAlignment.Center;
However, the problem is the name of the wrappanel (AligmentTest) is not being recognized in the code and gives an error. Is there any another way to do this?
Many thanks in advance. Regards,
Víctor
Solved. Finally I changed the previous xaml code for this one:
<WrapPanel Orientation="Vertical" VerticalAlignment="Center"/>
This provides the functionality I needed exactly. However, I anyone knows how to change the properties of a ToolVerticalWrapPanel programatically, it would be very interesting for the future :)
Regards,
Hello Victor,
If you want to get the ToolVerticalWrapPanel by name you should define it like this:
<igRibbon:XamRibbon.Tabs> <igRibbon:RibbonTabItem Header="header1"> <igRibbon:RibbonGroup Caption="group1"> <igRibbon:ToolVerticalWrapPanel Name="tool" VerticalToolAlignment="Bottom"> <igRibbon:ButtonTool Caption="button1"/> </igRibbon:ToolVerticalWrapPanel> </igRibbon:RibbonGroup> </igRibbon:RibbonTabItem> </igRibbon:XamRibbon.Tabs>
but it seems like that there is an issue with setting its VerticalToolAlignment Property, so I have logged this with development under ID: 185420 and I have also created a support ticket on your behalf: CAS-147387-T5T7H1 and have linked the development issue to it, so that you can get automatically updated, when a Service Release containing the fix is available for download. You can get the new version from our website’s “My IG”, “My Keys & Downloads” tags: https://www.infragistics.com/Membership/Default.aspx?panel=Downloads#Downloads
You can also monitor the support ticket’s progress through the “My Support Activity” tag: https://www.infragistics.com/Membership/MySupport.aspx
Hello Stefan,
Thanks a lot for your answer. Finally I have defined the ToolVerticalWrapPanel as you suggested me and then I can get it by name in the code. Once I did this, i can change the VerticalToolAlignment property without any problem in my code with the following line (for instance, to change the alignment to Top):
tool.VerticalToolAlignment = Infragistics.Windows.Ribbon.RibbonPanelVerticalToolAlignment.Top;
So by my side the problem is completely solved. Thanks again.