title: Raise event from Inner class to outer class in c#
body: <p>I'm using MVVM pattern in my project.</p>
  
  <p>My class design is like this:</p>
  
  <pre><code>Class Model : AbstractModel
  {
     InnerClass Iclass = new InnerClass();
  
    Public String ModelProp1
    {
      get
      {
       return Iclass.prop1;
       }
      set
      {
        Iclass.prop1 = value;
      }
     }
  
  public override void SetLabel(UInt16 value, int Index)
      {
          byte[] arr = BitConverter.GetBytes(value);
          this.Iclass.IclassConfig[Index].Label = arr[0];
      }
  
   public override string DateFormat
      {
          get { return Iclass.intlDate.ToString(); }
          set { Iclass.intlDate = Convert.ToByte(value); }
      }
  </code></pre>
  
  <p>}</p>
  
  <pre><code> Class InnerClass
  {
  public byte intlDate
   {
     get { return this.intl_date; }
          set { this.intl_date = value;
          RaiseModelPropertiesChangedEvent(new ValueChangedEventArgs {     Parameter_dateformat = this.intlDate });
    }
  
   private JClassa  []channel_config = new JClass[2];
   public JClass[] IclassConfig
      {
          get { return this.channel_config; }
          set { this.channel_config = value; }
      }
  </code></pre>
  
  <p>}</p>
  
  <pre><code>Public JClass
  {
   private byte  channel_label;
    public byte Label
   {
    get { return this.channel_label; }
      set { this.channel_label = value;}
   }
  </code></pre>
  
  <p>I'm getting data from other application. updated data is coming in InnerClass property from there I want to push this updated data to Model class.</p>
  
  <p>Problem is coming for JClass property how can I fire event such that It will push updated data to model class.</p>
  
  <p>For this I have created Event in InnerClass like this:</p>
  
  <pre><code> public event EventHandler&lt;ValueChangedEventArgs&gt; ModelPropertiesChanged;
    public void RaiseModelPropertiesChangedEvent(ValueChangedEventArgs e)
      {
          if (ModelPropertiesChanged != null)
              ModelPropertiesChanged(this, e);
      }
     public class ValueChangedEventArgs : EventArgs
     { 
        public int Parameter_dateformat { get; set; }
         public int Parameter_channelLabel { get; set; }
      }
  </code></pre>
  
  <p>Tell me how Can I achieve this. Becuase I have 4 property in Jclass and 6 Property is InnerClass.</p>