コード例 #1
0
        public ActionsViewModel(IActionHandler actionLoader, ISettingsHandler settingsHandler)
        {
            _actionLoader    = actionLoader ?? throw new ArgumentException("Parameter cannot be null", nameof(actionLoader));
            _settingsHandler = settingsHandler ?? throw new ArgumentException("Parameter cannot be null", nameof(settingsHandler));
            var loadedActions     = actionLoader.Load();
            var actionsViewModels = loadedActions.Select(a => new ActionViewModel(a, SaveChanges));

            _actions    = new ObservableCollection <ActionViewModel>(actionsViewModels);
            _isExpanded = settingsHandler.GetActionsIsExpanded();
        }