コード例 #1
0
        private void OnSelectAutomationCommand(string obj)
        {
            var selectedItems = Model.AutmationCommandMaps;
            var values        = _dataService.GetAutomationCommands()
                                .Where(x => selectedItems.All(y => y.AutomationCommandName != x.Name))
                                .Select(x => new AccountScreenAutmationCommandMap {
                AutomationCommandName = x.Name
            })
                                .ToList <IOrderable>();
            var selectedValues = InteractionService.UserIntraction.ChooseValuesFrom(
                values,
                selectedItems.ToList <IOrderable>(),
                Resources.AutomationCommand.ToPlural(),
                string.Format(Resources.SelectItemsFor_f, Resources.AutomationCommand.ToPlural(), Model.Name, Resources.AccountScreen),
                Resources.AutomationCommand,
                Resources.AutomationCommand.ToPlural());

            Model.SetAutomationCommandMaps(selectedValues.Cast <AccountScreenAutmationCommandMap>().ToList());
            _automationCommands = null;
            RaisePropertyChanged(nameof(AutomationCommands));
        }