public MainWindow() { _config = Config.Create(); var statTranslater = new StatTranslater(); statTranslater.LoadFile("Resources/Translation.json"); _viewModelFactory = new ViewModelFactory(statTranslater); DataContext = this; ListenCommand = new DelegateCommand(ListenExecute, ListenCanExecute); ComboBoxEnterCommand = new DelegateCommand <ComboBox>(ComboBoxEnterExecute); RemoveCommand = new DelegateCommand(RemoveExecute, RemoveCanExecute); ClipboardUpdateCommand = new DelegateCommand(ClipboardUpdateExecute); CopyToClipboardCommand = new DelegateCommand(CopyToClipboardExecute, CopyToClipboardCanExecute); SelectedAccount = _config.Accounts.FirstOrDefault(); foreach (var account in _config.Accounts) { Accounts.Add(account); } UpdateItems(); InitializeComponent(); }
public StatViewModel(StatModel stat, StatTranslater statTranslater) { Model = stat; if (stat.Range != null) { Range = new RangeViewModel(stat.Range); } Corrupted = Model.Corrupted; FormattedString = statTranslater.GetFormattedString(stat); }
public ViewModelFactory(StatTranslater statTranslater) { _statTranslater = statTranslater; }