rogier

rogier

  • NA
  • 2
  • 0

Custom Control Design Time Update question

Jun 13 2008 8:25 AM
The problem is the following: I have a simple user control which has a property that will bind a random Control (i.e. TextBox, Button, etc) to it.
aka (code simplified)
private Control _cControl;
public Control cControl { get;set; }

Now for the problem: everything works just fine, accept for 1 thing: As soon as (at design time) the Control that was assigned to cControl is removed, the design time property editor
does NOT remove the underlying properties... and so the design time property editor shows e.g. the properties for the TextBox. However, this was removed and is no longer valid!

Has anyone struggled with this before? And came to a decent solution?

I do have a working solution, (assign a disposed handler that will reset the property value to null), but I do not believe this is the way to go...

Any comments are welcome...

Answers (1)