/// <summary> /// 初始化属性 /// </summary> private void InitialProperty() { SystemInformationCollection sic = new SystemInformationCollection(); systemVersion = sic.OSVersion; NetFrameworkVersion = sic.NetFrameworkVersion; ProcessCount = sic.ProcessorCount; AllDotNetFrameworkVersion = sic.AllDotNetFrameworkVersion; }
/// <summary> /// Initializes a new instance of the InstallDotNetFrameworkUCViewModel class. /// </summary> public InstallDotNetFrameworkUCViewModel() { SystemInformationCollection sic = new SystemInformationCollection(); DNFrameworkList = sic.DNFrameworkNameList; //OpenTestCommand = new RelayCommand<string>(i => // { // if (string.IsNullOrEmpty(i)) // { // sic.OpenIt(i); // } // }); OpenFileCommand = new RelayCommand<string>(i => { if (!string.IsNullOrEmpty(i)) { //这里注意对sic的引用有闭包问题,切记 new SystemInformationCollection().OpenIt(i); } //MessageBox.Show(i); }); }