Breaking Change T958401
Visible to All Users

Popup - The CloseButtonClick event changed the delegate type from Action to EventCallback

What Changed

The DxPopup.CloseButtonClick event changed the delegate type from Action to EventCallback.

Reasons for Change

The Action delegate type could cause errors and inconvenience when the CloseButtonClick event handler contained asynchronous code.

For this delegate type, you also had to call the StateHasChanged method to re-render the Popup after changes. The EventCallback delegate contains a reference to its bound component and calls the StateHasChanged method automatically. So, you no longer need to care about component re-rendering and complicate your code.

Razor
<DxPopup HeaderText="Header" @bind-Visible="@PopupVisible" CloseButtonClick="@OnCloseButtonClick"> <Content><p>Content</p></Content> </DxPopup> @code { bool PopupVisible { get; set; } = false; void OnCloseButtonClick() { PopupVisible = false; // InvokeAsync(StateHasChanged); You no longer need to call this method. // ... } }

Impact on Existing Apps

This change will affect your application if you handle the CloseButtonClick event in C# code using RenderTreeBuilder (instead of the Razor markup).

C#
builder.OpenComponent<DxPopup>(0); builder.AddAttribute(1, "CloseButtonClick", new Action(OnCloseButtonClick);

How to Update Existing Apps

Handle the event in C# code as shown below.

C#
builder.OpenComponent<DxPopup>(0); builder.AddAttribute(1, "CloseButtonClick", EventCallback.Factory.Create(receiver, OnCloseButtonClick);

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.