I am finding that Design View (DV) is nice, but trying to change the way it automagically injects code into InitializeComponent
is very hard. And sometimes its automagical code breaks the program.
For example, DV automatically sees every single property of my custom UserControl, and then it assigns every single property to some value in InitializeComponent
. But I don't want it to assign values to some of the properties because some of my setters will throw a runtime exception if not used correctly. I could correct InitializeComponent
manually, but anytime I make a change to the design, SharpDevelop will just regenerate the function again.
And there's another case where I have the Default Constructor set the size based upon certain factors, but then InitializeComponent
will immediately set it to another static value.
How can I tell DV to not automagically assign values to certain properties I define?