You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/Learn/Navigation/Advanced/HowTo-UseNavigationView.md
+29-42Lines changed: 29 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,19 +28,10 @@ Choosing the right control for your navigation needs is important, and one commo
28
28
</Grid>
29
29
```
30
30
31
-
* Add a `RowDefinition` to the `Grid`'s `RowDefinitions` collection. This will define the height of the `NavigationView`'s menu.
32
-
33
-
```xml
34
-
<Grid.RowDefinitions>
35
-
<RowDefinitionHeight="Auto" />
36
-
<RowDefinition />
37
-
</Grid.RowDefinitions>
38
-
```
39
-
40
31
* Add a `NavigationView` control to the `Grid`. This will be the menu for the app.
41
32
42
33
```xml
43
-
<NavigationView Grid.Row="1">
34
+
<NavigationView>
44
35
...
45
36
</NavigationView>
46
37
```
@@ -53,7 +44,7 @@ Choosing the right control for your navigation needs is important, and one commo
53
44
For this tutorial, `Grid` should be placed in the `Content` area.
54
45
55
46
```xml
56
-
<Grid Grid.Row="1">
47
+
<Grid>
57
48
...
58
49
</Grid>
59
50
```
@@ -75,24 +66,24 @@ Choosing the right control for your navigation needs is important, and one commo
75
66
* Inside the `Grid` element of the `NavigationView`, add a `Grid` element to represent the content of each view you can to navigate to.
76
67
77
68
```xml
78
-
<Grid Grid.Row="1">
69
+
<Grid>
79
70
<Grid>
80
71
<TextBlockText="One"
81
-
FontSize="24"
82
-
HorizontalAlignment="Center"
83
-
VerticalAlignment="Center" />
72
+
FontSize="24"
73
+
HorizontalAlignment="Center"
74
+
VerticalAlignment="Center" />
84
75
</Grid>
85
76
<Grid>
86
77
<TextBlockText="Two"
87
-
FontSize="24"
88
-
HorizontalAlignment="Center"
89
-
VerticalAlignment="Center" />
78
+
FontSize="24"
79
+
HorizontalAlignment="Center"
80
+
VerticalAlignment="Center" />
90
81
</Grid>
91
82
<Grid>
92
83
<TextBlockText="Three"
93
-
FontSize="24"
94
-
HorizontalAlignment="Center"
95
-
VerticalAlignment="Center" />
84
+
FontSize="24"
85
+
HorizontalAlignment="Center"
86
+
VerticalAlignment="Center" />
96
87
</Grid>
97
88
</Grid>
98
89
```
@@ -103,7 +94,7 @@ Choosing the right control for your navigation needs is important, and one commo
103
94
104
95
* Add the `uen:Region.Attached` attached property to each of the following elements:
105
96
106
-
* The `Grid` element that contains the `NavigationView` and the `Grid` element that contains the content area.
97
+
* The `Grid` element that contains the `NavigationView`.
107
98
* The `NavigationView` element.
108
99
* The `Grid` element that contains the content area.
109
100
@@ -135,6 +126,9 @@ Choosing the right control for your navigation needs is important, and one commo
135
126
uen:Region.Navigator="Visibility"
136
127
```
137
128
129
+
> [!IMPORTANT]
130
+
> Even if you're not utilizing the `<Grid>` element to arrange the content (ie, you're navigating between pages defined with routes), you must still include the `<Grid>` element with the `uen:Region.Navigator="Visibility"` and `uen:Region.Attached="True"` attached properties. These properties are essential for enabling the navigator functionality.
131
+
138
132
* Add the `uen:Region.Name` attached property to each of the `Grid` elements that contain the content area. This will define the name of the view that the `Grid` will represent.
139
133
140
134
```xml
@@ -180,21 +174,20 @@ Choosing the right control for your navigation needs is important, and one commo
180
174
* Add a new **Page** item to your app called `ProductsPage` with the following code:
0 commit comments