Ticket T335011
Visible to All Users

Close Panel Button

created 9 years ago

How to set AutomationId for CloseButton for Panels?

Answers approved by DevExpress Support

created 9 years ago

Hello,
To accomplish this task, you can create an additional attached property for your LayoutPanel, find the "PART_CloseButton" element according to the following article and bind the corresponding AutomationId property to your attached property: How to modify DX themes in WPF.

Thanks,
Kirill

    Show previous comments (8)

      That is OK. Not sure if it worked correctly. Found some strange AutomationId. Please look at my video.

        Tried yours solution with mine MVVM code and not worked. Sth must have done wrong. Attached code and solution. Please take a look.

        DevExpress Support Team 9 years ago

          Thank you for providing the modified sample. As I can see, the AutomationProperties.AutomationId property is set correctly on your side. The issue occurs because of the ControlBoxButtonPresenterAutomationPeer implementation - it ignores the AutomationProperties.AutomationId property value. Our developers will fix this issue. In order not to overload this thread, I have created a separate report about this problem - ControlBoxButtonPresenter - The AutomationProperties.AutomationId property value is ignored.
          As a quick fix, you can replace ControlBoxButtonPresenter with a custom descendant - see the attached sample.

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.