public ModkitViewModel(IWindowFactory windowFactory) : base(windowFactory) { Logger = MainController.Get().Logger; RunCommand = new Commands.RelayCommand(Run, CanRun); List <Type> x = typeof(Common.Wcc.Wcc_lite).GetNestedTypes().ToList();//.Cast<WCC_Command>().ToList(); foreach (var item in x) { var cmd = (Common.Wcc.WCC_Command)Activator.CreateInstance(item); Commands.Add(cmd); } Commands = Commands.OrderBy(_ => _.Name).ToList(); }
public MainWindowViewModel() { if (!File.Exists(ConfigHelper.ConfigPath)) { ConfigHelper.SaveConfig<Config>(new Config { SelectedChatOption = false, SelectedStreamQualityOption = "source" }); Configuration = ConfigHelper.LoadConfig<Config>(); } else { Configuration = ConfigHelper.LoadConfig<Config>(); } QualityOptions = new List<string> {"source", "high", "medium", "low", "mobile", "audio"}; _selectedQualityOption = Configuration.SelectedStreamQualityOption; _openChat = Configuration.SelectedChatOption; History = Configuration.History; Watch = new RelayCommand(OnWatch, canExecute => !String.IsNullOrWhiteSpace(Stream)); ClearHistory = new RelayCommand(OnClearHistory, canExecute => true); }