Unable to identify dropdown press event in splitbutton

Ribbon for WPF Forum

Posted 11 months ago by Surendra Mudragada
Version: 23.1.0
Avatar

I have created a split button in my application, now creating triggers to change the background color of each of the buttons inside split button whenever user presses them.

I was able to successfully implement for the normal button on the left hand side but for the right hand side button i am not getting the IsPressed property set to true even on pressing it, 

could you please help

Comments (3)

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

Hello,

IsPressed will only fire for the button portion of the ribbon:SplitButton control.  When the arrow part is pressed, the IsPopupOpen property will be set to true and the SplitButton.PopupCommand will execute.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was before the next post in this thread.
Posted 1 month ago by UI-UX
Avatar

What about on Preview mouse down events. How will we distinguish!? 

[Modified 1 month ago]

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

The classic Ribbon product's SplitButton has an element in its template with name "PART_Button".  If the mouse is over that element in the template, it is over the button part of the control.  If it is over the SplitButton but not over the "PART_Button" element, then it is over the drop-down button portion.  

The newer Bars product's BarSplitButton has a protected IsOverButtonArea method that you can pass a MouseEventArgs to and it will tell you if the mouse is over the button portion.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.