A StackButton can be a PushButton with options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Perhaps this idea might be usable for others.
The StackButton ribbon control is a stack of different PushButtons where the last used PushButton remains visible to be used again. That visible button is the stack button's currentbutton property. Imagine if that StackButton control always shows the first button in the stack and the other button(s) in the StackButton are secondary to the first button's purpose.
Using the callback concept described in Jeremy Tammik's http://thebuildingcoder.typepad.com/blog/2012/11/roll-your-own-toggle-button.html you can have the second Pushbutton in a two button Stackbutton reset the Stackbutton's current button property back to that of the first button. Therefore this StackButton item always shows and activates the first button's action on its button face but also has a secondary option to invoke a settings manager activated by the second button.
Set the first button in the button stack set to your add-in command of choice. Set the second button in the button stack to show a Window Form or WPF Window to be the first button's settings manager. Have the settings communicated through the Add-in's Properties.Settings. The first button's command reads the current settings prior to acting. The second button's actions reads, sets and saves the settings the first button uses. It ends with a call back function that resets the StackButton's currentbutton to the first button in the stack. These settings would also persist between Revit sessions.
For example this is what a second button might invoke.
[Transaction(TransactionMode.Manual)] class SectionFarClipResetOptions : IExternalCommand { public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { FarClipSettingWPF settingWPF = new FarClipSettingWPF(); settingWPF.ShowDialog(); AppWTA.Instance.SetSplitButtonFarClipToTop(); return Result.Succeeded; } }
This is what the callback function might be in a hardcoded style.
public void SetSplitButtonFarClipToTop() { IList<PushButton> sbList = sbFarClip.GetItems(); sbFarClip.CurrentButton = sbList[0]; }
sbFarClip is a public SplitButton in this case.