ReduceOrder sample explanation request

Dec 22, 2012 at 10:59 PM
Edited Dec 22, 2012 at 11:00 PM

Hello

Recently I've started to learn this great control but when I've got to the topic of resizing and looked at the showcase example then It realy made yoghourt out of my brain.

What I do understand is that in RibbonTabItem in ReduceOrder property I have to provide the Name property of RibbonGroupBox that should be shrinked as next when window will be shrinked and controls wouldn't fit in. Ok. That's what I do understand. But then looking at the showcase example I saw something like: Font, Font, Font, Font, B, A, A, A, (A).....

So my question is: What's B, A and (A) ?

And if possible is it possible to get effect like this:

3 controls. Buttons to be precise:

Large, Large, Large, Large, Large, Middle, Small
Large, Large, Large, Middle, Small, Small, Small
Large, Middle, Small, Small, Small, Small, Small

So basicly next button will shink only when previous one is in state of "Small" size.

 

Thanks in advance

Dec 23, 2012 at 10:18 AM

Hi, 

in the following I'm referring to the Resize Sample on the download page (2.0 release).

as you may have already noticed, there are three SizeDefinitions (Large, Middle, Small) each ribbon control can have. 

The buttons are normally placed in a RibbonGroupBox, which is important for the next step. You name the RibbonGroupBox (e.g. "Other" like in the Sample) and fill it with buttons. A button with SizeDefinition="Large, Large, Large" means, that every time you are requesting a resize, the button stays in its large size (you can also write SizeDefinition="Large" to short it).

When you set the ReduceOrder in the TabItems property, you values in it refer to the controls name. So ReduceOrder="Default,Default,Default,Large,Large,Large,Other,Other,Other" refers to the RibbonGroupBoxes Default, Large and Other. Keep in mind, that the first reduced item is equals to the last in the row (so you have to kinda reverse the property in you mind to get the actual reduce order).

What the ReduceOrder does: 

It reduces the size definition of the named control. So first item means "Other" is set to large (now the buttons have the size: Large, Large, Middle, Middle). Next "Other" is set to middle (the buttons have the size: Large, Large, Small, Small). Next "Other" is set to Small (buttons are set to: Large, Small, Small, Small).

 

To came to your example: Name the button b1, b2 ,b3 (You can set SizeDefinitions to Large,Middle,Small or just leave it empty; has same effect). In the TabItems ReduceOrder you write (b1 will be resized first) : b3,b3,b3,b2,b2,b2,b1,b1,b1

I hope I could help you a little. In the download of the 2.0 Release are more SampleApplications, which are easier to to understand than the showcase app. 

Dec 23, 2012 at 4:05 PM

Hi and thanks for reply :)

Actually I understood the Resize sample from samples. But then I started watching showcase app and I just wondered what's "(A)" in ReduceOrder.

Ok. So what you're saying is that i can put even button's name in ReduceOrder list? That's great :)

I'll test it in a few hours how it works. But then again. What's "(A)" from the showcase?

I'm sorry. I have verry specific mind and I like to know all the details. Who knows? Maybe knowing this "trick" will come in handy someday :)

And because Xmas is near then I wish you and everybody here Merry Christmas and a Happy New Year :)

Dec 30, 2012 at 10:41 PM

I don't really know, what the "()" does, but the letter/name inside refers to an element. According to the source code, it modifies the resize size. But I'm not sure with this. Guess you have to test it.