|
| TriggerConditionOperation | ConditionOperation [get, set] |
| | Gets or sets the comparison operator that you use to compare Value A to Value B:
|
| |
| object | FixedPropertyValue [get, set] |
| |
| bool | IsValid [get] |
| | Gets the validity of the trigger condition.
|
| |
| Property | MessageA [get, set] |
| |
| Property | MessageB [get, set] |
| |
| ProjectItem | ProjectItemA [get, set] |
| |
| ProjectItem | ProjectItemB [get, set] |
| |
| Property | PropertyA [get, set] |
| |
| AnimationTargetPropertyAttributeEnum | PropertyAttributeA [get, set] |
| |
| AnimationTargetPropertyAttributeEnum | PropertyAttributeB [get, set] |
| |
| Property | PropertyB [get, set] |
| |
| new TriggerConditionItemProperties | PropertyTypes [get] |
| |
| TriggerConditionTermSourceType | TermASource [get, set] |
| |
| TriggerConditionTermSourceType | TermBSource [get, set] |
| | Gets or sets whether the trigger condition compares to a value (Value B) that comes from a property, a message, or a fixed value:
|
| |
| IEnumerable< ProjectItem > | Children [get] |
| | Gets all child items of a project item.
|
| |
| string | IconLocation [get] |
| |
| object | IconModifier [get, set] |
| |
| string | InvalidityReason [get] |
| |
| bool | IsDeleted [get] |
| |
| bool | IsDisposed [get] |
| |
| bool | IsHidden [get, set] |
| |
| bool | IsReadOnly [get, set] |
| |
| bool | IsValidState [get] |
| |
| string | KzbUrl [get] |
| | Gets the kzb URL of a project item.
|
| |
| string | Name [get, set] |
| | Gets or sets the name of a project item.
|
| |
| ProjectItem | Parent [get, set] |
| |
| string | Path [get] |
| |
| Project | Project [get] |
| | Gets the project in which this item is located.
|
| |
| Type | ProjectItemType [get] |
| |
| PropertyTypeLibrary | PropertyTypeLibrary [get] |
| | Gets the Property Types library of the project of this item which stores all property types you create in a Kanzi Studio project.
|
| |
| object | this[Property property] [get, set] |
| |
| object | this[string propertyName] [get, set] |
| |
| string | ToolTip [get] |
| |
| string | TypeDisplayName [get] |
| | Gets the type of a project item.
|
| |
| IEnumerable< Property > | Properties [get] |
| | Gets the properties in a project item or node component.
|
| |
|
| void | AddProperty (Property property) |
| | Adds a property to an item.
|
| |
| void | AddProperty (string propertyName) |
| | Adds a property to an item.
|
| |
| void | BeginBatchModification (string batchName) |
| |
| bool | CanAddProperty (Property property) |
| | Checks whether Kanzi Studio allows you to add a specific property to an item.
|
| |
| bool | CanAddProperty (string propertyName) |
| | Checks whether Kanzi Studio allows you to add a specific property to an item.
|
| |
| void | CommitBatchModification () |
| |
| bool | Delete () |
| | Deletes a project item.
|
| |
| void | DeregisterThumbnailUser (object user) |
| | Deregisters a registerd thumbnail user.
|
| |
| IEnumerable< Property > | GetAddableProperties () |
| | Gets a list of properties which you can add to an item.
|
| |
| T | GetAncestor< T > () |
| | Gets the nearest item of given type in the parent tree.
|
| |
| ProjectItem | GetChild (string childName) |
| | Gets the child item of the current item with the given name.
|
| |
| T | GetChild< T > (string childName) |
| | Gets the child item of the current item with the given name and type.
|
| |
| int | GetChildIndex (ProjectItem child) |
| |
| IEnumerable< Property > | GetContextProperties () |
| |
| IEnumerable< Property > | GetFixedProperties () |
| |
| IEnumerable< Property > | GetFrequentlyAddedProperties () |
| |
| ProjectItem | GetProjectItemByPath (string path) |
| |
| string | GetRelativeProjectPathTo (ProjectItem anotherItem) |
| |
| IEnumerable< Property > | GetRemovableProperties () |
| | Gets a list of properties which you can remove from an item.
|
| |
| BitmapSource | GetThumbnail (int width, int height, bool showChildren, bool showFullScreen, Node contextNode) |
| | Gets the thumbnail image for a project item.
|
| |
| BitmapSource | GetThumbnail (int width, int height, bool showChildren, bool showFullScreen, Node contextNode, float[] letterboxColorRGBA) |
| | Gets the thumbnail image for a project item.
|
| |
| IEnumerable< ProjectItem > | GetTreeItemsAsList () |
| | Enumerates the items under this ProjectItem including this item itself, children, and grand children.
|
| |
| bool | HasProperty (Property property) |
| | Checks whether an item has a specific property.
|
| |
| bool | HasProperty (string propertyName) |
| | Checks whether an item has a specific property.
|
| |
| bool | IsPropertyReadOnly (Property property) |
| |
| void | RegisterThumbnailUser (object user, uint width, uint height, bool showChildren, bool showFullScreen, Node contextNode) |
| | Registers a user for the thumbnail images for a project item.
|
| |
| void | RemoveProperty (Property property) |
| | Removes a property from an item.
|
| |
| void | RemoveProperty (string propertyName) |
| | Removes a property from an item.
|
| |
| void | SetChildIndex (ProjectItem child, int index) |
| |
| void | SetPropertyReadOnlyStatus (Property property, bool? value) |
| |
| void | UpdateValidity () |
| | Recalculates the validity the item.
|
| |
| object | Get (Property property) |
| | Gets the value of a property.
|
| |
| object | Get (string propertyName) |
| | Gets the value of a property.
|
| |
| T | Get< T > (TypedProperty< T > property) |
| | Gets the value of a property.
|
| |
| void | Set (string propertyName, object value) |
| | Sets the value of a property.
|
| |
| void | Set< T > (TypedProperty< T > property, T value) |
| | Sets the value of a property.
|
| |
| string | GenerateUniqueChildName (string defaultName) |
| | Generates a unique name.
|
| |
| string | GetInvalidityReasonOfNewName (string newName) |
| | Returns the reason why the passed name is not valid.
|
| |
| EventHandler< CollectionChangedEventArgs< ProjectItem > > | ChildCollectionChanged |
| |
| EventHandler< DeletedEventArgs > | Deleted |
| |
| EventHandler< DeletedEventArgs > | Deleting |
| |
| EventHandler< CollectionChangedEventArgs< ProjectItem > > | DescendantChildCollectionChanged |
| |
| EventHandler< DeletedEventArgs > | DescendantDeleted |
| |
| EventHandler< DynamicPropertyChangedEventArgs > | DescendantDynamicPropertyChanged |
| |
| EventHandler< ParentChangedEventArgs > | DescendantParentChanged |
| |
| EventHandler< CollectionChangedEventArgs< string > > | DescendantPropertyCollectionChanged |
| |
| EventHandler< ProjectItemEventArgs > | Disposing |
| |
| EventHandler< DynamicPropertyChangedEventArgs > | DynamicPropertyChanged |
| |
| EventHandler< ParentChangedEventArgs > | ParentChanged |
| |
| EventHandler< PathChangedEventArgs > | PathChanged |
| |
| EventHandler< DynamicPropertyChangedEventArgs > | PreviewDescendantDynamicPropertyChanged |
| |
| EventHandler< DynamicPropertyChangedEventArgs > | PreviewDynamicPropertyChanged |
| |
| EventHandler< CollectionChangedEventArgs< string > > | PropertyCollectionChanged |
| |
| EventHandler< ReplaceEventArgs > | Replacing |
| |
| EventHandler | ThumbnailChanged |
| |
| EventHandler | ValidityChanged |
| |
Configure trigger conditions.
Trigger conditions enable you to set which conditions must be met for the trigger to set off. For example, you can define conditions to set off a trigger when the user selects a specific item in a list box or presses a specific key on their keyboard, or to enable the user to click a button only when that button is visible, or to allow the user to scroll a Scroll View node only when a specific Page node is active.
To configure a trigger condition, define Type of A and Type of B, and a comparison operation that you use to compare Type of A to Type of B:
- To define Type of A to come from a property, set the #TermASource, #ProjectItemA, #PropertyA, and #PropertyAttributeA properties.
- To define Type of A to come from a message, set the #TermASource and #MessageA properties.
- To define the Operation, set the #ConditionOperation property.
- To define Type of B to come from a property, set the #TermBSource, #ProjectItemB, #PropertyB, and #PropertyAttributeB properties.
- To define Type of B to come from a message, set the #TermBSource and #MessageB properties.
- To define Type of B to be a fixed value, set the #TermBSource and #FixedPropertyValue properties.
- See also
- TriggerNodeComponent, TriggerActionItem, NodeComponentHost
Examples
To create and configure a trigger condition using a value from a property:
public void Execute(PluginCommandParameter parameter)
{
var rootPage = studio.ActiveProject.GetProjectItem("Screens/Screen/RootPage");
var button =
studio.ActiveProject.CreateProjectItem<Button2D>(rootPage.GenerateUniqueChildName("Button 2D"), rootPage);
button.Set(Properties.NodeVisible, true);
var clickTrigger =
button.Triggers.First(
trigger => trigger.Get(
Properties.TriggerMessageType) == studio.ActiveProject.MessageTypeLibrary.GetItemByName("Message.Button.Click"));
var triggerCondition = clickTrigger.CreateCondition();
triggerCondition.ProjectItemA = button;
triggerCondition.PropertyA = Properties.NodeVisible;
triggerCondition.FixedPropertyValue = true;
}
To create and configure a trigger condition using a value from a list box message:
public void Execute(PluginCommandParameter parameter)
{
var rootPage = studio.ActiveProject.GetProjectItem("Screens/Screen/RootPage");
var listBox =
studio.ActiveProject.CreateProjectItem<GridListBox2D>(rootPage.GenerateUniqueChildName("Grid List Box 2D"), rootPage);
var itemSelectedTrigger = listBox.CreateTrigger(studio.ActiveProject.NodeComponentTypeLibrary.GetItemByName("Kanzi.MessageTrigger"));
itemSelectedTrigger.Set(Properties.TriggerMessageType, studio.ActiveProject.MessageTypeLibrary.GetItemByName("Message.ListBox.ItemSelected"));
var triggerCondition = itemSelectedTrigger.CreateCondition();
triggerCondition.MessageA = Properties.ListBoxConceptItemSelectedMessageArgumentsSelectedItemIndex;
triggerCondition.FixedPropertyValue = 0;
}
To create and configure a trigger condition using a value from a keyboard message:
public void Execute(PluginCommandParameter parameter)
{
const int EnterKeyCode = 46;
var keyPressedTrigger = studio.ActiveProject.Screen.CreateTrigger(studio.ActiveProject.NodeComponentTypeLibrary.GetItemByName("Kanzi.MessageTrigger"));
keyPressedTrigger.Set(Properties.TriggerMessageType, studio.ActiveProject.MessageTypeLibrary.GetItemByName("Message.KeyPressed"));
var triggerCondition = keyPressedTrigger.CreateCondition();
triggerCondition.MessageA = Properties.InputMessageArgumentKey;
triggerCondition.FixedPropertyValue = EnterKeyCode;
var writeLogAction = keyPressedTrigger.CreateAction(studio.ActiveProject.TriggerActionTypeLibrary.GetItemByName("Kanzi.WriteLogAction"));
writeLogAction.Set(Properties.WriteLogActionLogText, "Enter pressed");
var keyManipulatorType = studio.ActiveProject.NodeComponentTypeLibrary.GetItemByName(NodeComponentTypeNames.KeyManipulatorComponent);
var keyManipulator = studio.ActiveProject.Screen.CreateNodeComponent("Key Manipulator", keyManipulatorType);
keyManipulator.Set(Properties.KeyManipulatorComponentLogicalKey, EnterKeyCode);
}