I have a problem setting a default value on a property, that is "updated" by Visual Studio Designer every time the form is modified in it.
Situation:
class MyHour {
MyHour() {}
MyHour(string h) {}
}
class MyPanel {
_FirstHour = new FirstHour("13:00");
[DefaultValue("13:00")]
Hour FirstHour {get { return _FirstHour; } set{...}}
}
When MyPanel is in the VS Designer, and the Designer is modified it (re)sets my(already pre-initialized):
MyHour myHour1 = new MyHour();
...
myPanel1.FirstHour = myHour1;
I want that it sets this(or just don't touch this property):
MyHour myHour1 = new MyHour("13:00");
...
myPanel1.FirstHour = myHour1;