Skip to main content

Screen Transitions with View Tree

This page uses the basic Views prepared in the previous page to build two screen-level Views — MainView and DetailView — and arranges them as siblings on the View Tree.

The central theme you will learn here is how to assemble a single screen in the View Definition Editor and why a sibling relationship on the View Tree is suited to mutually exclusive screen switching. You will also assign Jump To View to buttons and verify in the Player that MainView and DetailView switch without overlapping. This page is the core part for mastering the fundamentals of defining screen-level Views in the View Editor and navigating between sibling Views.

Creating MainView

In this section, you define a View that represents the entire main screen by combining the background, a shared header, and the main content. As you work through the steps, keep in mind that the View Definition Editor is the place where you assemble screen-level Views.

  1. In Solution Explorer, select the Solution folder and select Add > New Item from the context menu.
  2. In the New Item dialog, select View and name it MainView.
  3. Double-click the created MainView to open the View Definition Editor.
  4. Add the following elements to the left pane of the View Definition Editor:
    • Background_View
    • HeaderView
    • MainContent_View

MainView is a View that consolidates the background, the shared header, and the main-screen content into a single screen state. Note that HeaderView is reused here as an existing View — this demonstrates the concept of extracting common components into separate Views for reuse.

Creating DetailView

Next, you define a View that represents the entire detail screen. As with MainView, the background and header are reused as shared components; only the content portion differs. This approach lets multiple screens share the same visual framework while switching only their content.

  1. In Solution Explorer, select the Solution folder and select Add > New Item from the context menu.
  2. In the New Item dialog, select View and name it DetailView.
  3. Double-click the created DetailView to open the View Definition Editor.
  4. Add the following elements to the left pane of the View Definition Editor:
    • Background_View
    • HeaderView
    • DetailContent_View

DetailView is also an independent View that represents an entire screen. Because it shares the same background and header as MainView and differs only in content, you can easily switch between screen-level Views on the View Tree later.

Building the MainViewTree

Here you place MainView and DetailView onto the View Tree. The most important point is to arrange them as siblings. A sibling relationship is suited to switching between independent screen states.

  1. In Solution Explorer, select the Solution folder and select Add > New Item from the context menu.
  2. In the New Item dialog, select ViewTree and name it MainViewTree.
  3. Double-click the created MainViewTree to open the View Tree panel.
  4. Drag and drop MainView onto the View Tree panel to add it as a top-level View State.
  5. Similarly, drag and drop DetailView into the empty area below MainView to add it as a top-level View State.

Verifying the Sibling Relationship on the View Tree

  • MainView and DetailView are at the same hierarchy level (DetailView is not a child of MainView).
  • These two Views are targets for mutually exclusive switching.

If you drop DetailView onto the body of MainView, it becomes a child, which may inadvertently create a structure close to simultaneous display. Because you want to switch between entire screens in this tutorial, always drop DetailView into the empty area below MainView to arrange them as siblings.

Configuring Transitions Between Views

From this point, you set up Jump To View so that you can navigate between the sibling Views defined on the View Tree. Note that the transition target must be the completed screen-level View, not a content View.

  1. Double-click the MainContent scene to open the Scene Editor.
  2. In the Scene Tree, select OpenDetailButton.
  3. Drag and drop a Jump To View behavior onto Action in the Extra Scene Tree.
  4. Select the added Jump To View behavior and configure the following properties in the Properties panel:
    Property Category Item Value
    General Name JumpToDetailView
    Asset View DetailView

The reason you specify DetailView rather than DetailContent_View as the transition target is that you want to switch at the screen level, including the background and header. This is where the flow connects: the composite View you built in the View Definition Editor is used as a state on the View Tree.

Apply the same procedure to set up the return transition from DetailView to MainView. This completes the round-trip switching between sibling Views.

  1. Double-click the DetailContent scene to open the Scene Editor.
  2. In the Scene Tree, select BackButton.
  3. Drag and drop a Jump To View behavior onto Action in the Extra Scene Tree.
  4. Select the added Jump To View behavior and configure the following properties in the Properties panel:
    Property Category Item Value
    General Name JumpToMainView
    Asset View MainView

Verifying in the Player

Here you verify not only the switching between MainView and DetailView but also whether the clear setting on the Background is working correctly. Even when the transition itself succeeds, a previous screen may remain visible; in such cases, the cause is often on the Background side rather than the View Tree.

  1. Save the solution and launch the Player.
    • Verify that MainView appears immediately after launch.
  2. Click the Open Detail button.
    • Verify that the screen switches to DetailView.
  3. Click the Back button.
    • Verify that the screen returns to MainView.

In this page, you built MainView and DetailView as screen-level Views in the View Definition Editor and arranged them as siblings on the View Tree. You also implemented basic screen switching between sibling Views by using Jump To View. In the next page, you will learn a parent-child relationship — a structure with a different purpose — that switches only a local state while keeping the shared display intact.