CodeBeam.MudBlazor.Extensions icon indicating copy to clipboard operation
CodeBeam.MudBlazor.Extensions copied to clipboard

Modification in abstract classes

Open sharafee opened this issue 1 year ago • 3 comments
trafficstars

Hello, I have a suggestion for improving the extensibility of your project. To make it easier for us to use the core classes of your component, please consider making a few adjustments. For instance, in the class: public abstract class MudBaseInputExtended<T> : MudFormComponent<T, string>

Please define the Value parameter as virtual:

[Parameter] [Category(CategoryTypes.FormComponent.Data)] public virtual T? Value { get => _value; set => _value = value; }

Thank you!

sharafee avatar Jul 21 '24 11:07 sharafee

Well, why not. Could you prepare a PR?

mckaragoz avatar Jul 21 '24 13:07 mckaragoz

Sure, I can prepare a PR.

sharafee avatar Jul 21 '24 19:07 sharafee

Summary This Pull Request addresses an issue where the Value property in the MudBaseInputExtended class cannot be customized in derived classes when using @bind-Value. To resolve this, the Value property is made virtual in MudBaseInputExtended.

Changes Updated the MudBaseInputExtended class to make the Value property virtual. Motivation The current implementation does not allow customization of the Value property in derived classes, which is necessary for creating custom components that bind to the Value property using @bind-Value. Making the Value property virtual enables derived classes to override it and customize its behavior.

Testing Verified that the Value property can now be overridden in derived classes. Ensured that existing functionality remains unaffected by this change. Related Issues No specific issues reported but addresses a limitation in the flexibility of the MudBaseInputExtended class.

sharafee avatar Jul 22 '24 02:07 sharafee