public OwnedIdolViewModel(AppConfig config, UnitViewModel uvm) { m_config = config; m_uvm = uvm; Idols = new ListCollectionView(config.OwnedIdols); Filter = new IdolFilter(config, Idols, false); Filter.SetConfig(config.OwnedIdolFilterConfig); foreach (var option in config.OwnedIdolSortOptions) { Idols.SortDescriptions.Add(option.ToSortDescription()); } DeleteCommand = new DelegateCommand(Delete, () => SelectedIdols.Count > 0); CopyIidCommand = new DelegateCommand(CopyIid, () => SelectedIdols != null && SelectedIdols.Count == 1); }
public MainViewModel() { try { m_config = AppConfig.Load(); } catch(Exception e) { MessageBox.Show($"app.configを読み込めませんでした:{e.Message}"); Application.Current.Shutdown(); } Units = new UnitViewModel(m_config); OwnedIdol = new OwnedIdolViewModel(m_config,Units); ImplementedIdol = new ImplementedIdolViewModel(m_config, OwnedIdol); Simulation = new SimulationViewModel(m_config); }
public MainViewModel() { try { m_config = AppConfig.Load(); } catch (Exception e) { MessageBox.Show($"app.configを読み込めませんでした:{e.Message}"); Application.Current.Shutdown(); } Units = new UnitViewModel(m_config, this); OwnedIdol = new OwnedIdolViewModel(m_config, this); ImplementedIdol = new ImplementedIdolViewModel(m_config, this); Simulation = new SimulationViewModel(m_config); Potential = new PotentialViewModel(m_config); }