|
| 1 | +<DockPanel ux:Class="ApplicationTop"> |
| 2 | + <Router ux:Dependency="router"/> |
| 3 | + |
| 4 | + <!-- |
| 5 | + The title is partially static and dynamic: |
| 6 | + |
| 7 | + - The Menu or Back button is on all pages and in the code here |
| 8 | + - Each page will use `TitleAreaContent` to add a title, or other controls into this panel. |
| 9 | + --> |
| 10 | + <Panel Dock="Top" ux:Name="titleArea" Height="40" Color="#DDD"> |
| 11 | + <!-- Include Back or Menu navigation --> |
| 12 | + <Panel Alignment="Left" Padding="5,0" HitTestMode="LocalBounds" Navigation="router"> |
| 13 | + <WhileCanGoBack> |
| 14 | + <Text Value="" Alignment="Center" Font="MaterialIcons" FontSize="28"/> |
| 15 | + <Clicked> |
| 16 | + <GoBack/> |
| 17 | + </Clicked> |
| 18 | + </WhileCanGoBack> |
| 19 | + <WhileCanGoBack Invert="true"> |
| 20 | + <Text Value="" Alignment="Center" Font="MaterialIcons" FontSize="28"/> |
| 21 | + <Clicked> |
| 22 | + <RaiseUserEvent EventName="requestMenu"/> |
| 23 | + </Clicked> |
| 24 | + </WhileCanGoBack> |
| 25 | + </Panel> |
| 26 | + </Panel> |
| 27 | + <!-- The `TitleAreaContent` finds the panel via a resource binding --> |
| 28 | + <ResourceObject Key="titleArea" Value="titleArea"/> |
| 29 | + |
| 30 | + <!-- |
| 31 | + Two levels of navigation are used. |
| 32 | + |
| 33 | + The "home" path contains the bottom action bar to quickly navigate between top-level sections. Any page that wishes to have this action bar should reside inside "home". |
| 34 | + |
| 35 | + The other pages will not have this action bar, but will still have the common titleArea. |
| 36 | + --> |
| 37 | + <Navigator DefaultPath="home"> |
| 38 | + <CreateBookingPage ux:Template="createBooking"/> |
| 39 | + <AccountPage ux:Template="account"/> |
| 40 | + <BookingPage ux:Template="booking"/> |
| 41 | + |
| 42 | + <DockPanel ux:Name="home"> |
| 43 | + <PageControl Interaction="None" ux:Name="homeNav"> |
| 44 | + <FlightsPage ux:Name="flights" router="router"> |
| 45 | + <!-- use resources to adjust icon in the bottom action bar --> |
| 46 | + <string ux:Key="Icon" ux:Value=""/> |
| 47 | + <string ux:Key="ShortTitle" ux:Value="Flights"/> |
| 48 | + </FlightsPage> |
| 49 | + <BookingsPage ux:Name="bookings" router="router"> |
| 50 | + <string ux:Key="Icon" ux:Value=""/> |
| 51 | + <string ux:Key="ShortTitle" ux:Value="Bookings"/> |
| 52 | + </BookingsPage> |
| 53 | + </PageControl> |
| 54 | + |
| 55 | + <!-- The icon/page listing at the bottom. Here we're using a PageIndicator to make the creation dynamic. Though you could also hard-code the display here and use a `Navigator` above instead of a `PageControl` --> |
| 56 | + <PageIndicator Navigation="homeNav" Dock="Bottom" Color="#DDD"> |
| 57 | + <GridLayout RowCount="1" ChildOrder="ColumnMajor"/> |
| 58 | + |
| 59 | + <StackPanel ux:Template="Dot" Alignment="Center" ItemSpacing="5" Margin="5"> |
| 60 | + <Text Value="{Page Icon}" Font="MaterialIcons" FontSize="40" |
| 61 | + Color="#888" TextAlignment="Center" ux:Name="icon"/> |
| 62 | + <Text Value="{Page ShortTitle}" FontSize="14" |
| 63 | + Color="#888" TextAlignment="Center" ux:Name="label"/> |
| 64 | + <ActivatingAnimation> |
| 65 | + <Change icon.Color="#468"/> |
| 66 | + <Change label.Color="#468"/> |
| 67 | + </ActivatingAnimation> |
| 68 | + <Clicked> |
| 69 | + <NavigateTo Target="{Page Visual}"/> |
| 70 | + </Clicked> |
| 71 | + </StackPanel> |
| 72 | + </PageIndicator> |
| 73 | + </DockPanel> |
| 74 | + </Navigator> |
| 75 | +</DockPanel> |
0 commit comments