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
70
How to change ToolVerticalWrapPanel properties
posted

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