I am using a ObservableCollection to store the Environment Variables of Windows.
class VariableVieWModel
{
ObservableCollection vars
You haven't modified the ObservableCollection, only replaced it.
You should implement INotifyPropertyChanged
and call PropertyChanged
in the Variables
property setter.
BTW it's common in MVVM implementations to have a base class for your ViewModel:
class VariableViewModel : ViewModelBase
and implement common functionality such as INotifyPropertyChanged
in the base class to avoid duplication of code.