I am new to MVVM and Silverlight
I have managed to get an example Silverlight application up and running
I return the contents of a table – tblClip into my model (Entity Framework) and an associated object Clip.
Now I have a field on my Clip called Size. This is an integer which I want to increase by 5x
What is the correct approach to do this and still keep to the pattern?
1) Add a new property such as ModifiedSize on the model and populate it (although not sure where) I assume I would need to decorate it as a DataMember to get it back to the client
2) In the view model, once I have obtained the data from the service agent, go through the clips increasing the size
3) Something else…?
I do not need to save the objects back to the database.
Paul
UI specific properties belong on the ViewModel. For example, this is one way you could do it
Binding to
ModifiedSizein your XAML would then updateSizeas well as performINotifyPropertyChangednotificationsThe other thing you can do is skip the
ModifiedSizeproperty and use a converterand then bind to
Sizewith the converter