shared.PopupButton Popup behaves different when clicking

Editors for WPF Forum

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Version: 22.1.1
Avatar

Hi,

On the v 2019.1.687 the second click on the shared.PopupButton would close the popup. Currently on 2022.1 all the clicks opens the Popup. Can I somehow have the same behavior as in the 2019.1.687 version?

Kind regards,

Daniel

Comments (8)

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

Hello,

I'm testing this in our Shared Library's Popup Button QuickStart and am not seeing the described behavior.  Note that we have been working on PopupButton recently, so I wonder if you are on an older build that may have had this problem but has since been fixed.  Can you verify the exact version/build you are using?  I'm testing with a preview build of v22.1.2 but I don't believe the PopupButton logic has changed since its updates in v22.1.1.


Actipro Software Support

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi,

I am testing with the "Themes" button from the Controls Sample Browser. Is a shared:PopupButton like the ones I am using in my app. The "View" button behaves the same.

Kind regards,

Daniel

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

I was using shared:PopupButton Template and not working. If I will use ContentTemplate it will work but I want to be able to set the control template not a data template.

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi,

I managed to fix my behavior adding the x:Name="PART_IndicatorArea" on the control under the ControlTemplate.

Kind regards,

Daniel

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

One question tough. There is a way for me to change the drop shadow of the popup from the PopupButton ?

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

Hi Daniel,

Yes the popup portion of the PopupButton needs to have a Key of "PART_IndicatorArea" so that we know you are clicking on that part of the control.  Our default title bar button style's template (via SharedResourceKeys.WindowTitleBarButtonBaseStyleKey) didn't have that key set since it was originally used for regular Buttons and then was later updated to support PopupButton.  We've updated the template to also set the "PART_IndicatorArea" Key so that the use of PopupButton in the title bar functions as expected when clicking it to close the menu.

The Popup in a PopupButton's template (if you are using popup content) or our themed ContextMenu template (if you are using a popup menu) have these resources used for ShadowChrome:

<shared:ShadowChrome Direction="{DynamicResource {x:Static themes:AssetResourceKeys.PopupShadowDirectionDoubleKey}}"
  ShadowOpacity="{DynamicResource {x:Static themes:AssetResourceKeys.ShadowOpacityNormalDoubleKey}}">

You could override those resources in Application.Resources to other values if you wish.


Actipro Software Support

Posted 5 months ago by Daniel Constantin - ModuleWorks GmbH
Avatar

But what means that PopupShadowDirectionDoubleKey double value or the PopupShadowElevationInt32Key int value. I could not found any documentation about what value should I add for those.

The PopupShadowDirectionDoubleKey  is between 0 and 1, is an angle between 0 and 360 ?

Kind regards,

Daniel

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

Hi Daniel,

While the resources don't have documentation, the ShadowChrome control itself has documentation for the properties being set.

PopupShadowElevationInt32Key is an int for elevation of the shadow, a value from 0 to 24.

PopupShadowDirectionDoubleKey is a double from 0 to 360 that represents the direction of the shadow, in degrees, where 270 is down, 315 is lower-right, etc.  The default is 270, which is what most modern apps now use.  It is recommended to leave this the default.


Actipro Software Support

The latest build of this product (v22.1.3) was released 20 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.