-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add PaneTitle to NavigationViewTemplateSettings #18
Changes from all commits
d6659c0
c31fb32
435c55e
37e74e1
7255b19
9bb4de5
89d2c57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Background | ||
Xaml controls are typically implemented using an element tree that’s defined in a template. | ||
For example the template for a ComboBox control has a TextBlock in it to display the selected value. | ||
Several controls have properties that are only expected to be useful to these templates, | ||
and so there’s a common pattern for the control to expose them in a TemplateSettings property. | ||
For example [ComboBox.TemplateSettings](https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.ComboBox.TemplateSettings) | ||
is used by the ComboBox’s template. See [this doc page](https://docs.microsoft.com/en-us/windows/uwp/xaml-platform/template-settings-classes) for more details. | ||
|
||
The new API here adds a PaneTitle property to NavigationView's existing | ||
[TemplateSettings property](https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.NavigationViewTemplateSettings). | ||
This helps the control template decide if it should show the | ||
[NavigationView.PaneTitle](https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.NavigationView.PaneTitle) | ||
property, as it should be ignored if the | ||
[NavigationView.PaneHeader](https://docs.microsoft.com/uwp/api/Windows.UI.Xaml.Controls.NavigationView.PaneHeader) | ||
property is set. (The RS5 PaneHeader property supersedes/replaces the RS4 PaneTitle property.) | ||
|
||
|
||
# Description | ||
Provides calculated PaneTitle that can be referenced as TemplatedParent sources when defining templates for a NavigationView control. Not intended for general use. | ||
|
||
# Examples | ||
|
||
``` | ||
[webhosthidden] | ||
unsealed runtimeclass NavigationViewTemplateSettings : Windows.UI.Xaml.DependencyObject | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't an Example, this is the API, and should be in the API Details section. The "sample usage" from the Remarks section should be brought up here. |
||
{ | ||
... | ||
|
||
{ | ||
String PaneTitle{ get; }; | ||
static Windows.UI.Xaml.DependencyProperty PaneTitleProperty{ get; }; | ||
} | ||
} | ||
``` | ||
|
||
# Remarks | ||
This is intended for use in the style of the `NavigationView` control. Sample usage: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the template, not in the style There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Templatesetting is used in the style |
||
|
||
```xaml | ||
<Style TargetType="local:NavigationView"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be a template example. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand? TemplateSettings.PaneTitle example is always in the style Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneTitle}" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's used in the ControlTemplate, and the ControlTemplate is typically part of the default Style. (That Text property is on a TextBlock in a ControlTemplate.) PersonPictureSettings (#13) is a good reference. |
||
... | ||
<TextBlock | ||
x:Name="PaneTitleTextBlock" | ||
Grid.Column="0" | ||
Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneTitle}" | ||
HorizontalAlignment="Left" | ||
VerticalAlignment="Center" | ||
Style="{StaticResource NavigationViewItemHeaderTextStyle}"/> | ||
``` | ||
|
||
# API Notes | ||
|
||
## Class: NavigationViewTemplateSettings | ||
| Member Name | Description | | ||
|:- |:--| | ||
| PaneTitle | The NavigationView.PaneTitle displayed in the control. Empty when NavigationView.PaneHeader is set | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.