This reply was very helpful. I still have one question. Here is my mainview.ux:
<App>
<Router ux:Name="router" />
<DockPanel>
<Navigator DefaultTemplate="home">
<HomePage ux:Template="home" router="router" />
</Navigator>
</DockPanel>
</App>
All I want it to do is start up a “home” page that I can use to start the dialog with the user and that users can return to when they hit the home button.
Here is HomePage.ux
<DefaultPage ux:Class="HomePage">
<Router ux:Dependency="router" />
<JavaScript File="HomePage.js" />
<DockPanel>
<PageControl ux:Name="pageControl" >
<PageOne ux:Name="pageOne" router="router" />
<PageTwo ux:Name="pageTwo" router="router" />
</PageControl>
<Panel Dock="Top">
<Grid Alignment="Bottom" Height="50" ColumnCount="3" Background="#7f5ce6" >
<HomePageTab Label="Page One" pageControl="pageControl" page="pageOne" />
<HomePageTab Label="Page Two" pageControl="pageControl" page="pageTwo" />
</Grid>
</Panel>
</DockPanel>
</DefaultPage>
All I want it to do is display a blank screen with a couple of HomePageTab objects. HomePageTab is precisely as in the caatr example but to make life easy I’ll include it here:
<Panel ux:Class="HomePageTab" HitTestMode="LocalBoundsAndChildren">
<string ux:Property="Label" />
<PageControl ux:Dependency="pageControl" />
<Page ux:Dependency="page" />
<Text Alignment="Center" Value="{Property this.Label}" />
<Clicked>
<NavigateTo NavigationContext="pageControl" Target="page" />
</Clicked>
<WhilePressed>
<Scale Factor=".70" Duration=".08" Easing="QuadraticInOut" />
</WhilePressed>
</Panel>
PageOne and PageTwo.ux are basically the same right now as I just want to focus on navigation. They are just page objects that display “i am on Page One” and “I am on Page Two” in a text object.
PageOne.ux is:
Page ux:Class="PageOne">
<Router ux:Dependency="router" />
<JavaScript File="PageOne.js" />
<StackPanel>
<Text Value="This is Page One" />
</StackPanel>
</Page>
PageTwo.ux is:
<Page ux:Class="PageTwo">
<Router ux:Dependency="router" />
<JavaScript File="PageTwo.js" />
<StackPanel>
<Text Value="This is Page Two" />
</StackPanel>
</Page>
When I run this, instead of a blank screen I get a “This is Page One” upon the start of the application. I want this to be blank with just the two HomePageTab’s so I can give the users directions. The HomePageTabs are there and work perfectly.
I just do not understand why the text on Page One is displayed before the user has done anything. I have to think some default in the router is being triggered, but I still really don’t have a good grasp of route to know how to fix this.
Really appreciate your help – feel like I’m very close to getting the hang of navigation. Note that I have all the include’s for javascript but each javascript file (for this example) has only:
var Observable = require('FuseJS/Observable');
Many thanks for your help.