NoesisGUI
 

📘 Screen Navigation

🏘️ NoesisGUI ▸ 🏠 Noesis Studio ▸ 📘 Working With Interactivity ▸ 📘 Screen Navigation

Overview

There exist many different approaches to setting up Screen Navigation systems within the framework to enable a user to navigate from one screen within the interface to another.

These can range from solutions as basic as simply toggling the visibility of Elements from one 'screen' to another, all the way to driving entire systems with backend code.

With that said, Noesis Studio provides a set of robust built-in systems that can be leveraged to achieve a 'best-practice' highly modular and dynamic architecture that can be easily set up and managed by Designers and Developers alike.

Anatomy of Screen Navigation

At the core of the recommended approach to screen navigation sits the 📘 ContentControl Element.

What makes this Element so powerful in the context of screen navigation is that in addition to its Element Template, it also includes its very own 📘 ContentControl Content Template, allowing a structure where:

  • Each individual 'screen' is stored as a ContentControl Content Template Resource.
  • The ContentControl Element serves as the 'host' Element to display one individual Content Template (screen) at a time.
  • Changing 'screen' occurs as a result of changing the Content Template assigned to the ContentControl Element.
Documentation_Guide_Interactivity_ScreenNavigation_ContentSwap_Video.gif

ContentControl Element

In the context of Screen Navigation, the ContentControl Element:

Documentation_Guide_Interactivity_ScreenNavigation_ContentControlShowcase.png

ContentControl Content Template

Served by the ContentControl Element, each ContentControl Content Template:

  • Contains the layout and artwork making up each individual 'screen' within the interface.
  • Contains a root Element which can be used to host any applicable Storyboard animations, and sets which animation to use when transitioning into, or out of the 'screen' as outlined in 📑 Screen Transition Animations.
  • Contains the 📘 Triggers which dictate which 'screen' to navigate to when any of its controls are actuated, as outlined in 📑 NavigateActions.
Documentation_Guide_Interactivity_ScreenNavigation_ContentTemplateShowcase.png

Screen Data

The Project's Data used to drive Screen Navigation:

  • Includes one Data Structure per 'screen' in the Project, and contains all relevant Data used to drive the screen itself as outlined in 📑 Screen Data Structure.
  • Establishes the ViewModel served to the entire Page, which by extension provides access to each individual screen within the wider collection of all screens within the Project, as outlined in 📑 ViewModel Structure.
Documentation_Guide_Interactivity_ScreenNavigation_DataShowcase.png

Screen Navigation Configuration

Setting up Screen Navigation involves configuring multiple parts in concert to work together to produce a dynamic, customizable navigation system:

ContentControl Introduction

A 📘 ContentControl Element can be dragged from the 📘 Add Element Panel onto the 📘 Stage or into the 📘 Navigator Panel, then positioned within the layout as desired.

Content Template Creation

The Content Templates that are used to contain each 'screen' in this model can be created through two different methods:

Content Templates can be created directly from the 📘 Resources Panel by selecting the desired Resource Dictionary, followed by clicking on the + (Add Resource) icon, and from the 'Controls' section, creating a 'DataTemplate' Resource.

Documentation_Guide_Interactivity_ScreenNavigation_AddResourceItem.png

Once created, the Template Resource can be edited at any time by hovering over it and clicking its 🖉 (Edit) icon. This will open the Template in an isolated Template Editor from where its composition can be designed.

Documentation_Guide_Interactivity_ScreenNavigation_EditResourceItem.png

Alternatively, Content Templates can also be created directly from the 📘 ContentControl Element itself, by right-clicking on it on either the 📘 Stage or in the 📘 Navigator Panel, and from its context menu, navigating to 'Templates', 'Content', then selecting 'Create'.

Documentation_Guide_Interactivity_ScreenNavigation_CreateTemplate.png

A popup will then appear, allowing the Template Resource to be named, as well as being able to select the storage location for the Resource within the Project.

Documentation_Guide_Interactivity_ScreenNavigation_SaveTemplate.png

Selecting 'Accept' will finalize the process and open the Template, from where it can be populated like any other Template or Page in the framework.

Documentation_Guide_Interactivity_ScreenNavigation_EnterTemplate.png

It is important to note that creating a Content Template inline in this method will automatically assign the corresponding 'Data Type' to the Template Resource depending on what was populated in the ContentControl's Content Property at the time of creation.

For example, if a String was the value for the Content Property at the time of the Template's creation, the Template will be created as a 'String' Data Type. Alternatively, if the Content Property was bound to a Data Structure, it will be created as that Structure's Data Type. Although this 'pairing' can sometimes be useful, it can also result in Templates only being visible and accessible by Elements of that Type.

To remove this automatic pairing, the Template Resource can be selected in the 📘 Resources Panel to reveal its 📘 Properties Panel. Within its Properties, the 'Data Type' Property can be cleared by hovering over it and pressing MiddleMouse, or by clicking on its ⋮ (3-Dot) menu icon and selecting 'Clear Local Value'.

This will result in the Template being able to be universally accessible, and applicable to all supporting Elements.

Data-Driven Navigation

Employing the principles outlined in 📘 Data Structures and Properties, an interface's navigation can be set to be Data-driven by setting up purpose-built Data Structures:

Screen Data Structure

In this model, each 'screen' in an interface is given its own Data Structure, whose Data Properties include any Data pertinent to the population of the screen:

Documentation_Guide_Interactivity_ScreenNavigation_ScreenData.png

ViewModel Structure

The ViewModel governing the entire Project's Data, and assigned to the active Page, then serves the Data Structures of each individual screen, making them available to the interface for usage within the navigation system:

Documentation_Guide_Interactivity_ScreenNavigation_ViewModelData.png

Screen Navigation Destinations

In addition to serving as the 'host' that displays all 'screens' via its Content Template, the 📘 ContentControl Element also plays a critical functional role as the Element that contains the manifest of all screens that can be navigated to within its system.

Destination Manifest

With the ContentControl Element selected and its 📘 Properties Panel exposed, the 'Content Navigation' section can be used to add 'Destinations' to the screen navigation system driven by the Element.

Documentation_Guide_Interactivity_ScreenNavigation_Destinations.png

To add a new Destination, the + (Add Item) icon in the upper right can be clicked from the top of the Properties section:

Documentation_Guide_Interactivity_ScreenNavigation_AddDestination.png

Once the Destination has been added, information on the screen can then be populated:

Id
Allows a custom identifier to be set for each screen.
The Id is used in the context of the 📑 NavigateActions to set the screen that should be navigated to as a result of a navigation event.
Content
Sets which Content is associated with each screen. In most cases, this will be the Data Structure of the screen in question as was set in the 📑 Screen Data Structure.
Content Template
Sets which ContentControl Content Template Resource to populate the ContentControl with when the screen is invoked.

Screen Transition Animations

When a ContentControl Element changes the 'active screen' from one to another by swapping its Content Template, it is possible to create custom animations that dictate how the current screen 'exits', and how the incoming screen 'enters' during the transition from one screen to another.

TransitionContentPresenter Setup

To enable screen-to-screen transitions, a custom Template must first be made for the 📘 ContentControl Element, in which the default 📘 ContentPresenter Element is replaced with a 📘 TransitionContentPresenter Element as outlined in 📘 TransitionContentPresenter Configuration.

Transition Animation Setup

With the 📘 TransitionContentPresenter Element present within the 📘 ContentControl Element, the 📘 ContentControl Content Template can then be created or opened for edit.

Documentation_Guide_Interactivity_ScreenNavigation_EditCurrent.png

Within the Content Template, transition animations can then be created by navigating to the 📘 Animation Panel, and 📘 Creating Storyboards.

Documentation_Guide_Interactivity_ScreenNavigation_AddStoryboard.png

Either one generic Storyboard animation can be created to handle the screen's transitions 'in' and 'out', or completely bespoke Storyboards can be created for each.

Documentation_Guide_Interactivity_ScreenNavigation_MultiStoryboards.png

Once the desired Storyboards have been created, and the transitions designed, the root Element of the 📘 ContentControl Content Template can be selected. Within its 📘 Properties Panel, from its 'Transitions' section, the custom Storyboards to use during its transitions can be set.

Documentation_Guide_Interactivity_ScreenNavigation_Transitions.png

Each Transition Type will automatically apply based on the direction of the transition from one screen to another:

Enter
Defines the Storyboard to play when the screen is navigated towards, from anywhere.
Exit
Defines the Storyboard to play when the screen is navigated away from.
Reverse Enter
When a screen is part of an array of screens, defines the Storyboard to play when the screen is navigated towards, coming from a screen 'higher' in the index of screens.
Reverse Exit
When a screen is part of an array of screens, defines the Storyboard to play when the screen is navigated away from, towards a screen 'lower' in the index of screens.
 
© 2017 Noesis Technologies