RibbonSplitButton Synchronized With Current Item and Static text?

RibbonSplitButton Synchronized With Current Item and Static text?

andgas.lordone
Explorer Explorer
1,036 Views
2 Replies
Message 1 of 3

RibbonSplitButton Synchronized With Current Item and Static text?

andgas.lordone
Explorer
Explorer

Hi,
I'm a little problem with the RibbonSplitButton.
I wanted the current button contains the image and the action of current item, but the text I want it to be static.
The RibbonSplitButton contains a property called "IsSynchronizedWithCurrentItem" that does this, but it takes all information of current item.
I want behavior equal to the circle of ribbon autocad, where the text "circle" is static, as shown in the image below:

 

RibbonSplitButton.jpg

 

Below a generic code of how I did:

RibbonSplitButton panSplitButton = new RibbonSplitButton();
panSplitButton.Text = "Circle";
panSplitButton.ShowText = true;
panSplitButton.ShowImage = true;
panSplitButton.IsSplit = true;
panSplitButton.Size = RibbonItemSize.Large;
panSplitButton.IsSynchronizedWithCurrentItem = true;

RibbonButton panButton1 = new RibbonButton();
panButton1.Text = "Center, Radius";
panButton1.ShowText = true;
panButton1.ShowImage = true;
panButton1.Image = Images.getBitmap(Properties.Resources.Small);
panButton1.LargeImage = Images.getBitmap(Properties.Resources.large);
panButton1.Size = RibbonItemSize.Large;
panButton1.Orientation = System.Windows.Controls.Orientation.Vertical;
panButton1.CommandHandler = new RibbonCommandHandler();

RibbonButton panButton2 = new RibbonButton();
panButton2.Text = "Center, Diameter";
panButton2.ShowText = true;
panButton2.ShowImage = true;
panButton2.Image = Images.getBitmap(Properties.Resources.Small);
panButton2.LargeImage = Images.getBitmap(Properties.Resources.large);
panButton2.Size = RibbonItemSize.Large;
panButton2.Orientation = System.Windows.Controls.Orientation.Vertical;
panButton2.CommandHandler = new RibbonCommandHandler();

panSplitButton.Items.Add(panButton1);
panSplitButton.Items.Add(panButton2);

 

How can I keep the static text "circle" in the "IsSynchronizedWithCurrentItem" property as true?

 

0 Likes
Accepted solutions (1)
1,037 Views
2 Replies
Replies (2)
Message 2 of 3

Jeff_M
Consultant
Consultant
Accepted solution

Welcome to the Forums!

 

Use the SynchronizeOption property:

panSplitButton.SynchronizeOption = RibbonListButton.RibbonListButtonSynchronizeOption.Image;
Jeff_M, also a frequent Swamper
EESignature
0 Likes
Message 3 of 3

andgas.lordone
Explorer
Explorer
Thank you, your answer worked here! Thank you so much!

I think that this property "SynchronizeOption" should be specified in the documentation of autodesk, on Managed Class Reference Guide.
0 Likes