How to add a PopupButton to a Ribbon StackPanel in code?

Ribbon for WPF Forum

Posted 11 years ago by Crile Carvey
Avatar
Given this in XAML:
    <ribbon:StackPanel x:Name="ListButtonPanel" >
        <ribbon:PopupButton Label="Button" />
    </ribbon:StackPanel>
I'd like to do something like this in the code:
    PopupButton pb = new PopupButton();
    pb.Label="New button";
    ListButtonPanel.Children.Add(pb); 
But Visual Studio Intellisense doesn't think it is a good idea.

Any hints?

Crile

[Modified at 11/17/2008 08:12 PM]

Comments (2)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Crile,

That code looks fine to me, other than my guess is that your code PopupButton reference might be pulling in the one in ActiproSoftware.Windows.Controls namespace instead of the one in the ActiproSoftware.Windows.Controls.Ribbon.Controls namespace.


Actipro Software Support

Posted 11 years ago by Crile Carvey
Avatar
Thanks - that was it.

Crile
The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.