How to create a new Control
1. Creating CustomLabel Observable Class
CustomLabel Observable Class[Observable] public class CustomLabel : Label { [Intercepted] public string AnotherTextInternal { get; set;} public string AnotherText { get { return this.AnotherTextInternal; } set { this.AnotherTextInternal = value; this.AnotherTextChanged(EventArgs.Empty); } } [Intercepted] public EventHandler AnotherTextChanged { get; set; } protected virtual void OnAnotherTextChanged(EventArgs e) { this.AnotherTextChanged?.Invoke(this,EventArgs.Empty); } }
Observations when adding ObservableAttribute
ObservableAttributeObservations when adding InterceptedAttribute
InterceptedAttribute2. Creating CustomLabel Data Transfer Object
CustomLabel Data Transfer ObjectObservations
3. Creating CustomLabel Mapper
CustomLabel Mapper4. Register the mapper
Last updated
Was this helpful?