Scenario: should i use a custom control or a user control? RRS feed

  • Question

  • Let's say, I want to create a Panel with A static TextBlock that has the ability to switch to "EditState" where in the Textblock switches to become a TextBox. Should i make a custom control or a user control?

     So far what i've done is implement this through a customcontrol that has both a textbox and a textblock, with one with a collapsed visibility. upon change in property, the corresponding text element is set to visible.

     My problem now is when i try to use this control in a two way binding scenario. everything works fine except for when i enter into edit state, i don't seem to be able to edit the text that is within the textbox.

     //new to custom controls & databinding so there may be some concepts i am missing. will welcome enlightenment :)

    Monday, May 19, 2008 10:41 AM