I'm creating a WPF custom control and ran into a situation. A lot of the code does not execute until the control is initialized: if (this.IsInitialized) { ... }
However, this is causing an issue with my designer because it is never initialized.
I'm just wondering if using the DesignerProperties.GetIsInDesignMode()
in a custom control is normal to use, and if so, should I be wary of any pitfalls? I ask this because it just seems "dirty" to have designer-specific checking/code in a custom control.
I guess a good measuring stick would be to know if Microsoft uses Designer-specific code (not attributes) in any of their controls code?