Breaking Change T972518
Visible to All Users

Popup - The HeaderTemplate property has changed its signature

What Changed

The HeaderTemplate property changed its type from RenderFragment to RenderFragment<IPopupElementInfo>.

Reasons for Change

We decided to pass the IPopupElementInfo object as the context parameter for this template. The parameter contains an API that can be useful when customizing headers. For instance, you can use context.CloseCallback to implement a Close button.

Impact on Existing Apps

This change affects applications in the following cases:

  1. If you use the Popup component and another templated component (declare one within the other). The following error occurs: "…The child content element 'ChildContent' of component 'X' uses the same parameter name ('context') …"
Razor
<DxPopup ...> <HeaderTemplate> <DxFormLayout> @*...*@ <DxFormLayoutItem> <Template> <DxButton Click="OnClick" Text="OK"></DxButton> </Template> </DxFormLayoutItem> </DxFormLayout> </HeaderTemplate> </DxPopup>
  1. If you create the HeaderTemplate in C# code instead of markup.
Razor
<DxPopup HeaderTemplate="@CreateTemplate()" ...> @*...*@ </DxPopup> @code { public RenderFragment CreateTemplate() { return x => @<p>My Text</p>; }

How to Update Existing Apps

  1. If you nest the Popup and another templated component, specify the Context parameter explicitly in one of them.
Razor
<DxPopup ...> <HeaderTemplate Context="PopupContext"> <DxFormLayout> @*...*@ <DxFormLayoutItem Context="ItemContext"> <Template> <DxButton Click="OnClick" Text="OK"></DxButton> </Template> </DxFormLayoutItem> </DxFormLayout> </HeaderTemplate> </DxPopup>
  1. If you create the header template in C# code, use the RenderFragment<IPopupElementInfo> type instead of RenderFragment.
Razor
<DxPopup HeaderTemplate="@CreateTemplate()" ...> @*...*@ </DxPopup> @code { public RenderFragment<IPopupElementInfo> CreateTemplate() { return x => @<p>My Text</p>; }

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.