Breaking Change T1189089
Visible to All Users

Blazor - A new ComponentModel property in IComponentAdapter classes is required for custom Property Editors

What Changed

In v.23.1.5, we introduced the IComponentModelHolder interface with the ComponentModel property. If you implemented this interface in your custom Component Adapter, you could use the BlazorPropertyEditorBase.ComponentModel property to access the Component Adapter properties.

In v.23.2, we integrated the IComponentModelHolder interface into the IComponentAdapter interface. The ComponentAdapterBase class now comes with the abstract ComponentModel property.

Reasons for Change

This change allows for more efficient access to ASP.NET Core Blazor Property Editor underlying components at runtime in Controllers and their contexts .

Example: Disable Mouse Wheel Functionality in NumericPropertyEditor v.22.2 and v.23.1.5+ (NEW).

Impact on Existing Apps

This change affects your ASP.NET Core Blazor application if you implemented custom Property Editors based on custom Razor, DevExpress, and third-party components.

Example: Implement a Property Editor Based on a Custom Component (Blazor).

If you accessed ASP.NET Core Blazor Property Editor underlying components at runtime in Controllers and their contexts, you can optionally update your code to use a simpler approach.

Example: Disable Mouse Wheel Functionality in NumericPropertyEditor v.22.2 and v.23.1.5+ (NEW).

How to Update Existing Apps

To update your application, do the following:

  1. Add the override key word to the ComponentModel property of your Component Adapter. If you do not have this property, implement a property that returns your Component Adapter's IComponentModel value.
  2. Remove the implementation of the IComponentModelHolder interface from your Component Adapter, if there is one.

The following code snippets demonstrate changes to the implementation of a custom Component Adapter:

v.23.1.5

C#
// ... using DevExpress.ExpressApp.Blazor.Components; namespace YourSolutionName.Blazor.Server { public class InputAdapter : ComponentAdapterBase, IComponentModelHolder { public InputAdapter(InputModel componentModel) { ComponentModel = componentModel ?? throw new ArgumentNullException(nameof(componentModel)); ComponentModel.ValueChanged += ComponentModel_ValueChanged; } public InputModel ComponentModel { get; } IComponentModel IComponentModelHolder.ComponentModel => ComponentModel; // ... } }

v.23.2+

C#
// ... using DevExpress.ExpressApp.Blazor.Components; namespace YourSolutionName.Blazor.Server { public class InputAdapter : ComponentAdapterBase { public InputAdapter(InputModel componentModel) { ComponentModel = componentModel ?? throw new ArgumentNullException(nameof(componentModel)); ComponentModel.ValueChanged += ComponentModel_ValueChanged; } public override InputModel ComponentModel { get; } // ... } }

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.