A lot of times, I find myself doing UI control manipulation in the code behind and wanted to find a clean way of doing this.
Use Case: A drop down has CSS1 style, editable in Edit mode but has CSS2 style, view only in View mode
I can achieve this by simply have a set of switch case statements. I can use polymorphism and create a EditMode and ViewMode class but that requires me to have a reference to the UI control to be passed to these classes. This tightly couples the UI and the logic layer which I want to avoid.
Any ideas?
EDIT: Can anyone give an example of externalizing the UI logic from the code behind?