Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

creating a ViewModel class

$
0
0
  

I would like to create a ViewModel Class to retrieve the values from the Database. 
My goal is to retrieve the Values of Usage of RAM (Ram total & Ram available) from my DB Table and then display it on my View.

This is what I have done so far on my ViewModel Class


public class RamViewModel : INotifyPropertyChanged    
{       
float _ramTotal;  
float _ramUsed;  

public float RamTotal    
{   get { return _ramTotal; }   
{  set { _ramTotal = value; RaisePropertyChanged("RamTotal"); }  }       

public float RamUsed 
{  get { return _ramUsed; } 
{  set { _ramUsed = value; RaisePropertyChanged("RamUsed"); }      
}

private void RaisePropertyChanged(string p)    
{ throw new NotImplementedException(); } 

}
    



when I build the class, I got this error stating, " ViewModel.RamViewModel Does not implement interface member 'System.ComponentModel.INotifyPropertyChanged.PropertyChanged'"

Am I missing some collection here ?

kindly help to proceed further


Thanks



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>