Exemplo n.º 1
0
        public static ICommand New <TResult, TView, TViewModel>(TView view, TViewModel viewModel, ActionController <TView, TViewModel> actionController, params ActionContextEntry[] entries)
            where TView : class, IView
            where TViewModel : ViewModel <TView, TViewModel>, new()
            where TResult : Actionflow <TView, TViewModel>, new()
        {
            ICommand routedAction = null;

            try
            {
                routedAction = new RoutedAction <TResult, TView, TViewModel>(view, viewModel, actionController, entries);
            }
            catch (Exception exception)
            {
                ExceptionHandler.Handle(exception, Resources.ErrorMessageAction);
            }

            return(routedAction);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates a new action with a wrapper which implements the ICommand interface.
 /// </summary>
 /// <typeparam name="T">The type of action to create.</typeparam>
 /// <param name="entries">The default entries.</param>
 /// <returns>
 /// A new action with a wrapper which implements the ICommand interface
 /// </returns>
 public ICommand CreateRoutedAction <T>(params ActionContextEntry[] entries)
     where T : Actionflow <TView, TViewModel>, new()
 {
     return(RoutedAction.New <T, TView, TViewModel>(View, (TViewModel)this, ActionController, entries));
 }