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:
- Add the
override
key word to theComponentModel
property of your Component Adapter. If you do not have this property, implement a property that returns your Component Adapter'sIComponentModel
value. - 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; }
// ...
}
}