0

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?)

askedJul 19, 2022 at 0:48
lol's user avatar

1 Answer1

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.

answeredJul 19, 2022 at 12:05
Bart van Ingen Schenau's user avatar

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.