title: how to access Custom EventArgs class in Button click event?
body: <p>As a follow up to:
  <a href="https://stackoverflow.com/questions/5399770/access-values-within-custom-eventargs-class">access values within custom eventargs class</a></p>
  
  <p>How do I access public variables within custom Eventargs class, using button click or any other method?</p>
  
  <p>Example Custom Event Args class:</p>
  
  <pre><code>public class TraderEventArgs: EventArgs
  {
      private int _shares;
      private string _symbol;
  
      public TraderEventArgs(int shs, string sym)
      {
          this._shares = shs;
          this._symbol = sym;
      } 
  
      public decimal Price 
      {
          get {return _prices;}       
      }
  
     public int Shares
     {
         get { return _shares; }
     }
  }
  </code></pre>
  
  <p>Code behind button_click event:</p>
  
  <pre><code>public partial class _Default : System.Web.UI.Page
  {
      protected void Button1_Click(object sender, EventArgs e)
      {
          // run trader app
          myApp.Main();
  
          // try to access TraderEventArgs class
          TraderEventArgs: EventArgs ev = TraderEventArgs: EventArgs();   // Invalid
  
          TraderEventArgs ev = new TraderEventArgs();   // this needs argument variables that are unassigned... ?
  
          TraderEventArgs ev = (TraderEventArgs)e;  //  Unable to cast object of type 'System.EventArgs' to type TraderEventArgs'.
  
          string sym = ev.Symbol.ToString();
          string sharws = ev.Shares.ToString();
  
          // do something with data
  
       }
  </code></pre>
  
  <p>thanks for help.</p>