Esempio n. 1
0
        /// <summary>
        /// Sets the action context.
        /// </summary>
        /// <param name="parameter">The parameter.</param>
        private void SetActionContext(object parameter)
        {
            _action.ActionContext.Clear();

            foreach (var entry in _entries)
            {
                _action.ActionContext.Add(entry);
            }

            if (parameter == null)
            {
                return;
            }

            var parameterEntry = ActionContextEntry.Create(RoutedAction.CommandParameter, parameter, false);

            _action.ActionContext.Add(parameterEntry);
        }
Esempio n. 2
0
 /// <summary>
 /// Gets the entries.
 /// </summary>
 /// <returns></returns>
 public IEnumerable <ActionContextEntry> GetEntries()
 {
     return(_context.Select(x => ActionContextEntry.Create(x.Key, x.Value, false)).ToList().AsReadOnly());
 }