No edit summary |
m ((username removed) (log details removed)) |
||
(5 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
Class actions are actions that always have the context or the root objects as the object of a class. A class action cannot use the ViewModel [[VCurrent and vSelected|vCurrent or vSelected]] variables. | Class actions are actions that always have the context or the root objects as the object of a class. A class action cannot use the ViewModel [[VCurrent and vSelected|vCurrent or vSelected]] variables. A class action, therefore, is always based upon the object itself in the model, not on any information from the [[ViewModel]]. They are globally available to every view that shows an object of this class. | ||
Preferably, you make class actions for everything that can be class actions because they are then available wherever that object is shown within your application. | Preferably, you make class actions for everything that can be class actions because they are then available wherever that object is shown within your application. | ||
You show a class's class actions by clicking on the little arrow triangle at the top of the class from the diagram view. | |||
[[File:Class Actions - Image 1.png|frameless|84x84px]] | [[File:Class Actions - Image 1.png|frameless|84x84px]] | ||
Or directly access available actions and also add an action. Right-click on the class header and select | Or directly access available actions and also add an action. Right-click on the class header and select "Add Class action." | ||
[[File:Class Actions - Image 2.png|frameless|342x342px]] | [[File:Class Actions - Image 2.png|frameless|342x342px]] | ||
Line 13: | Line 13: | ||
This window pops up. | This window pops up. | ||
[[File:Class Actions - Image 3.png|frameless| | [[File:Class Actions - Image 3.png|frameless|565x565px]] | ||
When showing this view with class actions, you can also create new class actions and drag actions. The drag action is when one object is dragged on screen from one object on top of another. | When showing this view with class actions, you can also create new class actions and drag actions. The drag action is when one object is dragged on-screen from one object on top of another. | ||
Name the class action using camel case. That camel casing will then be split with spaces in between | Name the class action using camel case. That camel casing will then be split with spaces in between; it will give you an easy way to have a good action name until you want to change the presentation. | ||
[[File:Class Actions - Image 4.png|frameless]] | [[File:Class Actions - Image 4.png|frameless|238x238px]] | ||
If you click on the | If you click on the Enable Expression or Execute Expression, you can see that the context is the class itself. | ||
[[File:Class Actions - Image 5.png|frameless|339x339px]] | [[File:Class Actions - Image 5.png|frameless|339x339px]] | ||
Line 27: | Line 27: | ||
If you use "self" here, you will get the SysSuperClass in this example as a context - because it is a class action and always has its root or context as an instance of this class. | If you use "self" here, you will get the SysSuperClass in this example as a context - because it is a class action and always has its root or context as an instance of this class. | ||
[[File:Class | [[File:Class actions Image 6.png|frameless|483x483px]] | ||
In other respects, you can see the general [[Actions|action]] information. | In other respects, you can see the general [[Actions|action]] information. | ||
{{Edited|July|12|2024}} |
Latest revision as of 06:38, 14 March 2024
Class actions are actions that always have the context or the root objects as the object of a class. A class action cannot use the ViewModel vCurrent or vSelected variables. A class action, therefore, is always based upon the object itself in the model, not on any information from the ViewModel. They are globally available to every view that shows an object of this class.
Preferably, you make class actions for everything that can be class actions because they are then available wherever that object is shown within your application.
You show a class's class actions by clicking on the little arrow triangle at the top of the class from the diagram view.
Or directly access available actions and also add an action. Right-click on the class header and select "Add Class action."
This window pops up.
When showing this view with class actions, you can also create new class actions and drag actions. The drag action is when one object is dragged on-screen from one object on top of another.
Name the class action using camel case. That camel casing will then be split with spaces in between; it will give you an easy way to have a good action name until you want to change the presentation.
If you click on the Enable Expression or Execute Expression, you can see that the context is the class itself.
If you use "self" here, you will get the SysSuperClass in this example as a context - because it is a class action and always has its root or context as an instance of this class.
In other respects, you can see the general action information.