Adding custom properties

I created a custom control and now I want to add custom properties to it so that they appear in the property pane in Vis. Studio. How can I do that?

My custom property would be: "Animation Type" with "Fade | Blink | Scroll | Blend"

Thank you

+2


a source to share


1 answer


The designer automatically reads the properties of the class and adds them to the property view. So all you have to do is create a property using a public getter and setter

public AnimationType AnimationType { get; set; }

      



There are additional attributes that you can apply to the property, such as DefaultValue or EditorBrowsable , which change the way you view in the Properties view. All relevant attributes are in the System.ComponentModel namespace .

+1


a source







All Articles