01.
<
common:LayoutAwarePage
02.
x:Name
=
"pageRoot"
03.
x:Class
=
"$safeprojectname$.BasicPage1"
04.
DataContext
=
"{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
05.
xmlns
=
"http://schemas.microsoft.com/winfx/2006/xaml/presentation"
06.
xmlns:x
=
"http://schemas.microsoft.com/winfx/2006/xaml"
07.
xmlns:local
=
"using:$safeprojectname$"
08.
xmlns:common
=
"using:$safeprojectname$.Common"
09.
xmlns:d
=
"http://schemas.microsoft.com/expression/blend/2008"
10.
xmlns:mc
=
"http://schemas.openxmlformats.org/markup-compatibility/2006"
11.
mc:Ignorable
=
"d"
>
12.
13.
<
Page.Resources
>
14.
15.
16.
<
x:String
x:Key
=
"AppName"
>My Application</
x:String
>
17.
</
Page.Resources
>
18.
19.
<!--
20.
This grid acts as a root panel for the page that defines two rows:
21.
* Row 0 contains the back button and page title
22.
* Row 1 contains the rest of the page layout
23.
-->
24.
<
Grid
Style
=
"{StaticResource LayoutRootStyle}"
>
25.
<
Grid.RowDefinitions
>
26.
<
RowDefinition
Height
=
"140"
/>
27.
<
RowDefinition
Height
=
"*"
/>
28.
</
Grid.RowDefinitions
>
29.
30.
31.
<
Grid
>
32.
<
Grid.ColumnDefinitions
>
33.
<
ColumnDefinition
Width
=
"Auto"
/>
34.
<
ColumnDefinition
Width
=
"*"
/>
35.
</
Grid.ColumnDefinitions
>
36.
<
Button
x:Name
=
"backButton"
Click
=
"GoBack"
IsEnabled
=
"{Binding Frame.CanGoBack, ElementName=pageRoot}"
Style
=
"{StaticResource BackButtonStyle}"
/>
37.
<
TextBlock
x:Name
=
"pageTitle"
Grid.Column
=
"1"
Text
=
"{StaticResource AppName}"
Style
=
"{StaticResource PageHeaderTextStyle}"
/>
38.
</
Grid
>
39.
40.
<
VisualStateManager.VisualStateGroups
>
41.
42.
43.
<
VisualStateGroup
x:Name
=
"ApplicationViewStates"
>
44.
<
VisualState
x:Name
=
"FullScreenLandscape"
/>
45.
<
VisualState
x:Name
=
"Filled"
/>
46.
47.
48.
<
VisualState
x:Name
=
"FullScreenPortrait"
>
49.
<
Storyboard
>
50.
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetName
=
"backButton"
Storyboard.TargetProperty
=
"Style"
>
51.
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource PortraitBackButtonStyle}"
/>
52.
</
ObjectAnimationUsingKeyFrames
>
53.
</
Storyboard
>
54.
</
VisualState
>
55.
56.
57.
<
VisualState
x:Name
=
"Snapped"
>
58.
<
Storyboard
>
59.
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetName
=
"backButton"
Storyboard.TargetProperty
=
"Style"
>
60.
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource SnappedBackButtonStyle}"
/>
61.
</
ObjectAnimationUsingKeyFrames
>
62.
<
ObjectAnimationUsingKeyFrames
Storyboard.TargetName
=
"pageTitle"
Storyboard.TargetProperty
=
"Style"
>
63.
<
DiscreteObjectKeyFrame
KeyTime
=
"0"
Value
=
"{StaticResource SnappedPageHeaderTextStyle}"
/>
64.
</
ObjectAnimationUsingKeyFrames
>
65.
</
Storyboard
>
66.
</
VisualState
>
67.
</
VisualStateGroup
>
68.
</
VisualStateManager.VisualStateGroups
>
69.
</
Grid
>
70.
</
common:LayoutAwarePage
>