3.2.2 Navigation Form

The following example demonstrates how to specify a Form with a NavigationControl.

 <?xml version="1.0" encoding="utf-16" standalone="no"?>
 <axl:View Name="Navigation Form" xmlns="http://schemas.microsoft.com/client/2009/04" xmlns:a="http://schemas.microsoft.com/office/accessservices/2009/04/forms" xmlns:axl="http://schemas.microsoft.com/office/accessservices/2009/04/application" xmlns:x="http://schemas.microsoft.com/winfx/2009/04/xaml">
   <a:Form NavigationButtons="false" TabularBorderStyle="Both">
     <a:Form.Detail>
       <DataTemplate>
         <a:Section x:Name="Detail">
           <Grid a:LayoutGroup="2">
             <Grid.ColumnDefinitions>
               <ColumnDefinition/>
             </Grid.ColumnDefinitions>
             <Grid.RowDefinitions>
               <RowDefinition Height="32"/>
               <RowDefinition/>
             </Grid.RowDefinitions>
             <Border Grid.Column="0" Grid.Row="0">
               <a:NavigationControl x:Name="NavigationControl" MinWidth="500" ControlHeight="32" NavigationTargetSubform="NavigationSubform">
                 <Border>
                   <a:NavigationButton x:Name="UserDetailsNavigationButton" ControlWidth="120" Caption="User Details" ControlHeight="26" NavigationTargetName="Form.UserDetails"/>
                 </Border>
                 <Border>
                   <a:NavigationButton x:Name="TasksDatasheetNavigationButton" ControlWidth="120" Caption="All Tasks" ControlHeight="26" NavigationTargetName="Form.TasksDatasheet"/>
                 </Border>
                 <Border>
                   <a:NavigationButton x:Name="TaskReportNavigationButton" ControlWidth="120" Caption="Task report" ControlHeight="26" NavigationTargetName="Report.Task By Assigned To"/>
                 </Border>
               </a:NavigationControl>
             </Border>
             <Border Grid.Column="0" Grid.Row="1">
               <a:SubForm x:Name="NavigationSubform" MinHeight="480" MinWidth="500" ShowPageHeaderAndPageFooter="true"/>
             </Border>
           </Grid>
         </a:Section>
       </DataTemplate>
     </a:Form.Detail>
   </a:Form>
 </axl:View>

This form has a detail section specified in the same way as the previous example. The layout of the detail section has one conceptual column and two conceptual rows, the first of which has a fixed height of 32.

The NavigationControl element is specified by the first Border element, which means that it exists in the top conceptual row of the form. The first RowDefinition element specifies a fixed height, the same as the ControlHeight attribute of NavigationControl, but the first and only ColumnDefinition element doesn’t specify a fixed width. Instead, the NavigationControl uses the MinWidth attribute to specify that the conceptual column is at least 500 pixels wide. Similarly, the second RowDefinition element doesn’t specify a fixed height, but the SubForm element uses the MinHeight attribute to specify that the row is at least 480 pixels high.

The NavigationControl has three child NavigationButton controls, described in the following table. The NavigationTargetSubform attribute value NavigationSubform specifies that when the user clicks on one of the buttons, the associated object specified by the button’s NavigationTargetName attribute will be opened in NavigationSubform.

Button Name

Caption

Type of Associated Object

Name of Associated Object

UserDetailsNavigationButton

User Details

Form

UserDetails

TaskDataSheetNavigationButton

All Tasks

Form

TasksDatasheet

TaskReportNavigationButton

Task Report

Report

Task By Assigned To

Each of the buttons specifies a ControlHeight that is smaller than the height of the NavigationControl, which means that there is padding around the buttons.