title: MVVM Constructor Learning
body: <p>Hi I am trying to learn C# WPF MVVM. So I have a class with the following constructor</p>
  
  <p>Model Class</p>
  
  <pre><code>public BillMetaData(bool isKey, string attName, int attType, bool isRequired, int attLoc, int attLength, int isDecimal, int attAlignment) {
      _isKey = isKey;
      _attName = attName;
      _attType = attType;
      _isRequired = isRequired;
      _attLoc = attLoc;
      _attLength = attLength;
      _isDecimal = isDecimal;
      _attAlignment = attAlignment; }
  </code></pre>
  
  <p>Now I have my ModelView has follow, its not connected with a database yet, I am just trying to understand the pattern. </p>
  
  <pre><code>    bool isKey = true;
      string attName = "Name";
      int attType = 1;
      bool isRequired = true;
      int attLoc = 1;
      int attLength = 30;
      int isDecimal = 1;
      int attAlignment = 1;
  
      private BillMetaData obj = new BillMetaData( isKey, attName, attType, isRequired, attLoc, attLength, isDecimal, attAlignment);
  
      public string TxtCustomerName
      {
          get { return obj.attName; }
          set { obj.attName = value; }
      }   
  </code></pre>
  
  <p>However when creating the BillMetaData I get the following errors</p>
  
  <pre><code>a field initializer cannot reference the nonstatic field
  </code></pre>
  
  <p>From my ViewModel folder I reference my Model as follow</p>
  
  <pre><code>using Project.Model;
  </code></pre>
  
  <p>What I am doing wrong?</p>