.net - Alert that a WPF UserControl's dependency property must be set? -
i find when create wpf user controls, because need expose couple of additional dependency properties. typically, properties must set control work in intended way, , there no meaningful default value (because, example, property bound else).
when comes using/consuming controls, week or more after creating user control, never remember properties need set in markup.
i can't imagine way make these "required" in xaml editor, there good/standard place throw meaningful exception if/when property has not been set?
you add them "required" designer category can @ least find them later.
mark clr property [category("blah")]
attribute.
lame might suffice.
Comments
Post a Comment