I am using a networking library I created which contains aClient class. I have a GUI which will display all these clients in aListView with columns, such as one containing their online status. The online status property is only for the UI, so it is not present in the class in the networking library.
What I am currently doing is creating aClientModel class which contains a property for theClient, and additionally contains anisOnline property. I then add these 'ClientModel's to anObservableCollection in my ViewModel, which is bound to theListViewItemsSource in theXAML.
My question is this: When I have a class that I want to add properties which will be bound to the UI, is it right to making a "model wrapper" and doing what I am doing? Also, I am a bit confused if this would be considered a model or viewmodel (i.e, would it beClientViewModel orClientModel?)
1 Answer1
My question is this: When I have a class that I want to add properties which will be bound to the UI, is it right to making a "model wrapper" and doing what I am doing?
Yes, that is exactly what a ViewModel should be: a wrapper for the Model to adapt it to the needs of a View.
Explore related questions
See similar questions with these tags.
