Class ButtonSerializedParamController
The controller for editing the ButtonViewParams in a popup single parameter window
We do not need an associated IViewSerializedParamDefaultEditor implementation as this is a standard popup single parameter editor. We only need that if it has a custom editor
Inheritance
Inherited Members
Namespace: LemonEdge.Client.Core.Views
Assembly: ClientCore.dll
Syntax
public class ButtonSerializedParamController : ParamSingleViewerController<ButtonViewParams>, IParamViewerController, IPopupWindowController, IController
Constructors
ButtonSerializedParamController(IParamSingleViewer<ButtonViewParams>, ButtonViewParams)
Creates a new ButtonViewParams controller
Declaration
public ButtonSerializedParamController(IParamSingleViewer<ButtonViewParams> window, ButtonViewParams param)
Parameters
Type | Name | Description |
---|---|---|
IParamSingleViewer<ButtonViewParams> | window | The single popup param window this controller is for |
ButtonViewParams | param | The original parameter value to be displayed and edited by the user |
Methods
AlterControlInfo(ControlDisplayInfo)
Alters the ButtonID to provide a list of all valid command buttons
Declaration
protected override void AlterControlInfo(ControlDisplayInfo info)
Parameters
Type | Name | Description |
---|---|---|
ControlDisplayInfo | info | The control to alter with additional settings |
Overrides
AlterItemParameters(IModelLayoutCommon, Guid, String)
Pops up a parameter window for the specified command with the specified serialized CommandSerializedParam
Declaration
public static Task<(bool Modified, string NewParams)> AlterItemParameters(IModelLayoutCommon host, Guid id, string serializedParams)
Parameters
Type | Name | Description |
---|---|---|
IModelLayoutCommon | host | The context host this command operates within |
System.Guid | id | The unique global id of the command this should provide a popup parameter window for |
System.String | serializedParams | The serialized command parameter that inherits from CommandSerializedParam The UI must have a defined ParamSingleViewerController<T> for this command parameter type |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.ValueTuple<System.Boolean, System.String>> | A task holding if the user modified the parameters, and if they did what the new serialized parameters are |
ControlNames()
Adds 3 controls: ButtonID, ButtonName, and ButtonTooltip
Declaration
protected override IEnumerable<ControlDisplayInfoLight> ControlNames()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ControlDisplayInfoLight> | A list of all controls to be shown for editing in this popup |
Overrides
InitCommands(IList<ViewCommand>)
Adds an alter image command (ButtonIconID) and an alter custom button parameters command (ButtonParams)
Declaration
protected override void InitCommands(IList<ViewCommand> commands)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<ViewCommand> | commands | The initial set of commands for this popup single parameter window |
Overrides
OnItemChanged(Object, PropertyChangedEventArgs)
Reacts to any change of the ButtonID by resetting the ButtonParams and providing default values for the name, tooltip and icon
Declaration
protected override void OnItemChanged(object sender, PropertyChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The parameter that had its property changed |
System.ComponentModel.PropertyChangedEventArgs | e | The property changed event arguments |