/// <summary> /// Constructor /// </summary> /// <param name="caption">Caption</param> /// <param name="controller">Controller name</param> /// <param name="action">Action name (method on the controller)</param> /// <param name="routeValues">Optional route values (parameters) to be passed to the controller</param> /// <param name="standardIcon">The standard icon to be used as a brush resource.</param> /// <param name="category">Top level category (ID) assigned to this item</param> /// <param name="significance">General significance of the action.</param> public OnDemandLoadCustomViewViewAction(string caption, string controller, string action, dynamic routeValues = null, string category = "", StandardIcons standardIcon = StandardIcons.Switch, ViewActionSignificance significance = ViewActionSignificance.Normal) : base(caption, standardIcon: standardIcon, significance: significance, category: category) { Controller = controller; Action = action; RouteValues = routeValues; }
/// <summary> /// Initializes a new instance of the <see cref="ToggleViewAction"/> class. /// </summary> public ToggleViewAction(string caption = "", bool beginGroup = false, Action <IViewAction, object> execute = null, Func <IViewAction, object, bool> canExecute = null, string visualResourceKey = "", string category = "", string categoryCaption = "", int categoryOrder = 0, bool isDefault = false, bool isCancel = false, ViewActionSignificance significance = ViewActionSignificance.Normal, string[] userRoles = null, string brushResourceKey = "CODE.Framework-Icon-View", string logoBrushResourceKey = "", string groupTitle = "", int order = 10000, char accessKey = ' ', Key shortcutKey = Key.None, ModifierKeys shortcutKeyModifiers = ModifierKeys.None, char categoryAccessKey = ' ', bool isDefaultSelection = false, bool isPinned = false, string id = "") : base(caption, beginGroup, null, canExecute, visualResourceKey, category, categoryCaption, categoryOrder, isDefault, isCancel, significance, userRoles, brushResourceKey, logoBrushResourceKey, groupTitle, order, accessKey, shortcutKey, shortcutKeyModifiers, categoryAccessKey, isDefaultSelection, isPinned, id) { ViewActionType = ViewActionTypes.Toggle; SetExecutionDelegate((a, o) => { a.IsChecked = !a.IsChecked; if (execute != null) { execute(a, o); } }); }
/// <summary>Initializes a new instance of the <see cref="ApplicationShutdownViewAction"/> class.</summary> /// <param name="caption">The caption.</param> /// <param name="beginGroup">If represented visually, should this action be placed in a new group?</param> /// <param name="category">The category.</param> /// <param name="standardIcon">The standard icon to be used as a brush resource.</param> /// <param name="significance">General significance of the action.</param> public ApplicationShutdownViewAction(string caption = "Shutdown", bool beginGroup = false, string category = "", StandardIcons standardIcon = StandardIcons.None, ViewActionSignificance significance = ViewActionSignificance.Normal) : base(caption, beginGroup, ExecuteCommand, category: category, standardIcon: standardIcon, significance: significance) { BrushResourceKey = "CODE.Framework-Icon-ClosePane"; }
/// <summary> /// Initializes a new instance of the <see cref="ApplicationShutdownViewAction"/> class. /// </summary> /// <param name="model">The model associated with the view.</param> /// <param name="caption">The caption.</param> /// <param name="beginGroup">If represented visually, should this action be placed in a new group?</param> /// <param name="category">The category.</param> /// <param name="standardIcon">The standard icon to be used as a brush resource.</param> /// <param name="significance">General significance of the action.</param> public CloseCurrentViewAction(object model, string caption = "Close", bool beginGroup = false, string category = "", StandardIcons standardIcon = StandardIcons.ClosePane, ViewActionSignificance significance = ViewActionSignificance.Normal) : base(caption, beginGroup, category: category, standardIcon: standardIcon, significance: significance) { _model = model; SetExecutionDelegate(ExecuteCommand); BrushResourceKey = "CODE.Framework-Icon-ClosePane"; IsPinned = true; }
/// <summary> /// Initializes a new instance of the <see cref="ApplicationShutdownViewAction"/> class. /// </summary> /// <param name="model">The model associated with the view.</param> /// <param name="moveToElementName">Name of the element to move the cursor to.</param> /// <param name="caption">The caption.</param> /// <param name="beginGroup">If represented visually, should this action be placed in a new group?</param> /// <param name="category">The category.</param> /// <param name="standardIcon">The standard icon to be used as a brush resource.</param> /// <param name="significance">General significance of the action.</param> public MoveFocusViewAction(IHaveViewInformation model, string moveToElementName, string caption = "", bool beginGroup = false, string category = "", StandardIcons standardIcon = StandardIcons.None, ViewActionSignificance significance = ViewActionSignificance.Normal) : base(caption, beginGroup, category: category, standardIcon: standardIcon, significance: significance) { _model = model; _targetElementName = moveToElementName; BrushResourceKey = "CODE.Framework-Icon-ClosePane"; SetExecutionDelegate(ExecuteCommand); }
/// <summary> /// Initializes a new instance of the <see cref="ApplicationShutdownViewAction" /> class. /// </summary> /// <param name="theme">The theme to switch to.</param> /// <param name="caption">The caption.</param> /// <param name="beginGroup">If represented visually, should this action be placed in a new group?</param> /// <param name="category">The category.</param> /// <param name="categoryAccessKey">The category access key.</param> /// <param name="accessKey">The access key.</param> /// <param name="standardIcon">The standard icon to be used as a brush resource.</param> /// <param name="significance">General significance of the action.</param> public SwitchThemeViewAction(string theme, string caption = "", bool beginGroup = false, string category = "", char categoryAccessKey = ' ', char accessKey = ' ', StandardIcons standardIcon = StandardIcons.None, ViewActionSignificance significance = ViewActionSignificance.Normal) : base(!string.IsNullOrEmpty(caption) ? caption : theme, beginGroup, category: category, standardIcon: standardIcon, significance: significance, categoryAccessKey: categoryAccessKey, accessKey: accessKey) { _theme = theme; BrushResourceKey = "CODE.Framework-Icon-Switch"; SetExecutionDelegate(ExecuteCommand); }
/// <summary> /// Initializes a new instance of the <see cref="ToggleViewAction"/> class. /// </summary> public ToggleViewAction(string caption = "", bool beginGroup = false, Action<IViewAction, object> execute = null, Func<IViewAction, object, bool> canExecute = null, string visualResourceKey = "", string category = "", string categoryCaption = "", int categoryOrder = 0, bool isDefault = false, bool isCancel = false, ViewActionSignificance significance = ViewActionSignificance.Normal, string[] userRoles = null, string brushResourceKey = "CODE.Framework-Icon-View", string logoBrushResourceKey = "", string groupTitle = "", int order = 10000, char accessKey = ' ', Key shortcutKey = Key.None, ModifierKeys shortcutKeyModifiers = ModifierKeys.None, char categoryAccessKey = ' ', bool isDefaultSelection = false, bool isPinned = false, string id = "") : base(caption, beginGroup, null, canExecute, visualResourceKey, category, categoryCaption, categoryOrder, isDefault, isCancel, significance, userRoles, brushResourceKey, logoBrushResourceKey, groupTitle, order, accessKey, shortcutKey, shortcutKeyModifiers, categoryAccessKey, isDefaultSelection, isPinned, id) { ViewActionType = ViewActionTypes.Toggle; SetExecutionDelegate((a, o) => { a.IsChecked = !a.IsChecked; if (execute != null) execute(a, o); }); }