|
-
May 13th, 2013, 01:46 AM
#2
Re: Properly design a user control?
The UC definitely doesn't need four properties. It needs either one or three.
One option would be to consider the splitting and recombining of the text as a presentation-only issue and do it in the UC itself. In that case the UC needs just the one property and that can be bound to the window's view model so no need for a dedicated view model for the UC.
Another option would be for the UC to expose one property per TextBox and those three properties get bound to a dedicated view model. That view model has a fourth property that is exposed to the parent view model to deal with the combined text value.
Which of those two options you choose really depends on whether you consider the display of data in three separate parts to be a presentation issue alone or not, something like formatting a date/time value.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|