0

I am using a networking library I created which contains a Client class. I have a GUI which will display all these clients in a ListView 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 a ClientModel class which contains a property for the Client, and additionally contains an isOnline property. I then add these 'ClientModel's to an ObservableCollection in my ViewModel, which is bound to the ListView ItemsSource in the XAML.

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 be ClientViewModel or ClientModel?)

1 Answer 1

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.