NoesisGUI
 

📘 Setters

🏘️ NoesisGUI ▸ 🏠 Noesis Studio ▸ 📘 Working With Interactivity ▸ 📘 Setters

Overview

Exclusively available within Styles and Templates, Setters allow for Property value changes within a scope to occur when one or multiple Conditions are met.

Documentation_Guide_Interactivity_Setters_Showcase.png

Unlike 📘 Visual States, changes in presentation precipitated by a Setter's Conditions being met are instantaneous and do not include an animation layer.

Individual Setters, their 📑 Setter Types, and their 📑 Setter Configuration can be created through the 📘 Setters tab found within the 📘 Interactivity Panel.

Where the particular strength of Setters lie is their ability to employ 📑 Cascading Setters to build a robust and dynamic network where the Property values set by one particular Setter can 'inherit' any number of its values from another Setter.

Documentation_Guide_Interactivity_Setters_CascadingStylesDiagram.png

This technique allows, for example, in the case of a 📘 Button Element Style, to create:

  • A Button_Master_Style Button Style, which sets the base presentation and interaction states of Buttons it is either directly applied to, or applied to in another Style 'based on' this Style.
  • A Button_Disabled_Style Button Style, set to be 'Based on' the Button_Master_Style. This variant will conserve all of the Property values defined by the Button_Master_Style, but also can be set up to include new Property values used to display the Button being 'disabled'.

Using this technique, the base typography, colors, and interaction visuals can be changed for all Buttons at once in Button_Master_Style, without impacting the additional modifications defined in the 'Disabled' Button Style.

Anatomy of a Setter

Setters are created within the scope of either a Style or a Template, and are composed of four main components:

  1. The Setter Type which determines what to monitor within the UI, as determined by the capabilities of each of the individual 📑 Setter Types.
  2. The Setter Conditions which determine what must occur in the interface for the Setter to engage, as determined by the Conditions selected in either 📑 Property Change Setters or 📑 Data Change Setters.
  3. The Setter Condition Values which determine which specific Property or Data values must be encountered for the Setter to engage.
  4. The Setter Configuration which determines what changes in the interface should take effect once the Values for the Conditions of the selected Type have been met. Which Property values within the scope change when a Setter is fired can be set up through 📑 Setter Configuration.
Documentation_Guide_Interactivity_Setters_SetterAnatomy.png

Note

A Style or Template can contain an unlimited number of Setters.

Setter Types

Noesis Studio offers two different Setter Types out-of-the-box, each designed to listen to distinct areas of change within an interface:

Property Change Setters

Property Change Setters specialize in listening to Elements, their Properties, and their Events.

In a Property Change Setter's 📘 Properties Panel, its Conditions can be configured along the following options:

  1. The Property Change Setter Source Name, which determines which Element to monitor.
  2. The Property Change Setter Property, which determines which Element Property to monitor for Property value changes.
  3. The Property Change Setter Value, which determines the specific Property value that has to be detected to engage the presentation changes dictated by the Setter.
Documentation_Guide_Interactivity_Setters_PropertySetter.png

It is through a Property Change Setter for example, that a 📘 CheckBox Element could be set to display a special appearance for when it is both simultaneously 'Checked' and 'Hovered' when the Setter's Conditions are:

  • Condition 1: MouseOver = True
  • Condition 2: IsChecked = True

These Conditions can be combined in a myriad of ways to produce changes in the interface under very specific and intentional circumstances, easily allowing creators, for example, to also create a counterpart of the above, where the appearance of the CheckBox is set for when it is hovered (MouseOver = True), but is unchecked (IsChecked = False).

Data Change Setters

Data Change Setters specialize in monitoring changes to Data or Binding values within a Project.

In a Data Change Setter's 📘 Properties Panel, its Conditions can be configured along the following options:

  1. The Data Change Setter Binding, which determines what to monitor, and can either target a Data Context value, a Source value, a Relative Property value, or an Element's Property value by Name.
  2. The Data Change Setter Value, which determines the specific Property value that has to be encountered to engage the presenation changes dictated by the Setter.
Documentation_Guide_Interactivity_Setters_DataSetter.png

It is through a Data Change Setter for example, that a 📘 Button Element could have its presentation changed to a 'disabled' state if a Data Value hits '0'.

Universal Mechanics

Setter Configuration

Once either 📑 Property Change Setters or 📑 Data Change Setters have been configured and the desired Setter has been selected in the Setters tab, its 'Recording Mode' will engage as visible by the red outline around the 📘 Stage.

In this mode, any value changes made within an Element's 📘 Properties Panel or directly on-Stage using any of the 📘 Toolbox tools will be 'keyed' in the Setter, and display as a Property value change within the Setters tab under the associated Setter.

Removing Setter Values

Once a Property value has been 'keyed' in the Setter, it can be removed at any time by hovering over the Property value under the Setter and clicking the 🗑 (Remove) icon.

Removing Setters

Whole Setters, and all of their included Property values can equally be removed by hovering over the Setter and clicking the 🗑 (Remove) icon. It is important to note that all included Setter Values are removed along the Setter itself.

Documentation_Guide_Interactivity_Setters_RemoveSetter.png

Setters Context Menu

When a Setter is right-clicked in the Setters tab, multiple options are offered:

Documentation_Guide_Interactivity_Setters_ContextMenu.png
Reveal in VSCode
• Opens the current document in VSCode, and navigates to the line where the Setter is declared in the current scope.
Recommended to be used in tandem with the ↗️ NoesisGUI XAML Tools VSCode Extension.
Cut
Copy
Paste
• Allows the entirety of a Setter and its Property values to be Cut (Copied and Removed) or Copied (Copied and Retained) into the clipboard.
• Using the Paste function then allows the Cut or Copied Setter to be pasted as a new Setter within the Setters tab.
Duplicate
• Allows the duplication of individual Setters as new Setters within the Setters tab.
Delete
• Deletes the selected Setter from the scope.

Cascading Setters

When Setters are used within a Style, they can leverage a Style's ability to be 'Based On' another Style.

Mechanically, in the scenario of one 'child' Style, 'Based on' a 'parent' Style:

  1. The 'child' will inherit all Setters from the 'parent' Style, provided there are no conflicts between each of their instructions.
  2. If a 'child' Setter conflicts with the 'parent' Setter, the 'child' Setter has authority, and will overwrite the 'parent' Setter.

Creating a cascade of Setters can be achieved through:

  1. Creating a first Style containing the desired Setters.
  2. Creating a second Style, then from its Style 📘 Properties Panel, setting it to be 'Based On' the first Style, then creating any new Setters desired for the variant.

This process can then be repeated across as many levels of Styles as desired to create an entire library of variants, where presentational changes are governed throughout a collection of cascading centrally-managed Resources.

Documentation_Guide_Interactivity_Setters_BasedOnStyle.png
 
© 2017 Noesis Technologies