I have an WPF application which can take command line parameter. I want to use this command line parameter in ViewModel, I have following options to do that.
1) create public static variable in app.xaml.cs . read command line parameter value in main method and assign it to public static variable. that can be accessed in viewmodel using App.variablename.
2) create environment variable like System.Environment.SetEnvironmentVariable("CmdLineParam", "u") and later use it in viewmodel with Environment.GetEnvironmentVariable("CmdLineParam").
I want to ask which approach is good considering MVVM pattern and if there is better method to achieve this.