title: Passing command line arguments into WPF C# application and accessing its value
body: <p>So from <a href="https://stackoverflow.com/questions/9600453/command-line-arguments-in-c-sharp-application">this post</a> I got the following code for passing command line arguments into my WPF Application</p>
  
  <pre><code>public partial class App : Application
  {
      private string _customerCode;
      public string CustomerCode
      {
          get { return _customerCode; }
          set { _customerCode = value; }
      }
  
  
      protected override void OnStartup(StartupEventArgs e)
      {
          if (e.Args.Count() != 0)
          {
              CustomerCode = e.Args[0].Replace("/", string.Empty); 
          }
      }
  }
  </code></pre>
  
  <p>The application then starts my MainWindow.xaml and the application runs but in the viewModel for MainWindow.xaml (MainViewModel.cs) I would like to access the value of App.CustomerCode.</p>
  
  <p>Is this the right way to deal with command line arguments and is it possible to access the value of CustomerCode?</p>