I am pretty new to WPF MVVM, so pardon me if I understood MVVM concepts wrongly.
I have a DataGrid
in my View, which I have bound the ItemsSource
to an ObservableCollection<M>
in the ViewModel. The M
class is a Model class. However, the M
class has bool
properties, which are to be displayed in the DataGrid as "Yes/No"
strings.
Currently, I am using a Converter to convert the bool
value to string
. But, it just feels wrong for the ViewModel to expose a list (ObservableCollection)
of a Model to the View. I have also read that in MVVM, conversions should be done at ViewModel. So, what is the right way to implement this the MVVM way for a DataGrid
?