0% found this document useful (0 votes)
424 views4,291 pages

Windows Ui Xaml Controls

The document describes various controls and classes in the Windows.UI.Xaml.Controls namespace including: - AppBar controls like AppBarButton for placing commands in an app bar - AutoSuggestBox for autocomplete text entry - CalendarDatePicker for selecting dates on a calendar - CalendarView for displaying a calendar - ColorPicker for selecting colors - ComboBox for selecting from a drop-down list - CommandBar for organizing app commands
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
424 views4,291 pages

Windows Ui Xaml Controls

The document describes various controls and classes in the Windows.UI.Xaml.Controls namespace including: - AppBar controls like AppBarButton for placing commands in an app bar - AutoSuggestBox for autocomplete text entry - CalendarDatePicker for selecting dates on a calendar - CalendarView for displaying a calendar - ColorPicker for selecting colors - ComboBox for selecting from a drop-down list - CommandBar for organizing app commands
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4291

Contents

Windows.UI.Xaml.Controls
AnchorRequestedEventArgs
Anchor
AnchorCandidates
AppBar
AppBar
Closed
ClosedDisplayMode
ClosedDisplayModeProperty
Closing
IsOpen
IsOpenProperty
IsSticky
IsStickyProperty
LightDismissOverlayMode
LightDismissOverlayModeProperty
OnClosed
OnClosing
OnOpened
OnOpening
Opened
Opening
TemplateSettings
AppBarButton
AppBarButton
DynamicOverflowOrder
DynamicOverflowOrderProperty
Icon
IconProperty
IsCompact
IsCompactProperty
IsInOverflow
IsInOverflowProperty
KeyboardAcceleratorTextOverride
KeyboardAcceleratorTextOverrideProperty
Label
LabelPosition
LabelPositionProperty
LabelProperty
TemplateSettings
AppBarClosedDisplayMode
AppBarElementContainer
AppBarElementContainer
DynamicOverflowOrder
DynamicOverflowOrderProperty
IsCompact
IsCompactProperty
IsInOverflow
IsInOverflowProperty
AppBarSeparator
AppBarSeparator
DynamicOverflowOrder
DynamicOverflowOrderProperty
IsCompact
IsCompactProperty
IsInOverflow
IsInOverflowProperty
AppBarToggleButton
AppBarToggleButton
DynamicOverflowOrder
DynamicOverflowOrderProperty
Icon
IconProperty
IsCompact
IsCompactProperty
IsInOverflow
IsInOverflowProperty
KeyboardAcceleratorTextOverride
KeyboardAcceleratorTextOverrideProperty
Label
LabelPosition
LabelPositionProperty
LabelProperty
TemplateSettings
AutoSuggestBox
AutoMaximizeSuggestionArea
AutoMaximizeSuggestionAreaProperty
AutoSuggestBox
Description
DescriptionProperty
Header
HeaderProperty
IsSuggestionListOpen
IsSuggestionListOpenProperty
LightDismissOverlayMode
LightDismissOverlayModeProperty
MaxSuggestionListHeight
MaxSuggestionListHeightProperty
PlaceholderText
PlaceholderTextProperty
QueryIcon
QueryIconProperty
QuerySubmitted
SuggestionChosen
Text
TextBoxStyle
TextBoxStyleProperty
TextChanged
TextMemberPath
TextMemberPathProperty
TextProperty
UpdateTextOnSelect
UpdateTextOnSelectProperty
AutoSuggestBoxQuerySubmittedEventArgs
AutoSuggestBoxQuerySubmittedEventArgs
ChosenSuggestion
QueryText
AutoSuggestBoxSuggestionChosenEventArgs
AutoSuggestBoxSuggestionChosenEventArgs
SelectedItem
AutoSuggestBoxTextChangedEventArgs
AutoSuggestBoxTextChangedEventArgs
CheckCurrent
Reason
ReasonProperty
AutoSuggestionBoxTextChangeReason
BackClickEventArgs
BackClickEventArgs
Handled
BackClickEventHandler
BackgroundSizing
BitmapIcon
BitmapIcon
ShowAsMonochrome
ShowAsMonochromeProperty
UriSource
UriSourceProperty
BitmapIconSource
BitmapIconSource
ShowAsMonochrome
ShowAsMonochromeProperty
UriSource
UriSourceProperty
Border
Background
BackgroundProperty
BackgroundSizing
BackgroundSizingProperty
BackgroundTransition
Border
BorderBrush
BorderBrushProperty
BorderThickness
BorderThicknessProperty
Child
ChildTransitions
ChildTransitionsProperty
CornerRadius
CornerRadiusProperty
Padding
PaddingProperty
Button
Button
Flyout
FlyoutProperty
CalendarDatePicker
CalendarDatePicker
CalendarIdentifier
CalendarIdentifierProperty
CalendarViewDayItemChanging
CalendarViewStyle
CalendarViewStyleProperty
Closed
Date
DateChanged
DateFormat
DateFormatProperty
DateProperty
DayOfWeekFormat
DayOfWeekFormatProperty
Description
DescriptionProperty
DisplayMode
DisplayModeProperty
FirstDayOfWeek
FirstDayOfWeekProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
IsCalendarOpen
IsCalendarOpenProperty
IsGroupLabelVisible
IsGroupLabelVisibleProperty
IsOutOfScopeEnabled
IsOutOfScopeEnabledProperty
IsTodayHighlighted
IsTodayHighlightedProperty
LightDismissOverlayMode
LightDismissOverlayModeProperty
MaxDate
MaxDateProperty
MinDate
MinDateProperty
Opened
PlaceholderText
PlaceholderTextProperty
SetDisplayDate
SetYearDecadeDisplayDimensions
CalendarDatePickerDateChangedEventArgs
NewDate
OldDate
CalendarView
BlackoutForeground
BlackoutForegroundProperty
CalendarIdentifier
CalendarIdentifierProperty
CalendarItemBackground
CalendarItemBackgroundProperty
CalendarItemBorderBrush
CalendarItemBorderBrushProperty
CalendarItemBorderThickness
CalendarItemBorderThicknessProperty
CalendarItemForeground
CalendarItemForegroundProperty
CalendarView
CalendarViewDayItemChanging
CalendarViewDayItemStyle
CalendarViewDayItemStyleProperty
DayItemFontFamily
DayItemFontFamilyProperty
DayItemFontSize
DayItemFontSizeProperty
DayItemFontStyle
DayItemFontStyleProperty
DayItemFontWeight
DayItemFontWeightProperty
DayOfWeekFormat
DayOfWeekFormatProperty
DisplayMode
DisplayModeProperty
FirstDayOfWeek
FirstDayOfWeekProperty
FirstOfMonthLabelFontFamily
FirstOfMonthLabelFontFamilyProperty
FirstOfMonthLabelFontSize
FirstOfMonthLabelFontSizeProperty
FirstOfMonthLabelFontStyle
FirstOfMonthLabelFontStyleProperty
FirstOfMonthLabelFontWeight
FirstOfMonthLabelFontWeightProperty
FirstOfYearDecadeLabelFontFamily
FirstOfYearDecadeLabelFontFamilyProperty
FirstOfYearDecadeLabelFontSize
FirstOfYearDecadeLabelFontSizeProperty
FirstOfYearDecadeLabelFontStyle
FirstOfYearDecadeLabelFontStyleProperty
FirstOfYearDecadeLabelFontWeight
FirstOfYearDecadeLabelFontWeightProperty
FocusBorderBrush
FocusBorderBrushProperty
HorizontalDayItemAlignment
HorizontalDayItemAlignmentProperty
HorizontalFirstOfMonthLabelAlignment
HorizontalFirstOfMonthLabelAlignmentProperty
HoverBorderBrush
HoverBorderBrushProperty
IsGroupLabelVisible
IsGroupLabelVisibleProperty
IsOutOfScopeEnabled
IsOutOfScopeEnabledProperty
IsTodayHighlighted
IsTodayHighlightedProperty
MaxDate
MaxDateProperty
MinDate
MinDateProperty
MonthYearItemFontFamily
MonthYearItemFontFamilyProperty
MonthYearItemFontSize
MonthYearItemFontSizeProperty
MonthYearItemFontStyle
MonthYearItemFontStyleProperty
MonthYearItemFontWeight
MonthYearItemFontWeightProperty
NumberOfWeeksInView
NumberOfWeeksInViewProperty
OutOfScopeBackground
OutOfScopeBackgroundProperty
OutOfScopeForeground
OutOfScopeForegroundProperty
PressedBorderBrush
PressedBorderBrushProperty
PressedForeground
PressedForegroundProperty
SelectedBorderBrush
SelectedBorderBrushProperty
SelectedDates
SelectedDatesChanged
SelectedDatesProperty
SelectedForeground
SelectedForegroundProperty
SelectedHoverBorderBrush
SelectedHoverBorderBrushProperty
SelectedPressedBorderBrush
SelectedPressedBorderBrushProperty
SelectionMode
SelectionModeProperty
SetDisplayDate
SetYearDecadeDisplayDimensions
TemplateSettings
TemplateSettingsProperty
TodayFontWeight
TodayFontWeightProperty
TodayForeground
TodayForegroundProperty
VerticalDayItemAlignment
VerticalDayItemAlignmentProperty
VerticalFirstOfMonthLabelAlignment
VerticalFirstOfMonthLabelAlignmentProperty
CalendarViewDayItem
CalendarViewDayItem
Date
DateProperty
IsBlackout
IsBlackoutProperty
SetDensityColors
CalendarViewDayItemChangingEventArgs
InRecycleQueue
Item
Phase
RegisterUpdateCallback
CalendarViewDayItemChangingEventHandler
CalendarViewDisplayMode
CalendarViewSelectedDatesChangedEventArgs
AddedDates
RemovedDates
CalendarViewSelectionMode
CandidateWindowAlignment
CandidateWindowBoundsChangedEventArgs
Bounds
Canvas
Canvas
GetLeft
GetTop
GetZIndex
LeftProperty
SetLeft
SetTop
SetZIndex
TopProperty
ZIndexProperty
CaptureElement
CaptureElement
Source
SourceProperty
Stretch
StretchProperty
CharacterCasing
CheckBox
CheckBox
ChoosingGroupHeaderContainerEventArgs
ChoosingGroupHeaderContainerEventArgs
Group
GroupHeaderContainer
GroupIndex
ChoosingItemContainerEventArgs
ChoosingItemContainerEventArgs
IsContainerPrepared
Item
ItemContainer
ItemIndex
CleanUpVirtualizedItemEventArgs
Cancel
UIElement
Value
CleanUpVirtualizedItemEventHandler
ClickMode
ColorChangedEventArgs
NewColor
OldColor
ColorPicker
Color
ColorChanged
ColorPicker
ColorProperty
ColorSpectrumComponents
ColorSpectrumComponentsProperty
ColorSpectrumShape
ColorSpectrumShapeProperty
IsAlphaEnabled
IsAlphaEnabledProperty
IsAlphaSliderVisible
IsAlphaSliderVisibleProperty
IsAlphaTextInputVisible
IsAlphaTextInputVisibleProperty
IsColorChannelTextInputVisible
IsColorChannelTextInputVisibleProperty
IsColorPreviewVisible
IsColorPreviewVisibleProperty
IsColorSliderVisible
IsColorSliderVisibleProperty
IsColorSpectrumVisible
IsColorSpectrumVisibleProperty
IsHexInputVisible
IsHexInputVisibleProperty
IsMoreButtonVisible
IsMoreButtonVisibleProperty
MaxHue
MaxHueProperty
MaxSaturation
MaxSaturationProperty
MaxValue
MaxValueProperty
MinHue
MinHueProperty
MinSaturation
MinSaturationProperty
MinValue
MinValueProperty
PreviousColor
PreviousColorProperty
ColorPickerHsvChannel
ColorSpectrumComponents
ColorSpectrumShape
ColumnDefinition
ActualWidth
ColumnDefinition
MaxWidth
MaxWidthProperty
MinWidth
MinWidthProperty
Width
WidthProperty
ColumnDefinitionCollection
Append
Clear
First
GetAt
GetEnumerator
GetMany
GetView
IndexOf
Insert
InsertAt
Item
RemoveAt
RemoveAtEnd
ReplaceAll
SetAt
Size
ComboBox
ComboBox
Description
DescriptionProperty
DropDownClosed
DropDownOpened
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
IsDropDownOpen
IsDropDownOpenProperty
IsEditable
IsEditableProperty
IsSelectionBoxHighlighted
IsTextSearchEnabled
IsTextSearchEnabledProperty
LightDismissOverlayMode
LightDismissOverlayModeProperty
MaxDropDownHeight
MaxDropDownHeightProperty
OnDropDownClosed
OnDropDownOpened
PlaceholderForeground
PlaceholderForegroundProperty
PlaceholderText
PlaceholderTextProperty
SelectionBoxItem
SelectionBoxItemTemplate
SelectionChangedTrigger
SelectionChangedTriggerProperty
TemplateSettings
Text
TextBoxStyle
TextBoxStyleProperty
TextProperty
TextSubmitted
ComboBoxItem
ComboBoxItem
ComboBoxSelectionChangedTrigger
ComboBoxTextSubmittedEventArgs
Handled
Text
CommandBar
CommandBar
CommandBarOverflowPresenterStyle
CommandBarOverflowPresenterStyleProperty
CommandBarTemplateSettings
DefaultLabelPosition
DefaultLabelPositionProperty
DynamicOverflowItemsChanging
IsDynamicOverflowEnabled
IsDynamicOverflowEnabledProperty
OverflowButtonVisibility
OverflowButtonVisibilityProperty
PrimaryCommands
PrimaryCommandsProperty
SecondaryCommands
SecondaryCommandsProperty
CommandBarDefaultLabelPosition
CommandBarDynamicOverflowAction
CommandBarFlyout
CommandBarFlyout
PrimaryCommands
SecondaryCommands
CommandBarLabelPosition
CommandBarOverflowButtonVisibility
CommandBarOverflowPresenter
CommandBarOverflowPresenter
CommandBarOverflowPresenter
ContainerContentChangingEventArgs
ContainerContentChangingEventArgs
Handled
InRecycleQueue
Item
ItemContainer
ItemIndex
Phase
RegisterUpdateCallback
ContentControl
Content
ContentControl
ContentProperty
ContentTemplate
ContentTemplateProperty
ContentTemplateRoot
ContentTemplateSelector
ContentTemplateSelectorProperty
ContentTransitions
ContentTransitionsProperty
OnContentChanged
OnContentTemplateChanged
OnContentTemplateSelectorChanged
ContentDialog
CloseButtonClick
CloseButtonCommand
CloseButtonCommandParameter
CloseButtonCommandParameterProperty
CloseButtonCommandProperty
CloseButtonStyle
CloseButtonStyleProperty
CloseButtonText
CloseButtonTextProperty
Closed
Closing
ContentDialog
DefaultButton
DefaultButtonProperty
FullSizeDesired
FullSizeDesiredProperty
Hide
IsPrimaryButtonEnabled
IsPrimaryButtonEnabledProperty
IsSecondaryButtonEnabled
IsSecondaryButtonEnabledProperty
Opened
PrimaryButtonClick
PrimaryButtonCommand
PrimaryButtonCommandParameter
PrimaryButtonCommandParameterProperty
PrimaryButtonCommandProperty
PrimaryButtonStyle
PrimaryButtonStyleProperty
PrimaryButtonText
PrimaryButtonTextProperty
SecondaryButtonClick
SecondaryButtonCommand
SecondaryButtonCommandParameter
SecondaryButtonCommandParameterProperty
SecondaryButtonCommandProperty
SecondaryButtonStyle
SecondaryButtonStyleProperty
SecondaryButtonText
SecondaryButtonTextProperty
ShowAsync
Title
TitleProperty
TitleTemplate
TitleTemplateProperty
ContentDialogButton
ContentDialogButtonClickDeferral
Complete
ContentDialogButtonClickEventArgs
Cancel
GetDeferral
ContentDialogClosedEventArgs
Result
ContentDialogClosingDeferral
Complete
ContentDialogClosingEventArgs
Cancel
GetDeferral
Result
ContentDialogOpenedEventArgs
ContentDialogPlacement
ContentDialogResult
ContentLinkChangedEventArgs
ChangeKind
ContentLinkInfo
TextRange
ContentLinkChangeKind
ContentPresenter
Background
BackgroundProperty
BackgroundSizing
BackgroundSizingProperty
BackgroundTransition
BorderBrush
BorderBrushProperty
BorderThickness
BorderThicknessProperty
CharacterSpacing
CharacterSpacingProperty
Content
ContentPresenter
ContentProperty
ContentTemplate
ContentTemplateProperty
ContentTemplateSelector
ContentTemplateSelectorProperty
ContentTransitions
ContentTransitionsProperty
CornerRadius
CornerRadiusProperty
FontFamily
FontFamilyProperty
FontSize
FontSizeProperty
FontStretch
FontStretchProperty
FontStyle
FontStyleProperty
FontWeight
FontWeightProperty
Foreground
ForegroundProperty
HorizontalContentAlignment
HorizontalContentAlignmentProperty
IsTextScaleFactorEnabled
IsTextScaleFactorEnabledProperty
LineHeight
LineHeightProperty
LineStackingStrategy
LineStackingStrategyProperty
MaxLines
MaxLinesProperty
OnContentTemplateChanged
OnContentTemplateSelectorChanged
OpticalMarginAlignment
OpticalMarginAlignmentProperty
Padding
PaddingProperty
TextLineBounds
TextLineBoundsProperty
TextWrapping
TextWrappingProperty
VerticalContentAlignment
VerticalContentAlignmentProperty
ContextMenuEventArgs
CursorLeft
CursorTop
Handled
ContextMenuOpeningEventHandler
Control
ApplyTemplate
Background
BackgroundProperty
BackgroundSizing
BackgroundSizingProperty
BorderBrush
BorderBrushProperty
BorderThickness
BorderThicknessProperty
CharacterSpacing
CharacterSpacingProperty
Control
CornerRadius
CornerRadiusProperty
DefaultStyleKey
DefaultStyleKeyProperty
DefaultStyleResourceUri
DefaultStyleResourceUriProperty
ElementSoundMode
ElementSoundModeProperty
Focus
FocusDisengaged
FocusEngaged
FocusState
FocusStateProperty
FontFamily
FontFamilyProperty
FontSize
FontSizeProperty
FontStretch
FontStretchProperty
FontStyle
FontStyleProperty
FontWeight
FontWeightProperty
Foreground
ForegroundProperty
GetIsTemplateFocusTarget
GetIsTemplateKeyTipTarget
GetTemplateChild
HorizontalContentAlignment
HorizontalContentAlignmentProperty
IsEnabled
IsEnabledChanged
IsEnabledProperty
IsFocusEngaged
IsFocusEngagedProperty
IsFocusEngagementEnabled
IsFocusEngagementEnabledProperty
IsTabStop
IsTabStopProperty
IsTemplateFocusTargetProperty
IsTemplateKeyTipTargetProperty
IsTextScaleFactorEnabled
IsTextScaleFactorEnabledProperty
OnCharacterReceived
OnDoubleTapped
OnDragEnter
OnDragLeave
OnDragOver
OnDrop
OnGotFocus
OnHolding
OnKeyDown
OnKeyUp
OnLostFocus
OnManipulationCompleted
OnManipulationDelta
OnManipulationInertiaStarting
OnManipulationStarted
OnManipulationStarting
OnPointerCanceled
OnPointerCaptureLost
OnPointerEntered
OnPointerExited
OnPointerMoved
OnPointerPressed
OnPointerReleased
OnPointerWheelChanged
OnPreviewKeyDown
OnPreviewKeyUp
OnRightTapped
OnTapped
Padding
PaddingProperty
RemoveFocusEngagement
RequiresPointer
RequiresPointerProperty
SetIsTemplateFocusTarget
SetIsTemplateKeyTipTarget
TabIndex
TabIndexProperty
TabNavigation
TabNavigationProperty
Template
TemplateProperty
UseSystemFocusVisuals
UseSystemFocusVisualsProperty
VerticalContentAlignment
VerticalContentAlignmentProperty
XYFocusDown
XYFocusDownProperty
XYFocusLeft
XYFocusLeftProperty
XYFocusRight
XYFocusRightProperty
XYFocusUp
XYFocusUpProperty
ControlTemplate
ControlTemplate
TargetType
DataTemplateSelector
DataTemplateSelector
GetElement
RecycleElement
SelectTemplate
SelectTemplateCore
DatePickedEventArgs
DatePickedEventArgs
NewDate
OldDate
DatePicker
CalendarIdentifier
CalendarIdentifierProperty
Date
DateChanged
DatePicker
DateProperty
DayFormat
DayFormatProperty
DayVisible
DayVisibleProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
LightDismissOverlayMode
LightDismissOverlayModeProperty
MaxYear
MaxYearProperty
MinYear
MinYearProperty
MonthFormat
MonthFormatProperty
MonthVisible
MonthVisibleProperty
Orientation
OrientationProperty
SelectedDate
SelectedDateChanged
SelectedDateProperty
YearFormat
YearFormatProperty
YearVisible
YearVisibleProperty
DatePickerFlyout
CalendarIdentifier
CalendarIdentifierProperty
Date
DatePicked
DatePickerFlyout
DateProperty
DayFormat
DayFormatProperty
DayVisible
DayVisibleProperty
MaxYear
MaxYearProperty
MinYear
MinYearProperty
MonthFormat
MonthFormatProperty
MonthVisible
MonthVisibleProperty
ShowAtAsync
YearFormat
YearFormatProperty
YearVisible
YearVisibleProperty
DatePickerFlyoutItem
GetCustomProperty
GetIndexedProperty
GetStringRepresentation
PrimaryText
PrimaryTextProperty
SecondaryText
SecondaryTextProperty
Type
DatePickerFlyoutPresenter
DatePickerSelectedValueChangedEventArgs
NewDate
OldDate
DatePickerValueChangedEventArgs
NewDate
OldDate
DisabledFormattingAccelerators
DragItemsCompletedEventArgs
DropResult
Items
DragItemsStartingEventArgs
Cancel
Data
DragItemsStartingEventArgs
Items
DragItemsStartingEventHandler
DropDownButton
DropDownButton
DropDownButtonAutomationPeer
Collapse
DropDownButtonAutomationPeer
Expand
ExpandCollapseState
DynamicOverflowItemsChangingEventArgs
Action
DynamicOverflowItemsChangingEventArgs
FlipView
FlipView
UseTouchAnimationsForAllNavigation
UseTouchAnimationsForAllNavigationProperty
FlipViewItem
FlipViewItem
Flyout
Content
ContentProperty
Flyout
FlyoutPresenterStyle
FlyoutPresenterStyleProperty
FlyoutPresenter
FlyoutPresenter
FocusDisengagedEventArgs
FocusEngagedEventArgs
Handled
FontIcon
FontFamily
FontFamilyProperty
FontIcon
FontSize
FontSizeProperty
FontStyle
FontStyleProperty
FontWeight
FontWeightProperty
Glyph
GlyphProperty
IsTextScaleFactorEnabled
IsTextScaleFactorEnabledProperty
MirroredWhenRightToLeft
MirroredWhenRightToLeftProperty
FontIconSource
FontFamily
FontFamilyProperty
FontIconSource
FontSize
FontSizeProperty
FontStyle
FontStyleProperty
FontWeight
FontWeightProperty
Glyph
GlyphProperty
IsTextScaleFactorEnabled
IsTextScaleFactorEnabledProperty
MirroredWhenRightToLeft
MirroredWhenRightToLeftProperty
Frame
BackStack
BackStackDepth
BackStackDepthProperty
BackStackProperty
CacheSize
CacheSizeProperty
CanGoBack
CanGoBackProperty
CanGoForward
CanGoForwardProperty
CurrentSourcePageType
CurrentSourcePageTypeProperty
ForwardStack
ForwardStackProperty
Frame
GetNavigationState
GoBack
GoForward
IsNavigationStackEnabled
IsNavigationStackEnabledProperty
Navigate
Navigated
NavigateToType
Navigating
NavigationFailed
NavigationStopped
SetNavigationState
SourcePageType
SourcePageTypeProperty
Grid
BackgroundSizing
BackgroundSizingProperty
BorderBrush
BorderBrushProperty
BorderThickness
BorderThicknessProperty
ColumnDefinitions
ColumnProperty
ColumnSpacing
ColumnSpacingProperty
ColumnSpanProperty
CornerRadius
CornerRadiusProperty
GetColumn
GetColumnSpan
GetRow
GetRowSpan
Grid
Padding
PaddingProperty
RowDefinitions
RowProperty
RowSpacing
RowSpacingProperty
RowSpanProperty
SetColumn
SetColumnSpan
SetRow
SetRowSpan
GridView
GridView
GridViewHeaderItem
GridViewHeaderItem
GridViewItem
GridViewItem
TemplateSettings
GroupItem
GroupItem
GroupStyle
ContainerStyle
ContainerStyleSelector
GroupStyle
HeaderContainerStyle
HeaderTemplate
HeaderTemplateSelector
HidesIfEmpty
Panel
PropertyChanged
PropertyChanged
GroupStyleSelector
GroupStyleSelector
SelectGroupStyle
SelectGroupStyleCore
HandwritingPanelClosedEventArgs
HandwritingPanelOpenedEventArgs
HandwritingPanelPlacementAlignment
HandwritingView
AreCandidatesEnabled
AreCandidatesEnabledProperty
Closed
HandwritingView
IsOpen
IsOpenProperty
Opened
PlacementAlignment
PlacementAlignmentProperty
PlacementTarget
PlacementTargetProperty
TryClose
TryOpen
Hub
CompleteViewChange
CompleteViewChangeFrom
CompleteViewChangeTo
DefaultSectionIndex
DefaultSectionIndexProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
Hub
InitializeViewChange
IsActiveView
IsActiveViewProperty
IsZoomedInView
IsZoomedInViewProperty
MakeVisible
Orientation
OrientationProperty
ScrollToSection
SectionHeaderClick
SectionHeaders
Sections
SectionsInView
SectionsInViewChanged
SemanticZoomOwner
SemanticZoomOwnerProperty
StartViewChangeFrom
StartViewChangeTo
HubSection
ContentTemplate
ContentTemplateProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
HubSection
IsHeaderInteractive
IsHeaderInteractiveProperty
HubSectionCollection
Append
Clear
First
GetAt
GetEnumerator
GetMany
GetView
IndexOf
Insert
InsertAt
Item
RemoveAt
RemoveAtEnd
ReplaceAll
SetAt
Size
HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs
Section
HubSectionHeaderClickEventHandler
HyperlinkButton
HyperlinkButton
NavigateUri
NavigateUriProperty
ICommandBarElement
IsCompact
ICommandBarElement2
DynamicOverflowOrder
IsInOverflow
IconElement
Foreground
ForegroundProperty
IconSource
Foreground
ForegroundProperty
IconSourceElement
IconSource
IconSourceElement
IconSourceProperty
IInsertionPanel
GetInsertionIndexes
IItemContainerMapping
ContainerFromIndex
ContainerFromItem
IndexFromContainer
ItemFromContainer
Image
GetAlphaMask
GetAsCastingSource
Image
ImageFailed
ImageOpened
NineGrid
NineGridProperty
PlayToSource
PlayToSourceProperty
Source
SourceProperty
Stretch
StretchProperty
INavigate
Navigate
IncrementalLoadingTrigger
InkCanvas
InkCanvas
InkPresenter
InkToolbar
ActiveTool
ActiveToolChanged
ActiveToolProperty
ButtonFlyoutPlacement
ButtonFlyoutPlacementProperty
Children
ChildrenProperty
EraseAllClicked
GetMenuButton
GetToggleButton
GetToolButton
InitialControls
InitialControlsProperty
InkDrawingAttributes
InkDrawingAttributesChanged
InkDrawingAttributesProperty
InkToolbar
IsRulerButtonChecked
IsRulerButtonCheckedChanged
IsRulerButtonCheckedProperty
IsStencilButtonChecked
IsStencilButtonCheckedChanged
IsStencilButtonCheckedProperty
Orientation
OrientationProperty
TargetInkCanvas
TargetInkCanvasProperty
InkToolbarBallpointPenButton
InkToolbarBallpointPenButton
InkToolbarButtonFlyoutPlacement
InkToolbarCustomPen
CreateInkDrawingAttributes
CreateInkDrawingAttributesCore
InkToolbarCustomPen
InkToolbarCustomPenButton
ConfigurationContent
ConfigurationContentProperty
CustomPen
CustomPenProperty
InkToolbarCustomPenButton
InkToolbarCustomToggleButton
InkToolbarCustomToggleButton
InkToolbarCustomToolButton
ConfigurationContent
ConfigurationContentProperty
InkToolbarCustomToolButton
InkToolbarEraserButton
InkToolbarEraserButton
InkToolbarEraserButton
IsClearAllVisible
IsClearAllVisibleProperty
InkToolbarFlyoutItem
Checked
InkToolbarFlyoutItem
IsChecked
IsCheckedProperty
Kind
KindProperty
Unchecked
InkToolbarFlyoutItemKind
InkToolbarHighlighterButton
InkToolbarHighlighterButton
InkToolbarInitialControls
InkToolbarIsStencilButtonCheckedChangedEventArgs
InkToolbarIsStencilButtonCheckedChangedEventArgs
StencilButton
StencilKind
InkToolbarMenuButton
IsExtensionGlyphShown
IsExtensionGlyphShownProperty
MenuKind
InkToolbarMenuKind
InkToolbarPenButton
MaxStrokeWidth
MaxStrokeWidthProperty
MinStrokeWidth
MinStrokeWidthProperty
Palette
PaletteProperty
SelectedBrush
SelectedBrushIndex
SelectedBrushIndexProperty
SelectedBrushProperty
SelectedStrokeWidth
SelectedStrokeWidthProperty
InkToolbarPencilButton
InkToolbarPencilButton
InkToolbarPenConfigurationControl
InkToolbarPenConfigurationControl
PenButton
PenButtonProperty
InkToolbarRulerButton
InkToolbarRulerButton
Ruler
RulerProperty
InkToolbarStencilButton
InkToolbarStencilButton
IsProtractorItemVisible
IsProtractorItemVisibleProperty
IsRulerItemVisible
IsRulerItemVisibleProperty
Protractor
ProtractorProperty
Ruler
RulerProperty
SelectedStencil
SelectedStencilProperty
InkToolbarStencilKind
InkToolbarToggle
InkToolbarToggleButton
ToggleKind
InkToolbarTool
InkToolbarToolButton
IsExtensionGlyphShown
IsExtensionGlyphShown
IsExtensionGlyphShownProperty
ToolKind
IScrollAnchorProvider
CurrentAnchor
RegisterAnchorCandidate
UnregisterAnchorCandidate
ISemanticZoomInformation
CompleteViewChange
CompleteViewChangeFrom
CompleteViewChangeTo
InitializeViewChange
IsActiveView
IsZoomedInView
MakeVisible
SemanticZoomOwner
StartViewChangeFrom
StartViewChangeTo
IsTextTrimmedChangedEventArgs
ItemClickEventArgs
ClickedItem
ItemClickEventArgs
ItemClickEventHandler
ItemCollection
Append
Clear
First
GetAt
GetEnumerator
GetMany
GetView
IndexOf
Insert
InsertAt
Item
RemoveAt
RemoveAtEnd
ReplaceAll
SetAt
Size
VectorChanged
ItemContainerGenerator
ContainerFromIndex
ContainerFromItem
GenerateNext
GeneratorPositionFromIndex
GetItemContainerGeneratorForPanel
IndexFromContainer
IndexFromGeneratorPosition
ItemFromContainer
ItemsChanged
PrepareItemContainer
Recycle
Remove
RemoveAll
StartAt
Stop
ItemsControl
ClearContainerForItemOverride
ContainerFromIndex
ContainerFromItem
DisplayMemberPath
DisplayMemberPathProperty
GetContainerForItemOverride
GetItemsOwner
GroupHeaderContainerFromItemContainer
GroupStyle
GroupStyleSelector
GroupStyleSelectorProperty
IndexFromContainer
IsGrouping
IsGroupingProperty
IsItemItsOwnContainerOverride
ItemContainerGenerator
ItemContainerStyle
ItemContainerStyleProperty
ItemContainerStyleSelector
ItemContainerStyleSelectorProperty
ItemContainerTransitions
ItemContainerTransitionsProperty
ItemFromContainer
Items
ItemsControl
ItemsControlFromItemContainer
ItemsPanel
ItemsPanelProperty
ItemsPanelRoot
ItemsSource
ItemsSourceProperty
ItemTemplate
ItemTemplateProperty
ItemTemplateSelector
ItemTemplateSelectorProperty
OnGroupStyleSelectorChanged
OnItemContainerStyleChanged
OnItemContainerStyleSelectorChanged
OnItemsChanged
OnItemTemplateChanged
OnItemTemplateSelectorChanged
PrepareContainerForItemOverride
ItemsPanelTemplate
ItemsPanelTemplate
ItemsPickedEventArgs
AddedItems
ItemsPickedEventArgs
RemovedItems
ItemsPresenter
AreHorizontalSnapPointsRegular
AreVerticalSnapPointsRegular
Footer
FooterProperty
FooterTemplate
FooterTemplateProperty
FooterTransitions
FooterTransitionsProperty
GetIrregularSnapPoints
GetRegularSnapPoints
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
HeaderTransitions
HeaderTransitionsProperty
HorizontalSnapPointsChanged
ItemsPresenter
Padding
PaddingProperty
VerticalSnapPointsChanged
ItemsStackPanel
AreStickyGroupHeadersEnabled
AreStickyGroupHeadersEnabled
AreStickyGroupHeadersEnabledProperty
CacheLength
CacheLengthProperty
FirstCacheIndex
FirstVisibleIndex
GroupHeaderPlacement
GroupHeaderPlacementProperty
GroupPadding
GroupPaddingProperty
ItemsStackPanel
ItemsUpdatingScrollMode
LastCacheIndex
LastVisibleIndex
Orientation
OrientationProperty
ScrollingDirection
ItemsUpdatingScrollMode
ItemsWrapGrid
AreStickyGroupHeadersEnabled
AreStickyGroupHeadersEnabledProperty
CacheLength
CacheLengthProperty
FirstCacheIndex
FirstVisibleIndex
GroupHeaderPlacement
GroupHeaderPlacementProperty
GroupPadding
GroupPaddingProperty
ItemHeight
ItemHeightProperty
ItemsWrapGrid
ItemWidth
ItemWidthProperty
LastCacheIndex
LastVisibleIndex
MaximumRowsOrColumns
MaximumRowsOrColumnsProperty
Orientation
OrientationProperty
ScrollingDirection
LightDismissOverlayMode
ListBox
ListBox
ScrollIntoView
SelectAll
SelectedItems
SelectionMode
SelectionModeProperty
SingleSelectionFollowsFocus
SingleSelectionFollowsFocusProperty
ListBoxItem
ListBoxItem
ListPickerFlyout
DisplayMemberPath
DisplayMemberPathProperty
ItemsPicked
ItemsSource
ItemsSourceProperty
ItemTemplate
ItemTemplateProperty
ListPickerFlyout
SelectedIndex
SelectedIndexProperty
SelectedItem
SelectedItemProperty
SelectedItems
SelectedValue
SelectedValuePath
SelectedValuePathProperty
SelectedValueProperty
SelectionMode
SelectionModeProperty
ShowAtAsync
ListPickerFlyoutPresenter
ListPickerFlyoutSelectionMode
ListView
ListView
ListViewBase
CanDragItems
CanDragItemsProperty
CanReorderItems
CanReorderItemsProperty
ChoosingGroupHeaderContainer
ChoosingItemContainer
CompleteViewChange
CompleteViewChangeFrom
CompleteViewChangeTo
ContainerContentChanging
DataFetchSize
DataFetchSizeProperty
DeselectRange
DragItemsCompleted
DragItemsStarting
Footer
FooterProperty
FooterTemplate
FooterTemplateProperty
FooterTransitions
FooterTransitionsProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
HeaderTransitions
HeaderTransitionsProperty
IncrementalLoadingThreshold
IncrementalLoadingThresholdProperty
IncrementalLoadingTrigger
IncrementalLoadingTriggerProperty
InitializeViewChange
IsActiveView
IsActiveViewProperty
IsDragSource
IsItemClickEnabled
IsItemClickEnabledProperty
IsMultiSelectCheckBoxEnabled
IsMultiSelectCheckBoxEnabledProperty
IsSwipeEnabled
IsSwipeEnabledProperty
IsZoomedInView
IsZoomedInViewProperty
ItemClick
ListViewBase
LoadMoreItemsAsync
MakeVisible
PrepareConnectedAnimation
ReorderMode
ReorderModeProperty
ScrollIntoView
SelectAll
SelectedItems
SelectedRanges
SelectionMode
SelectionModeProperty
SelectRange
SemanticZoomOwner
SemanticZoomOwnerProperty
SetDesiredContainerUpdateDuration
ShowsScrollingPlaceholders
ShowsScrollingPlaceholdersProperty
SingleSelectionFollowsFocus
SingleSelectionFollowsFocusProperty
StartViewChangeFrom
StartViewChangeTo
TryStartConnectedAnimationAsync
ListViewBaseHeaderItem
ListViewHeaderItem
ListViewHeaderItem
ListViewItem
ListViewItem
TemplateSettings
ListViewItemToKeyHandler
ListViewKeyToItemHandler
ListViewPersistenceHelper
GetRelativeScrollPosition
SetRelativeScrollPositionAsync
ListViewReorderMode
ListViewSelectionMode
MediaElement
ActualStereo3DVideoPackingMode
ActualStereo3DVideoPackingModeProperty
AddAudioEffect
AddVideoEffect
AreTransportControlsEnabled
AreTransportControlsEnabledProperty
AspectRatioHeight
AspectRatioHeightProperty
AspectRatioWidth
AspectRatioWidthProperty
AudioCategory
AudioCategoryProperty
AudioDeviceType
AudioDeviceTypeProperty
AudioStreamCount
AudioStreamCountProperty
AudioStreamIndex
AudioStreamIndexProperty
AutoPlay
AutoPlayProperty
Balance
BalanceProperty
BufferingProgress
BufferingProgressChanged
BufferingProgressProperty
CanPause
CanPauseProperty
CanPlayType
CanSeek
CanSeekProperty
CurrentState
CurrentStateChanged
CurrentStateProperty
DefaultPlaybackRate
DefaultPlaybackRateProperty
DownloadProgress
DownloadProgressChanged
DownloadProgressOffset
DownloadProgressOffsetProperty
DownloadProgressProperty
GetAsCastingSource
GetAudioStreamLanguage
IsAudioOnly
IsAudioOnlyProperty
IsFullWindow
IsFullWindowProperty
IsLooping
IsLoopingProperty
IsMuted
IsMutedProperty
IsStereo3DVideo
IsStereo3DVideoProperty
MarkerReached
Markers
MediaElement
MediaEnded
MediaFailed
MediaOpened
NaturalDuration
NaturalDurationProperty
NaturalVideoHeight
NaturalVideoHeightProperty
NaturalVideoWidth
NaturalVideoWidthProperty
PartialMediaFailureDetected
Pause
Play
PlaybackRate
PlaybackRateProperty
PlayToPreferredSourceUri
PlayToPreferredSourceUriProperty
PlayToSource
PlayToSourceProperty
Position
PositionProperty
PosterSource
PosterSourceProperty
ProtectionManager
ProtectionManagerProperty
RateChanged
RealTimePlayback
RealTimePlaybackProperty
RemoveAllEffects
SeekCompleted
SetMediaStreamSource
SetPlaybackSource
SetSource
Source
SourceProperty
Stereo3DVideoPackingMode
Stereo3DVideoPackingModeProperty
Stereo3DVideoRenderMode
Stereo3DVideoRenderModeProperty
Stop
Stretch
StretchProperty
TransportControls
Volume
VolumeChanged
VolumeProperty
MediaPlayerElement
AreTransportControlsEnabled
AreTransportControlsEnabledProperty
AutoPlay
AutoPlayProperty
IsFullWindow
IsFullWindowProperty
MediaPlayer
MediaPlayerElement
MediaPlayerProperty
PosterSource
PosterSourceProperty
SetMediaPlayer
Source
SourceProperty
Stretch
StretchProperty
TransportControls
MediaPlayerPresenter
IsFullWindow
IsFullWindowProperty
MediaPlayer
MediaPlayerPresenter
MediaPlayerProperty
Stretch
StretchProperty
MediaTransportControls
FastPlayFallbackBehaviour
FastPlayFallbackBehaviourProperty
Hide
IsCompact
IsCompactOverlayButtonVisible
IsCompactOverlayButtonVisibleProperty
IsCompactOverlayEnabled
IsCompactOverlayEnabledProperty
IsCompactProperty
IsFastForwardButtonVisible
IsFastForwardButtonVisibleProperty
IsFastForwardEnabled
IsFastForwardEnabledProperty
IsFastRewindButtonVisible
IsFastRewindButtonVisibleProperty
IsFastRewindEnabled
IsFastRewindEnabledProperty
IsFullWindowButtonVisible
IsFullWindowButtonVisibleProperty
IsFullWindowEnabled
IsFullWindowEnabledProperty
IsNextTrackButtonVisible
IsNextTrackButtonVisibleProperty
IsPlaybackRateButtonVisible
IsPlaybackRateButtonVisibleProperty
IsPlaybackRateEnabled
IsPlaybackRateEnabledProperty
IsPreviousTrackButtonVisible
IsPreviousTrackButtonVisibleProperty
IsRepeatButtonVisible
IsRepeatButtonVisibleProperty
IsRepeatEnabled
IsRepeatEnabledProperty
IsSeekBarVisible
IsSeekBarVisibleProperty
IsSeekEnabled
IsSeekEnabledProperty
IsSkipBackwardButtonVisible
IsSkipBackwardButtonVisibleProperty
IsSkipBackwardEnabled
IsSkipBackwardEnabledProperty
IsSkipForwardButtonVisible
IsSkipForwardButtonVisibleProperty
IsSkipForwardEnabled
IsSkipForwardEnabledProperty
IsStopButtonVisible
IsStopButtonVisibleProperty
IsStopEnabled
IsStopEnabledProperty
IsVolumeButtonVisible
IsVolumeButtonVisibleProperty
IsVolumeEnabled
IsVolumeEnabledProperty
IsZoomButtonVisible
IsZoomButtonVisibleProperty
IsZoomEnabled
IsZoomEnabledProperty
MediaTransportControls
Show
ShowAndHideAutomatically
ShowAndHideAutomaticallyProperty
ThumbnailRequested
MediaTransportControlsHelper
DropoutOrderProperty
GetDropoutOrder
SetDropoutOrder
MenuBar
Items
ItemsProperty
MenuBar
MenuBarItem
Items
ItemsProperty
MenuBarItem
Title
TitleProperty
MenuBarItemFlyout
MenuBarItemFlyout
MenuFlyout
Items
MenuFlyout
MenuFlyoutPresenterStyle
MenuFlyoutPresenterStyleProperty
ShowAt
MenuFlyoutItem
Click
Command
CommandParameter
CommandParameterProperty
CommandProperty
Icon
IconProperty
KeyboardAcceleratorTextOverride
KeyboardAcceleratorTextOverrideProperty
MenuFlyoutItem
TemplateSettings
Text
TextProperty
MenuFlyoutItemBase
MenuFlyoutPresenter
MenuFlyoutPresenter
TemplateSettings
MenuFlyoutSeparator
MenuFlyoutSeparator
MenuFlyoutSubItem
Icon
IconProperty
Items
MenuFlyoutSubItem
Text
TextProperty
NavigationView
AlwaysShowHeader
AlwaysShowHeaderProperty
AutoSuggestBox
AutoSuggestBoxProperty
BackRequested
CompactModeThresholdWidth
CompactModeThresholdWidthProperty
CompactPaneLength
CompactPaneLengthProperty
ContainerFromMenuItem
ContentOverlay
ContentOverlayProperty
DisplayMode
DisplayModeChanged
DisplayModeProperty
ExpandedModeThresholdWidth
ExpandedModeThresholdWidthProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
IsBackButtonVisible
IsBackButtonVisibleProperty
IsBackEnabled
IsBackEnabledProperty
IsPaneOpen
IsPaneOpenProperty
IsPaneToggleButtonVisible
IsPaneToggleButtonVisibleProperty
IsPaneVisible
IsPaneVisibleProperty
IsSettingsVisible
IsSettingsVisibleProperty
ItemInvoked
MenuItemContainerStyle
MenuItemContainerStyleProperty
MenuItemContainerStyleSelector
MenuItemContainerStyleSelectorProperty
MenuItemFromContainer
MenuItems
MenuItemsProperty
MenuItemsSource
MenuItemsSourceProperty
MenuItemTemplate
MenuItemTemplateProperty
MenuItemTemplateSelector
MenuItemTemplateSelectorProperty
NavigationView
OpenPaneLength
OpenPaneLengthProperty
OverflowLabelMode
OverflowLabelModeProperty
PaneClosed
PaneClosing
PaneCustomContent
PaneCustomContentProperty
PaneDisplayMode
PaneDisplayModeProperty
PaneFooter
PaneFooterProperty
PaneHeader
PaneHeaderProperty
PaneOpened
PaneOpening
PaneTitle
PaneTitleProperty
PaneToggleButtonStyle
PaneToggleButtonStyleProperty
SelectedItem
SelectedItemProperty
SelectionChanged
SelectionFollowsFocus
SelectionFollowsFocusProperty
SettingsItem
SettingsItemProperty
ShoulderNavigationEnabled
ShoulderNavigationEnabledProperty
TemplateSettings
TemplateSettingsProperty
NavigationViewBackButtonVisible
NavigationViewBackRequestedEventArgs
NavigationViewDisplayMode
NavigationViewDisplayModeChangedEventArgs
DisplayMode
NavigationViewItem
CompactPaneLength
CompactPaneLengthProperty
Icon
IconProperty
NavigationViewItem
SelectsOnInvoked
SelectsOnInvokedProperty
NavigationViewItemBase
NavigationViewItemHeader
NavigationViewItemHeader
NavigationViewItemInvokedEventArgs
InvokedItem
InvokedItemContainer
IsSettingsInvoked
NavigationViewItemInvokedEventArgs
RecommendedNavigationTransitionInfo
NavigationViewItemSeparator
NavigationViewItemSeparator
NavigationViewList
NavigationViewList
NavigationViewOverflowLabelMode
NavigationViewPaneClosingEventArgs
Cancel
NavigationViewPaneDisplayMode
NavigationViewSelectionChangedEventArgs
IsSettingsSelected
RecommendedNavigationTransitionInfo
SelectedItem
SelectedItemContainer
NavigationViewSelectionFollowsFocus
NavigationViewShoulderNavigationEnabled
NavigationViewTemplateSettings
BackButtonVisibility
BackButtonVisibilityProperty
LeftPaneVisibility
LeftPaneVisibilityProperty
NavigationViewTemplateSettings
OverflowButtonVisibility
OverflowButtonVisibilityProperty
PaneToggleButtonVisibility
PaneToggleButtonVisibilityProperty
SingleSelectionFollowsFocus
SingleSelectionFollowsFocusProperty
TopPadding
TopPaddingProperty
TopPaneVisibility
TopPaneVisibilityProperty
NotifyEventArgs
CallingUri
Value
NotifyEventHandler
Orientation
Page
BottomAppBar
BottomAppBarProperty
Frame
FrameProperty
NavigationCacheMode
OnNavigatedFrom
OnNavigatedTo
OnNavigatingFrom
Page
TopAppBar
TopAppBarProperty
Panel
Background
BackgroundProperty
BackgroundTransition
Children
ChildrenTransitions
ChildrenTransitionsProperty
IsItemsHost
IsItemsHostProperty
Panel
PanelScrollingDirection
ParallaxSourceOffsetKind
ParallaxView
Child
ChildProperty
HorizontalShift
HorizontalShiftProperty
HorizontalSourceEndOffset
HorizontalSourceEndOffsetProperty
HorizontalSourceOffsetKind
HorizontalSourceOffsetKindProperty
HorizontalSourceStartOffset
HorizontalSourceStartOffsetProperty
IsHorizontalShiftClamped
IsHorizontalShiftClampedProperty
IsVerticalShiftClamped
IsVerticalShiftClampedProperty
MaxHorizontalShiftRatio
MaxHorizontalShiftRatioProperty
MaxVerticalShiftRatio
MaxVerticalShiftRatioProperty
ParallaxView
RefreshAutomaticHorizontalOffsets
RefreshAutomaticVerticalOffsets
Source
SourceProperty
VerticalShift
VerticalShiftProperty
VerticalSourceEndOffset
VerticalSourceEndOffsetProperty
VerticalSourceOffsetKind
VerticalSourceOffsetKindProperty
VerticalSourceStartOffset
VerticalSourceStartOffsetProperty
PasswordBox
CanPasteClipboardContent
CanPasteClipboardContentProperty
ContextMenuOpening
Description
DescriptionProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
InputScope
InputScopeProperty
IsPasswordRevealButtonEnabled
IsPasswordRevealButtonEnabledProperty
MaxLength
MaxLengthProperty
Password
PasswordBox
PasswordChanged
PasswordChanging
PasswordChar
PasswordCharProperty
PasswordProperty
PasswordRevealMode
PasswordRevealModeProperty
Paste
PasteFromClipboard
PlaceholderText
PlaceholderTextProperty
PreventKeyboardDisplayOnProgrammaticFocus
PreventKeyboardDisplayOnProgrammaticFocusProperty
SelectAll
SelectionFlyout
SelectionFlyoutProperty
SelectionHighlightColor
SelectionHighlightColorProperty
TextReadingOrder
TextReadingOrderProperty
PasswordBoxPasswordChangingEventArgs
IsContentChanging
PasswordRevealMode
PathIcon
Data
DataProperty
PathIcon
PathIconSource
Data
DataProperty
PathIconSource
PersonPicture
BadgeGlyph
BadgeGlyphProperty
BadgeImageSource
BadgeImageSourceProperty
BadgeNumber
BadgeNumberProperty
BadgeText
BadgeTextProperty
Contact
ContactProperty
DisplayName
DisplayNameProperty
Initials
InitialsProperty
IsGroup
IsGroupProperty
PersonPicture
PreferSmallImage
PreferSmallImageProperty
ProfilePicture
ProfilePictureProperty
PickerConfirmedEventArgs
PickerConfirmedEventArgs
PickerFlyout
ConfirmationButtonsVisible
ConfirmationButtonsVisibleProperty
Confirmed
Content
ContentProperty
PickerFlyout
ShowAtAsync
PickerFlyoutPresenter
Pivot
GetSlideInAnimationGroup
HeaderFocusVisualPlacement
HeaderFocusVisualPlacementProperty
HeaderTemplate
HeaderTemplateProperty
IsHeaderItemsCarouselEnabled
IsHeaderItemsCarouselEnabledProperty
IsLocked
IsLockedProperty
LeftHeader
LeftHeaderProperty
LeftHeaderTemplate
LeftHeaderTemplateProperty
Pivot
PivotItemLoaded
PivotItemLoading
PivotItemUnloaded
PivotItemUnloading
RightHeader
RightHeaderProperty
RightHeaderTemplate
RightHeaderTemplateProperty
SelectedIndex
SelectedIndexProperty
SelectedItem
SelectedItemProperty
SelectionChanged
SetSlideInAnimationGroup
SlideInAnimationGroupProperty
Title
TitleProperty
TitleTemplate
TitleTemplateProperty
PivotHeaderFocusVisualPlacement
PivotItem
Header
HeaderProperty
PivotItem
PivotItemEventArgs
Item
PivotItemEventArgs
PivotSlideInAnimationGroup
ProgressBar
IsIndeterminate
IsIndeterminateProperty
ProgressBar
ShowError
ShowErrorProperty
ShowPaused
ShowPausedProperty
TemplateSettings
ProgressRing
IsActive
IsActiveProperty
ProgressRing
TemplateSettings
RadioButton
GroupName
GroupNameProperty
RadioButton
RatingControl
Caption
CaptionProperty
InitialSetValue
InitialSetValueProperty
IsClearEnabled
IsClearEnabledProperty
IsReadOnly
IsReadOnlyProperty
ItemInfo
ItemInfoProperty
MaxRating
MaxRatingProperty
PlaceholderValue
PlaceholderValueProperty
RatingControl
Value
ValueChanged
ValueProperty
RatingItemFontInfo
DisabledGlyph
DisabledGlyphProperty
Glyph
GlyphProperty
PlaceholderGlyph
PlaceholderGlyphProperty
PointerOverGlyph
PointerOverGlyphProperty
PointerOverPlaceholderGlyph
PointerOverPlaceholderGlyphProperty
RatingItemFontInfo
UnsetGlyph
UnsetGlyphProperty
RatingItemImageInfo
DisabledImage
DisabledImage
DisabledImageProperty
Image
ImageProperty
PlaceholderImage
PlaceholderImageProperty
PointerOverImage
PointerOverImageProperty
PointerOverPlaceholderImage
PointerOverPlaceholderImageProperty
RatingItemImageInfo
UnsetImage
UnsetImageProperty
RatingItemInfo
RatingItemInfo
RefreshContainer
PullDirection
PullDirectionProperty
RefreshContainer
RefreshRequested
RequestRefresh
Visualizer
VisualizerProperty
RefreshInteractionRatioChangedEventArgs
InteractionRatio
RefreshPullDirection
RefreshRequestedEventArgs
GetDeferral
RefreshStateChangedEventArgs
NewState
OldState
RefreshVisualizer
Content
ContentProperty
InfoProviderProperty
Orientation
OrientationProperty
RefreshRequested
RefreshStateChanged
RefreshVisualizer
RequestRefresh
State
StateProperty
RefreshVisualizerOrientation
RefreshVisualizerState
RelativePanel
AboveProperty
AlignBottomWithPanelProperty
AlignBottomWithProperty
AlignHorizontalCenterWithPanelProperty
AlignHorizontalCenterWithProperty
AlignLeftWithPanelProperty
AlignLeftWithProperty
AlignRightWithPanelProperty
AlignRightWithProperty
AlignTopWithPanelProperty
AlignTopWithProperty
AlignVerticalCenterWithPanelProperty
AlignVerticalCenterWithProperty
BackgroundSizing
BackgroundSizingProperty
BelowProperty
BorderBrush
BorderBrushProperty
BorderThickness
BorderThicknessProperty
CornerRadius
CornerRadiusProperty
GetAbove
GetAlignBottomWith
GetAlignBottomWithPanel
GetAlignHorizontalCenterWith
GetAlignHorizontalCenterWithPanel
GetAlignLeftWith
GetAlignLeftWithPanel
GetAlignRightWith
GetAlignRightWithPanel
GetAlignTopWith
GetAlignTopWithPanel
GetAlignVerticalCenterWith
GetAlignVerticalCenterWithPanel
GetBelow
GetLeftOf
GetRightOf
LeftOfProperty
Padding
PaddingProperty
RelativePanel
RightOfProperty
SetAbove
SetAlignBottomWith
SetAlignBottomWithPanel
SetAlignHorizontalCenterWith
SetAlignHorizontalCenterWithPanel
SetAlignLeftWith
SetAlignLeftWithPanel
SetAlignRightWith
SetAlignRightWithPanel
SetAlignTopWith
SetAlignTopWithPanel
SetAlignVerticalCenterWith
SetAlignVerticalCenterWithPanel
SetBelow
SetLeftOf
SetRightOf
RequiresPointer
RichEditBox
AcceptsReturn
AcceptsReturnProperty
CandidateWindowBoundsChanged
CharacterCasing
CharacterCasingProperty
ClipboardCopyFormat
ClipboardCopyFormatProperty
ContentLinkBackgroundColor
ContentLinkBackgroundColorProperty
ContentLinkChanged
ContentLinkForegroundColor
ContentLinkForegroundColorProperty
ContentLinkInvoked
ContentLinkProviders
ContentLinkProvidersProperty
ContextMenuOpening
CopyingToClipboard
CuttingToClipboard
Description
DescriptionProperty
DesiredCandidateWindowAlignment
DesiredCandidateWindowAlignmentProperty
DisabledFormattingAccelerators
DisabledFormattingAcceleratorsProperty
Document
GetLinguisticAlternativesAsync
HandwritingView
HandwritingViewProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
HorizontalTextAlignment
HorizontalTextAlignmentProperty
InputScope
InputScopeProperty
IsColorFontEnabled
IsColorFontEnabledProperty
IsHandwritingViewEnabled
IsHandwritingViewEnabledProperty
IsReadOnly
IsReadOnlyProperty
IsSpellCheckEnabled
IsSpellCheckEnabledProperty
IsTextPredictionEnabled
IsTextPredictionEnabledProperty
MaxLength
MaxLengthProperty
Paste
PlaceholderText
PlaceholderTextProperty
PreventKeyboardDisplayOnProgrammaticFocus
PreventKeyboardDisplayOnProgrammaticFocusProperty
ProofingMenuFlyout
ProofingMenuFlyoutProperty
RichEditBox
SelectionChanged
SelectionChanging
SelectionFlyout
SelectionFlyoutProperty
SelectionHighlightColor
SelectionHighlightColorProperty
SelectionHighlightColorWhenNotFocused
SelectionHighlightColorWhenNotFocusedProperty
TextAlignment
TextAlignmentProperty
TextChanged
TextChanging
TextCompositionChanged
TextCompositionEnded
TextCompositionStarted
TextDocument
TextReadingOrder
TextReadingOrderProperty
TextWrapping
TextWrappingProperty
RichEditBoxSelectionChangingEventArgs
Cancel
SelectionLength
SelectionStart
RichEditBoxTextChangingEventArgs
IsContentChanging
RichEditClipboardFormat
RichTextBlock
BaselineOffset
Blocks
CharacterSpacing
CharacterSpacingProperty
ContentEnd
ContentStart
ContextMenuOpening
CopySelectionToClipboard
Focus
FontFamily
FontFamilyProperty
FontSize
FontSizeProperty
FontStretch
FontStretchProperty
FontStyle
FontStyleProperty
FontWeight
FontWeightProperty
Foreground
ForegroundProperty
GetPositionFromPoint
HasOverflowContent
HasOverflowContentProperty
HorizontalTextAlignment
HorizontalTextAlignmentProperty
IsColorFontEnabled
IsColorFontEnabledProperty
IsTextScaleFactorEnabled
IsTextScaleFactorEnabledProperty
IsTextSelectionEnabled
IsTextSelectionEnabledProperty
IsTextTrimmed
IsTextTrimmedChanged
IsTextTrimmedProperty
LineHeight
LineHeightProperty
LineStackingStrategy
LineStackingStrategyProperty
MaxLines
MaxLinesProperty
OpticalMarginAlignment
OpticalMarginAlignmentProperty
OverflowContentTarget
OverflowContentTargetProperty
Padding
PaddingProperty
RichTextBlock
Select
SelectAll
SelectedText
SelectedTextProperty
SelectionChanged
SelectionEnd
SelectionFlyout
SelectionFlyoutProperty
SelectionHighlightColor
SelectionHighlightColorProperty
SelectionStart
TextAlignment
TextAlignmentProperty
TextDecorations
TextDecorationsProperty
TextHighlighters
TextIndent
TextIndentProperty
TextLineBounds
TextLineBoundsProperty
TextReadingOrder
TextReadingOrderProperty
TextTrimming
TextTrimmingProperty
TextWrapping
TextWrappingProperty
RichTextBlockOverflow
BaselineOffset
ContentEnd
ContentSource
ContentStart
Focus
GetPositionFromPoint
HasOverflowContent
HasOverflowContentProperty
IsTextTrimmed
IsTextTrimmedChanged
IsTextTrimmedProperty
MaxLines
MaxLinesProperty
OverflowContentTarget
OverflowContentTargetProperty
Padding
PaddingProperty
RichTextBlockOverflow
RowDefinition
ActualHeight
Height
HeightProperty
MaxHeight
MaxHeightProperty
MinHeight
MinHeightProperty
RowDefinition
RowDefinitionCollection
Append
Clear
First
GetAt
GetEnumerator
GetMany
GetView
IndexOf
Insert
InsertAt
Item
RemoveAt
RemoveAtEnd
ReplaceAll
SetAt
Size
ScrollBarVisibility
ScrollContentPresenter
CanContentRenderOutsideBounds
CanContentRenderOutsideBoundsProperty
CanHorizontallyScroll
CanVerticallyScroll
ExtentHeight
ExtentWidth
HorizontalOffset
LineDown
LineLeft
LineRight
LineUp
MakeVisible
MouseWheelDown
MouseWheelLeft
MouseWheelRight
MouseWheelUp
PageDown
PageLeft
PageRight
PageUp
ScrollContentPresenter
ScrollOwner
SetHorizontalOffset
SetVerticalOffset
SizesContentToTemplatedParent
SizesContentToTemplatedParentProperty
VerticalOffset
ViewportHeight
ViewportWidth
ScrollIntoViewAlignment
ScrollMode
ScrollViewer
AnchorRequested
BringIntoViewOnFocusChange
BringIntoViewOnFocusChangeProperty
CanContentRenderOutsideBounds
CanContentRenderOutsideBoundsProperty
ChangeView
ComputedHorizontalScrollBarVisibility
ComputedHorizontalScrollBarVisibilityProperty
ComputedVerticalScrollBarVisibility
ComputedVerticalScrollBarVisibilityProperty
CurrentAnchor
DirectManipulationCompleted
DirectManipulationStarted
ExtentHeight
ExtentHeightProperty
ExtentWidth
ExtentWidthProperty
GetBringIntoViewOnFocusChange
GetCanContentRenderOutsideBounds
GetHorizontalScrollBarVisibility
GetHorizontalScrollMode
GetIsDeferredScrollingEnabled
GetIsHorizontalRailEnabled
GetIsHorizontalScrollChainingEnabled
GetIsScrollInertiaEnabled
GetIsVerticalRailEnabled
GetIsVerticalScrollChainingEnabled
GetIsZoomChainingEnabled
GetIsZoomInertiaEnabled
GetVerticalScrollBarVisibility
GetVerticalScrollMode
GetZoomMode
HorizontalAnchorRatio
HorizontalAnchorRatioProperty
HorizontalOffset
HorizontalOffsetProperty
HorizontalScrollBarVisibility
HorizontalScrollBarVisibilityProperty
HorizontalScrollMode
HorizontalScrollModeProperty
HorizontalSnapPointsAlignment
HorizontalSnapPointsAlignmentProperty
HorizontalSnapPointsType
HorizontalSnapPointsTypeProperty
InvalidateScrollInfo
IsDeferredScrollingEnabled
IsDeferredScrollingEnabledProperty
IsHorizontalRailEnabled
IsHorizontalRailEnabledProperty
IsHorizontalScrollChainingEnabled
IsHorizontalScrollChainingEnabledProperty
IsScrollInertiaEnabled
IsScrollInertiaEnabledProperty
IsVerticalRailEnabled
IsVerticalRailEnabledProperty
IsVerticalScrollChainingEnabled
IsVerticalScrollChainingEnabledProperty
IsZoomChainingEnabled
IsZoomChainingEnabledProperty
IsZoomInertiaEnabled
IsZoomInertiaEnabledProperty
LeftHeader
LeftHeaderProperty
MaxZoomFactor
MaxZoomFactorProperty
MinZoomFactor
MinZoomFactorProperty
ReduceViewportForCoreInputViewOcclusions
ReduceViewportForCoreInputViewOcclusionsProperty
RegisterAnchorCandidate
ScrollableHeight
ScrollableHeightProperty
ScrollableWidth
ScrollableWidthProperty
ScrollToHorizontalOffset
ScrollToVerticalOffset
ScrollViewer
SetBringIntoViewOnFocusChange
SetCanContentRenderOutsideBounds
SetHorizontalScrollBarVisibility
SetHorizontalScrollMode
SetIsDeferredScrollingEnabled
SetIsHorizontalRailEnabled
SetIsHorizontalScrollChainingEnabled
SetIsScrollInertiaEnabled
SetIsVerticalRailEnabled
SetIsVerticalScrollChainingEnabled
SetIsZoomChainingEnabled
SetIsZoomInertiaEnabled
SetVerticalScrollBarVisibility
SetVerticalScrollMode
SetZoomMode
TopHeader
TopHeaderProperty
TopLeftHeader
TopLeftHeaderProperty
UnregisterAnchorCandidate
VerticalAnchorRatio
VerticalAnchorRatioProperty
VerticalOffset
VerticalOffsetProperty
VerticalScrollBarVisibility
VerticalScrollBarVisibilityProperty
VerticalScrollMode
VerticalScrollModeProperty
VerticalSnapPointsAlignment
VerticalSnapPointsAlignmentProperty
VerticalSnapPointsType
VerticalSnapPointsTypeProperty
ViewChanged
ViewChanging
ViewportHeight
ViewportHeightProperty
ViewportWidth
ViewportWidthProperty
ZoomFactor
ZoomFactorProperty
ZoomMode
ZoomModeProperty
ZoomSnapPoints
ZoomSnapPointsProperty
ZoomSnapPointsType
ZoomSnapPointsTypeProperty
ZoomToFactor
ScrollViewerView
HorizontalOffset
VerticalOffset
ZoomFactor
ScrollViewerViewChangedEventArgs
IsIntermediate
ScrollViewerViewChangedEventArgs
ScrollViewerViewChangingEventArgs
FinalView
IsInertial
NextView
SearchBox
ChooseSuggestionOnEnter
ChooseSuggestionOnEnterProperty
FocusOnKeyboardInput
FocusOnKeyboardInputProperty
PlaceholderText
PlaceholderTextProperty
PrepareForFocusOnKeyboardInput
QueryChanged
QuerySubmitted
QueryText
QueryTextProperty
ResultSuggestionChosen
SearchBox
SearchHistoryContext
SearchHistoryContextProperty
SearchHistoryEnabled
SearchHistoryEnabledProperty
SetLocalContentSuggestionSettings
SuggestionsRequested
SearchBoxQueryChangedEventArgs
Language
LinguisticDetails
QueryText
SearchBoxQuerySubmittedEventArgs
KeyModifiers
Language
LinguisticDetails
QueryText
SearchBoxResultSuggestionChosenEventArgs
KeyModifiers
SearchBoxResultSuggestionChosenEventArgs
Tag
SearchBoxSuggestionsRequestedEventArgs
Language
Language
LinguisticDetails
QueryText
Request
SectionsInViewChangedEventArgs
AddedSections
RemovedSections
SectionsInViewChangedEventHandler
SelectionChangedEventArgs
AddedItems
RemovedItems
SelectionChangedEventArgs
SelectionChangedEventHandler
SelectionMode
SemanticZoom
CanChangeViews
CanChangeViewsProperty
IsZoomedInViewActive
IsZoomedInViewActiveProperty
IsZoomOutButtonEnabled
IsZoomOutButtonEnabledProperty
SemanticZoom
ToggleActiveView
ViewChangeCompleted
ViewChangeStarted
ZoomedInView
ZoomedInViewProperty
ZoomedOutView
ZoomedOutViewProperty
SemanticZoomLocation
Bounds
Item
SemanticZoomLocation
SemanticZoomViewChangedEventArgs
DestinationItem
IsSourceZoomedInView
SemanticZoomViewChangedEventArgs
SourceItem
SemanticZoomViewChangedEventHandler
SettingsFlyout
BackClick
HeaderBackground
HeaderBackgroundProperty
HeaderForeground
HeaderForegroundProperty
Hide
IconSource
IconSourceProperty
SettingsFlyout
Show
ShowIndependent
TemplateSettings
Title
TitleProperty
Slider
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
IntermediateValue
IntermediateValueProperty
IsDirectionReversed
IsDirectionReversedProperty
IsThumbToolTipEnabled
IsThumbToolTipEnabledProperty
Orientation
OrientationProperty
Slider
SnapsTo
SnapsToProperty
StepFrequency
StepFrequencyProperty
ThumbToolTipValueConverter
ThumbToolTipValueConverterProperty
TickFrequency
TickFrequencyProperty
TickPlacement
TickPlacementProperty
SnapPointsType
SplitButton
Click
Command
CommandParameter
CommandParameterProperty
CommandProperty
Flyout
FlyoutProperty
SplitButton
SplitButtonAutomationPeer
Collapse
Expand
ExpandCollapseState
Invoke
SplitButtonAutomationPeer
SplitButtonClickEventArgs
SplitView
CompactPaneLength
CompactPaneLengthProperty
Content
ContentProperty
DisplayMode
DisplayModeProperty
IsPaneOpen
IsPaneOpenProperty
LightDismissOverlayMode
LightDismissOverlayModeProperty
OpenPaneLength
OpenPaneLengthProperty
Pane
PaneBackground
PaneBackgroundProperty
PaneClosed
PaneClosing
PaneOpened
PaneOpening
PanePlacement
PanePlacementProperty
PaneProperty
SplitView
TemplateSettings
TemplateSettingsProperty
SplitViewDisplayMode
SplitViewPaneClosingEventArgs
Cancel
SplitViewPanePlacement
StackPanel
AreHorizontalSnapPointsRegular
AreScrollSnapPointsRegular
AreScrollSnapPointsRegularProperty
AreVerticalSnapPointsRegular
BackgroundSizing
BackgroundSizingProperty
BorderBrush
BorderBrushProperty
BorderThickness
BorderThicknessProperty
CornerRadius
CornerRadiusProperty
GetInsertionIndexes
GetIrregularSnapPoints
GetRegularSnapPoints
HorizontalSnapPointsChanged
Orientation
OrientationProperty
Padding
PaddingProperty
Spacing
SpacingProperty
StackPanel
VerticalSnapPointsChanged
StretchDirection
StyleSelector
SelectStyle
SelectStyleCore
StyleSelector
SwapChainBackgroundPanel
CreateCoreIndependentInputSource
SwapChainBackgroundPanel
SwapChainPanel
CompositionScaleChanged
CompositionScaleX
CompositionScaleXProperty
CompositionScaleY
CompositionScaleYProperty
CreateCoreIndependentInputSource
SwapChainPanel
SwipeBehaviorOnInvoked
SwipeControl
BottomItems
BottomItemsProperty
Close
LeftItems
LeftItemsProperty
RightItems
RightItemsProperty
SwipeControl
TopItems
TopItemsProperty
SwipeItem
Background
BackgroundProperty
BehaviorOnInvoked
BehaviorOnInvokedProperty
Command
CommandParameter
CommandParameterProperty
CommandProperty
Foreground
ForegroundProperty
IconSource
IconSourceProperty
Invoked
SwipeItem
Text
TextProperty
SwipeItemInvokedEventArgs
SwipeControl
SwipeItems
Append
Clear
First
GetAt
GetEnumerator
GetMany
GetView
IndexOf
Insert
InsertAt
Item
Mode
ModeProperty
RemoveAt
RemoveAtEnd
ReplaceAll
SetAt
Size
SwipeItems
SwipeMode
Symbol
SymbolIcon
Symbol
SymbolIcon
SymbolProperty
SymbolIconSource
Symbol
SymbolIconSource
SymbolProperty
TextBlock
BaselineOffset
CharacterSpacing
CharacterSpacingProperty
ContentEnd
ContentStart
ContextMenuOpening
CopySelectionToClipboard
Focus
FontFamily
FontFamilyProperty
FontSize
FontSizeProperty
FontStretch
FontStretchProperty
FontStyle
FontStyleProperty
FontWeight
FontWeightProperty
Foreground
ForegroundProperty
GetAlphaMask
HorizontalTextAlignment
HorizontalTextAlignmentProperty
Inlines
IsColorFontEnabled
IsColorFontEnabledProperty
IsTextScaleFactorEnabled
IsTextScaleFactorEnabledProperty
IsTextSelectionEnabled
IsTextSelectionEnabledProperty
IsTextTrimmed
IsTextTrimmedChanged
IsTextTrimmedProperty
LineHeight
LineHeightProperty
LineStackingStrategy
LineStackingStrategyProperty
MaxLines
MaxLinesProperty
OpticalMarginAlignment
OpticalMarginAlignmentProperty
Padding
PaddingProperty
Select
SelectAll
SelectedText
SelectedTextProperty
SelectionChanged
SelectionEnd
SelectionFlyout
SelectionFlyoutProperty
SelectionHighlightColor
SelectionHighlightColorProperty
SelectionStart
Text
TextAlignment
TextAlignmentProperty
TextBlock
TextDecorations
TextDecorationsProperty
TextHighlighters
TextLineBounds
TextLineBoundsProperty
TextProperty
TextReadingOrder
TextReadingOrderProperty
TextTrimming
TextTrimmingProperty
TextWrapping
TextWrappingProperty
TextBox
AcceptsReturn
AcceptsReturnProperty
BeforeTextChanging
CandidateWindowBoundsChanged
CanPasteClipboardContent
CanPasteClipboardContentProperty
CanRedo
CanRedoProperty
CanUndo
CanUndoProperty
CharacterCasing
CharacterCasingProperty
ClearUndoRedoHistory
ContextMenuOpening
CopyingToClipboard
CopySelectionToClipboard
CutSelectionToClipboard
CuttingToClipboard
Description
DescriptionProperty
DesiredCandidateWindowAlignment
DesiredCandidateWindowAlignmentProperty
GetLinguisticAlternativesAsync
GetRectFromCharacterIndex
HandwritingView
HandwritingViewProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
HorizontalTextAlignment
HorizontalTextAlignmentProperty
InputScope
InputScopeProperty
IsColorFontEnabled
IsColorFontEnabledProperty
IsHandwritingViewEnabled
IsHandwritingViewEnabledProperty
IsReadOnly
IsReadOnlyProperty
IsSpellCheckEnabled
IsSpellCheckEnabledProperty
IsTextPredictionEnabled
IsTextPredictionEnabledProperty
MaxLength
MaxLengthProperty
Paste
PasteFromClipboard
PlaceholderForeground
PlaceholderForegroundProperty
PlaceholderText
PlaceholderTextProperty
PreventKeyboardDisplayOnProgrammaticFocus
PreventKeyboardDisplayOnProgrammaticFocusProperty
ProofingMenuFlyout
ProofingMenuFlyoutProperty
Redo
Select
SelectAll
SelectedText
SelectionChanged
SelectionChanging
SelectionFlyout
SelectionFlyoutProperty
SelectionHighlightColor
SelectionHighlightColorProperty
SelectionHighlightColorWhenNotFocused
SelectionHighlightColorWhenNotFocusedProperty
SelectionLength
SelectionStart
Text
TextAlignment
TextAlignmentProperty
TextBox
TextChanged
TextChanging
TextCompositionChanged
TextCompositionEnded
TextCompositionStarted
TextProperty
TextReadingOrder
TextReadingOrderProperty
TextWrapping
TextWrappingProperty
Undo
TextBoxBeforeTextChangingEventArgs
Cancel
Cancel
NewText
TextBoxSelectionChangingEventArgs
Cancel
SelectionLength
SelectionStart
TextBoxTextChangingEventArgs
IsContentChanging
TextChangedEventArgs
TextChangedEventHandler
TextCommandBarFlyout
TextCommandBarFlyout
TextCompositionChangedEventArgs
Length
StartIndex
TextCompositionEndedEventArgs
Length
StartIndex
TextCompositionStartedEventArgs
Length
StartIndex
TextControlCopyingToClipboardEventArgs
Handled
TextControlCuttingToClipboardEventArgs
Handled
TextControlPasteEventArgs
Handled
TextControlPasteEventHandler
TimePickedEventArgs
NewTime
OldTime
TimePickedEventArgs
TimePicker
ClockIdentifier
ClockIdentifierProperty
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
LightDismissOverlayMode
LightDismissOverlayModeProperty
MinuteIncrement
MinuteIncrementProperty
SelectedTime
SelectedTimeChanged
SelectedTimeProperty
Time
TimeChanged
TimePicker
TimeProperty
TimePickerFlyout
ClockIdentifier
ClockIdentifierProperty
MinuteIncrement
MinuteIncrementProperty
ShowAtAsync
Time
TimePicked
TimePickerFlyout
TimeProperty
TimePickerFlyoutPresenter
TimePickerSelectedValueChangedEventArgs
NewTime
OldTime
TimePickerValueChangedEventArgs
NewTime
OldTime
ToggleMenuFlyoutItem
IsChecked
IsCheckedProperty
ToggleMenuFlyoutItem
ToggleSplitButton
IsChecked
IsCheckedChanged
ToggleSplitButton
ToggleSplitButtonAutomationPeer
Collapse
Expand
ExpandCollapseState
Toggle
ToggleSplitButtonAutomationPeer
ToggleState
ToggleSplitButtonIsCheckedChangedEventArgs
ToggleSwitch
Header
HeaderProperty
HeaderTemplate
HeaderTemplateProperty
IsOn
IsOnProperty
OffContent
OffContentProperty
OffContentTemplate
OffContentTemplateProperty
OnContent
OnContentProperty
OnContentTemplate
OnContentTemplateProperty
OnHeaderChanged
OnOffContentChanged
OnOnContentChanged
OnToggled
TemplateSettings
Toggled
ToggleSwitch
ToolTip
Closed
HorizontalOffset
HorizontalOffsetProperty
IsOpen
IsOpenProperty
Opened
Placement
PlacementProperty
PlacementRect
PlacementRectProperty
PlacementTarget
PlacementTargetProperty
TemplateSettings
ToolTip
VerticalOffset
VerticalOffsetProperty
ToolTipService
GetPlacement
GetPlacementTarget
GetToolTip
PlacementProperty
PlacementTargetProperty
SetPlacement
SetPlacementTarget
SetToolTip
ToolTipProperty
TreeView
CanDragItems
CanDragItemsProperty
CanReorderItems
CanReorderItemsProperty
Collapse
Collapsed
ContainerFromItem
ContainerFromNode
DragItemsCompleted
DragItemsStarting
Expand
Expanding
ItemContainerStyle
ItemContainerStyleProperty
ItemContainerStyleSelector
ItemContainerStyleSelectorProperty
ItemContainerTransitions
ItemContainerTransitionsProperty
ItemFromContainer
ItemInvoked
ItemsSource
ItemsSourceProperty
ItemTemplate
ItemTemplateProperty
ItemTemplateSelector
ItemTemplateSelectorProperty
NodeFromContainer
RootNodes
SelectAll
SelectedNodes
SelectionMode
SelectionModeProperty
TreeView
TreeViewCollapsedEventArgs
Item
Node
TreeViewDragItemsCompletedEventArgs
DropResult
Items
TreeViewDragItemsStartingEventArgs
Cancel
Data
Items
TreeViewExpandingEventArgs
Item
Node
TreeViewItem
CollapsedGlyph
CollapsedGlyphProperty
ExpandedGlyph
ExpandedGlyphProperty
GlyphBrush
GlyphBrushProperty
GlyphOpacity
GlyphOpacityProperty
GlyphSize
GlyphSizeProperty
HasUnrealizedChildren
HasUnrealizedChildrenProperty
IsExpanded
IsExpandedProperty
ItemsSource
ItemsSourceProperty
TreeViewItem
TreeViewItemTemplateSettings
TreeViewItemTemplateSettingsProperty
TreeViewItemInvokedEventArgs
Handled
InvokedItem
TreeViewItemTemplateSettings
CollapsedGlyphVisibility
CollapsedGlyphVisibilityProperty
DragItemsCount
DragItemsCountProperty
ExpandedGlyphVisibility
ExpandedGlyphVisibilityProperty
Indentation
IndentationProperty
TreeViewItemTemplateSettings
TreeViewList
TreeViewList
TreeViewNode
Children
Content
ContentProperty
Depth
DepthProperty
HasChildren
HasChildrenProperty
HasUnrealizedChildren
IsExpanded
IsExpandedProperty
Parent
TreeViewNode
TreeViewSelectionMode
UIElementCollection
Append
Clear
First
GetAt
GetEnumerator
GetMany
GetView
IndexOf
Insert
InsertAt
Item
Move
RemoveAt
RemoveAtEnd
ReplaceAll
SetAt
Size
UserControl
Content
ContentProperty
UserControl
VariableSizedWrapGrid
ColumnSpanProperty
GetColumnSpan
GetRowSpan
HorizontalChildrenAlignment
HorizontalChildrenAlignmentProperty
ItemHeight
ItemHeightProperty
ItemWidth
ItemWidthProperty
MaximumRowsOrColumns
MaximumRowsOrColumnsProperty
Orientation
OrientationProperty
RowSpanProperty
SetColumnSpan
SetRowSpan
VariableSizedWrapGrid
VerticalChildrenAlignment
VerticalChildrenAlignmentProperty
Viewbox
Child
Stretch
StretchDirection
StretchDirectionProperty
StretchProperty
Viewbox
VirtualizationMode
VirtualizingPanel
AddInternalChild
BringIndexIntoView
InsertInternalChild
ItemContainerGenerator
OnClearChildren
OnItemsChanged
RemoveInternalChildRange
VirtualizingStackPanel
AreScrollSnapPointsRegular
AreScrollSnapPointsRegularProperty
CleanUpVirtualizedItemEvent
GetIsVirtualizing
GetVirtualizationMode
IsVirtualizingProperty
OnCleanUpVirtualizedItem
Orientation
OrientationProperty
SetVirtualizationMode
VirtualizationModeProperty
VirtualizingStackPanel
WebView
AddWebAllowedObject
AllowedScriptNotifyUris
AllowedScriptNotifyUrisProperty
AnyScriptNotifyUri
BuildLocalStreamUri
CanGoBack
CanGoBackProperty
CanGoForward
CanGoForwardProperty
CapturePreviewToStreamAsync
CaptureSelectedContentToDataPackageAsync
ClearTemporaryWebDataAsync
ContainsFullScreenElement
ContainsFullScreenElementChanged
ContainsFullScreenElementProperty
ContentLoading
DataTransferPackage
DataTransferPackageProperty
DefaultBackgroundColor
DefaultBackgroundColorProperty
DefaultExecutionMode
DeferredPermissionRequestById
DeferredPermissionRequests
DocumentTitle
DocumentTitleProperty
DOMContentLoaded
ExecutionMode
Focus
FrameContentLoading
FrameDOMContentLoaded
FrameNavigationCompleted
FrameNavigationStarting
GoBack
GoForward
InvokeScript
InvokeScriptAsync
LoadCompleted
LongRunningScriptDetected
Navigate
NavigateToLocalStreamUri
NavigateToString
NavigateWithHttpRequestMessage
NavigationCompleted
NavigationFailed
NavigationStarting
NewWindowRequested
PermissionRequested
Refresh
ScriptNotify
SeparateProcessLost
Settings
Source
SourceProperty
Stop
UnsafeContentWarningDisplaying
UnsupportedUriSchemeIdentified
UnviewableContentIdentified
WebResourceRequested
WebView
XYFocusDown
XYFocusDownProperty
XYFocusLeft
XYFocusLeftProperty
XYFocusRight
XYFocusRightProperty
XYFocusUp
XYFocusUpProperty
WebViewBrush
Redraw
SetSource
SourceName
SourceNameProperty
WebViewBrush
WebViewContentLoadingEventArgs
Uri
WebViewDeferredPermissionRequest
Allow
Deny
Id
PermissionType
Uri
WebViewDOMContentLoadedEventArgs
Uri
WebViewExecutionMode
WebViewLongRunningScriptDetectedEventArgs
ExecutionTime
ExecutionTime
StopPageScriptExecution
WebViewNavigationCompletedEventArgs
IsSuccess
Uri
WebErrorStatus
WebViewNavigationFailedEventArgs
Uri
WebErrorStatus
WebViewNavigationFailedEventHandler
WebViewNavigationStartingEventArgs
Cancel
Uri
WebViewNewWindowRequestedEventArgs
Handled
Referrer
Uri
WebViewPermissionRequest
Allow
Defer
Deny
Id
PermissionType
State
Uri
WebViewPermissionRequestedEventArgs
PermissionRequest
WebViewPermissionState
WebViewPermissionType
WebViewSeparateProcessLostEventArgs
WebViewSettings
IsIndexedDBEnabled
IsJavaScriptEnabled
WebViewUnsupportedUriSchemeIdentifiedEventArgs
Handled
Uri
WebViewUnviewableContentIdentifiedEventArgs
MediaType
Referrer
Uri
WebViewWebResourceRequestedEventArgs
GetDeferral
Request
Response
WrapGrid
HorizontalChildrenAlignment
HorizontalChildrenAlignmentProperty
ItemHeight
ItemHeightProperty
ItemWidth
ItemWidthProperty
MaximumRowsOrColumns
MaximumRowsOrColumnsProperty
Orientation
OrientationProperty
VerticalChildrenAlignment
VerticalChildrenAlignmentProperty
WrapGrid
ZoomMode
Windows.UI.Xaml.Controls Windows.UI.Xaml.Controls
Windows.UI.Xaml.Controls Namespace
Provides UI controls and classes that support existing and custom controls.

Classes
AnchorRequestedEventArgs
AnchorRequestedEventArgs Provides data for the ScrollViewer.AnchorRequested event.
AnchorRequestedEventArgs

AppBar AppBar AppBar


Represents the container control that holds app UI
components for commanding and experiences. For Windows
10, see Remarks.

AppBarButton AppBarButton AppBarButton


Represents a templated button control to be displayed in an
AppBar.

AppBarElementContainer AppBarElementContainer
AppBarElementContainer Represents a container that allows an element that doesn't
implement ICommandBarElement to be displayed in a
command bar.

AppBarSeparator AppBarSeparator
AppBarSeparator Represents a line that separates items in an AppBar or
CommandBar.

AppBarToggleButton AppBarToggleButton
AppBarToggleButton Represents a button control that can switch states and be
displayed in an AppBar.

AutoSuggestBox AutoSuggestBox AutoSuggestBox


Represents a text control that makes suggestions to users as
they enter text using a keyboard or pen (using ink and
handwriting recognition). The app is notified when text has
been changed by the user and is responsible for providing
relevant suggestions for this control to display.

AutoSuggestBoxQuerySubmittedEventArgs
AutoSuggestBoxQuerySubmittedEventArgs Provides event data for the AutoSuggestBox.QuerySubmitted
event.
AutoSuggestBoxQuerySubmittedEventArgs

AutoSuggestBoxSuggestionChosenEventArgs
AutoSuggestBoxSuggestionChosenEventArgs Provides data for the SuggestionChosen event.
AutoSuggestBoxSuggestionChosenEventArgs

AutoSuggestBoxTextChangedEventArgs
AutoSuggestBoxTextChangedEventArgs Provides data for the TextChanged event.
AutoSuggestBoxTextChangedEventArgs
BackClickEventArgs BackClickEventArgs
BackClickEventArgs Provides event data for the SettingsFlyout.BackClick event.

BitmapIcon BitmapIcon BitmapIcon


Represents an icon that uses a bitmap as its content.

BitmapIconSource BitmapIconSource
BitmapIconSource Represents an icon source that uses a bitmap as its content.

Border Border Border


Draws a border, background, or both, around another object.

Button Button Button


Represents a templated button control that interprets a Click
user interaction.

CalendarDatePicker CalendarDatePicker
CalendarDatePicker Represents a control that allows a user to pick a date from a
calendar display.

CalendarDatePickerDateChangedEventArgs
CalendarDatePickerDateChangedEventArgs Provides event data for the DateChanged event.
CalendarDatePickerDateChangedEventArgs

CalendarView CalendarView CalendarView


Represents a control that enables a user to select a date by
using a visual calendar display.

CalendarViewDayItem CalendarViewDayItem
CalendarViewDayItem Represents a day on a CalendarView.

CalendarViewDayItemChangingEventArgs
CalendarViewDayItemChangingEventArgs Provides data for the CalendarViewDayItemChanging event.
CalendarViewDayItemChangingEventArgs

CalendarViewSelectedDatesChangedEventArgs
CalendarViewSelectedDatesChangedEventArgs Provides data for the SelectedDatesChanged event.
CalendarViewSelectedDatesChangedEventArgs

CandidateWindowBoundsChangedEventArgs
CandidateWindowBoundsChangedEventArgs Provides event data for the
CandidateWindowBoundsChanged event.
CandidateWindowBoundsChangedEventArgs

Canvas Canvas Canvas


Defines an area within which you can explicitly position child
objects, using coordinates that are relative to the Canvas area.

CaptureElement CaptureElement CaptureElement


Renders a stream from a capture device, such as a camera or
webcam. CaptureElement is used in conjunction with the
Windows.Media.Capture.MediaCapture API, and must be
hooked up in the code behind.
CheckBox CheckBox CheckBox
Represents a control that a user can select (check) or clear
(uncheck). A CheckBox can also report its value as
indeterminate.

ChoosingGroupHeaderContainerEventArgs
ChoosingGroupHeaderContainerEventArgs Provides event data for the
ListViewBase.ChoosingGroupHeaderContainer event.
ChoosingGroupHeaderContainerEventArgs

ChoosingItemContainerEventArgs
ChoosingItemContainerEventArgs Provides event data for the
ListViewBase.ChoosingItemContainer event.
ChoosingItemContainerEventArgs

CleanUpVirtualizedItemEventArgs
CleanUpVirtualizedItemEventArgs Provides data for the CleanUpVirtualizedItemEvent event.
CleanUpVirtualizedItemEventArgs

ColorChangedEventArgs ColorChangedEventArgs
ColorChangedEventArgs Provides event data for the ColorChanged event.

ColorPicker ColorPicker ColorPicker


Represents a control that lets a user pick a color using a color
spectrum, sliders, and text input.

ColumnDefinition ColumnDefinition
ColumnDefinition Defines column-specific properties that apply to Grid objects.

ColumnDefinitionCollection
ColumnDefinitionCollection Provides access to an ordered, strongly typed collection of
ColumnDefinition objects.
ColumnDefinitionCollection

ComboBox ComboBox ComboBox


Represents a selection control that combines a non-editable
text box and a drop-down list box that allows users to select
an item from a list.

ComboBoxItem ComboBoxItem ComboBoxItem


Represents the container for an item in a ComboBox control.

ComboBoxTextSubmittedEventArgs
ComboBoxTextSubmittedEventArgs Provides data when the user enters custom text into the
ComboBox.
ComboBoxTextSubmittedEventArgs

CommandBar CommandBar CommandBar


Represents a specialized app bar that provides layout for
AppBarButton and related command elements.

CommandBarFlyout CommandBarFlyout
CommandBarFlyout Represents a specialized flyout that provides layout for
AppBarButton and related command elements.
CommandBarOverflowPresenter
CommandBarOverflowPresenter Displays the overflow content of a CommandBar.
CommandBarOverflowPresenter

ContainerContentChangingEventArgs
ContainerContentChangingEventArgs Provides data for the ContainerContentChanging event.
ContainerContentChangingEventArgs

ContentControl ContentControl ContentControl


Represents a control with a single piece of content. Controls
such as Button, CheckBox, and ScrollViewer directly or
indirectly inherit from this class.

ContentDialog ContentDialog ContentDialog


Represents a dialog box that can be customized to contain
checkboxes, hyperlinks, buttons and any other XAML content.

ContentDialogButtonClickDeferral
ContentDialogButtonClickDeferral Represents a deferral that can be used by an app to respond
asynchronously to a button click event.
ContentDialogButtonClickDeferral

ContentDialogButtonClickEventArgs
ContentDialogButtonClickEventArgs Provides data for the button click events.
ContentDialogButtonClickEventArgs

ContentDialogClosedEventArgs
ContentDialogClosedEventArgs Provides data for the Closed event.
ContentDialogClosedEventArgs

ContentDialogClosingDeferral
ContentDialogClosingDeferral Represents a deferral that can be used by an app to respond
asynchronously to the closing event of the ContentDialog.
ContentDialogClosingDeferral

ContentDialogClosingEventArgs
ContentDialogClosingEventArgs Provides data for the closing event.
ContentDialogClosingEventArgs

ContentDialogOpenedEventArgs
ContentDialogOpenedEventArgs Provides data for the Opened event.
ContentDialogOpenedEventArgs

ContentLinkChangedEventArgs
ContentLinkChangedEventArgs Provides data for the RichEditBox.ContentLinkChanged event.
ContentLinkChangedEventArgs

ContentPresenter ContentPresenter
ContentPresenter Displays the content of a ContentControl. Can also provide
content presentation for non-controls. Provides a base class
for specialized presenters such as ScrollContentPresenter.

ContextMenuEventArgs ContextMenuEventArgs
ContextMenuEventArgs Provides event data for the ContextMenuOpening event that
exists on several text-related UI elements.
Control Control Control
Represents the base class for UI elements that use a
ControlTemplate to define their appearance. Parent class for
ContentControl, UserControl, ItemsControl and several
practical controls.

ControlTemplate ControlTemplate
ControlTemplate Defines the element tree that is used as the control template
for a control.

DataTemplateSelector DataTemplateSelector
DataTemplateSelector Enables custom template selection logic at the application
level.

DatePickedEventArgs DatePickedEventArgs
DatePickedEventArgs Provides data for the DatePicked event.

DatePicker DatePicker DatePicker


Represents a control that allows a user to pick a date value.

DatePickerFlyout DatePickerFlyout
DatePickerFlyout Represents a control that allows a user to pick a date.

DatePickerFlyoutItem DatePickerFlyoutItem
DatePickerFlyoutItem Represents the container for an item in the DatePickerFlyout
control.

DatePickerFlyoutPresenter
DatePickerFlyoutPresenter Represents a control to allow a user to pick a date.
DatePickerFlyoutPresenter

DatePickerSelectedValueChangedEventArgs
DatePickerSelectedValueChangedEventArgs Provides event data for the DatePicker.SelectedDateChanged
event.
DatePickerSelectedValueChangedEventArgs

DatePickerValueChangedEventArgs
DatePickerValueChangedEventArgs Provides event data for the DatePicker.DateChanged event.
DatePickerValueChangedEventArgs

DragItemsCompletedEventArgs
DragItemsCompletedEventArgs Provides event data for the DragItemsCompleted event.
DragItemsCompletedEventArgs

DragItemsStartingEventArgs
DragItemsStartingEventArgs Provides event data for the DragItemsStarting event.
DragItemsStartingEventArgs

DropDownButton DropDownButton DropDownButton


Represents a button with a chevron intended to open a menu.

DropDownButtonAutomationPeer
DropDownButtonAutomationPeer Exposes DropDownButton types to Microsoft UI Automation.
DropDownButtonAutomationPeer
DynamicOverflowItemsChangingEventArgs
DynamicOverflowItemsChangingEventArgs Provides data for the
CommandBar.DynamicOverflowItemsChanging event.
DynamicOverflowItemsChangingEventArgs

FlipView FlipView FlipView


Represents an items control that displays one item at a time,
and enables "flip" behavior for traversing its collection of items.

FlipViewItem FlipViewItem FlipViewItem


Represents the container for an item in a FlipView control.

Flyout Flyout Flyout


Represents a control that displays lightweight UI that is either
information, or requires user interaction. Unlike a dialog, a
Flyout can be light dismissed by clicking or tapping outside of
it, pressing the device’s back button, or pressing the ‘Esc’ key.

FlyoutPresenter FlyoutPresenter
FlyoutPresenter Displays the content of a Flyout.

FocusDisengagedEventArgs
FocusDisengagedEventArgs Provides data for the FocusDisengaged event.
FocusDisengagedEventArgs

FocusEngagedEventArgs FocusEngagedEventArgs
FocusEngagedEventArgs Provides data for the FocusEngaged event.

FontIcon FontIcon FontIcon


Represents an icon that uses a glyph from the specified font.

FontIconSource FontIconSource FontIconSource


Represents an icon source that uses a glyph from the specified
font.

Frame Frame Frame


Displays Page instances, supports navigation to new pages,
and maintains a navigation history to support forward and
backward navigation.

Grid Grid Grid


Defines a flexible grid area that consists of columns and rows.
Child elements of the Grid are measured and arranged
according to their row/column assignments (set by using
Grid.Row and Grid.Column attached properties) and other
logic.

GridView GridView GridView


Represents a control that displays data items in rows and
columns.
GridViewHeaderItem GridViewHeaderItem
GridViewHeaderItem Represents items in the header for grouped data inside a
GridView.

GridViewItem GridViewItem GridViewItem


Represents the container for an item in a GridView control.

GroupItem GroupItem GroupItem


Represents the root element for a subtree that is created for a
group.

GroupStyle GroupStyle GroupStyle


Describes how to display the grouped items in a collection,
such as the collection from GroupItems.

GroupStyleSelector GroupStyleSelector
GroupStyleSelector Enables custom group style selection logic as a function of the
parent group and its level.

HandwritingPanelClosedEventArgs
HandwritingPanelClosedEventArgs Provides event data for the HandwritingView.Closed event.
HandwritingPanelClosedEventArgs

HandwritingPanelOpenedEventArgs
HandwritingPanelOpenedEventArgs Provides event data for the HandwritingView.Opened event.
HandwritingPanelOpenedEventArgs

HandwritingView HandwritingView
HandwritingView Represents a Windows Ink input surface for text input
controls.

Hub Hub Hub


For Windows 10 and later: We recommend against using
this control; use one of the other navigation controls
instead. For a list, see the Navigation basics article.
Represents a control that displays groups of content in a
panning view.

HubSection HubSection HubSection


Represents a single group of content in a Hub.

HubSectionCollection HubSectionCollection
HubSectionCollection Represents an ordered collection of HubSection objects.

HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs Provides data for the Hub.SectionHeaderClick event.
HubSectionHeaderClickEventArgs

HyperlinkButton HyperlinkButton
HyperlinkButton Represents a button control that functions as a hyperlink.
IconElement IconElement IconElement
Represents the base class for an icon UI element.

IconSource IconSource IconSource


Represents the base class for an icon source.

IconSourceElement IconSourceElement
IconSourceElement Represents an icon that uses an IconSource as its content.

Image Image Image


Represents a control that displays an image. The image source
is specified by referring to an image file, using several
supported formats. The image source can also be set with a
stream. See Remarks for the list of supported image source
formats.

InkCanvas InkCanvas InkCanvas


Defines an area that receives and displays all pen input as
either an ink stroke or an erase stroke (input from an eraser
tip, or the pen tip when modified with an erase button).

InkToolbar InkToolbar InkToolbar


Represents a Universal Windows app control containing a
customizable and extensible collection of buttons that activate
ink-related features in an associated InkCanvas.

InkToolbarBallpointPenButton
InkToolbarBallpointPenButton Represents an InkToolbar button that activates the built-in
ballpoint pen.
InkToolbarBallpointPenButton

InkToolbarCustomPen InkToolbarCustomPen
InkToolbarCustomPen Represents an InkToolbar pen for which the ink color palette
and pen tip properties, such as shape, rotation, and size, are
defined by the host app.

InkToolbarCustomPenButton
InkToolbarCustomPenButton Represents an InkToolbar button that activates a pen for
which the ink color palette and pen tip properties, such as
InkToolbarCustomPenButton
shape, rotation, and size, are defined by the host app.

InkToolbarCustomToggleButton
InkToolbarCustomToggleButton Represents an InkToolbar button that sets the state of an app-
defined feature to on or off. When turned on, the feature
InkToolbarCustomToggleButton
works in conjunction with the active tool.

InkToolbarCustomToolButton
InkToolbarCustomToolButton Represents an InkToolbar button that invokes a non-pen tool,
defined by the host app.
InkToolbarCustomToolButton

InkToolbarEraserButton InkToolbarEraserButton
InkToolbarEraserButton Represents an InkToolbar button that activates the built-in
eraser tool.
InkToolbarFlyoutItem InkToolbarFlyoutItem
InkToolbarFlyoutItem Represents an InkToolbar button on a flyout. This item can be
a basic button, a radio button, a radio toggle button, or a
check box.

InkToolbarHighlighterButton
InkToolbarHighlighterButton Represents an InkToolbar toggle button control that activates
the built-in highlighter pen.
InkToolbarHighlighterButton

InkToolbarIsStencilButtonCheckedChangedEventArgs
InkToolbarIsStencilButtonCheckedChangedEventArgs Provides data for the IsStencilButtonCheckedChanged event.
InkToolbarIsStencilButtonCheckedChangedEventArgs

InkToolbarMenuButton InkToolbarMenuButton
InkToolbarMenuButton Represents an InkToolbar button that invokes a menu of tools,
defined by the host app.

InkToolbarPenButton InkToolbarPenButton
InkToolbarPenButton Provides a base class for all built-in and custom pen buttons
on an InkToolbar.

InkToolbarPencilButton InkToolbarPencilButton
InkToolbarPencilButton Represents an InkToolbar toggle button control that activates
the built-in pencil.

InkToolbarPenConfigurationControl
InkToolbarPenConfigurationControl Represents an object used to configure an optional flyout
associated with an InkToolbarCustomPenButton. An
InkToolbarPenConfigurationControl
"extension glyph" is displayed on the button to indicate the
existence of the flyout.

InkToolbarRulerButton InkToolbarRulerButton
InkToolbarRulerButton Represents an InkToolbar button that sets the state of the
built-in ruler tool to on or off.

InkToolbarStencilButton
InkToolbarStencilButton Represents an InkToolbar button that sets the state of stencil
tool to on or off.
InkToolbarStencilButton

InkToolbarToggleButton InkToolbarToggleButton
InkToolbarToggleButton Represents an object that provides infrastructure for both
built-in and custom toggle buttons on an InkToolbar.

InkToolbarToolButton InkToolbarToolButton
InkToolbarToolButton Provides a base class for all built-in and custom buttons on an
InkToolbar.

IsTextTrimmedChangedEventArgs
IsTextTrimmedChangedEventArgs Provides event data for the IsTextTrimmedChanged event.
IsTextTrimmedChangedEventArgs

ItemClickEventArgs ItemClickEventArgs
ItemClickEventArgs Provides event data for the ItemClick event.
ItemCollection ItemCollection ItemCollection
Holds the list of items that represent the content of an
ItemsControl.

ItemContainerGenerator ItemContainerGenerator
ItemContainerGenerator Provides mappings between the items of an ItemsControl and
their container elements.

ItemsControl ItemsControl ItemsControl


Represents a control that can be used to present a collection
of items.

ItemsPanelTemplate ItemsPanelTemplate
ItemsPanelTemplate Specifies the panel that the ItemsPresenter creates for the
layout of the items of an ItemsControl.

ItemsPickedEventArgs ItemsPickedEventArgs
ItemsPickedEventArgs Provides data for the ItemsPicked event.

ItemsPresenter ItemsPresenter ItemsPresenter


Specifies where items are placed in a control, usually an
ItemsControl.

ItemsStackPanel ItemsStackPanel
ItemsStackPanel Arranges child elements of an ItemsControl into a single line
that can be oriented horizontally or vertically. Supports pixel-
based UI virtualization and grouped layouts.

ItemsWrapGrid ItemsWrapGrid ItemsWrapGrid


Positions child elements sequentially from left to right or top
to bottom in an ItemsControl that shows multiple items.
When elements extend beyond the container edge, elements
are positioned in the next row or column. Supports pixel-
based UI virtualization and grouped layouts.

ListBox ListBox ListBox


Presents a list of items the user can select from.

ListBoxItem ListBoxItem ListBoxItem


Represents the container for an item in a ListBox control.

ListPickerFlyout ListPickerFlyout
ListPickerFlyout Represents a control that allows a user to pick one or more
items from a list. See Remarks.

ListPickerFlyoutPresenter
ListPickerFlyoutPresenter Represents a control that allows a user to pick one or more
items from a list. (Not recommended for Universal Windows
ListPickerFlyoutPresenter
Platform (UWP) app. See Flyout.)

ListView ListView ListView


Represents a control that displays data items in a vertical
stack.
ListViewBase ListViewBase ListViewBase
Provides the infrastructure for the ListView and GridView
classes.

ListViewBaseHeaderItem ListViewBaseHeaderItem
ListViewBaseHeaderItem Provides the infrastructure for the ListViewHeaderItem and
GridViewHeaderItem classes.

ListViewHeaderItem ListViewHeaderItem
ListViewHeaderItem Represents items in the header for grouped data inside a
ListView.

ListViewItem ListViewItem ListViewItem


Represents the container for an item in a ListView control.

ListViewPersistenceHelper
ListViewPersistenceHelper Represents a helper class to save and retrieve the relative
scroll position of the ListView.
ListViewPersistenceHelper

MediaElement MediaElement MediaElement


Represents an object that renders audio and video to the
display. See Remarks.

MediaPlayerElement MediaPlayerElement
MediaPlayerElement Represents an object that uses a MediaPlayer to render audio
and video to the display.

MediaPlayerPresenter MediaPlayerPresenter
MediaPlayerPresenter Represents an object that displays a MediaPlayer.

MediaTransportControls MediaTransportControls
MediaTransportControls Represents the playback controls for a media player element.

MediaTransportControlsHelper
MediaTransportControlsHelper Provides properties and methods to customize media
transport controls.
MediaTransportControlsHelper

MenuBar MenuBar MenuBar


Represents a specialized container that presents a set of
menus in a horizontal row, typically at the top of an app
window.

MenuBarItem MenuBarItem MenuBarItem


Represents a top-level menu in a MenuBar control.

MenuBarItemFlyout MenuBarItemFlyout
MenuBarItemFlyout Represents the flyout of a MenuBar item.

MenuFlyout MenuFlyout MenuFlyout


Represents a flyout that displays a menu of commands.
MenuFlyoutItem MenuFlyoutItem MenuFlyoutItem
Represents a command in a MenuFlyout control.

MenuFlyoutItemBase MenuFlyoutItemBase
MenuFlyoutItemBase Represents the base class for items in a MenuFlyout control.

MenuFlyoutPresenter MenuFlyoutPresenter
MenuFlyoutPresenter Displays the content of a MenuFlyout control.

MenuFlyoutSeparator MenuFlyoutSeparator
MenuFlyoutSeparator Represents a horizontal line that separates items in an
MenuFlyout.

MenuFlyoutSubItem MenuFlyoutSubItem
MenuFlyoutSubItem Represents a menu item that displays a sub-menu in a
MenuFlyout control.

NavigationView NavigationView NavigationView


Represents a container that enables navigation of app content.
It has a header, a view for the main content, and a menu pane
for navigation commands.

NavigationViewBackRequestedEventArgs
NavigationViewBackRequestedEventArgs Provides event data for the NavigationView.BackRequested
event.
NavigationViewBackRequestedEventArgs

NavigationViewDisplayModeChangedEventArgs
NavigationViewDisplayModeChangedEventArgs Provides data for the NavigationView.DisplayModeChanged
event.
NavigationViewDisplayModeChangedEventArgs

NavigationViewItem NavigationViewItem
NavigationViewItem Represents the container for an item in a NavigationView
control.

NavigationViewItemBase NavigationViewItemBase
NavigationViewItemBase Base class for NavigationView menu items.

NavigationViewItemHeader
NavigationViewItemHeader Represents a header for a group of menu items in a
NavigationMenu.
NavigationViewItemHeader

NavigationViewItemInvokedEventArgs
NavigationViewItemInvokedEventArgs Provides event data for the NavigationView.ItemInvoked
event.
NavigationViewItemInvokedEventArgs

NavigationViewItemSeparator
NavigationViewItemSeparator Represents a line that separates menu items in a
NavigationMenu.
NavigationViewItemSeparator

NavigationViewList NavigationViewList
NavigationViewList Represents a control that displays menu items in a
NavigationView control.
NavigationViewPaneClosingEventArgs
NavigationViewPaneClosingEventArgs Provides data for the NavigationView.PaneClosing event.
NavigationViewPaneClosingEventArgs

NavigationViewSelectionChangedEventArgs
NavigationViewSelectionChangedEventArgs Provides data for the NavigationView.SelectionChanged event.
NavigationViewSelectionChangedEventArgs

NavigationViewTemplateSettings
NavigationViewTemplateSettings Provides calculated values that can be referenced as
TemplatedParent sources when defining templates for a
NavigationViewTemplateSettings
NavigationView. Not intended for general use.

NotifyEventArgs NotifyEventArgs
NotifyEventArgs Provides data for the ScriptNotify event.

Page Page Page


Represents content that a Frame control can navigate to.

Panel Panel Panel


Provides a base class for all Panel elements. Use Panel
elements to position and arrange child objects in a UI page.

ParallaxView ParallaxView ParallaxView


Represents a container that ties the scroll position of a
foreground element, such as a list, to a background element,
such as an image. As you scroll through the foreground
element, it animates the background element to create a
parallax effect.

PasswordBox PasswordBox PasswordBox


Represents a control for entering passwords.

PasswordBoxPasswordChangingEventArgs
PasswordBoxPasswordChangingEventArgs Provides event data for the PasswordBox.PasswordChanging
event.
PasswordBoxPasswordChangingEventArgs

PathIcon PathIcon PathIcon


Represents an icon that uses a vector path as its content.

PathIconSource PathIconSource PathIconSource


Represents an icon source that uses a vector path as its
content.

PersonPicture PersonPicture PersonPicture


Represents a control that displays the avatar image for a
person, if one is available; if not, it displays the person's initials
or a generic glyph.

PickerConfirmedEventArgs
PickerConfirmedEventArgs Provides data for the PickerConfirmed event.
PickerConfirmedEventArgs
PickerFlyout PickerFlyout PickerFlyout
Represents a custom picker control. (Not recommended for
Universal Windows Platform (UWP) app. See Flyout.)

PickerFlyoutPresenter PickerFlyoutPresenter
PickerFlyoutPresenter Represents a custom picker. (Not recommended for Universal
Windows Platform (UWP) app. See Flyout.)

Pivot Pivot Pivot


Represents a control that provides quick navigation of views
within an app.

PivotItem PivotItem PivotItem


Represents the container for an item in a Pivot control.

PivotItemEventArgs PivotItemEventArgs
PivotItemEventArgs Event arguments for dynamically interacting with the
PivotItem before use, allowing for delay load scenarios.

ProgressBar ProgressBar ProgressBar


Represents a control that indicates the progress of an
operation, where the typical visual appearance is a bar that
animates a filled area as progress continues.

ProgressRing ProgressRing ProgressRing


Represents a control that indicates that an operation is
ongoing. The typical visual appearance is a ring-shaped
"spinner" that cycles an animation as progress continues.

RadioButton RadioButton RadioButton


Represents a button that allows a user to select a single
option from a group of options.

RatingControl RatingControl RatingControl


Represents a control that lets a user enter a star rating.

RatingItemFontInfo RatingItemFontInfo
RatingItemFontInfo Represents information about the visual states of font
elements that represent a rating.

RatingItemImageInfo RatingItemImageInfo
RatingItemImageInfo Represents information about the visual states of image
elements that represent a rating.

RatingItemInfo RatingItemInfo RatingItemInfo


Represents information about the visual states of the elements
that represent a rating.

RefreshContainer RefreshContainer
RefreshContainer Represents a container control that provides a
RefreshVisualizer and pull-to-refresh functionality for scrollable
content.
RefreshInteractionRatioChangedEventArgs
RefreshInteractionRatioChangedEventArgs Provides event data.
RefreshInteractionRatioChangedEventArgs

RefreshRequestedEventArgs
RefreshRequestedEventArgs Provides event data for RefreshRequested events.
RefreshRequestedEventArgs

RefreshStateChangedEventArgs
RefreshStateChangedEventArgs Provides event data for the
RefreshVisualizer.RefreshStateChanged event.
RefreshStateChangedEventArgs

RefreshVisualizer RefreshVisualizer
RefreshVisualizer Represents a control that provides animated state indicators
for content refresh.

RelativePanel RelativePanel RelativePanel


Defines an area within which you can position and align child
objects in relation to each other or the parent panel.

RichEditBox RichEditBox RichEditBox


Represents a rich text editing control that supports formatted
text, hyperlinks, and other rich content.

RichEditBoxSelectionChangingEventArgs
RichEditBoxSelectionChangingEventArgs Provides event data for the RichEditBox.SelectionChanging
event.
RichEditBoxSelectionChangingEventArgs

RichEditBoxTextChangingEventArgs
RichEditBoxTextChangingEventArgs Provides event data for the RichEditBox.TextChanging event.
RichEditBoxTextChangingEventArgs

RichTextBlock RichTextBlock RichTextBlock


Represents a rich text display container that supports
formatted text, hyperlinks, inline images, and other rich
content. RichTextBlock supports a built-in overflow model.

RichTextBlockOverflow RichTextBlockOverflow
RichTextBlockOverflow Represents a rich text display overflow container. This element
cannot have direct content. The only purpose of
RichTextBlockOverflow is to display text content that does not
fit in the bounds of a RichTextBlock or another
RichTextBlockOverflow element.

RowDefinition RowDefinition RowDefinition


Defines row-specific properties that apply to Grid elements.

RowDefinitionCollection
RowDefinitionCollection Provides access to an ordered, strongly typed collection of
RowDefinition objects.
RowDefinitionCollection

ScrollContentPresenter ScrollContentPresenter
ScrollContentPresenter Displays the content of a ScrollViewer control.
ScrollViewer ScrollViewer ScrollViewer
Represents a scrollable area that can contain other visible
elements.

ScrollViewerView ScrollViewerView
ScrollViewerView Provides a view for a ScrollViewer when its view is changing.

ScrollViewerViewChangedEventArgs
ScrollViewerViewChangedEventArgs Provides event data for the ViewChanged event and similar
control-specific events.
ScrollViewerViewChangedEventArgs

ScrollViewerViewChangingEventArgs
ScrollViewerViewChangingEventArgs Provides event data for the ViewChanging event and similar
control-specific events.
ScrollViewerViewChangingEventArgs

SearchBox SearchBox SearchBox


Represents a control that can be used to enter search query
text. (Not recommended for Universal Windows Platform
(UWP) apps. See AutoSuggestBox.)

SearchBoxQueryChangedEventArgs
SearchBoxQueryChangedEventArgs Provides event data for the SearchBox.QueryChanged event.
SearchBoxQueryChangedEventArgs

SearchBoxQuerySubmittedEventArgs
SearchBoxQuerySubmittedEventArgs Provides event data for the SearchBox.QuerySubmitted event.
SearchBoxQuerySubmittedEventArgs

SearchBoxResultSuggestionChosenEventArgs
SearchBoxResultSuggestionChosenEventArgs Provides event data for the
SearchBox.ResultSuggestionChosen event.
SearchBoxResultSuggestionChosenEventArgs

SearchBoxSuggestionsRequestedEventArgs
SearchBoxSuggestionsRequestedEventArgs Provides event data for the SearchBox.SuggestionsRequested
event.
SearchBoxSuggestionsRequestedEventArgs

SectionsInViewChangedEventArgs
SectionsInViewChangedEventArgs Provides data for the Hub.SectionsInViewChanged event.
SectionsInViewChangedEventArgs

SelectionChangedEventArgs
SelectionChangedEventArgs Provides data for the SelectionChanged event.
SelectionChangedEventArgs

SemanticZoom SemanticZoom SemanticZoom


Represents a scrollable control that incorporates two views
that have a semantic relationship. For example, the
ZoomedOutView might be an index of titles, and the
ZoomedInView might include details and summaries for each
of the title entries. Views can be changed using zoom or other
interactions.
SemanticZoomLocation SemanticZoomLocation
SemanticZoomLocation Communicates information for items and view state in a
SemanticZoom, such that hosts for scrolling and virtualization
(such as ListViewBase ) can get correct item and bounds
information.

SemanticZoomViewChangedEventArgs
SemanticZoomViewChangedEventArgs Provides event data for the ViewChangeStarted and
ViewChangeCompleted events.
SemanticZoomViewChangedEventArgs

SettingsFlyout SettingsFlyout SettingsFlyout No t e

SettingsFlyout is not supported for use in Universal Windows


Platform (UWP) app for Windows 10. Instead, use a Flyout.
No t e

SettingsFlyout is supported only for use with the SettingsPane


in Windows 8. While the SettingsFlyout type is visible in
Windows Phone projects, SettingsPane is not present on
Windows Phone, so use of SettingsFlyout is not supported.
Represents a control that provides in-context access to
settings that affect the current app. (Not recommended for
Universal Windows Platform (UWP) app.)

Slider Slider Slider


Represents a control that lets the user select from a range of
values by moving a Thumb control along a track.

SplitButton SplitButton SplitButton


Represents a button with two parts that can be invoked
separately. One part behaves like a standard button and the
other part invokes a flyout.

SplitButtonAutomationPeer
SplitButtonAutomationPeer Exposes SplitButton types to Microsoft UI Automation.
SplitButtonAutomationPeer

SplitButtonClickEventArgs
SplitButtonClickEventArgs Provides event data for the SplitButton.Click event.
SplitButtonClickEventArgs

SplitView SplitView SplitView


Represents a container with two views; one view for the main
content and another view that is typically used for navigation
commands.

SplitViewPaneClosingEventArgs
SplitViewPaneClosingEventArgs Provides event data for the SplitView.PaneClosing event.
SplitViewPaneClosingEventArgs

StackPanel StackPanel StackPanel


Arranges child elements into a single line that can be oriented
horizontally or vertically.
StyleSelector StyleSelector StyleSelector
Enables custom item style selection logic as a function of the
content data and its specific item container.

SwapChainBackgroundPanel
SwapChainBackgroundPanel Implements a XAML layout surface target for Microsoft
DirectX interoperation scenarios. This panel has some atypical
SwapChainBackgroundPanel
restrictions on its usage within an app window; see Remarks.
Import an t

SwapChainBackgroundPanel may be altered or unavailable for


releases after Windows 8.1 Instead, use SwapChainPanel.

SwapChainPanel SwapChainPanel SwapChainPanel


Provides a hosting surface, where Microsoft DirectX swap
chains provide content that can be rendered into a XAML UI.
A SwapChainPanel element is a key component for an app
that renders Microsoft DirectX graphics and then presents
those visuals within a XAML page.

SwipeControl SwipeControl SwipeControl


Represents a container that provides access to contextual
commands through touch interactions.

SwipeItem SwipeItem SwipeItem


Represents an individual command in a SwipeControl.

SwipeItemInvokedEventArgs
SwipeItemInvokedEventArgs Provides event data for the SwipeItem.Invoked event.
SwipeItemInvokedEventArgs

SwipeItems SwipeItems SwipeItems


Represents a collection of SwipeItem objects.

SymbolIcon SymbolIcon SymbolIcon


Represents an icon that uses a glyph from the Segoe MDL2
Assets font as its content.

SymbolIconSource SymbolIconSource
SymbolIconSource Represents an icon source that uses a glyph from the Segoe
MDL2 Assets font as its content.

TextBlock TextBlock TextBlock


Provides a lightweight control for displaying small amounts of
text.

TextBox TextBox TextBox


Represents a control that can be used to display and edit plain
text (single or multi-line).

TextBoxBeforeTextChangingEventArgs
TextBoxBeforeTextChangingEventArgs Provides event data for the TextBox.BeforeTextChanging event.
TextBoxBeforeTextChangingEventArgs
TextBoxSelectionChangingEventArgs
TextBoxSelectionChangingEventArgs Provides event data for the TextBox.SelectionChanging event.
TextBoxSelectionChangingEventArgs

TextBoxTextChangingEventArgs
TextBoxTextChangingEventArgs Provides event data for the TextBox.TextChanging event.
TextBoxTextChangingEventArgs

TextChangedEventArgs TextChangedEventArgs
TextChangedEventArgs Provides data for the TextChanged event.

TextCommandBarFlyout TextCommandBarFlyout
TextCommandBarFlyout Represents a specialized command bar flyout that contains
commands for editing text.

TextCompositionChangedEventArgs
TextCompositionChangedEventArgs Provides event data for the TextCompositionChanged event
on TextBox and RichEditBox.
TextCompositionChangedEventArgs

TextCompositionEndedEventArgs
TextCompositionEndedEventArgs Provides event data for the TextCompositionEnded event on
TextBox and RichEditBox.
TextCompositionEndedEventArgs

TextCompositionStartedEventArgs
TextCompositionStartedEventArgs Provides event data for the TextCompositionStarted event on
TextBox and RichEditBox.
TextCompositionStartedEventArgs

TextControlCopyingToClipboardEventArgs
TextControlCopyingToClipboardEventArgs Provides event data for the CopyingToClipboard event.
TextControlCopyingToClipboardEventArgs

TextControlCuttingToClipboardEventArgs
TextControlCuttingToClipboardEventArgs Provides event data for the CuttingToClipboard event.
TextControlCuttingToClipboardEventArgs

TextControlPasteEventArgs
TextControlPasteEventArgs Provides data for the text control Paste event.
TextControlPasteEventArgs

TimePickedEventArgs TimePickedEventArgs
TimePickedEventArgs Provides data for the TimePicked event.

TimePicker TimePicker TimePicker


Represents a control that allows a user to pick a time value.

TimePickerFlyout TimePickerFlyout
TimePickerFlyout Represents a control that allows a user to pick a time value.

TimePickerFlyoutPresenter
TimePickerFlyoutPresenter Represents the visual container for the TimePickerFlyout.
TimePickerFlyoutPresenter
TimePickerSelectedValueChangedEventArgs
TimePickerSelectedValueChangedEventArgs Provides event data for the TimePicker.SelectedTimeChanged
event.
TimePickerSelectedValueChangedEventArgs

TimePickerValueChangedEventArgs
TimePickerValueChangedEventArgs Provides event data for the TimePicker.TimeChanged event.
TimePickerValueChangedEventArgs

ToggleMenuFlyoutItem ToggleMenuFlyoutItem
ToggleMenuFlyoutItem Represents an item in a MenuFlyout that a user can change
between two states, checked or unchecked.

ToggleSplitButton ToggleSplitButton
ToggleSplitButton Represents a button with two parts that can be invoked
separately. One part behaves like a toggle button and the
other part invokes a flyout.

ToggleSplitButtonAutomationPeer
ToggleSplitButtonAutomationPeer Exposes ToggleSplitButton types to Microsoft UI Automation.
ToggleSplitButtonAutomationPeer

ToggleSplitButtonIsCheckedChangedEventArgs
ToggleSplitButtonIsCheckedChangedEventArgs Provides event data for the
ToggleSplitButton.IsCheckedChanged event.
ToggleSplitButtonIsCheckedChangedEventArgs

ToggleSwitch ToggleSwitch ToggleSwitch


Represents a switch that can be toggled between two states.

ToolTip ToolTip ToolTip


Represents a control that creates a pop-up window that
displays information for an element in the UI.

ToolTipService ToolTipService ToolTipService


Represents a service that provides static methods to display a
ToolTip.

TreeView TreeView TreeView


Represents a hierarchical list with expanding and collapsing
nodes that contain nested items.

TreeViewCollapsedEventArgs
TreeViewCollapsedEventArgs Provides event data for the TreeView.Collapsed event.
TreeViewCollapsedEventArgs

TreeViewDragItemsCompletedEventArgs
TreeViewDragItemsCompletedEventArgs Provides event data for the TreeView.DragItemsCompleted
event.
TreeViewDragItemsCompletedEventArgs

TreeViewDragItemsStartingEventArgs
TreeViewDragItemsStartingEventArgs Provides event data for the TreeView.DragItemsStarting event.
TreeViewDragItemsStartingEventArgs
TreeViewExpandingEventArgs
TreeViewExpandingEventArgs Provides event data for the TreeView.Expanding event.
TreeViewExpandingEventArgs

TreeViewItem TreeViewItem TreeViewItem


Represents the container for an item in a TreeView control.

TreeViewItemInvokedEventArgs
TreeViewItemInvokedEventArgs Provides event data for the TreeView.ItemInvoked event.
TreeViewItemInvokedEventArgs

TreeViewItemTemplateSettings
TreeViewItemTemplateSettings Provides calculated values that can be referenced as
TemplatedParent sources when defining templates for a
TreeViewItemTemplateSettings
TreeViewItem control. Not intended for general use.

TreeViewList TreeViewList TreeViewList


Represents a flattened list of tree view items so that
operations such as keyboard navigation and drag-and-drop
can be inherited from ListView.

TreeViewNode TreeViewNode TreeViewNode


Represents a node in a TreeView control.

UIElementCollection UIElementCollection
UIElementCollection Represents an ordered collection of UIElement objects.

UserControl UserControl UserControl


Provides the base class for defining a new control that
encapsulates related existing controls and provides its own
logic.

VariableSizedWrapGrid VariableSizedWrapGrid
VariableSizedWrapGrid Provides a grid-style layout panel where each tile/cell can be
variable size based on content.

Viewbox Viewbox Viewbox


Defines a content decorator that can stretch and scale a single
child to fill the available space.

VirtualizingPanel VirtualizingPanel
VirtualizingPanel Provides a framework for Panel elements that virtualize their
visual children.

VirtualizingStackPanel VirtualizingStackPanel
VirtualizingStackPanel Arranges and virtualizes content on a single line that is
oriented either horizontally or vertically. Can only be used to
display items in an ItemsControl.

WebView WebView WebView


Provides a control that hosts HTML content in an app.
WebViewBrush WebViewBrush WebViewBrush
Provides a brush that renders the content that is currently
hosted in a WebView control.

WebViewContentLoadingEventArgs
WebViewContentLoadingEventArgs Provides data for the WebView.ContentLoading event.
WebViewContentLoadingEventArgs

WebViewDeferredPermissionRequest
WebViewDeferredPermissionRequest Represents a deferred request for permissions in a WebView.
WebViewDeferredPermissionRequest

WebViewDOMContentLoadedEventArgs
WebViewDOMContentLoadedEventArgs Provides data for the DOMContentLoaded event.
WebViewDOMContentLoadedEventArgs

WebViewLongRunningScriptDetectedEventArgs
WebViewLongRunningScriptDetectedEventArgs Provides data for the WebView.LongRunningScriptDetected
event.
WebViewLongRunningScriptDetectedEventArgs

WebViewNavigationCompletedEventArgs
WebViewNavigationCompletedEventArgs Provides data for the WebView.NavigationCompleted and
FrameNavigationCompleted events.
WebViewNavigationCompletedEventArgs

WebViewNavigationFailedEventArgs
WebViewNavigationFailedEventArgs Provides data for the WebView.NavigationFailed event.
WebViewNavigationFailedEventArgs

WebViewNavigationStartingEventArgs
WebViewNavigationStartingEventArgs Provides data for the WebView.NavigationStarting and
FrameNavigationStarting events.
WebViewNavigationStartingEventArgs

WebViewNewWindowRequestedEventArgs
WebViewNewWindowRequestedEventArgs Provides data for the WebView.NewWindowRequested event.
WebViewNewWindowRequestedEventArgs

WebViewPermissionRequest
WebViewPermissionRequest Represents a request for permissions in a WebView.
WebViewPermissionRequest

WebViewPermissionRequestedEventArgs
WebViewPermissionRequestedEventArgs Provides event data for the WebView.PermissionRequested
event.
WebViewPermissionRequestedEventArgs

WebViewSeparateProcessLostEventArgs
WebViewSeparateProcessLostEventArgs Provides event data for the WebView.SeparateProcessLost
event.
WebViewSeparateProcessLostEventArgs

WebViewSettings WebViewSettings
WebViewSettings Defines properties that enable or disable WebView features.
WebViewUnsupportedUriSchemeIdentifiedEventArgs
WebViewUnsupportedUriSchemeIdentifiedEventArgs Provides data for the
WebView.UnsupportedUriSchemeIdentified event.
WebViewUnsupportedUriSchemeIdentifiedEventArgs

WebViewUnviewableContentIdentifiedEventArgs
WebViewUnviewableContentIdentifiedEventArgs Provides data for the WebView.UnviewableContentIdentified
event.
WebViewUnviewableContentIdentifiedEventArgs

WebViewWebResourceRequestedEventArgs
WebViewWebResourceRequestedEventArgs Provides event data for the WebView.WebResourceRequested
event.
WebViewWebResourceRequestedEventArgs

WrapGrid WrapGrid WrapGrid


Positions child elements sequentially from left to right or top
to bottom. When elements extend beyond the container edge,
elements are positioned in the next row or column. Can only
be used to display items in an ItemsControl. See Remarks.

Interfaces
ICommandBarElement ICommandBarElement
ICommandBarElement Defines the compact view for command bar elements.

ICommandBarElement2 ICommandBarElement2
ICommandBarElement2 Defines members to manage the command bar overflow
menu.

IInsertionPanel IInsertionPanel
IInsertionPanel Provides methods to let an item be inserted between other
items in a drag-and-drop operation.

IItemContainerMapping IItemContainerMapping
IItemContainerMapping Provides methods that let an ItemsControl map data items to
UI containers.

INavigate INavigate INavigate


Defines the navigation action for navigation hosts and
navigation initiators.

IScrollAnchorProvider IScrollAnchorProvider
IScrollAnchorProvider Specifies a contract for a scrolling control that supports scroll
anchoring.

ISemanticZoomInformation
ISemanticZoomInformation Communicates the info needed for a view to serve as one of
the two possible views (ZoomedOutView or ZoomedInView )
ISemanticZoomInformation
of a SemanticZoom.

Enums
AppBarClosedDisplayMode
AppBarClosedDisplayMode Defines constants that specify whether icon buttons are
displayed when an app bar is not completely open.
AppBarClosedDisplayMode

AutoSuggestionBoxTextChangeReason
AutoSuggestionBoxTextChangeReason Values used to indicate the reason for the text changing in the
AutoSuggestBox.
AutoSuggestionBoxTextChangeReason

BackgroundSizing BackgroundSizing
BackgroundSizing Defines constants that specify how far an element's
background extends in relation to the element's border.

CalendarViewDisplayMode
CalendarViewDisplayMode Defines constants that specify which view of the calendar is
shown.
CalendarViewDisplayMode

CalendarViewSelectionMode
CalendarViewSelectionMode Defines constants that specify what kind of date selections are
allowed in the calendar.
CalendarViewSelectionMode

CandidateWindowAlignment
CandidateWindowAlignment Defines constants that specify how the Input Method Editor
(IME) window for text predictions is aligned with a text edit
CandidateWindowAlignment
control.

CharacterCasing CharacterCasing
CharacterCasing Defines constants that specify how a control modifies the case
of characters as they are typed.

ClickMode ClickMode ClickMode


Specifies when the Click event should be raised for a control.

ColorPickerHsvChannel ColorPickerHsvChannel
ColorPickerHsvChannel Defines contstants that specify which Hue-Saturation-Value-
Alpha component a slider in a ColorPicker controls.

ColorSpectrumComponents
ColorSpectrumComponents Defines constants that specify how the Hue-Saturation-Value
(HSV) color components are mapped onto the ColorSpectrum.
ColorSpectrumComponents

ColorSpectrumShape ColorSpectrumShape
ColorSpectrumShape Defines constants that specify how the ColorSpectrum control
is shown.

ComboBoxSelectionChangedTrigger
ComboBoxSelectionChangedTrigger Defines constants that specify what action causes a
SelectionChanged event to occur.
ComboBoxSelectionChangedTrigger

CommandBarDefaultLabelPosition
CommandBarDefaultLabelPosition Defines constants that specify the placement and visibility of
AppBarButton labels in a CommandBar.
CommandBarDefaultLabelPosition
CommandBarDynamicOverflowAction
CommandBarDynamicOverflowAction Defines constants that specify whether items were added to or
removed from the CommandBar overflow menu.
CommandBarDynamicOverflowAction

CommandBarLabelPosition
CommandBarLabelPosition Defines constants that specify the placement and visibility of
an app bar button's label.
CommandBarLabelPosition

CommandBarOverflowButtonVisibility
CommandBarOverflowButtonVisibility Defines constants that specify when a command bar's overflow
button is shown.
CommandBarOverflowButtonVisibility

ContentDialogButton ContentDialogButton
ContentDialogButton Defines constants that specify the default button on a content
dialog.

ContentDialogPlacement ContentDialogPlacement
ContentDialogPlacement Defines constants that specify where in the XAML visual tree a
ContentDialog is rooted.

ContentDialogResult ContentDialogResult
ContentDialogResult Specifies identifiers to indicate the return value of a
ContentDialog

ContentLinkChangeKind ContentLinkChangeKind
ContentLinkChangeKind Defines constants that specify what kind of change is being
made to a ContentLink.

DisabledFormattingAccelerators
DisabledFormattingAccelerators Defines constants that specify which keyboard shortcuts for
formatting are disabled in a RichEditBox.
DisabledFormattingAccelerators

HandwritingPanelPlacementAlignment
HandwritingPanelPlacementAlignment Defines constants that specify where the handwriting view
panel is anchored to the control.
HandwritingPanelPlacementAlignment

IncrementalLoadingTrigger
IncrementalLoadingTrigger Defines constants that specify list view incremental loading
behavior (IncrementalLoadingTrigger property).
IncrementalLoadingTrigger

InkToolbarButtonFlyoutPlacement
InkToolbarButtonFlyoutPlacement Specifies the location of the ink stroke configuration flyout
relative to the InkToolbar.
InkToolbarButtonFlyoutPlacement

InkToolbarFlyoutItemKind
InkToolbarFlyoutItemKind Specifies the types of buttons that can be used on an
InkToolbar flyout.
InkToolbarFlyoutItemKind

InkToolbarInitialControls
InkToolbarInitialControls Defines constants that specify the built-in buttons
(InitialControls ) added to an InkToolbar at initialization.
InkToolbarInitialControls
InkToolbarMenuKind InkToolbarMenuKind
InkToolbarMenuKind Specifies the types of menu buttons that can be added to an
InkToolbar.

InkToolbarStencilKind InkToolbarStencilKind
InkToolbarStencilKind Specifies the types of InkToolbar stencils.

InkToolbarToggle InkToolbarToggle
InkToolbarToggle Defines constants that specify the button types exposed in the
toggle button group of an InkToolbar.

InkToolbarTool InkToolbarTool InkToolbarTool


Defines constants that specify the type of built-in or custom
tool associated with the InkToolbarToolButton.

ItemsUpdatingScrollMode
ItemsUpdatingScrollMode Defines constants that specify the scrolling behavior of items
while updating.
ItemsUpdatingScrollMode

LightDismissOverlayMode
LightDismissOverlayMode Defines constants that specify whether the area outside of a
light-dismiss UI is darkened.
LightDismissOverlayMode

ListPickerFlyoutSelectionMode
ListPickerFlyoutSelectionMode Defines constants that specify the selection mode of a
ListPickerFlyout.
ListPickerFlyoutSelectionMode

ListViewReorderMode ListViewReorderMode
ListViewReorderMode Defines constants that specify the reorder mode of a ListView
or GridView.

ListViewSelectionMode ListViewSelectionMode
ListViewSelectionMode Defines constants that specify the selection mode of a ListView
or GridView.

NavigationViewBackButtonVisible
NavigationViewBackButtonVisible Defines constants that specify whether the back button is
visible in NavigationView.
NavigationViewBackButtonVisible

NavigationViewDisplayMode
NavigationViewDisplayMode Defines constants that specify how the pane is shown in a
NavigationView.
NavigationViewDisplayMode

NavigationViewOverflowLabelMode
NavigationViewOverflowLabelMode Defines constants that specify the label for the overflow
button in a NavigationView.
NavigationViewOverflowLabelMode

NavigationViewPaneDisplayMode
NavigationViewPaneDisplayMode Defines constants that specify how and where the
NavigationView pane is shown.
NavigationViewPaneDisplayMode
NavigationViewSelectionFollowsFocus
NavigationViewSelectionFollowsFocus Defines constants that specify whether item selection changes
when keyboard focus changes in a NavigationView.
NavigationViewSelectionFollowsFocus

NavigationViewShoulderNavigationEnabled
NavigationViewShoulderNavigationEnabled Defines constants that specify when gamepad bumpers can be
used to navigate the top-level navigation items in a
NavigationViewShoulderNavigationEnabled
NavigationView.

Orientation Orientation Orientation


Defines constants that specify the different orientations that a
control or layout can have.

PanelScrollingDirection
PanelScrollingDirection Defines constants that specify the direction that a panel is
scrolling.
PanelScrollingDirection

ParallaxSourceOffsetKind
ParallaxSourceOffsetKind Defines constants that specify how the source offset values of
a ParallaxView are interpreted.
ParallaxSourceOffsetKind

PasswordRevealMode PasswordRevealMode
PasswordRevealMode Defines constants that specify the password reveal behavior of
a PasswordBox.

PivotHeaderFocusVisualPlacement
PivotHeaderFocusVisualPlacement Defines constants that specify the style of focus visual used for
pivot header items.
PivotHeaderFocusVisualPlacement

PivotSlideInAnimationGroup
PivotSlideInAnimationGroup Defines constants that specify the different slide-in animation
groups that Pivot elements can belong to.
PivotSlideInAnimationGroup

RefreshPullDirection RefreshPullDirection
RefreshPullDirection Defines constants that specify the direction to pull a
RefreshContainer to initiate a refresh.

RefreshVisualizerOrientation
RefreshVisualizerOrientation Defines constants that specify the orientation of a
RefreshVisualizer.
RefreshVisualizerOrientation

RefreshVisualizerState RefreshVisualizerState
RefreshVisualizerState Defines constants that specify the state of a RefreshVisualizer

RequiresPointer RequiresPointer
RequiresPointer Defines constants that specify when an element requires a
mouse-like pointer behavior from a game pad.

RichEditClipboardFormat
RichEditClipboardFormat Defines constants that specify the format of text copied from a
RichEditBox.
RichEditClipboardFormat
ScrollBarVisibility ScrollBarVisibility
ScrollBarVisibility Defines constants that specify the visibility of a scrollbar within
a ScrollViewer control.

ScrollIntoViewAlignment
ScrollIntoViewAlignment Defines constants that describe how an item that is
programmatically scrolled into view aligns with the visible area.
ScrollIntoViewAlignment

ScrollMode ScrollMode ScrollMode


Defines constants that specify scrolling behavior for
ScrollViewer and other parts involved in scrolling scenarios.

SelectionMode SelectionMode SelectionMode


Defines constants that specify the selection behavior for a
ListBox.

SnapPointsType SnapPointsType SnapPointsType


Defines constants that specify how panning snap points are
processed for gesture/manipulation input.

SplitViewDisplayMode SplitViewDisplayMode
SplitViewDisplayMode Defines constants that specify how the pane is shown in a
SplitView.

SplitViewPanePlacement SplitViewPanePlacement
SplitViewPanePlacement Defines constants that specify whether the pane is to the left
or right of the content in a SplitView.

StretchDirection StretchDirection
StretchDirection Defines constants that specify the direction that content is
scaled.

SwipeBehaviorOnInvoked SwipeBehaviorOnInvoked
SwipeBehaviorOnInvoked Defines constants that specify how a SwipeControl behaves
after a command is invoked.

SwipeMode SwipeMode SwipeMode


Defines constants that specify the effect of a swipe interaction.

Symbol Symbol Symbol


Defines constants that specify a glyph from the Segoe MDL2
Assets font to use as the content of a SymbolIcon.

TreeViewSelectionMode TreeViewSelectionMode
TreeViewSelectionMode Defines constants that specify the selection behavior for a
TreeView instance.

VirtualizationMode VirtualizationMode
VirtualizationMode Defines constants that specify how VirtualizingStackPanel
manages item containers for its child items.
WebViewExecutionMode WebViewExecutionMode
WebViewExecutionMode Defines constants that specify whether WebView hosts HTML
content on the UI thread or on a non-UI thread.

WebViewPermissionState WebViewPermissionState
WebViewPermissionState Defines constants that specify the state of a
WebView.PermissionRequested event.

WebViewPermissionType WebViewPermissionType
WebViewPermissionType Defines constants the specify the type of permission requested
in a WebView.

ZoomMode ZoomMode ZoomMode


Defines constants that specify the current mode for zoom
behavior in the ScrollViewer content.

Delegates
BackClickEventHandler BackClickEventHandler
BackClickEventHandler Represents the method that will handle a BackClick event.

CalendarViewDayItemChangingEventHandler
CalendarViewDayItemChangingEventHandler Represents the method that will handle the
CalendarViewDayItemChanging event.
CalendarViewDayItemChangingEventHandler

CleanUpVirtualizedItemEventHandler
CleanUpVirtualizedItemEventHandler Represents the method that handles the
CleanUpVirtualizedItemEvent attached event.
CleanUpVirtualizedItemEventHandler

ContextMenuOpeningEventHandler
ContextMenuOpeningEventHandler Represents the method that will handle the
ContextMenuOpening event that exists on several text-
ContextMenuOpeningEventHandler
related UI elements.

DragItemsStartingEventHandler
DragItemsStartingEventHandler Represents the method that will handle the DragItemsStarting
event.
DragItemsStartingEventHandler

HubSectionHeaderClickEventHandler
HubSectionHeaderClickEventHandler Represents the method that will handle a
Hub.SectionHeaderClick event.
HubSectionHeaderClickEventHandler

ItemClickEventHandler ItemClickEventHandler
ItemClickEventHandler Represents the method that will handle an ItemClick event.

ListViewItemToKeyHandler
ListViewItemToKeyHandler Represents the method that will handle callback for the
GetRelativeScrollPosition method.
ListViewItemToKeyHandler
ListViewKeyToItemHandler
ListViewKeyToItemHandler Represents the asynchronous method that will handle callback
for the SetRelativeScrollPositionAsync method.
ListViewKeyToItemHandler

NotifyEventHandler NotifyEventHandler
NotifyEventHandler Represents the method that will handle the ScriptNotify event.

SectionsInViewChangedEventHandler
SectionsInViewChangedEventHandler Represents the method that will handle a
SectionsInViewChanged event.
SectionsInViewChangedEventHandler

SelectionChangedEventHandler
SelectionChangedEventHandler Represents the method that will handle the SelectionChanged
event.
SelectionChangedEventHandler

SemanticZoomViewChangedEventHandler
SemanticZoomViewChangedEventHandler Represents the method that will handle the
ViewChangeStarted and ViewChangeCompleted events.
SemanticZoomViewChangedEventHandler

TextChangedEventHandler
TextChangedEventHandler Represents the method that will handle the TextChanged
event.
TextChangedEventHandler

TextControlPasteEventHandler
TextControlPasteEventHandler Represents the method that will handle a Paste event.
TextControlPasteEventHandler

WebViewNavigationFailedEventHandler
WebViewNavigationFailedEventHandler Represents the method that will handle the
WebView.NavigationFailed event.
WebViewNavigationFailedEventHandler
AnchorRequestedEventArgs AnchorRequestedEventArgs
AnchorRequestedEventArgs Class
Provides data for the ScrollViewer.AnchorRequested event.

D eclaration
public : sealed class AnchorRequestedEventArgs : IAnchorRequestedEventArgs
struct winrt::Windows::UI::Xaml::Controls::AnchorRequestedEventArgs : IAnchorRequestedEventArgs
public sealed class AnchorRequestedEventArgs : IAnchorRequestedEventArgs

I nheritance H ierarchy
None

Properties
Anchor
Anchor
Anchor

Gets or sets the anchor element to use when performing scroll anchoring.

AnchorCandidates
AnchorCandidates
AnchorCandidates

Gets the set of anchor candidates that are currently registered with the scrolling control (e.g. ScrollViewer).
AnchorRequestedEventArgs.Anchor AnchorRequested
EventArgs.Anchor AnchorRequestedEventArgs.Anchor
I n this Article
Edit
Gets or sets the anchor element to use when performing scroll anchoring.
public : UIElement Anchor { get; set; }
UIElement Anchor();

void Anchor(UIElement anchor);


public UIElement Anchor { get; set; }

Returns
UIElement
The UIElement to use as the CurrentAnchor. The default is null.

Remarks
The element must be a descendent of the scrolling control.
AnchorRequestedEventArgs.AnchorCandidates Anchor
RequestedEventArgs.AnchorCandidates Anchor
RequestedEventArgs.AnchorCandidates
I n this Article
Edit
Gets the set of anchor candidates that are currently registered with the scrolling control (e.g. ScrollViewer).
public : IVector<UIElement> AnchorCandidates { get; }
IVector<UIElement> AnchorCandidates();
public IList<UIElement> AnchorCandidates { get; }

Returns
IList<UIElement>
A list of UIElement anchor candidates.
AppBar AppBar AppBar Class
Represents the container control that holds app UI components for commanding and experiences. For Windows 10,
see Remarks.

D eclaration
public : class AppBar : ContentControl, IAppBar, IAppBar2, IAppBar3, IAppBar4, IAppBarOverrides,
IAppBarOverrides3
struct winrt::Windows::UI::Xaml::Controls::AppBar : ContentControl, IAppBar, IAppBar2, IAppBar3,
IAppBar4, IAppBarOverrides, IAppBarOverrides3
public class AppBar : ContentControl, IAppBar, IAppBar2, IAppBar3, IAppBar4, IAppBarOverrides,
IAppBarOverrides3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
Im p o rt a nt

You should use the AppBar only when you are upgrading a Universal Windows 8 app that uses the AppBar, and need
to minimize changes. For new apps in Windows 10, we recommend using the CommandBar control instead.
An app bar is a UI element that's typically used to present commands and tools to the user, but can also be used for
navigation. An app bar can appear at the top of the page, at the bottom of the page, or both. By default, its shown in a
minimal state. Its content is shown or hidden when the user presses the ellipsis [••• ], or performs a right-click that is
not otherwise handled by the app.
Here's an app bar in it's minimal state.

Here's the app bar when it's open.

You can open and close the app bar programmatically by setting the IsOpen property. You can use the Opening,
Opened, Closing, and Closed events to respond to the app bar being opened or closed.
By default, the app bar is dismissed (closed) when the user interacts with the app anywhere outside of the app bar.
Closing the app bar this way is called light dismiss. You can control how the app bar is dismissed by setting the IsSticky
property. When the app bar is sticky, it's not closed by a light dismiss gesture. The app bar remains visible until the user
right clicks or presses the ellipsis [••• ].
To add an app bar in Extensible Application Markup Language (XAML ), you assign an AppBar control to a Page 's
TopAppBar or BottomAppBar property. A single app bar can be shared across multiple pages. You can add and remove
commands programmatically based on the page context.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the AppBar control.

R ES O U R CE K EY D ES CR IPTIO N

AppBarBackground Background color at rest

AppBarForeground Text color at rest

AppBarHighContrastBorder Border color for high-contrast

AppBarEllipsisButtonBackground Background color of ellipsis at rest

AppBarEllipsisButtonBackgroundPointerOver Background color of ellipsis on hover

AppBarEllipsisButtonBackgroundPressed Background color of ellipsis when pressed

AppBarEllipsisButtonBackgroundDisabled Background color of ellipsis when disabled

AppBarEllipsisButtonForeground Foreground color of ellipsis at rest

AppBarEllipsisButtonForegroundPointerOver Foreground color of ellipsis on hover

AppBarEllipsisButtonForegroundPressed Foreground color of ellipsis when pressed

AppBarEllipsisButtonForegroundDisabled Foreground color of ellipsis when disabled

AppBarEllipsisButtonBorderBrush Border color of ellipsis at rest

AppBarEllipsisButtonBorderBrushPointerOver Border color of ellipsis on hover

AppBarEllipsisButtonBorderBrushPressed Border color of ellipsis when pressed

AppBarEllipsisButtonBorderBrushDisabled Border color of ellipsis when disabled

Constructors
AppBar()
AppBar()
AppBar()
Initializes a new instance of the AppBar class.

Properties
ClosedDisplayMode
ClosedDisplayMode
ClosedDisplayMode

Gets or sets a value that indicates whether icon buttons are displayed when the app bar is not completely open.

ClosedDisplayModeProperty
ClosedDisplayModeProperty
ClosedDisplayModeProperty

Identifies the ClosedDisplayMode dependency property.

IsOpen
IsOpen
IsOpen

Gets or sets a value that indicates whether the AppBar is open.

IsOpenProperty
IsOpenProperty
IsOpenProperty

Identifies the IsOpen dependency property.

IsSticky
IsSticky
IsSticky

Gets or sets a value that indicates whether the AppBar does not close on light dismiss.

IsStickyProperty
IsStickyProperty
IsStickyProperty

Identifies the IsSticky dependency property.

LightDismissOverlayMode
LightDismissOverlayMode
LightDismissOverlayMode

Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.
LightDismissOverlayModeProperty
LightDismissOverlayModeProperty
LightDismissOverlayModeProperty

Identifies the LightDismissOverlayMode dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension
sources when defining templates for an AppBar control.

Methods
OnClosed(Object)
OnClosed(Object)
OnClosed(Object)

Invoked when the AppBar changes from visible to hidden.

OnClosing(Object)
OnClosing(Object)
OnClosing(Object)

Invoked when the AppBar starts to change from visible to hidden.

OnOpened(Object)
OnOpened(Object)
OnOpened(Object)

Invoked when the AppBar changes from hidden to visible, or is first displayed.

OnOpening(Object)
OnOpening(Object)
OnOpening(Object)

Invoked when the AppBar starts to change from hidden to visible, or starts to be first displayed.

Events
Closed
Closed
Closed

Occurs when the AppBar changes from visible to hidden.


Closing
Closing
Closing

Occurs when the AppBar starts to change from visible to hidden.

Opened
Opened
Opened

Occurs when the AppBar changes from hidden to visible.

Opening
Opening
Opening

Occurs when the AppBar starts to change from hidden to visible.

See Also
AppBar AppBar AppBar
I n this Article
Edit
Initializes a new instance of the AppBar class.

public : AppBar()
AppBar() const;
public AppBar()
AppBar.Closed AppBar.Closed AppBar.Closed
I n this Article
Edit
Occurs when the AppBar changes from visible to hidden.

public : event EventHandler<Platform::Object> Closed


// Register
event_token Closed(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void Closed(event_token const& cookie) const;

// Revoke with event_revoker


Closed_revoker Closed(auto_revoke_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> Closed

<AppBar Closed="eventhandler"/>

Remarks
You can respond to the app bar being dismissed by handling the Closed event.
See Quickstart: Adding app bars
Also
AppBar.ClosedDisplayMode AppBar.ClosedDisplayMode
AppBar.ClosedDisplayMode
I n this Article
Edit
Gets or sets a value that indicates whether icon buttons are displayed when the app bar is not completely open.
public : AppBarClosedDisplayMode ClosedDisplayMode { get; set; }
AppBarClosedDisplayMode ClosedDisplayMode();

void ClosedDisplayMode(AppBarClosedDisplayMode closeddisplaymode);


public AppBarClosedDisplayMode ClosedDisplayMode { get; set; }

<AppBar ClosedDisplayMode="Compact"/>
-or-
<AppBar ClosedDisplayMode="Minimal"/>

Returns
AppBarClosedDisplayMode
A value that indicates whether icon buttons are displayed when the app bar is not completely open.
AppBar.ClosedDisplayModeProperty AppBar.Closed
DisplayModeProperty AppBar.ClosedDisplayMode
Property
I n this Article
Edit
Identifies the ClosedDisplayMode dependency property.
public : static DependencyProperty ClosedDisplayModeProperty { get; }
static DependencyProperty ClosedDisplayModeProperty();
public static DependencyProperty ClosedDisplayModeProperty { get; }

Returns
DependencyProperty
The identifier for the ClosedDisplayMode dependency property.
AppBar.Closing AppBar.Closing AppBar.Closing
I n this Article
Edit
Occurs when the AppBar starts to change from visible to hidden.

public : event EventHandler<Platform::Object> Closing


// Register
event_token Closing(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void Closing(event_token const& cookie) const;

// Revoke with event_revoker


Closing_revoker Closing(auto_revoke_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> Closing

<AppBar Closing="eventhandler"/>
AppBar.IsOpen AppBar.IsOpen AppBar.IsOpen
I n this Article
Edit
Gets or sets a value that indicates whether the AppBar is open.

public : Platform::Boolean IsOpen { get; set; }


bool IsOpen();

void IsOpen(bool isopen);


public bool IsOpen { get; set; }

<AppBar IsOpen="bool"/>

Returns
bool
true if the app bar is open; otherwise, false.

Examples
<AppBar IsOpen="True">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource PreviousAppBarButtonStyle}"
Click="Button_Click"/>
<Button Style="{StaticResource NextAppBarButtonStyle}"
Click="Button_Click"/>
</StackPanel>
</Grid>
</AppBar>

Remarks
How the app bar is displayed when it's open depends on the ClosedDisplayMode property setting. For more info, see
App bar and command bar.
You can open and close the app bar programmatically by setting the IsOpen property. You can use the Opening,
Opened, Closing, and Closed events to respond to the app bar being opened or closed.
Notes for previous versions
Windows 8 Binding to the IsOpen property doesn't have the expected results because the PropertyChanged
notification doesn't occur when the property is set.

See Quickstart: Adding app bars


Also
AppBar.IsOpenProperty AppBar.IsOpenProperty AppBar.
IsOpenProperty
I n this Article
Edit
Identifies the IsOpen dependency property.
public : static DependencyProperty IsOpenProperty { get; }
static DependencyProperty IsOpenProperty();
public static DependencyProperty IsOpenProperty { get; }

Returns
DependencyProperty
The identifier for the IsOpen dependency property.
AppBar.IsSticky AppBar.IsSticky AppBar.IsSticky
I n this Article
Edit
Gets or sets a value that indicates whether the AppBar does not close on light dismiss.

public : Platform::Boolean IsSticky { get; set; }


bool IsSticky();

void IsSticky(bool issticky);


public bool IsSticky { get; set; }

<AppBar IsSticky="bool" .../>

Returns
bool
true if the AppBar does not close on light dismiss. false if the AppBar is hidden on light dismiss.

Examples
<AppBar IsSticky="True">
<Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<Button Style="{StaticResource HelpAppBarButtonStyle}"
Click="Button_Click"/>
</StackPanel>
</Grid>
</AppBar>

Remarks
By default, app bars are dismissed when the user interacts with your app anywhere outside of the app bar. This is called
light dismiss. To keep commands visible, you can change the dismissal mode by setting the IsSticky property to true.
When an app bar is sticky, it's dismissed only when the user right-clicks, presses Windows+Z, or swipes from the top
or bottom edge of the screen.
See Quickstart: Adding app bars
Also
AppBar.IsStickyProperty AppBar.IsStickyProperty AppBar.
IsStickyProperty
I n this Article
Edit
Identifies the IsSticky dependency property.
public : static DependencyProperty IsStickyProperty { get; }
static DependencyProperty IsStickyProperty();
public static DependencyProperty IsStickyProperty { get; }

Returns
DependencyProperty
The identifier for the IsSticky dependency property.
AppBar.LightDismissOverlayMode AppBar.LightDismiss
OverlayMode AppBar.LightDismissOverlayMode
I n this Article
Edit
Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.
public : LightDismissOverlayMode LightDismissOverlayMode { get; set; }
LightDismissOverlayMode LightDismissOverlayMode();

void LightDismissOverlayMode(LightDismissOverlayMode lightdismissoverlaymode);


public LightDismissOverlayMode LightDismissOverlayMode { get; set; }

<appBar LightDismissOverlayMode="lightDismissOverlayModeMemberName" />

Returns
LightDismissOverlayMode
A value of the enumeration that specifies whether the area outside of a light-dismiss UI is darkened. The default is
Auto.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Transient UI, such as a MenuFlyout or secondary menu in a command bar, closes when you click or tap outside of it.
This is called light-dismiss. "Overlay" refers to the area outside of a light-dismiss UI.
By default, the "overlay" is darkened on the Xbox, and not darkened on other devices families. You can set
LightDismissOverlayMode to On to make your app darken the "overlay" area on all device families, or set it to Off to
not darken the "overlay" area on all device families.
Version compatibility
The LightDismissOverlayMode property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded"/>
private void CommandBar_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBar",
"LightDismissOverlayMode"))
{
commandBar1.LightDismissOverlayMode = LightDismissOverlayMode.On;
}
}
AppBar.LightDismissOverlayModeProperty AppBar.Light
DismissOverlayModeProperty AppBar.LightDismiss
OverlayModeProperty
I n this Article
Edit
Identifies the LightDismissOverlayMode dependency property.
public : static DependencyProperty LightDismissOverlayModeProperty { get; }
static DependencyProperty LightDismissOverlayModeProperty();
public static DependencyProperty LightDismissOverlayModeProperty { get; }

Returns
DependencyProperty
The identifier for the LightDismissOverlayMode dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AppBar.OnClosed AppBar.OnClosed AppBar.OnClosed
I n this Article
Edit
Invoked when the AppBar changes from visible to hidden.

protected : virtual void OnClosed(Platform::Object e)


virtual void OnClosed(winrt::Windows::Foundation::IInspectable e) const;
protected virtual void OnClosed(Object e)

Parameters
e Object
Event data for the event.
AppBar.OnClosing AppBar.OnClosing AppBar.OnClosing
I n this Article
Edit
Invoked when the AppBar starts to change from visible to hidden.

protected : virtual void OnClosing(Platform::Object e)


virtual void OnClosing(winrt::Windows::Foundation::IInspectable e) const;
protected virtual void OnClosing(Object e)

Parameters
e Object
Event data for the event.
AppBar.OnOpened AppBar.OnOpened AppBar.On
Opened
I n this Article
Edit
Invoked when the AppBar changes from hidden to visible, or is first displayed.
protected : virtual void OnOpened(Platform::Object e)
virtual void OnOpened(winrt::Windows::Foundation::IInspectable e) const;
protected virtual void OnOpened(Object e)

Parameters
e Object
Event data for the event.
AppBar.OnOpening AppBar.OnOpening AppBar.On
Opening
I n this Article
Edit
Invoked when the AppBar starts to change from hidden to visible, or starts to be first displayed.
protected : virtual void OnOpening(Platform::Object e)
virtual void OnOpening(winrt::Windows::Foundation::IInspectable e) const;
protected virtual void OnOpening(Object e)

Parameters
e Object
Event data for the event.
AppBar.Opened AppBar.Opened AppBar.Opened
I n this Article
Edit
Occurs when the AppBar changes from hidden to visible.

public : event EventHandler<Platform::Object> Opened


// Register
event_token Opened(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void Opened(event_token const& cookie) const;

// Revoke with event_revoker


Opened_revoker Opened(auto_revoke_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> Opened

<AppBar Opened="eventhandler"/>

Remarks
You can respond to the app bar being opened by handling the Opened event.
See Quickstart: Adding app bars
Also
AppBar.Opening AppBar.Opening AppBar.Opening
I n this Article
Edit
Occurs when the AppBar starts to change from hidden to visible.

public : event EventHandler<Platform::Object> Opening


// Register
event_token Opening(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void Opening(event_token const& cookie) const;

// Revoke with event_revoker


Opening_revoker Opening(auto_revoke_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> Opening

<AppBar Opening="eventhandler"/>
AppBar.TemplateSettings AppBar.TemplateSettings App
Bar.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension sources
when defining templates for an AppBar control.
public : AppBarTemplateSettings TemplateSettings { get; }
AppBarTemplateSettings TemplateSettings();
public AppBarTemplateSettings TemplateSettings { get; }

Returns
AppBarTemplateSettings
An object that provides calculated values for templates.
AppBarButton AppBarButton AppBarButton Class
Represents a templated button control to be displayed in an AppBar.

D eclaration
public : class AppBarButton : Button, IAppBarButton, IAppBarButton3, IAppBarButton4,
IAppBarButton5, ICommandBarElement, ICommandBarElement2
struct winrt::Windows::UI::Xaml::Controls::AppBarButton : Button, IAppBarButton, IAppBarButton3,
IAppBarButton4, IAppBarButton5, ICommandBarElement, ICommandBarElement2
public class AppBarButton : Button, IAppBarButton, IAppBarButton3, IAppBarButton4,
IAppBarButton5, ICommandBarElement, ICommandBarElement2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
Button

Remarks
App bar buttons differ from standard buttons in several ways:
The default appearance is a semi-transparent rectangle without a border.
You use the Label and Icon properties to set the content instead of the Content property. The Content property is
ignored if the Icon is set.
The button has the IsCompact property to control its size.
AppBarButton has two sizes; normal and compact. By default, it's shown with a text label and full padding. When the
IsCompact property is set to true, the text label is hidden and the height of the button is reduced.
Here are the same commands shown in their normal state, and then in their compact state.

When used in the CommandBar control as part of the PrimaryCommands collection, the CommandBar sets the
IsCompact property automatically as the control opens and closes. If you use an app bar button elsewhere, like in the
Content of a CommandBar, in an AppBar, or the app canvas, you need to set the IsCompact property appropriately in
your code. When used outside of an app bar, Windows guidelines indicate that the button should always be in its
compact state. You should also include a ToolTip to display the text label.
You use the Label and Icon properties to define the content of the app bar buttons. Set the Label property to a string to
specify the text label. It’s shown by default, and is hidden when the button is in its compact state, so you also need to
define a meaningful icon. To define the app bar button icon, set the Icon property to an element derived from the
IconElement class. There are four kinds of icon elements provided:
FontIcon - the icon is based on a glyph from the specified font family.
BitmapIcon - the icon is based on a bitmap image file with the specified Uri.
PathIcon - the icon is based on Path data.
SymbolIcon - the icon is based on a glyph from the Segoe MDL2 Assets font as listed in the Symbol enumeration.
AppBarButton icons have a default font size of 20px.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the AppBarButton control.

R ES O U R CE K EY D ES CR IPTIO N

AppBarButtonBackground Background color at rest

AppBarButtonBackgroundPointerOver Background color on hover

AppBarButtonBackgroundPressed Background color when pressed

AppBarButtonBackgroundDisabled Background color when disabled

AppBarButtonForeground Foreground color at rest

AppBarButtonForegroundPointerOver Foreground color on hover

AppBarButtonForegroundPressed Foreground color when pressed

AppBarButtonForegroundDisabled Foreground color when disabled

AppBarButtonBorderBrush Border color at rest

AppBarButtonBorderBrushPointerOver Border color on hover

AppBarButtonBorderBrushPressed Border color when pressed

AppBarButtonBorderBrushDisabled Border color when disabled

Constructors
AppBarButton()
AppBarButton()
AppBarButton()

Initializes a new instance of the AppBarButton class.

Properties
DynamicOverflowOrder
DynamicOverflowOrder
DynamicOverflowOrder

Gets or sets the order in which this item is moved to the CommandBar overflow menu.

DynamicOverflowOrderProperty
DynamicOverflowOrderProperty
DynamicOverflowOrderProperty

Identifies the DynamicOverflowOrder dependency property.

Icon
Icon
Icon

Gets or sets the graphic content of the app bar button.

IconProperty
IconProperty
IconProperty

Identifies the Icon dependency property.

IsCompact
IsCompact
IsCompact

Gets or sets a value that indicates whether the button is shown with no label and reduced padding.

IsCompactProperty
IsCompactProperty
IsCompactProperty

Identifies the IsCompact dependency property.

IsInOverflow
IsInOverflow
IsInOverflow
Gets a value that indicates whether this item is in the overflow menu.

IsInOverflowProperty
IsInOverflowProperty
IsInOverflowProperty

Identifies the IsInOverflow dependency property.

KeyboardAcceleratorTextOverride
KeyboardAcceleratorTextOverride
KeyboardAcceleratorTextOverride

Gets or sets a string that overrides the default key combination string associated with a keyboard accelerator.

Example of a menu showing keyboard accelerators for various menu items

KeyboardAcceleratorTextOverrideProperty
KeyboardAcceleratorTextOverrideProperty
KeyboardAcceleratorTextOverrideProperty

Identifies the AppBarButton.KeyboardAcceleratorTextOverride dependency property.

Label
Label
Label

Gets or sets the text description displayed on the app bar button.

LabelPosition
LabelPosition
LabelPosition

Gets or sets a value that indicates the placement and visibility of the button's label.

LabelPositionProperty
LabelPositionProperty
LabelPositionProperty
Identifies the LabelPosition dependency property.

LabelProperty
LabelProperty
LabelProperty

Identifies the Label dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension
sources when defining templates for an AppBarButton control.

See Also
AppBarButton AppBarButton AppBarButton
I n this Article
Edit
Initializes a new instance of the AppBarButton class.

public : AppBarButton()
AppBarButton() const;
public AppBarButton()
AppBarButton.DynamicOverflowOrder AppBarButton.
DynamicOverflowOrder AppBarButton.DynamicOverflow
Order
I n this Article
Edit
Gets or sets the order in which this item is moved to the CommandBar overflow menu.
public : int DynamicOverflowOrder { get; set; }
int32_t DynamicOverflowOrder();

void DynamicOverflowOrder(int32_t dynamicoverfloworder);


public int DynamicOverflowOrder { get; set; }

<AppBarButton DynamicOverflowOrder="int" .../>

Returns
int
The order in which this item is moved to the overflow menu relative to other items.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
For more info and guidelines, see the App bar and command bar article.
Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default,
PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for
example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable
this behavior.
Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the
PrimaryCommands collection to SecondaryCommands.
This property has an effect only when this element is in the CommandBar.PrimaryCommands collection and
CommandBar.IsDynamicOverflowEnabled is true.
You can assign the same DynamicOverflowOrder value to more than one element. Elements with the same value move
in and out of the overflow area at the same time.
Version compatibility
The DynamicOverflowOrder property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607
(or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a
previous version.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
<AppBarButton x:Name="appBarButtonCut" Icon="Cut" Label="Cut"/>
<AppBarButton x:Name="appBarButtonCopy" Icon="Copy" Label="Copy"/>
<AppBarSeparator x:Name="appBarSeparator1"/>
<AppBarButton x:Name="appBarButtonPaste" Icon="Paste" Label="Paste"/>
</CommandBar>

private void CommandBar_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarButton",
"DynamicOverflowOrder"))
{
commandBar1.IsDynamicOverflowEnabled = true;
appBarButtonCut.DynamicOverflowOrder = 1;
appBarButtonCopy.DynamicOverflowOrder = 2;
appBarSeparator1.DynamicOverflowOrder = 2;
appBarButtonPaste.DynamicOverflowOrder = 3;
}
}
AppBarButton.DynamicOverflowOrderProperty AppBar
Button.DynamicOverflowOrderProperty AppBarButton.
DynamicOverflowOrderProperty
I n this Article
Edit
Identifies the DynamicOverflowOrder dependency property.
public : static DependencyProperty DynamicOverflowOrderProperty { get; }
static DependencyProperty DynamicOverflowOrderProperty();
public static DependencyProperty DynamicOverflowOrderProperty { get; }

Returns
DependencyProperty
The identifier for the DynamicOverflowOrder dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AppBarButton.Icon AppBarButton.Icon AppBarButton.
Icon
I n this Article
Edit
Gets or sets the graphic content of the app bar button.
public : IconElement Icon { get; set; }
IconElement Icon();

void Icon(IconElement icon);


public IconElement Icon { get; set; }

<AppBarButton Icon="symbolName" .../>

Returns
IconElement
The graphic content of the app bar button.
See IconElement
Also
AppBarButton.IconProperty AppBarButton.IconProperty
AppBarButton.IconProperty
I n this Article
Edit
Identifies the Icon dependency property.
public : static DependencyProperty IconProperty { get; }
static DependencyProperty IconProperty();
public static DependencyProperty IconProperty { get; }

Returns
DependencyProperty
The identifier for the Icon dependency property.
AppBarButton.IsCompact AppBarButton.IsCompact App
BarButton.IsCompact
I n this Article
Edit
Gets or sets a value that indicates whether the button is shown with no label and reduced padding.
public : Platform::Boolean IsCompact { get; set; }
bool IsCompact();

void IsCompact(bool iscompact);


public bool IsCompact { get; set; }

<AppBarButton IsCompact="bool" .../>

Returns
bool
true if the button is shown in its compact state; otherwise, false. The default is false.

Remarks
AppBarButton.IsCompactProperty AppBarButton.Is
CompactProperty AppBarButton.IsCompactProperty
I n this Article
Edit
Identifies the IsCompact dependency property.
public : static DependencyProperty IsCompactProperty { get; }
static DependencyProperty IsCompactProperty();
public static DependencyProperty IsCompactProperty { get; }

Returns
DependencyProperty
The identifier for the IsCompact dependency property.
AppBarButton.IsInOverflow AppBarButton.IsInOverflow
AppBarButton.IsInOverflow
I n this Article
Edit
Gets a value that indicates whether this item is in the overflow menu.
public : Platform::Boolean IsInOverflow { get; }
bool IsInOverflow();
public bool IsInOverflow { get; }

Returns
bool
true if this item is in the overflow menu; otherwise, false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
For more info and guidelines, see the App bar and command bar article.
Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default,
PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for
example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable
this behavior.
Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the
PrimaryCommands collection to SecondaryCommands.
Version compatibility
The IsInOverflow property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607
(or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a
previous version.
To avoid exceptions when your app runs on previous versions of Windows 10, do not use this property without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
property before you use it.
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarButton", "IsInOverflow"))
{
bool overflow = appBarButton1.IsInOverflow;
}
See App bar and command bar guide
Also
AppBarButton.IsInOverflowProperty AppBarButton.IsIn
OverflowProperty AppBarButton.IsInOverflowProperty
I n this Article
Edit
Identifies the IsInOverflow dependency property.
public : static DependencyProperty IsInOverflowProperty { get; }
static DependencyProperty IsInOverflowProperty();
public static DependencyProperty IsInOverflowProperty { get; }

Returns
DependencyProperty
The identifier for the IsInOverflow dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AppBarButton.KeyboardAcceleratorTextOverride AppBar
Button.KeyboardAcceleratorTextOverride AppBarButton.
KeyboardAcceleratorTextOverride
I n this Article
Edit
Gets or sets a string that overrides the default key combination string associated with a keyboard accelerator.

Example of a menu showing keyboard accelerators for various menu items


public : Platform::String KeyboardAcceleratorTextOverride { get; set; }
winrt::hstring KeyboardAcceleratorTextOverride();

void KeyboardAcceleratorTextOverride(winrt::hstring keyboardacceleratortextoverride);


public string KeyboardAcceleratorTextOverride { get; set; }

Returns
string
The string to replace the default key combination string. The default is null.
Use a single space for no text.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

Remarks
Windows 10, version 1703, introduced keyboard accelerator shortcuts. However, these shortcuts were not displayed
with the UI of their corresponding controls.
Starting with Windows 10, version 1803, when KeyboardAccelerators are declared, controls display the corresponding
key combinations by default.
The override text is not be presented if the system cannot detect an attached keyboard (you can check this yourself
through the KeyboardPresent property).
Version compatibility
The KeyboardAcceleratorTextOverride property is not available prior to Windows 10, version 1803. If your app’s
'minimum platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the
Requirements block later in this page, you must design and test your app to account for this. For more info, see Version
adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
<AppBarButton x:Name="appBarButtonCut" Icon="Cut" Label="Cut"/>
</CommandBar>

private void CommandBar_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarButton",
"KeyboardAcceleratorTextOverride"))
{
appBarButtonCut.KeyboardAcceleratorTextOverride = "Ctrl+C";
}
}

See Keyboard Accelerators


Also
AppBarButton.KeyboardAcceleratorTextOverrideProperty
AppBarButton.KeyboardAcceleratorTextOverrideProperty
AppBarButton.KeyboardAcceleratorTextOverrideProperty
I n this Article
Edit
Identifies the AppBarButton.KeyboardAcceleratorTextOverride dependency property.
public : static DependencyProperty KeyboardAcceleratorTextOverrideProperty { get; }
static DependencyProperty KeyboardAcceleratorTextOverrideProperty();
public static DependencyProperty KeyboardAcceleratorTextOverrideProperty { get; }

Returns
DependencyProperty
The identifier for the AppBarButton.KeyboardAcceleratorTextOverride dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

See Keyboard Accelerators


Also
AppBarButton.Label AppBarButton.Label AppBarButton.
Label
I n this Article
Edit
Gets or sets the text description displayed on the app bar button.
public : Platform::String Label { get; set; }
winrt::hstring Label();

void Label(winrt::hstring label);


public string Label { get; set; }

<AppBarButton Label="stringContent" .../>

Returns
string
The text description displayed on the app bar button.
AppBarButton.LabelPosition AppBarButton.LabelPosition
AppBarButton.LabelPosition
I n this Article
Edit
Gets or sets a value that indicates the placement and visibility of the button's label.
public : CommandBarLabelPosition LabelPosition { get; set; }
CommandBarLabelPosition LabelPosition();

void LabelPosition(CommandBarLabelPosition labelposition);


public CommandBarLabelPosition LabelPosition { get; set; }

<AppBarButton LabelPosition="commandBarLabelPositionMemberName" />

Returns
CommandBarLabelPosition
An enumeration value that specifies the placement and visibility of the button's label. The default is Default.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
By default, the app bar button's label is displayed in the position specified by the CommandBar.DefaultLabelPosition
property. You can set the LabelPosition property to override this value and make the label always collapsed for a
specific app bar button.
Version compatibility
The LabelPosition property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
<AppBarButton x:Name="appBarButtonCut" Icon="Cut" Label="Cut"/>
</CommandBar>

private void CommandBar_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarButton", "LabelPosition"))
{
appBarButtonCut.LabelPosition = CommandBarLabelPosition.Collapsed;
}
}
AppBarButton.LabelPositionProperty AppBarButton.
LabelPositionProperty AppBarButton.LabelPosition
Property
I n this Article
Edit
Identifies the LabelPosition dependency property.
public : static DependencyProperty LabelPositionProperty { get; }
static DependencyProperty LabelPositionProperty();
public static DependencyProperty LabelPositionProperty { get; }

Returns
DependencyProperty
The identifier for the LabelPosition dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AppBarButton.LabelProperty AppBarButton.Label
Property AppBarButton.LabelProperty
I n this Article
Edit
Identifies the Label dependency property.
public : static DependencyProperty LabelProperty { get; }
static DependencyProperty LabelProperty();
public static DependencyProperty LabelProperty { get; }

Returns
DependencyProperty
The identifier for the Label dependency property.
AppBarButton.TemplateSettings AppBarButton.Template
Settings AppBarButton.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension sources
when defining templates for an AppBarButton control.
public : AppBarButtonTemplateSettings TemplateSettings { get; }
AppBarButtonTemplateSettings TemplateSettings();
public AppBarButtonTemplateSettings TemplateSettings { get; }

Returns
AppBarButtonTemplateSettings
An object that provides calculated values for templates.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


AppBarClosedDisplayMode AppBarClosedDisplayMode
AppBarClosedDisplayMode Enum
Defines constants that specify whether icon buttons are displayed when an app bar is not completely open.

D eclaration
public : enum class AppBarClosedDisplayMode
enum class winrt::Windows::UI::Xaml::Controls::AppBarClosedDisplayMode : int32_t
public enum AppBarClosedDisplayMode

I nheritance H ierarchy
None

Fields
Compact Compact Compact Icon buttons are displayed but labels are not visible.

Hidden Hidden Hidden The app bar is not displayed.

Minimal Minimal Minimal Only the ellipsis is displayed. Neither icon buttons nor labels are visible.
AppBarElementContainer AppBarElementContainer App
BarElementContainer Class
Represents a container that allows an element that doesn't implement ICommandBarElement to be displayed in a
command bar.

D eclaration
public : class AppBarElementContainer : ContentControl, IAppBarElementContainer,
ICommandBarElement, ICommandBarElement2
struct winrt::Windows::UI::Xaml::Controls::AppBarElementContainer : ContentControl,
IAppBarElementContainer, ICommandBarElement, ICommandBarElement2
public class AppBarElementContainer : ContentControl, IAppBarElementContainer,
ICommandBarElement, ICommandBarElement2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
In order to be added to the primary or secondary command collections of a command bar, an element must implement
the ICommandBarElement interface. AppBarElementContainer is a wrapper that implements this interface so you can
add an element to a command bar even if it doesn't implement the interface itself.

Constructors
AppBarElementContainer()
AppBarElementContainer()
AppBarElementContainer()

Initializes a new instance of the AppBarElementContainer class.

Properties
DynamicOverflowOrder
DynamicOverflowOrder
DynamicOverflowOrder

Gets or sets the order in which this item is moved to the CommandBar overflow menu.

DynamicOverflowOrderProperty
DynamicOverflowOrderProperty
DynamicOverflowOrderProperty

Identifies the DynamicOverflowOrder dependency property.


IsCompact
IsCompact
IsCompact

Gets or sets a value that indicates whether the element is shown in its compact state.

IsCompactProperty
IsCompactProperty
IsCompactProperty

Identifies the IsCompact dependency property.

IsInOverflow
IsInOverflow
IsInOverflow

Gets a value that indicates whether this item is in the overflow menu.

IsInOverflowProperty
IsInOverflowProperty
IsInOverflowProperty

Identifies the IsInOverflow dependency property.


AppBarElementContainer AppBarElementContainer App
BarElementContainer
I n this Article
Edit
Initializes a new instance of the AppBarElementContainer class.
public : AppBarElementContainer()
AppBarElementContainer() const;
public AppBarElementContainer()
AppBarElementContainer.DynamicOverflowOrder App
BarElementContainer.DynamicOverflowOrder AppBar
ElementContainer.DynamicOverflowOrder
I n this Article
Edit
Gets or sets the order in which this item is moved to the CommandBar overflow menu.
public : int DynamicOverflowOrder { get; set; }
int32_t DynamicOverflowOrder();

void DynamicOverflowOrder(int32_t dynamicoverfloworder);


public int DynamicOverflowOrder { get; set; }

<AppBarElementContainer DynamicOverflowOrder="int" .../>

Returns
int
The order in which this item is moved to the overflow menu relative to other items.
AppBarElementContainer.DynamicOverflowOrder
Property AppBarElementContainer.DynamicOverflow
OrderProperty AppBarElementContainer.Dynamic
OverflowOrderProperty
I n this Article
Edit
Identifies the DynamicOverflowOrder dependency property.
public : static DependencyProperty DynamicOverflowOrderProperty { get; }
static DependencyProperty DynamicOverflowOrderProperty();
public static DependencyProperty DynamicOverflowOrderProperty { get; }

Returns
DependencyProperty
The identifier for the DynamicOverflowOrder dependency property.
AppBarElementContainer.IsCompact AppBarElement
Container.IsCompact AppBarElementContainer.Is
Compact
I n this Article
Edit
Gets or sets a value that indicates whether the element is shown in its compact state.
public : Platform::Boolean IsCompact { get; set; }
bool IsCompact();

void IsCompact(bool iscompact);


public bool IsCompact { get; set; }

<AppBarElementContainer IsCompact="bool" .../>

Returns
bool
true if the element is shown in its compact state; otherwise, false. The default is false.
AppBarElementContainer.IsCompactProperty AppBar
ElementContainer.IsCompactProperty AppBarElement
Container.IsCompactProperty
I n this Article
Edit
Identifies the IsCompact dependency property.
public : static DependencyProperty IsCompactProperty { get; }
static DependencyProperty IsCompactProperty();
public static DependencyProperty IsCompactProperty { get; }

Returns
DependencyProperty
The identifier for the IsCompact dependency property.
AppBarElementContainer.IsInOverflow AppBarElement
Container.IsInOverflow AppBarElementContainer.IsIn
Overflow
I n this Article
Edit
Gets a value that indicates whether this item is in the overflow menu.
public : Platform::Boolean IsInOverflow { get; }
bool IsInOverflow();
public bool IsInOverflow { get; }

Returns
bool
true if this item is in the overflow menu; otherwise, false.
AppBarElementContainer.IsInOverflowProperty AppBar
ElementContainer.IsInOverflowProperty AppBarElement
Container.IsInOverflowProperty
I n this Article
Edit
Identifies the IsInOverflow dependency property.
public : static DependencyProperty IsInOverflowProperty { get; }
static DependencyProperty IsInOverflowProperty();
public static DependencyProperty IsInOverflowProperty { get; }

Returns
DependencyProperty
The identifier for the IsInOverflow dependency property.
AppBarSeparator AppBarSeparator AppBarSeparator
Class
Represents a line that separates items in an AppBar or CommandBar.

D eclaration
public : class AppBarSeparator : Control, IAppBarSeparator, ICommandBarElement,
ICommandBarElement2
struct winrt::Windows::UI::Xaml::Controls::AppBarSeparator : Control, IAppBarSeparator,
ICommandBarElement, ICommandBarElement2
public class AppBarSeparator : Control, IAppBarSeparator, ICommandBarElement,
ICommandBarElement2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the AppBarSeparator control.

R ES O U R CE K EY D ES CR IPTIO N

AppBarSeparatorForeground Foreground color at rest

Constructors
AppBarSeparator()
AppBarSeparator()
AppBarSeparator()

Initializes a new instance of the AppBarSeparator class.


Properties
DynamicOverflowOrder
DynamicOverflowOrder
DynamicOverflowOrder

Gets or sets the order in which this item is moved to the CommandBar overflow menu.

DynamicOverflowOrderProperty
DynamicOverflowOrderProperty
DynamicOverflowOrderProperty

Identifies the DynamicOverflowOrder dependency property.

IsCompact
IsCompact
IsCompact

Gets or sets a value that indicates whether the separator is shown with reduced padding.

IsCompactProperty
IsCompactProperty
IsCompactProperty

Identifies the IsCompact dependency property.

IsInOverflow
IsInOverflow
IsInOverflow

Gets a value that indicates whether this item is in the overflow menu.

IsInOverflowProperty
IsInOverflowProperty
IsInOverflowProperty

Identifies the IsInOverflow dependency property.

See Also
Control
Control
Control
Control
Control
AppBarSeparator AppBarSeparator AppBarSeparator
I n this Article
Edit
Initializes a new instance of the AppBarSeparator class.

public : AppBarSeparator()
AppBarSeparator() const;
public AppBarSeparator()
AppBarSeparator.DynamicOverflowOrder AppBar
Separator.DynamicOverflowOrder AppBarSeparator.
DynamicOverflowOrder
I n this Article
Edit
Gets or sets the order in which this item is moved to the CommandBar overflow menu.
public : int DynamicOverflowOrder { get; set; }
int32_t DynamicOverflowOrder();

void DynamicOverflowOrder(int32_t dynamicoverfloworder);


public int DynamicOverflowOrder { get; set; }

<AppBarSeparator DynamicOverflowOrder="int" .../>

Returns
int
The order in which this item is moved to the overflow menu relative to other items.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
For more info and guidelines, see the App bar and command bar article.
Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default,
PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for
example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable
this behavior.
Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the
PrimaryCommands collection to SecondaryCommands.
This property has an effect only when this element is in the CommandBar.PrimaryCommands collection and
CommandBar.IsDynamicOverflowEnabled is true.
You can assign the same DynamicOverflowOrder value to more than one element. Elements with the same value move
in and out of the overflow area at the same time.
Version compatibility
The DynamicOverflowOrder property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607
(or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a
previous version.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
<AppBarButton x:Name="appBarButtonCut" Icon="Cut" Label="Cut"/>
<AppBarButton x:Name="appBarButtonCopy" Icon="Copy" Label="Copy"/>
<AppBarSeparator x:Name="appBarSeparator1"/>
<AppBarButton x:Name="appBarButtonPaste" Icon="Paste" Label="Paste"/>
</CommandBar>

private void CommandBar_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarSeparator",
"DynamicOverflowOrder"))
{
commandBar1.IsDynamicOverflowEnabled = true;
appBarButtonCut.DynamicOverflowOrder = 1;
appBarButtonCopy.DynamicOverflowOrder = 2;
appBarSeparator1.DynamicOverflowOrder = 2;
appBarButtonPaste.DynamicOverflowOrder = 3;
}
}
AppBarSeparator.DynamicOverflowOrderProperty App
BarSeparator.DynamicOverflowOrderProperty AppBar
Separator.DynamicOverflowOrderProperty
I n this Article
Edit
Identifies the DynamicOverflowOrder dependency property.
public : static DependencyProperty DynamicOverflowOrderProperty { get; }
static DependencyProperty DynamicOverflowOrderProperty();
public static DependencyProperty DynamicOverflowOrderProperty { get; }

Returns
DependencyProperty
The identifier for the DynamicOverflowOrder dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AppBarSeparator.IsCompact AppBarSeparator.IsCompact
AppBarSeparator.IsCompact
I n this Article
Edit
Gets or sets a value that indicates whether the separator is shown with reduced padding.
public : Platform::Boolean IsCompact { get; set; }
bool IsCompact();

void IsCompact(bool iscompact);


public bool IsCompact { get; set; }

<AppBarSeparator IsCompact="bool" .../>

Returns
bool
True if the separator is shown in its compact state; otherwise, false. The default is false.
AppBarSeparator.IsCompactProperty AppBarSeparator.Is
CompactProperty AppBarSeparator.IsCompactProperty
I n this Article
Edit
Identifies the IsCompact dependency property.
public : static DependencyProperty IsCompactProperty { get; }
static DependencyProperty IsCompactProperty();
public static DependencyProperty IsCompactProperty { get; }

Returns
DependencyProperty
The identifier for the IsCompact dependency property.
AppBarSeparator.IsInOverflow AppBarSeparator.IsIn
Overflow AppBarSeparator.IsInOverflow
I n this Article
Edit
Gets a value that indicates whether this item is in the overflow menu.
public : Platform::Boolean IsInOverflow { get; }
bool IsInOverflow();
public bool IsInOverflow { get; }

Returns
bool
true if this item is in the overflow menu; otherwise, false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
For more info and guidelines, see the App bar and command bar article.
Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default,
PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for
example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable
this behavior.
Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the
PrimaryCommands collection to SecondaryCommands.
When IsInOverflow is true for an AppBarSeparator, the separator bar is hidden rather than being shown in the
overflow area.
Version compatibility
The IsInOverflow property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607
(or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a
previous version.
To avoid exceptions when your app runs on previous versions of Windows 10, do not use this property without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
property before you use it.
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarSeparator", "IsInOverflow"))
{
bool overflow = appBarSeparator1.IsInOverflow;
}
AppBarSeparator.IsInOverflowProperty AppBarSeparator.
IsInOverflowProperty AppBarSeparator.IsInOverflow
Property
I n this Article
Edit
Identifies the IsInOverflow dependency property.
public : static DependencyProperty IsInOverflowProperty { get; }
static DependencyProperty IsInOverflowProperty();
public static DependencyProperty IsInOverflowProperty { get; }

Returns
DependencyProperty
The identifier for the IsInOverflow dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AppBarToggleButton AppBarToggleButton AppBarToggle
Button Class
Represents a button control that can switch states and be displayed in an AppBar.

D eclaration
public : class AppBarToggleButton : ToggleButton, IAppBarToggleButton, IAppBarToggleButton3,
IAppBarToggleButton4, IAppBarToggleButton5, ICommandBarElement, ICommandBarElement2
struct winrt::Windows::UI::Xaml::Controls::AppBarToggleButton : ToggleButton,
IAppBarToggleButton, IAppBarToggleButton3, IAppBarToggleButton4, IAppBarToggleButton5,
ICommandBarElement, ICommandBarElement2
public class AppBarToggleButton : ToggleButton, IAppBarToggleButton, IAppBarToggleButton3,
IAppBarToggleButton4, IAppBarToggleButton5, ICommandBarElement, ICommandBarElement2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton

Remarks
An AppBarToggleButton is similar to an AppBarButton with an additional toggle state. When used inside a
CommandBar. the visual appearance changes based on whether the control appears in the primary commands or the
overflow menu. Here is an example of a toggled button as both a primary command and secondary command.

Control style and template


You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the AppBarToggleButton control.
R ES O U R CE K EY D ES CR IPTIO N

AppBarToggleButtonBackground Background color at rest

AppBarToggleButtonBackgroundDisabled Background color when disabled

AppBarToggleButtonBackgroundChecked Background color at rest and checked

AppBarToggleButtonBackgroundCheckedPointerOver Background color on hover and checked

AppBarToggleButtonBackgroundCheckedPressed Background color when pressed and checked

AppBarToggleButtonBackgroundCheckedDisabled Background color when disabled and checked

AppBarToggleButtonBackgroundHighLightOverlay Overlay background color at rest

AppBarToggleButtonBackgroundHighLightOverlayPointerOver Overlay background color on hover

AppBarToggleButtonBackgroundHighLightOverlayPressed Overlay background color when pressed

AppBarToggleButtonBackgroundHighLightOverlayCheckedPoi Overlay background color on hover and checked


nterOver

AppBarToggleButtonBackgroundHighLightOverlayCheckedPre Overlay background color when pressed and checked


ssed

AppBarToggleButtonForeground Label text color at rest

AppBarToggleButtonForegroundPointerOver Label text color on hover

AppBarToggleButtonForegroundPressed Label text color when pressed

AppBarToggleButtonForegroundDisabled Label text color when disabled

AppBarToggleButtonForegroundChecked Label text color at rest and checked

AppBarToggleButtonForegroundCheckedPointerOver Label text color on hover and checked

AppBarToggleButtonForegroundCheckedPressed Label text color when pressed and checked

AppBarToggleButtonForegroundCheckedDisabled Label text color when disabled and checked

AppBarToggleButtonBorderBrush Border color at rest

AppBarToggleButtonBorderBrushPointerOver Border color on hover

AppBarToggleButtonBorderBrushPressed Border color when pressed

AppBarToggleButtonBorderBrushDisabled Border color when disabled

AppBarToggleButtonBorderBrushChecked Border color at rest and checked

AppBarToggleButtonBorderBrushCheckedPointerOver Border color on hover and checked


AppBarToggleButtonBorderBrushCheckedPressed Border color when pressed and checked

AppBarToggleButtonBorderBrushCheckedDisabled Border color when disabled and checked

AppBarToggleButtonCheckGlyphForeground Check mark color at rest (in overflow)

AppBarToggleButtonCheckGlyphForegroundPointerOver Check mark color on hover (in overflow)

AppBarToggleButtonCheckGlyphForegroundPressed Check mark color when pressed (in overflow)

AppBarToggleButtonCheckGlyphForegroundDisabled Check mark color when disabled (in overflow)

AppBarToggleButtonCheckGlyphForegroundChecked Check mark color at rest and checked (in overflow)

AppBarToggleButtonCheckGlyphForegroundCheckedPointerO Check mark color on hover and checked (in overflow)


ver

AppBarToggleButtonCheckGlyphForegroundCheckedPressed Check mark color when pressed and checked (in overflow)

AppBarToggleButtonCheckGlyphForegroundCheckedDisabled Check mark color when disabled and checked (in overflow)

AppBarToggleButtonOverflowLabelForegroundPointerOver Label text color on hover (in overflow)

AppBarToggleButtonOverflowLabelForegroundPressed Label text color when pressed (in overflow)

AppBarToggleButtonOverflowLabelForegroundDisabled Label text color when disabled (in overflow)

AppBarToggleButtonOverflowLabelForegroundCheckedPointer Label text color on hover and checked (in overflow)


Over

AppBarToggleButtonOverflowLabelForegroundCheckedPresse Label text color when pressed and checked (in overflow)
d

AppBarToggleButtonOverflowLabelForegroundCheckedDisable Label text color when disabled and checked (in overflow)
d

Constructors
AppBarToggleButton()
AppBarToggleButton()
AppBarToggleButton()

Initializes a new instance of the AppBarToggleButton class.

Properties
DynamicOverflowOrder
DynamicOverflowOrder
DynamicOverflowOrder

Gets or sets the order in which this item is moved to the CommandBar overflow menu.
DynamicOverflowOrderProperty
DynamicOverflowOrderProperty
DynamicOverflowOrderProperty

Identifies the DynamicOverflowOrder dependency property.

Icon
Icon
Icon

Gets or sets the graphic content of the app bar toggle button.

IconProperty
IconProperty
IconProperty

Identifies the Icon dependency property.

IsCompact
IsCompact
IsCompact

Gets or sets a value that indicates whether the button is shown with no label and reduced padding.

IsCompactProperty
IsCompactProperty
IsCompactProperty

Identifies the IsCompact dependency property.

IsInOverflow
IsInOverflow
IsInOverflow

Gets a value that indicates whether this item is in the overflow menu.

IsInOverflowProperty
IsInOverflowProperty
IsInOverflowProperty

Identifies the IsInOverflow dependency property.

KeyboardAcceleratorTextOverride
KeyboardAcceleratorTextOverride
KeyboardAcceleratorTextOverride
Gets or sets a string that overrides the default key combination string associated with a keyboard accelerator.

Example of a menu showing keyboard accelerators for various menu items

KeyboardAcceleratorTextOverrideProperty
KeyboardAcceleratorTextOverrideProperty
KeyboardAcceleratorTextOverrideProperty

Identifies the AppBarToggleButton.KeyboardAcceleratorTextOverride dependency property.

Label
Label
Label

Gets or sets the text description displayed on the app bar toggle button.

LabelPosition
LabelPosition
LabelPosition

Gets or sets a value that indicates the placement and visibility of the button's label.

LabelPositionProperty
LabelPositionProperty
LabelPositionProperty

Identifies the LabelPosition dependency property.

LabelProperty
LabelProperty
LabelProperty

Identifies the Label dependency property.

TemplateSettings
TemplateSettings
TemplateSettings
Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension
sources when defining templates for an AppBarToggleButton control.

See Also
Control
Control
ToggleButton
Control
Control
Control
AppBarToggleButton AppBarToggleButton AppBarToggle
Button
I n this Article
Edit
Initializes a new instance of the AppBarToggleButton class.
public : AppBarToggleButton()
AppBarToggleButton() const;
public AppBarToggleButton()
AppBarToggleButton.DynamicOverflowOrder AppBar
ToggleButton.DynamicOverflowOrder AppBarToggle
Button.DynamicOverflowOrder
I n this Article
Edit
Gets or sets the order in which this item is moved to the CommandBar overflow menu.
public : int DynamicOverflowOrder { get; set; }
int32_t DynamicOverflowOrder();

void DynamicOverflowOrder(int32_t dynamicoverfloworder);


public int DynamicOverflowOrder { get; set; }

<AppBarToggleButton DynamicOverflowOrder="int" .../>

Returns
int
The order in which this item is moved to the overflow menu relative to other items.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
For more info and guidelines, see the App bar and command bar article.
Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default,
PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for
example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable
this behavior.
Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the
PrimaryCommands collection to SecondaryCommands.
This property has an effect only when this element is in the CommandBar.PrimaryCommands collection and
CommandBar.IsDynamicOverflowEnabled is true.
You can assign the same DynamicOverflowOrder value to more than one element. Elements with the same value move
in and out of the overflow area at the same time.
Version compatibility
The DynamicOverflowOrder property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607
(or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a
previous version.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
<AppBarToggleButton x:Name="appBarButtonShuffle" Icon="Shuffle" Label="Shuffle"/>
<AppBarToggleButton x:Name="appBarButtonRepeat" Icon="RepeatAll" Label="Repeat"/>
</CommandBar>

private void CommandBar_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarToggleButton",
"DynamicOverflowOrder"))
{
commandBar1.IsDynamicOverflowEnabled = true;
appBarButtonShuffle.DynamicOverflowOrder = 1;
appBarButtonRepeat.DynamicOverflowOrder = 2;
}
}
AppBarToggleButton.DynamicOverflowOrderProperty
AppBarToggleButton.DynamicOverflowOrderProperty
AppBarToggleButton.DynamicOverflowOrderProperty
I n this Article
Edit
Identifies the DynamicOverflowOrder dependency property.
public : static DependencyProperty DynamicOverflowOrderProperty { get; }
static DependencyProperty DynamicOverflowOrderProperty();
public static DependencyProperty DynamicOverflowOrderProperty { get; }

Returns
DependencyProperty
The identifier for the DynamicOverflowOrder dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AppBarToggleButton.Icon AppBarToggleButton.Icon App
BarToggleButton.Icon
I n this Article
Edit
Gets or sets the graphic content of the app bar toggle button.
public : IconElement Icon { get; set; }
IconElement Icon();

void Icon(IconElement icon);


public IconElement Icon { get; set; }

<AppBarToggleButton Icon="symbolName" .../>

Returns
IconElement
The graphic content of the app bar toggle button.
See IconElement
Also
AppBarToggleButton.IconProperty AppBarToggleButton.
IconProperty AppBarToggleButton.IconProperty
I n this Article
Edit
Identifies the Icon dependency property.
public : static DependencyProperty IconProperty { get; }
static DependencyProperty IconProperty();
public static DependencyProperty IconProperty { get; }

Returns
DependencyProperty
The identifier for the Icon dependency property.
AppBarToggleButton.IsCompact AppBarToggleButton.Is
Compact AppBarToggleButton.IsCompact
I n this Article
Edit
Gets or sets a value that indicates whether the button is shown with no label and reduced padding.
public : Platform::Boolean IsCompact { get; set; }
bool IsCompact();

void IsCompact(bool iscompact);


public bool IsCompact { get; set; }

<AppBarToggleButton IsCompact="bool" .../>

Returns
bool
True if the button is shown in its compact state; otherwise, false. The default is false.
AppBarToggleButton.IsCompactProperty AppBarToggle
Button.IsCompactProperty AppBarToggleButton.Is
CompactProperty
I n this Article
Edit
Identifies the IsCompact dependency property.
public : static DependencyProperty IsCompactProperty { get; }
static DependencyProperty IsCompactProperty();
public static DependencyProperty IsCompactProperty { get; }

Returns
DependencyProperty
The identifier for the IsCompact dependency property.
AppBarToggleButton.IsInOverflow AppBarToggleButton.
IsInOverflow AppBarToggleButton.IsInOverflow
I n this Article
Edit
Gets a value that indicates whether this item is in the overflow menu.
public : Platform::Boolean IsInOverflow { get; }
bool IsInOverflow();
public bool IsInOverflow { get; }

Returns
bool
true if this item is in the overflow menu; otherwise, false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
For more info and guidelines, see the App bar and command bar article.
Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default,
PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for
example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable
this behavior.
Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the
PrimaryCommands collection to SecondaryCommands.
Version compatibility
The IsInOverflow property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607
(or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a
previous version.
To avoid exceptions when your app runs on previous versions of Windows 10, do not use this property without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
property before you use it.
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarToggleButton", "IsInOverflow"))
{
bool overflow = appBarToggleButton1.IsInOverflow;
}
AppBarToggleButton.IsInOverflowProperty AppBar
ToggleButton.IsInOverflowProperty AppBarToggleButton.
IsInOverflowProperty
I n this Article
Edit
Identifies the IsInOverflow dependency property.
public : static DependencyProperty IsInOverflowProperty { get; }
static DependencyProperty IsInOverflowProperty();
public static DependencyProperty IsInOverflowProperty { get; }

Returns
DependencyProperty
The identifier for the IsInOverflow dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AppBarToggleButton.KeyboardAcceleratorTextOverride
AppBarToggleButton.KeyboardAcceleratorTextOverride
AppBarToggleButton.KeyboardAcceleratorTextOverride
I n this Article
Edit
Gets or sets a string that overrides the default key combination string associated with a keyboard accelerator.

Example of a menu showing keyboard accelerators for various menu items


public : Platform::String KeyboardAcceleratorTextOverride { get; set; }
winrt::hstring KeyboardAcceleratorTextOverride();

void KeyboardAcceleratorTextOverride(winrt::hstring keyboardacceleratortextoverride);


public string KeyboardAcceleratorTextOverride { get; set; }

Returns
string
The string to replace the default key combination string. The default is null.
Use a single space for no text.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

Remarks
Windows 10, version 1703, introduced keyboard accelerator shortcuts. However, these shortcuts were not displayed
with the UI of their corresponding controls.
Starting with Windows 10, version 1803, when KeyboardAccelerators are declared, controls display the corresponding
key combinations by default.
The override text is not be presented if the system cannot detect an attached keyboard (you can check this yourself
through the KeyboardPresent property).
Version compatibility
The KeyboardAcceleratorTextOverride property is not available prior to Windows 10, version 1803. If your app’s
'minimum platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the
Requirements block later in this page, you must design and test your app to account for this. For more info, see Version
adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
<AppBarToggleButton x:Name="appBarButtonShuffle" Icon="Shuffle" Label="Shuffle"/>
</CommandBar>

private void CommandBar_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarToggleButton",
"KeyboardAcceleratorTextOverride"))
{
appBarButtonCut.KeyboardAcceleratorTextOverride = "Ctrl+S";
}
}

See Keyboard Accelerators


Also
AppBarToggleButton.KeyboardAcceleratorTextOverride
Property AppBarToggleButton.KeyboardAcceleratorText
OverrideProperty AppBarToggleButton.Keyboard
AcceleratorTextOverrideProperty
I n this Article
Edit
Identifies the AppBarToggleButton.KeyboardAcceleratorTextOverride dependency property.
public : static DependencyProperty KeyboardAcceleratorTextOverrideProperty { get; }
static DependencyProperty KeyboardAcceleratorTextOverrideProperty();
public static DependencyProperty KeyboardAcceleratorTextOverrideProperty { get; }

Returns
DependencyProperty
The identifier for the AppBarToggleButton.KeyboardAcceleratorTextOverride dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

See Keyboard Accelerators


Also
AppBarToggleButton.Label AppBarToggleButton.Label
AppBarToggleButton.Label
I n this Article
Edit
Gets or sets the text description displayed on the app bar toggle button.
public : Platform::String Label { get; set; }
winrt::hstring Label();

void Label(winrt::hstring label);


public string Label { get; set; }

<AppBarToggleButton Label="stringContent" .../>

Returns
string
The text description displayed on the app bar toggle button.
AppBarToggleButton.LabelPosition AppBarToggleButton.
LabelPosition AppBarToggleButton.LabelPosition
I n this Article
Edit
Gets or sets a value that indicates the placement and visibility of the button's label.
public : CommandBarLabelPosition LabelPosition { get; set; }
CommandBarLabelPosition LabelPosition();

void LabelPosition(CommandBarLabelPosition labelposition);


public CommandBarLabelPosition LabelPosition { get; set; }

<AppBarToggleButton LabelPosition="commandBarLabelPositionMemberName" />

Returns
CommandBarLabelPosition
An enumeration value that specifies the placement and visibility of the button's label. The default is Default.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
By default, the app bar button's label is displayed in the position specified by the CommandBar.DefaultLabelPosition
property. You can set the LabelPosition property to override this value and make the label always collapsed for a
specific app bar button.
Version compatibility
The LabelPosition property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
<AppBarToggleButton x:Name="appBarButtonShuffle" Icon="Shuffle" Label="Shuffle"/>
</CommandBar>

private void CommandBar_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AppBarToggleButton",
"LabelPosition"))
{
appBarButtonShuffle.LabelPosition = CommandBarLabelPosition.Collapsed;
}
}
AppBarToggleButton.LabelPositionProperty AppBar
ToggleButton.LabelPositionProperty AppBarToggle
Button.LabelPositionProperty
I n this Article
Edit
Identifies the LabelPosition dependency property.
public : static DependencyProperty LabelPositionProperty { get; }
static DependencyProperty LabelPositionProperty();
public static DependencyProperty LabelPositionProperty { get; }

Returns
DependencyProperty
The identifier for the LabelPosition dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AppBarToggleButton.LabelProperty AppBarToggle
Button.LabelProperty AppBarToggleButton.Label
Property
I n this Article
Edit
Identifies the Label dependency property.
public : static DependencyProperty LabelProperty { get; }
static DependencyProperty LabelProperty();
public static DependencyProperty LabelProperty { get; }

Returns
DependencyProperty
The identifier for the Label dependency property.
AppBarToggleButton.TemplateSettings AppBarToggle
Button.TemplateSettings AppBarToggleButton.Template
Settings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension sources
when defining templates for an AppBarToggleButton control.
public : AppBarToggleButtonTemplateSettings TemplateSettings { get; }
AppBarToggleButtonTemplateSettings TemplateSettings();
public AppBarToggleButtonTemplateSettings TemplateSettings { get; }

Returns
AppBarToggleButtonTemplateSettings
An object that provides calculated values for templates.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


AutoSuggestBox AutoSuggestBox AutoSuggestBox Class
Represents a text control that makes suggestions to users as they enter text using a keyboard or pen (using ink and
handwriting recognition). The app is notified when text has been changed by the user and is responsible for providing
relevant suggestions for this control to display.

D eclaration
public : sealed class AutoSuggestBox : ItemsControl, IAutoSuggestBox, IAutoSuggestBox2,
IAutoSuggestBox3, IAutoSuggestBox4
struct winrt::Windows::UI::Xaml::Controls::AutoSuggestBox : ItemsControl, IAutoSuggestBox,
IAutoSuggestBox2, IAutoSuggestBox3, IAutoSuggestBox4
public sealed class AutoSuggestBox : ItemsControl, IAutoSuggestBox, IAutoSuggestBox2,
IAutoSuggestBox3, IAutoSuggestBox4

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl

Remarks
 Tip

For more info, design guidance, and code examples, see Auto-suggest box.
Use an AutoSuggestBox to provide a list of suggestions for a user to select from as they type.
By default, the text entry box doesn’t have a query button shown. You can set the QueryIcon property to add a button
with the specified icon on the right side of the text box. For example, to make the AutoSuggestBox look like a typical
search box, add a ‘find’ icon, like this.
<AutoSuggestBox QueryIcon="Find"/>

Here's an AutoSuggestBox with a 'find' icon. The suggestion list shows suggested results based on the user's entry.

To use an @Windows.UI.Xaml.Controls.AutoSuggestBox?
text=AutoSuggestBox, you need to respond to 3 user actions.
Text changed - When the user enters text, update the suggestion list.
Suggestion chosen - When the user chooses a suggestion in the suggestion list, update the text box.
Query submitted - When the user submits a query, show the query results.
Text changed

The TextChanged event occurs whenever the content of the text box is updated. Use the event args Reason property to
determine whether the change was due to user input. If the change reason is UserInput, filter your data based on the
input. Then, set the filtered data as the ItemsSource of the AutoSuggestBox to update the suggestion list.
To control how items are displayed in the suggestion list, you can use DisplayMemberPath or ItemTemplate.
To display the text of a single property of your data item, set the DisplayMemberPath property to choose which
property from your object to display in the suggestion list.
To define a custom look for each item in the list, use the ItemTemplate property .
Suggestion chosen

When a user navigates through the suggestion list using the keyboard, you need to update the text in the text box to
match.
You can set the TextMemberPath property to choose which property from your data object to display in the text box. If
you specify a TextMemberPath, the text box is updated automatically. You should typically specify the same value for
DisplayMemberPath and TextMemberPath so the text is the same in the suggestion list and the text box.
If you need to show more than a simple property, handle the SuggestionChosen event to populate the text box with
custom text based on the selected item.
Quer y submitted

Handle the QuerySubmitted event to perform a query action appropriate to your app and show result to the user.
The QuerySubmitted event occurs when a user commits a query string. The user can commit a query in one of these
ways:
While focus is in the text box, press Enter or click the query icon. The event args ChosenSuggestion property is null.
While focus is in the suggestion list, press Enter, click, or tap an item. The event args ChosenSuggestion property
contains the item that was selected from the list. In all cases, the event args QueryText property contains the text from
the text box.
Accessibility

If you are using an assistive technology, such as Narrator, to interact with the AutoSuggestBox the accessibility
experience has already been hooked up for you. A user will:
Know the list is present and when the list closes
Know how many suggestions are available
Be able to move Narrator focus to the list
Be able to Navigate through a suggestion with all other reading modes See Auto-suggest accessibility for more
information.
Pen input
Starting with Windows 10, version 1803, XAML text input boxes feature embedded support for pen input using
Windows Ink. When a user taps into a text input box using a Windows pen, the text box transforms to let the user write
directly into it with a pen, rather than opening a separate input panel.
You can configure the handwriting view of the AutoSuggestBox through its TextBox control, as we show here.

<AutoSuggestBox Name="NoHandwritingAutoSuggestBox"
BorderThickness="0" Width="680"
FontSize="24" VerticalAlignment="Top"
HorizontalAlignment="Center"
PlaceholderText="Handwriting view is not supported">
<AutoSuggestBox.TextBoxStyle>
<Style TargetType="TextBox">
<Setter Property="IsHandwritingViewEnabled" Value="False"/>
</Style>
</AutoSuggestBox.TextBoxStyle>
</AutoSuggestBox>
For more info, see Text input with the handwriting view.
Control style and template

You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the AutoSuggestBox control. Resources that start with "TextControl" are shared
by TextBox, PasswordBox, RichEditBox, and AutoSuggestBox.

R ES O U R CE K EY D ES CR IPTIO N

AutoSuggestBoxSuggestionsListBackground Background color of suggestion list

AutoSuggestBoxSuggestionsListBorderBrush Border color of suggestion list

TextControlForeground Text color at rest

TextControlForegroundPointerOver Text color on hover

TextControlForegroundFocused Text color when focused

TextControlForegroundDisabled Text color when disabled

TextControlBackground Background color at rest

TextControlBackgroundPointerOver Background color on hover

TextControlBackgroundFocused Background color when focused

TextControlBackgroundDisabled Background color when disabled

TextControlBorderBrush Border color at rest

TextControlBorderBrushPointerOver Border color on hover


TextControlBorderBrushFocused Border color when focused

TextControlBorderBrushDisabled Border color when disabled

TextControlPlaceholderForeground Placeholder text color at rest

TextControlPlaceholderForegroundPointerOver Placeholder text color on hover

TextControlPlaceholderForegroundFocused Placeholder text color when focused

TextControlPlaceholderForegroundDisabled Placeholder text color when disabled

TextControlHeaderForeground Header text color at rest

TextControlHeaderForegroundDisabled Header text color when disabled

TextControlSelectionHighlightColor Highlight color of selected text

TextControlButtonBackground Background color of delete button at rest

TextControlButtonBackgroundPointerOver Background color of delete button on hover

TextControlButtonBackgroundPressed Background color of delete button when pressed

TextControlButtonBorderBrush Border color of delete button at rest

TextControlButtonBorderBrushPointerOver Border color of delete button on hover

TextControlButtonBorderBrushPressed Border color of delete button when pressed

TextControlButtonForeground Foreground color of delete button at rest

TextControlButtonForegroundPointerOver Foreground color of delete button on hover

TextControlButtonForegroundPressed Foreground color of delete button when pressed

Constructors
AutoSuggestBox()
AutoSuggestBox()
AutoSuggestBox()

Initializes a new instance of the AutoSuggestBox class.

Properties
AutoMaximizeSuggestionArea
AutoMaximizeSuggestionArea
AutoMaximizeSuggestionArea

Indicates if the suggestion area should be automatically maximized.


AutoMaximizeSuggestionAreaProperty
AutoMaximizeSuggestionAreaProperty
AutoMaximizeSuggestionAreaProperty

Identifies the AutoMaximizeSuggestionArea dependency property.

Description
Description
Description

Gets or sets content that is shown below the control. The content should provide guidance about the input
expected by the control.

DescriptionProperty
DescriptionProperty
DescriptionProperty

Identifies the Description dependency property.

Header
Header
Header

Gets or sets the header object for the text box portion of this control.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

IsSuggestionListOpen
IsSuggestionListOpen
IsSuggestionListOpen

Gets or sets a Boolean value indicating whether the drop-down portion of the AutoSuggestBox is open.

IsSuggestionListOpenProperty
IsSuggestionListOpenProperty
IsSuggestionListOpenProperty

Identifies the IsSuggestionListOpen dependency property.

LightDismissOverlayMode
LightDismissOverlayMode
LightDismissOverlayMode

Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.

LightDismissOverlayModeProperty
LightDismissOverlayModeProperty
LightDismissOverlayModeProperty

Identifies the LightDismissOverlayMode dependency property.

MaxSuggestionListHeight
MaxSuggestionListHeight
MaxSuggestionListHeight

Gets or set the maximum height for the drop-down portion of the AutoSuggestBox control.

MaxSuggestionListHeightProperty
MaxSuggestionListHeightProperty
MaxSuggestionListHeightProperty

Identifies the MaxSuggestionListHeight dependency property.

PlaceholderText
PlaceholderText
PlaceholderText

Gets or sets the placeholder text to be displayed in the control.

PlaceholderTextProperty
PlaceholderTextProperty
PlaceholderTextProperty

Identifies the PlaceholderText dependency property.

QueryIcon
QueryIcon
QueryIcon

Gets or sets the graphic content of the button that is clicked to initiate a query.

QueryIconProperty
QueryIconProperty
QueryIconProperty

Identifies the QueryIcon dependency property.


Text
Text
Text

Gets or sets the text that is shown in the control.

TextBoxStyle
TextBoxStyle
TextBoxStyle

Gets or sets the style of the auto-suggest text box.

TextBoxStyleProperty
TextBoxStyleProperty
TextBoxStyleProperty

Identifies the TextBoxStyle dependency property.

TextMemberPath
TextMemberPath
TextMemberPath

Gets or sets the property path that is used to get the value for display in the text box portion of the
AutoSuggestBox control, when an item is selected.

TextMemberPathProperty
TextMemberPathProperty
TextMemberPathProperty

Identifies the TextMemberPath dependency property.

TextProperty
TextProperty
TextProperty

Identifies the PlaceholderText dependency property.

UpdateTextOnSelect
UpdateTextOnSelect
UpdateTextOnSelect

Used in conjunction with TextMemberPath, gets or sets a value indicating whether items in the view will trigger an
update of the editable text part of the AutoSuggestBox when clicked.

UpdateTextOnSelectProperty
UpdateTextOnSelectProperty
UpdateTextOnSelectProperty

Identifies the UpdateTextOnSelect dependency property.

Events
QuerySubmitted
QuerySubmitted
QuerySubmitted

Occurs when the user submits a search query.

SuggestionChosen
SuggestionChosen
SuggestionChosen

Raised before the text content of the editable control component is updated.

TextChanged
TextChanged
TextChanged

Raised after the text content of the editable control component is updated.

See Also
ItemsControl
ItemsControl
ItemsControl
ItemsControl
ItemsControl
AutoSuggestBox.AutoMaximizeSuggestionArea Auto
SuggestBox.AutoMaximizeSuggestionArea AutoSuggest
Box.AutoMaximizeSuggestionArea
I n this Article
Edit
Indicates if the suggestion area should be automatically maximized.
public : Platform::Boolean AutoMaximizeSuggestionArea { get; set; }
bool AutoMaximizeSuggestionArea();

void AutoMaximizeSuggestionArea(bool automaximizesuggestionarea);


public bool AutoMaximizeSuggestionArea { get; set; }

<AutoSuggestBox AutoMaximizeSuggestionArea="bool"/>

Returns
bool
A Boolean value that indicates if the suggestion area should be automatically maximized.
AutoSuggestBox.AutoMaximizeSuggestionAreaProperty
AutoSuggestBox.AutoMaximizeSuggestionAreaProperty
AutoSuggestBox.AutoMaximizeSuggestionAreaProperty
I n this Article
Edit
Identifies the AutoMaximizeSuggestionArea dependency property.
public : static DependencyProperty AutoMaximizeSuggestionAreaProperty { get; }
static DependencyProperty AutoMaximizeSuggestionAreaProperty();
public static DependencyProperty AutoMaximizeSuggestionAreaProperty { get; }

Returns
DependencyProperty
The identifier for the AutoMaximizeSuggestionArea dependency property.
AutoSuggestBox AutoSuggestBox AutoSuggestBox
I n this Article
Edit
Initializes a new instance of the AutoSuggestBox class.

public : AutoSuggestBox()
AutoSuggestBox() const;
public AutoSuggestBox()
AutoSuggestBox.Description AutoSuggestBox.
Description AutoSuggestBox.Description
I n this Article
Edit
Gets or sets content that is shown below the control. The content should provide guidance about the input expected by
the control.
public : Platform::Object Description { get; set; }
winrt::Windows::Foundation::IInspectable Description();

void Description(winrt::Windows::Foundation::IInspectable description);


public object Description { get; set; }

Returns
object
The content to be displayed below the control. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


AutoSuggestBox.DescriptionProperty AutoSuggestBox.
DescriptionProperty AutoSuggestBox.Description
Property
I n this Article
Edit
Identifies the Description dependency property.
public : static DependencyProperty DescriptionProperty { get; }
static DependencyProperty DescriptionProperty();
public static DependencyProperty DescriptionProperty { get; }

Returns
DependencyProperty
The identifier for the Description dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


AutoSuggestBox.Header AutoSuggestBox.Header Auto
SuggestBox.Header
I n this Article
Edit
Gets or sets the header object for the text box portion of this control.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<AutoSuggestBox Header="headerString"/>

Returns
object
The header object for the text box portion of this control.
AutoSuggestBox.HeaderProperty AutoSuggestBox.
HeaderProperty AutoSuggestBox.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
AutoSuggestBox.IsSuggestionListOpen AutoSuggestBox.
IsSuggestionListOpen AutoSuggestBox.IsSuggestionList
Open
I n this Article
Edit
Gets or sets a Boolean value indicating whether the drop-down portion of the AutoSuggestBox is open.
public : Platform::Boolean IsSuggestionListOpen { get; set; }
bool IsSuggestionListOpen();

void IsSuggestionListOpen(bool issuggestionlistopen);


public bool IsSuggestionListOpen { get; set; }

Returns
bool
A Boolean value indicating whether the drop-down portion of the AutoSuggestBox is open.

Remarks
Do not set IsSuggestionListOpen in XAML. It's a state property for runtime interactions, and values set in XAML are
ignored.
AutoSuggestBox.IsSuggestionListOpenProperty Auto
SuggestBox.IsSuggestionListOpenProperty AutoSuggest
Box.IsSuggestionListOpenProperty
I n this Article
Edit
Identifies the IsSuggestionListOpen dependency property.
public : static DependencyProperty IsSuggestionListOpenProperty { get; }
static DependencyProperty IsSuggestionListOpenProperty();
public static DependencyProperty IsSuggestionListOpenProperty { get; }

Returns
DependencyProperty
Identifier for the IsSuggestionListOpen dependency property.
AutoSuggestBox.LightDismissOverlayMode AutoSuggest
Box.LightDismissOverlayMode AutoSuggestBox.Light
DismissOverlayMode
I n this Article
Edit
Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.
public : LightDismissOverlayMode LightDismissOverlayMode { get; set; }
LightDismissOverlayMode LightDismissOverlayMode();

void LightDismissOverlayMode(LightDismissOverlayMode lightdismissoverlaymode);


public LightDismissOverlayMode LightDismissOverlayMode { get; set; }

Returns
LightDismissOverlayMode
A value of the enumeration that specifies whether the area outside of a light-dismiss UI is darkened. The default is
Auto.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Transient UI, such as the suggestion pane of an AutoSuggestBox, closes when you click or tap outside of it. This is
called light-dismiss. "Overlay" refers to the area outside of a light-dismiss UI.
By default, the "overlay" is darkened on the Xbox, and not darkened on other devices families. You can set
LightDismissOverlayMode to On to make your app darken the "overlay" area on all device families, or set it to Off to
not darken the "overlay" area on all device families.
Version compatibility
The LightDismissOverlayMode property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.AutoSuggestBox",
"LightDismissOverlayMode"))
{
autoSuggestBox1.LightDismissOverlayMode = LightDismissOverlayMode.On;
}
}
AutoSuggestBox.LightDismissOverlayModeProperty Auto
SuggestBox.LightDismissOverlayModeProperty Auto
SuggestBox.LightDismissOverlayModeProperty
I n this Article
Edit
Identifies the LightDismissOverlayMode dependency property.
public : static DependencyProperty LightDismissOverlayModeProperty { get; }
static DependencyProperty LightDismissOverlayModeProperty();
public static DependencyProperty LightDismissOverlayModeProperty { get; }

Returns
DependencyProperty
The identifier for the LightDismissOverlayMode dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


AutoSuggestBox.MaxSuggestionListHeight AutoSuggest
Box.MaxSuggestionListHeight AutoSuggestBox.Max
SuggestionListHeight
I n this Article
Edit
Gets or set the maximum height for the drop-down portion of the AutoSuggestBox control.
public : double MaxSuggestionListHeight { get; set; }
double MaxSuggestionListHeight();

void MaxSuggestionListHeight(double maxsuggestionlistheight);


public double MaxSuggestionListHeight { get; set; }

<AutoSuggestBox MaxSuggestionListHeight="double"/>

Returns
double
The maximum height for the drop-down portion of the AutoSuggestBox control.
AutoSuggestBox.MaxSuggestionListHeightProperty Auto
SuggestBox.MaxSuggestionListHeightProperty Auto
SuggestBox.MaxSuggestionListHeightProperty
I n this Article
Edit
Identifies the MaxSuggestionListHeight dependency property.
public : static DependencyProperty MaxSuggestionListHeightProperty { get; }
static DependencyProperty MaxSuggestionListHeightProperty();
public static DependencyProperty MaxSuggestionListHeightProperty { get; }

Returns
DependencyProperty
Identifier for the MaxSuggestionListHeight dependency property.
AutoSuggestBox.PlaceholderText AutoSuggestBox.
PlaceholderText AutoSuggestBox.PlaceholderText
I n this Article
Edit
Gets or sets the placeholder text to be displayed in the control.
public : Platform::String PlaceholderText { get; set; }
winrt::hstring PlaceholderText();

void PlaceholderText(winrt::hstring placeholdertext);


public string PlaceholderText { get; set; }

<AutoSuggestBox PlaceholderText="string"/>

Returns
string
The placeholder text to be displayed in the control. The default is an empty string.
AutoSuggestBox.PlaceholderTextProperty AutoSuggest
Box.PlaceholderTextProperty AutoSuggestBox.
PlaceholderTextProperty
I n this Article
Edit
Identifies the PlaceholderText dependency property.
public : static DependencyProperty PlaceholderTextProperty { get; }
static DependencyProperty PlaceholderTextProperty();
public static DependencyProperty PlaceholderTextProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderText dependency property.
AutoSuggestBox.QueryIcon AutoSuggestBox.QueryIcon
AutoSuggestBox.QueryIcon
I n this Article
Edit
Gets or sets the graphic content of the button that is clicked to initiate a query.
public : IconElement QueryIcon { get; set; }
IconElement QueryIcon();

void QueryIcon(IconElement queryicon);


public IconElement QueryIcon { get; set; }

<AutoSuggestBox QueryIcon="symbolName" .../>

Returns
IconElement
The graphic content of the button that is clicked to initiate a query, if present; otherwise, null. The default is null.
AutoSuggestBox.QueryIconProperty AutoSuggestBox.
QueryIconProperty AutoSuggestBox.QueryIconProperty
I n this Article
Edit
Identifies the QueryIcon dependency property.
public : static DependencyProperty QueryIconProperty { get; }
static DependencyProperty QueryIconProperty();
public static DependencyProperty QueryIconProperty { get; }

Returns
DependencyProperty
The identifier for the QueryIcon dependency property.
AutoSuggestBox.QuerySubmitted AutoSuggestBox.
QuerySubmitted AutoSuggestBox.QuerySubmitted
I n this Article
Edit
Occurs when the user submits a search query.
public : event TypedEventHandler<AutoSuggestBox, AutoSuggestBoxQuerySubmittedEventArgs>
QuerySubmitted
// Register
event_token QuerySubmitted(TypedEventHandler<AutoSuggestBox, AutoSuggestBoxQuerySubmittedEventArgs>
const& handler) const;

// Revoke with event_token


void QuerySubmitted(event_token const& cookie) const;

// Revoke with event_revoker


QuerySubmitted_revoker QuerySubmitted(auto_revoke_t, TypedEventHandler<AutoSuggestBox,
AutoSuggestBoxQuerySubmittedEventArgs> const& handler) const;
public event TypedEventHandler<AutoSuggestBox, AutoSuggestBoxQuerySubmittedEventArgs> QuerySubmitted

<AutoSuggestBox QuerySubmitted="eventhandler"/>

Remarks
See AutoSuggestBoxQuerySubmittedEventArgs.
AutoSuggestBox.SuggestionChosen AutoSuggestBox.
SuggestionChosen AutoSuggestBox.SuggestionChosen
I n this Article
Edit
Raised before the text content of the editable control component is updated.
public : event TypedEventHandler<AutoSuggestBox, AutoSuggestBoxSuggestionChosenEventArgs>
SuggestionChosen
// Register
event_token SuggestionChosen(TypedEventHandler<AutoSuggestBox,
AutoSuggestBoxSuggestionChosenEventArgs> const& handler) const;

// Revoke with event_token


void SuggestionChosen(event_token const& cookie) const;

// Revoke with event_revoker


SuggestionChosen_revoker SuggestionChosen(auto_revoke_t, TypedEventHandler<AutoSuggestBox,
AutoSuggestBoxSuggestionChosenEventArgs> const& handler) const;
public event TypedEventHandler<AutoSuggestBox, AutoSuggestBoxSuggestionChosenEventArgs>
SuggestionChosen

<AutoSuggestBox SuggestionChosen="eventhandler"/>

Remarks
Respond to this event when you would like to display information in the editable part of the text control beyond what is
provided by TextMemberPath.
AutoSuggestBox.Text AutoSuggestBox.Text AutoSuggest
Box.Text
I n this Article
Edit
Gets or sets the text that is shown in the control.
public : Platform::String Text { get; set; }
winrt::hstring Text();

void Text(winrt::hstring text);


public string Text { get; set; }

Returns
string
The text that is shown in the control.

Remarks
This property is not typically set in XAML.
AutoSuggestBox.TextBoxStyle AutoSuggestBox.TextBox
Style AutoSuggestBox.TextBoxStyle
I n this Article
Edit
Gets or sets the style of the auto-suggest text box.
public : Style TextBoxStyle { get; set; }
Style TextBoxStyle();

void TextBoxStyle(Style textboxstyle);


public Style TextBoxStyle { get; set; }

<AutoSuggestBox TextBoxStyle={StaticResource styleResourceKey}/>

Returns
Style
The style of the auto-suggest text box.
AutoSuggestBox.TextBoxStyleProperty AutoSuggestBox.
TextBoxStyleProperty AutoSuggestBox.TextBoxStyle
Property
I n this Article
Edit
Identifies the TextBoxStyle dependency property.
public : static DependencyProperty TextBoxStyleProperty { get; }
static DependencyProperty TextBoxStyleProperty();
public static DependencyProperty TextBoxStyleProperty { get; }

Returns
DependencyProperty
Identifier for the TextBoxStyle dependency property.
AutoSuggestBox.TextChanged AutoSuggestBox.Text
Changed AutoSuggestBox.TextChanged
I n this Article
Edit
Raised after the text content of the editable control component is updated.
public : event TypedEventHandler<AutoSuggestBox, AutoSuggestBoxTextChangedEventArgs> TextChanged
// Register
event_token TextChanged(TypedEventHandler<AutoSuggestBox, AutoSuggestBoxTextChangedEventArgs> const&
handler) const;

// Revoke with event_token


void TextChanged(event_token const& cookie) const;

// Revoke with event_revoker


TextChanged_revoker TextChanged(auto_revoke_t, TypedEventHandler<AutoSuggestBox,
AutoSuggestBoxTextChangedEventArgs> const& handler) const;
public event TypedEventHandler<AutoSuggestBox, AutoSuggestBoxTextChangedEventArgs> TextChanged

<AutoSuggestBox TextChanged="eventhandler"/>

Remarks
Using the AutoSuggestBoxTextChangedEventArgs data for this event, your app can differentiate between changes
from a user typing in the TextBox versus an item being selected from the drop-down suggestion list.
AutoSuggestBox.TextMemberPath AutoSuggestBox.Text
MemberPath AutoSuggestBox.TextMemberPath
I n this Article
Edit
Gets or sets the property path that is used to get the value for display in the text box portion of the AutoSuggestBox
control, when an item is selected.
public : Platform::String TextMemberPath { get; set; }
winrt::hstring TextMemberPath();

void TextMemberPath(winrt::hstring textmemberpath);


public string TextMemberPath { get; set; }

<AutoSuggestBox TextMemberPath="propertyName"/>

Returns
string
The property path that is used to get the value for display in the text box portion of the AutoSuggestBox control, when
an item is selected.
AutoSuggestBox.TextMemberPathProperty AutoSuggest
Box.TextMemberPathProperty AutoSuggestBox.Text
MemberPathProperty
I n this Article
Edit
Identifies the TextMemberPath dependency property.
public : static DependencyProperty TextMemberPathProperty { get; }
static DependencyProperty TextMemberPathProperty();
public static DependencyProperty TextMemberPathProperty { get; }

Returns
DependencyProperty
Identifier for the TextMemberPath dependency property.
AutoSuggestBox.TextProperty AutoSuggestBox.Text
Property AutoSuggestBox.TextProperty
I n this Article
Edit
Identifies the PlaceholderText dependency property.
public : static DependencyProperty TextProperty { get; }
static DependencyProperty TextProperty();
public static DependencyProperty TextProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderText dependency property.
AutoSuggestBox.UpdateTextOnSelect AutoSuggestBox.
UpdateTextOnSelect AutoSuggestBox.UpdateTextOn
Select
I n this Article
Edit
Used in conjunction with TextMemberPath, gets or sets a value indicating whether items in the view will trigger an
update of the editable text part of the AutoSuggestBox when clicked.
public : Platform::Boolean UpdateTextOnSelect { get; set; }
bool UpdateTextOnSelect();

void UpdateTextOnSelect(bool updatetextonselect);


public bool UpdateTextOnSelect { get; set; }

<AutoSuggestBox UpdateTextOnSelect="bool"/>

Returns
bool
A value indicating whether items in the view will trigger an update of the editable text part of the AutoSuggestBox
when clicked.
AutoSuggestBox.UpdateTextOnSelectProperty Auto
SuggestBox.UpdateTextOnSelectProperty AutoSuggest
Box.UpdateTextOnSelectProperty
I n this Article
Edit
Identifies the UpdateTextOnSelect dependency property.
public : static DependencyProperty UpdateTextOnSelectProperty { get; }
static DependencyProperty UpdateTextOnSelectProperty();
public static DependencyProperty UpdateTextOnSelectProperty { get; }

Returns
DependencyProperty
Identifier for the UpdateTextOnSelect dependency property.
AutoSuggestBoxQuerySubmittedEventArgs AutoSuggest
BoxQuerySubmittedEventArgs AutoSuggestBoxQuery
SubmittedEventArgs Class
Provides event data for the AutoSuggestBox.QuerySubmitted event.

D eclaration
public : sealed class AutoSuggestBoxQuerySubmittedEventArgs : DependencyObject,
IAutoSuggestBoxQuerySubmittedEventArgs
struct winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxQuerySubmittedEventArgs :
DependencyObject, IAutoSuggestBoxQuerySubmittedEventArgs
public sealed class AutoSuggestBoxQuerySubmittedEventArgs : DependencyObject,
IAutoSuggestBoxQuerySubmittedEventArgs

I nheritance H ierarchy
DependencyObject

Constructors
AutoSuggestBoxQuerySubmittedEventArgs()
AutoSuggestBoxQuerySubmittedEventArgs()
AutoSuggestBoxQuerySubmittedEventArgs()

Initializes a new instance of the AutoSuggestBoxQuerySubmittedEventArgs class.

Properties
ChosenSuggestion
ChosenSuggestion
ChosenSuggestion

Gets the suggested result that the user chose.

QueryText
QueryText
QueryText

Gets the query text of the current search.

See Also
DependencyObject
AutoSuggestBoxQuerySubmittedEventArgs AutoSuggest
BoxQuerySubmittedEventArgs AutoSuggestBoxQuery
SubmittedEventArgs
I n this Article
Edit
Initializes a new instance of the AutoSuggestBoxQuerySubmittedEventArgs class.
public : AutoSuggestBoxQuerySubmittedEventArgs()
AutoSuggestBoxQuerySubmittedEventArgs() const;
public AutoSuggestBoxQuerySubmittedEventArgs()
AutoSuggestBoxQuerySubmittedEventArgs.Chosen
Suggestion AutoSuggestBoxQuerySubmittedEventArgs.
ChosenSuggestion AutoSuggestBoxQuerySubmitted
EventArgs.ChosenSuggestion
I n this Article
Edit
Gets the suggested result that the user chose.
public : Platform::Object ChosenSuggestion { get; }
winrt::Windows::Foundation::IInspectable ChosenSuggestion();
public object ChosenSuggestion { get; }

Returns
object
The suggested result that the user chose.
AutoSuggestBoxQuerySubmittedEventArgs.QueryText
AutoSuggestBoxQuerySubmittedEventArgs.QueryText
AutoSuggestBoxQuerySubmittedEventArgs.QueryText
I n this Article
Edit
Gets the query text of the current search.
public : Platform::String QueryText { get; }
winrt::hstring QueryText();
public string QueryText { get; }

Returns
string
The query text of the current search.
AutoSuggestBoxSuggestionChosenEventArgs Auto
SuggestBoxSuggestionChosenEventArgs AutoSuggestBox
SuggestionChosenEventArgs Class
Provides data for the SuggestionChosen event.

D eclaration
public : sealed class AutoSuggestBoxSuggestionChosenEventArgs : DependencyObject,
IAutoSuggestBoxSuggestionChosenEventArgs
struct winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxSuggestionChosenEventArgs :
DependencyObject, IAutoSuggestBoxSuggestionChosenEventArgs
public sealed class AutoSuggestBoxSuggestionChosenEventArgs : DependencyObject,
IAutoSuggestBoxSuggestionChosenEventArgs

I nheritance H ierarchy
DependencyObject

Constructors
AutoSuggestBoxSuggestionChosenEventArgs()
AutoSuggestBoxSuggestionChosenEventArgs()
AutoSuggestBoxSuggestionChosenEventArgs()

Initializes a new instance of the AutoSuggestBoxSuggestionChosenEventArgs class.

Properties
SelectedItem
SelectedItem
SelectedItem

Gets a reference to the selected item.

See Also
DependencyObject
AutoSuggestBoxSuggestionChosenEventArgs Auto
SuggestBoxSuggestionChosenEventArgs AutoSuggestBox
SuggestionChosenEventArgs
I n this Article
Edit
Initializes a new instance of the AutoSuggestBoxSuggestionChosenEventArgs class.
public : AutoSuggestBoxSuggestionChosenEventArgs()
AutoSuggestBoxSuggestionChosenEventArgs() const;
public AutoSuggestBoxSuggestionChosenEventArgs()
AutoSuggestBoxSuggestionChosenEventArgs.Selected
Item AutoSuggestBoxSuggestionChosenEventArgs.
SelectedItem AutoSuggestBoxSuggestionChosenEvent
Args.SelectedItem
I n this Article
Edit
Gets a reference to the selected item.
public : Platform::Object SelectedItem { get; }
winrt::Windows::Foundation::IInspectable SelectedItem();
public object SelectedItem { get; }

Returns
object
A reference to the selected item.
AutoSuggestBoxTextChangedEventArgs AutoSuggestBox
TextChangedEventArgs AutoSuggestBoxTextChanged
EventArgs Class
Provides data for the TextChanged event.

D eclaration
public : sealed class AutoSuggestBoxTextChangedEventArgs : DependencyObject,
IAutoSuggestBoxTextChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::AutoSuggestBoxTextChangedEventArgs :
DependencyObject, IAutoSuggestBoxTextChangedEventArgs
public sealed class AutoSuggestBoxTextChangedEventArgs : DependencyObject,
IAutoSuggestBoxTextChangedEventArgs

I nheritance H ierarchy
DependencyObject

Constructors
AutoSuggestBoxTextChangedEventArgs()
AutoSuggestBoxTextChangedEventArgs()
AutoSuggestBoxTextChangedEventArgs()

Initializes a new instance of the AutoSuggestBoxTextChangedEventArgs class.

Properties
Reason
Reason
Reason

Gets or sets a value that indicates the reason for the text changing in the AutoSuggestBox.

ReasonProperty
ReasonProperty
ReasonProperty

Identifies the Reason dependency property.

Methods
CheckCurrent()
CheckCurrent()
CheckCurrent()

Returns a Boolean value indicating if the current value of the TextBox is unchanged from the point in time when
the TextChanged event was raised.
See Also
DependencyObject
AutoSuggestBoxTextChangedEventArgs AutoSuggestBox
TextChangedEventArgs AutoSuggestBoxTextChanged
EventArgs
I n this Article
Edit
Initializes a new instance of the AutoSuggestBoxTextChangedEventArgs class.
public : AutoSuggestBoxTextChangedEventArgs()
AutoSuggestBoxTextChangedEventArgs() const;
public AutoSuggestBoxTextChangedEventArgs()
AutoSuggestBoxTextChangedEventArgs.CheckCurrent
AutoSuggestBoxTextChangedEventArgs.CheckCurrent
AutoSuggestBoxTextChangedEventArgs.CheckCurrent
I n this Article
Edit
Returns a Boolean value indicating if the current value of the TextBox is unchanged from the point in time when the
TextChanged event was raised.
public : Platform::Boolean CheckCurrent()
bool CheckCurrent() const;
public bool CheckCurrent()

Returns
bool
Indicates if the current value of the TextBox is unchanged from the point in time when the TextChanged event was
raised.

Remarks
This method is useful in determining if the text has changed since the event was raised, such as after obtaining
suggestions from an asynchronous operation, in which time the user may have altered the text. Returns true if the text
has not changed, false if it has.
AutoSuggestBoxTextChangedEventArgs.Reason Auto
SuggestBoxTextChangedEventArgs.Reason AutoSuggest
BoxTextChangedEventArgs.Reason
I n this Article
Edit
Gets or sets a value that indicates the reason for the text changing in the AutoSuggestBox.
public : AutoSuggestionBoxTextChangeReason Reason { get; set; }
AutoSuggestionBoxTextChangeReason Reason();

void Reason(AutoSuggestionBoxTextChangeReason reason);


public AutoSuggestionBoxTextChangeReason Reason { get; set; }

Returns
AutoSuggestionBoxTextChangeReason
The reason for the text changing in the AutoSuggestBox.
AutoSuggestBoxTextChangedEventArgs.ReasonProperty
AutoSuggestBoxTextChangedEventArgs.ReasonProperty
AutoSuggestBoxTextChangedEventArgs.ReasonProperty
I n this Article
Edit
Identifies the Reason dependency property.
public : static DependencyProperty ReasonProperty { get; }
static DependencyProperty ReasonProperty();
public static DependencyProperty ReasonProperty { get; }

Returns
DependencyProperty
Identifier for the Reason dependency property.
AutoSuggestionBoxTextChangeReason AutoSuggestion
BoxTextChangeReason AutoSuggestionBoxTextChange
Reason Enum
Values used to indicate the reason for the text changing in the AutoSuggestBox.

D eclaration
public : enum class AutoSuggestionBoxTextChangeReason
enum class winrt::Windows::UI::Xaml::Controls::AutoSuggestionBoxTextChangeReason : int32_t
public enum AutoSuggestionBoxTextChangeReason

I nheritance H ierarchy
None

Fields
ProgrammaticChange ProgrammaticChange The text was changed via code.
ProgrammaticChange

SuggestionChosen SuggestionChosen SuggestionChosen The user selected one of the items in the auto-
suggestion box.

UserInput UserInput UserInput The user edited the text.


BackClickEventArgs BackClickEventArgs BackClickEvent
Args Class
Provides event data for the SettingsFlyout.BackClick event.

D eclaration
public : sealed class BackClickEventArgs : IBackClickEventArgs
struct winrt::Windows::UI::Xaml::Controls::BackClickEventArgs : IBackClickEventArgs
public sealed class BackClickEventArgs : IBackClickEventArgs

I nheritance H ierarchy
None

Constructors
BackClickEventArgs()
BackClickEventArgs()
BackClickEventArgs()

Initializes a new instance of the BackClickEventArgs class.

Properties
Handled
Handled
Handled

Gets or sets a value that can cancel the navigation. A true value for Handled cancels the default behavior.
BackClickEventArgs BackClickEventArgs BackClickEvent
Args
I n this Article
Edit
Initializes a new instance of the BackClickEventArgs class.
public : BackClickEventArgs()
BackClickEventArgs() const;
public BackClickEventArgs()
BackClickEventArgs.Handled BackClickEventArgs.
Handled BackClickEventArgs.Handled
I n this Article
Edit
Gets or sets a value that can cancel the navigation. A true value for Handled cancels the default behavior.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
true to cancel the navigation. false to use default behavior. The default is false.
BackClickEventHandler BackClickEventHandler BackClick
EventHandler Delegate
Represents the method that will handle a BackClick event.

D eclaration
public : delegate void BackClickEventHandler(Platform::Object sender, BackClickEventArgs e)
struct BackClickEventHandler : winrt::Windows::Foundation::IUnknown
{
BackClickEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> BackClickEventHandler(L lambda);
template <typename F> BackClickEventHandler(F* function);
template <typename O, typename M> BackClickEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::BackClickEventArgs const& e) const;
};
public delegate void BackClickEventHandler(Object sender, BackClickEventArgs e)

I nheritance H ierarchy
None
BackgroundSizing BackgroundSizing BackgroundSizing
Enum
Defines constants that specify how far an element's background extends in relation to the element's border.

D eclaration
public : enum class BackgroundSizing
enum class winrt::Windows::UI::Xaml::Controls::BackgroundSizing : int32_t
public enum BackgroundSizing

I nheritance H ierarchy
None

Remarks
This enumeration is used by elements that have a BackgroundSizing property.

Fields
InnerBorderEdge InnerBorderEdge The element's background extends to the inner edge of the border, but does not
InnerBorderEdge extend under the border.

OuterBorderEdge OuterBorderEdge The element's background extends under the border to its outer edge, and is
OuterBorderEdge visible if the border is transparent.
BitmapIcon BitmapIcon BitmapIcon Class
Represents an icon that uses a bitmap as its content.

D eclaration
public : class BitmapIcon : IconElement, IBitmapIcon, IBitmapIcon2
struct winrt::Windows::UI::Xaml::Controls::BitmapIcon : IconElement, IBitmapIcon, IBitmapIcon2
public class BitmapIcon : IconElement, IBitmapIcon, IBitmapIcon2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
IconElement

Remarks
Note

BitmapIcon is typically used to provide the icon for an AppBarButton, and the remarks in this section assume this
usage. However, it can be used anywhere a UIElement can be used. The remarks apply to all usages.
To use a BitmapIcon as the Icon for an AppBarButton, you specify the URI of an image file.
The file that you use should be a solid image on a transparent background. The bitmap image as retrieved from the
UriSource location is expected to be a true bitmap that has transparent pixels and non-transparent pixels. The
recommended format is PNG. Other file-format image sources will load apparently without error but result in a solid
block of the foreground color inside the AppBarButton.
All color info is stripped from the bitmap when the BitmapIcon is rendered. The remaining non-transparent colors are
combined to produce an image that's entirely the foreground color as set by the Foreground property (this typically
comes from styles or templates, such as the default template resolving to a theme resource).
Note

You can set the Foreground property on the AppBarButton or on the BitmapIcon. If you set the Foreground on the
AppBarButton, it's applied only to the default visual state. It's not applied to the other visual states defined in the
AppBarButton template, like MouseOver . If you set the Foreground on the BitmapIcon, the color is applied to all visual
states.
The default font size for an AppBarButton Icon is 20px.
You typically specify a UriSource value that references a bitmap that you've included as part of the app, as a resource
or otherwise within the app package. For more info on the ms-appx: scheme and other URI schemes that you can use
to reference resources in your app, see Uri schemes.

Constructors
BitmapIcon()
BitmapIcon()
BitmapIcon()

Initializes a new instance of the BitmapIcon class.


Properties
ShowAsMonochrome
ShowAsMonochrome
ShowAsMonochrome

Gets or sets a value that indicates whether the bitmap is shown in a single color.

ShowAsMonochromeProperty
ShowAsMonochromeProperty
ShowAsMonochromeProperty

Identifies the ShowAsMonochrome dependency property.

UriSource
UriSource
UriSource

Gets or sets the Uniform Resource Identifier (URI) of the bitmap to use as the icon content.

UriSourceProperty
UriSourceProperty
UriSourceProperty

Identifies the UriSource dependency property.

See Also
IconElement
IconElement
BitmapIcon BitmapIcon BitmapIcon
I n this Article
Edit
Initializes a new instance of the BitmapIcon class.

public : BitmapIcon()
BitmapIcon() const;
public BitmapIcon()
BitmapIcon.ShowAsMonochrome BitmapIcon.ShowAs
Monochrome BitmapIcon.ShowAsMonochrome
I n this Article
Edit
Gets or sets a value that indicates whether the bitmap is shown in a single color.
public : Platform::Boolean ShowAsMonochrome { get; set; }
bool ShowAsMonochrome();

void ShowAsMonochrome(bool showasmonochrome);


public bool ShowAsMonochrome { get; set; }

<BitmapIcon ShowAsMonochrome="bool"/>

Returns
bool
true to show the bitmap in a single color; false to show the bitmap in full color. The default is true.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


BitmapIcon.ShowAsMonochromeProperty BitmapIcon.
ShowAsMonochromeProperty BitmapIcon.ShowAs
MonochromeProperty
I n this Article
Edit
Identifies the ShowAsMonochrome dependency property.
public : static DependencyProperty ShowAsMonochromeProperty { get; }
static DependencyProperty ShowAsMonochromeProperty();
public static DependencyProperty ShowAsMonochromeProperty { get; }

Returns
DependencyProperty
The identifier for the ShowAsMonochrome dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


BitmapIcon.UriSource BitmapIcon.UriSource BitmapIcon.
UriSource
I n this Article
Edit
Gets or sets the Uniform Resource Identifier (URI) of the bitmap to use as the icon content.
public : Uri UriSource { get; set; }
Uri UriSource();

void UriSource(Uri urisource);


public Uri UriSource { get; set; }

<BitmapIcon UriSource="uriString"/>

Returns
Uri
The Uri of the bitmap to use as the icon content. The default is null.
See Foreground
Also Adding app bars
Uri schemes
BitmapIcon.UriSourceProperty BitmapIcon.UriSource
Property BitmapIcon.UriSourceProperty
I n this Article
Edit
Identifies the UriSource dependency property.
public : static DependencyProperty UriSourceProperty { get; }
static DependencyProperty UriSourceProperty();
public static DependencyProperty UriSourceProperty { get; }

Returns
DependencyProperty
The identifier for the UriSource dependency property.
BitmapIconSource BitmapIconSource BitmapIconSource
Class
Represents an icon source that uses a bitmap as its content.

D eclaration
public : class BitmapIconSource : IconSource, IBitmapIconSource
struct winrt::Windows::UI::Xaml::Controls::BitmapIconSource : IconSource, IBitmapIconSource
public class BitmapIconSource : IconSource, IBitmapIconSource

I nheritance H ierarchy
DependencyObject
IconSource

Remarks
BitmapIconSource is similar to BitmapIcon. However, because it is not a FrameworkElement, it can be shared.

Constructors
BitmapIconSource()
BitmapIconSource()
BitmapIconSource()

Initializes a new instance of the BitmapIconSource class.

Properties
ShowAsMonochrome
ShowAsMonochrome
ShowAsMonochrome

Gets or sets a value that indicates whether the bitmap is shown in a single color.

ShowAsMonochromeProperty
ShowAsMonochromeProperty
ShowAsMonochromeProperty

Identifies the ShowAsMonochrome dependency property.

UriSource
UriSource
UriSource

Gets or sets the Uniform Resource Identifier (URI) of the bitmap to use as the icon content.
UriSourceProperty
UriSourceProperty
UriSourceProperty

Identifies the UriSource dependency property.


BitmapIconSource BitmapIconSource BitmapIconSource
I n this Article
Edit
Initializes a new instance of the BitmapIconSource class.

public : BitmapIconSource()
BitmapIconSource() const;
public BitmapIconSource()
BitmapIconSource.ShowAsMonochrome BitmapIcon
Source.ShowAsMonochrome BitmapIconSource.ShowAs
Monochrome
I n this Article
Edit
Gets or sets a value that indicates whether the bitmap is shown in a single color.
public : Platform::Boolean ShowAsMonochrome { get; set; }
bool ShowAsMonochrome();

void ShowAsMonochrome(bool showasmonochrome);


public bool ShowAsMonochrome { get; set; }

<BitmapIconSource ShowAsMonochrome="bool"/>

Returns
bool
true to show the bitmap in a single color; false to show the bitmap in full color. The default is true.
BitmapIconSource.ShowAsMonochromeProperty Bitmap
IconSource.ShowAsMonochromeProperty BitmapIcon
Source.ShowAsMonochromeProperty
I n this Article
Edit
Identifies the ShowAsMonochrome dependency property.
public : static DependencyProperty ShowAsMonochromeProperty { get; }
static DependencyProperty ShowAsMonochromeProperty();
public static DependencyProperty ShowAsMonochromeProperty { get; }

Returns
DependencyProperty
The identifier for the ShowAsMonochrome dependency property.
BitmapIconSource.UriSource BitmapIconSource.Uri
Source BitmapIconSource.UriSource
I n this Article
Edit
Gets or sets the Uniform Resource Identifier (URI) of the bitmap to use as the icon content.
public : Uri UriSource { get; set; }
Uri UriSource();

void UriSource(Uri urisource);


public Uri UriSource { get; set; }

<BitmapIconSource UriSource="uriString"/>

Returns
Uri
The Uri of the bitmap to use as the icon content. The default is null.
BitmapIconSource.UriSourceProperty BitmapIconSource.
UriSourceProperty BitmapIconSource.UriSourceProperty
I n this Article
Edit
Identifies the UriSource dependency property.
public : static DependencyProperty UriSourceProperty { get; }
static DependencyProperty UriSourceProperty();
public static DependencyProperty UriSourceProperty { get; }

Returns
DependencyProperty
The identifier for the UriSource dependency property.
Border Border Border Class
Draws a border, background, or both, around another object.

D eclaration
public : sealed class Border : FrameworkElement, IBorder, IBorder2
struct winrt::Windows::UI::Xaml::Controls::Border : FrameworkElement, IBorder, IBorder2
public sealed class Border : FrameworkElement, IBorder, IBorder2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
Border is a container control that draws a border, background, or both, around another object. Here's a gray border
around two rectangles.

You can specify basic properties of a Border by setting its Width, Height, BorderBrush, BorderThickness, and
Background color. In addition, you can round the border corners by setting the CornerRadius property, and you can
position the object inside the Border by setting the Padding property.
A Border can contain only one child object. If you want to put a border around multiple objects, wrap them in a
container object such as StackPanel.

Constructors
Border()
Border()
Border()

Initializes a new instance of the Border class.

Properties
Background
Background
Background

Gets or sets the Brush that fills the background (inner area) of the border.
BackgroundProperty
BackgroundProperty
BackgroundProperty

Identifies the Background dependency property.

BackgroundSizing
BackgroundSizing
BackgroundSizing

Gets or sets a value that indicates how far the background extends in relation to this element's border.

BackgroundSizingProperty
BackgroundSizingProperty
BackgroundSizingProperty

Identifies the BackgroundSizing dependency property.

BackgroundTransition
BackgroundTransition
BackgroundTransition

Gets or sets an instance of BrushTransition to automatically animate changes to the Background property.

BorderBrush
BorderBrush
BorderBrush

Gets or sets the Brush that is applied to the edge area of the Border.

BorderBrushProperty
BorderBrushProperty
BorderBrushProperty

Identifies the BorderBrush dependency property.

BorderThickness
BorderThickness
BorderThickness

Gets or sets the thickness of the border.

BorderThicknessProperty
BorderThicknessProperty
BorderThicknessProperty
Identifies the BorderThickness dependency property.

Child
Child
Child

Gets or sets the child element to draw the border around.

ChildTransitions
ChildTransitions
ChildTransitions

Gets or sets the collection of Transition style elements that apply to child content of a Border.

ChildTransitionsProperty
ChildTransitionsProperty
ChildTransitionsProperty

Identifies the ChildTransitions dependency property.

CornerRadius
CornerRadius
CornerRadius

Gets or sets the radius for the corners of the border.

CornerRadiusProperty
CornerRadiusProperty
CornerRadiusProperty

Identifies the CornerRadius dependency property.

Padding
Padding
Padding

Gets or sets the distance between the border and its child object.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.


See Also
FrameworkElement
FrameworkElement
Border.Background Border.Background Border.
Background
I n this Article
Edit
Gets or sets the Brush that fills the background (inner area) of the border.
public : Brush Background { get; set; }
Brush Background();

void Background(Brush background);


public Brush Background { get; set; }

<Border Background="{StaticResource resourceName}"/>

Returns
Brush
The brush that fills the background. The default is null, (a null brush) which is evaluated as Transparent for rendering.

Examples
The following example shows how to set the background of a Border to a solid color using an inline-defined attribute
value "Cyan". The XAML parser uses this "Cyan" value to refer to the named color Colors.Cyan, and to create the
SolidColorBrush instance that supplies the runtime value.
<Border Background="Cyan" CornerRadius="20" Grid.Column="2" Grid.Row="2">
<TextBlock Text="Background Brush" TextWrapping="Wrap" VerticalAlignment="Center" />
</Border>

Remarks
The Background value for a Border is visible underneath the inner area if the element that is the Child element has
transparency or null value brushes for any of its defining area. It is also visible between the border edge and the Child
content if nonzero values are applied for a Padding value.
See Use brushes
Also
Border.BackgroundProperty Border.BackgroundProperty
Border.BackgroundProperty
I n this Article
Edit
Identifies the Background dependency property.
public : static DependencyProperty BackgroundProperty { get; }
static DependencyProperty BackgroundProperty();
public static DependencyProperty BackgroundProperty { get; }

Returns
DependencyProperty
The identifier for the Background dependency property.
Border.BackgroundSizing Border.BackgroundSizing
Border.BackgroundSizing
I n this Article
Edit
Gets or sets a value that indicates how far the background extends in relation to this element's border.
public : BackgroundSizing BackgroundSizing { get; set; }
BackgroundSizing BackgroundSizing();

void BackgroundSizing(BackgroundSizing backgroundsizing);


public BackgroundSizing BackgroundSizing { get; set; }

Returns
BackgroundSizing
A value of the enumeration that indicates how far the background extends. The default is InnerBorderEdge.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
You can set this property to OuterBorderEdge to make the element's background extend under the border. If the
border is transparent, the background will show through it.
See BackgroundSizing
Also
Border.BackgroundSizingProperty Border.Background
SizingProperty Border.BackgroundSizingProperty
I n this Article
Edit
Identifies the BackgroundSizing dependency property.
public : static DependencyProperty BackgroundSizingProperty { get; }
static DependencyProperty BackgroundSizingProperty();
public static DependencyProperty BackgroundSizingProperty { get; }

Returns
DependencyProperty
The identifier for the BackgroundSizing dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


Border.BackgroundTransition Border.Background
Transition Border.BackgroundTransition
I n this Article
Edit
Gets or sets an instance of BrushTransition to automatically animate changes to the Background property.
public : BrushTransition BackgroundTransition { get; set; }
BrushTransition BackgroundTransition();

void BackgroundTransition(BrushTransition backgroundtransition);


public BrushTransition BackgroundTransition { get; set; }

Returns
BrushTransition
An instance of BrushTransition to automatically animate changes to the Background; otherwise, null. The default is
null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Examples
This example shows how to apply a background transition to a Border. Each time BorderBackground is updated, the
background will animate from the old brush to the new brush.
<Border Background="{x:Bind BorderBackground}">
<Border.BackgroundTransition>
<BrushTransition />
</Border.BackgroundTransition>
</Border>

Remarks
Use this property to animate any change to the Background property. When a new value is set from code or through
data binding, the change is animated from the old value to the new value, rather than happening instantaneously.
Even though the transition animation takes time, the change to the actual property value is instantaneous. For example,
if you change a property from code and then read it back, you’ll see the new value, even though the visual effect of the
property change is somewhere between the new and the old.
If a property value changes a second time while the first change is still animating, the animation will use the currently
animated value as the "starting" value for the next animation, and then animate to the new "final" value. The duration
will be reset.
See BrushTransition
Also
Border Border Border
I n this Article
Edit
Initializes a new instance of the Border class.

public : Border()
Border() const;
public Border()
Border.BorderBrush Border.BorderBrush Border.Border
Brush
I n this Article
Edit
Gets or sets the Brush that is applied to the edge area of the Border.
public : Brush BorderBrush { get; set; }
Brush BorderBrush();

void BorderBrush(Brush borderbrush);


public Brush BorderBrush { get; set; }

<Border BorderBrush="{StaticResource resourceName}"/>

Returns
Brush
The brush that fills the border. The default is null, (a null brush) which is evaluated as Transparent for rendering.

Examples
This example shows how to set the BorderBrush value to a solid color using an inline-defined attribute value "Blue".
The XAML parser uses this "Blue" value to refer to the named color Colors.Blue, and to create the SolidColorBrush
instance that supplies the runtime value.
<Border BorderThickness="5" BorderBrush="Blue" >
<StackPanel Grid.Column="0" Grid.Row="0">
<TextBlock Text="One"/>
<TextBlock Text="Two"/>
<TextBlock Text="Three"/>
</StackPanel>
</Border>

Remarks
The BorderThickness value must be greater than 0 in order to see the BorderBrush value take effect.
See Use brushes
Also
Border.BorderBrushProperty Border.BorderBrushProperty
Border.BorderBrushProperty
I n this Article
Edit
Identifies the BorderBrush dependency property.
public : static DependencyProperty BorderBrushProperty { get; }
static DependencyProperty BorderBrushProperty();
public static DependencyProperty BorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the BorderBrush dependency property.
Border.BorderThickness Border.BorderThickness Border.
BorderThickness
I n this Article
Edit
Gets or sets the thickness of the border.
public : Thickness BorderThickness { get; set; }
Thickness BorderThickness();

void BorderThickness(Thickness borderthickness);


public Thickness BorderThickness { get; set; }

<Border BorderThickness="uniform"/>
- or -
<Border BorderThickness="left&right,top&bottom"/>
- or -
<Border BorderThickness="left,top,right,bottom"/>

Returns
Thickness
The thickness of the border, in pixels. The default is 0 on all four sides.
See Thickness
Also
Border.BorderThicknessProperty Border.BorderThickness
Property Border.BorderThicknessProperty
I n this Article
Edit
Identifies the BorderThickness dependency property.
public : static DependencyProperty BorderThicknessProperty { get; }
static DependencyProperty BorderThicknessProperty();
public static DependencyProperty BorderThicknessProperty { get; }

Returns
DependencyProperty
The identifier for the BorderThickness dependency property.
Border.Child Border.Child Border.Child
I n this Article
Edit
Gets or sets the child element to draw the border around.

public : UIElement Child { get; set; }


UIElement Child();

void Child(UIElement child);


public UIElement Child { get; set; }

<Border>
singleChild
</Border>

Returns
UIElement
The UIElement to apply the border to.
Border.ChildTransitions Border.ChildTransitions Border.
ChildTransitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to child content of a Border.
public : TransitionCollection ChildTransitions { get; set; }
TransitionCollection ChildTransitions();

void ChildTransitions(TransitionCollection childtransitions);


public TransitionCollection ChildTransitions { get; set; }

<Border>
<Border.ChildTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</Border.ChildTransitions>
</Border>

Returns
TransitionCollection
The strongly typed collection of Transition style elements.

Remarks
Note

Prior to Windows 10, version 1809 (SDK 17763), the XAML syntax for properties that have a TransitionCollection
value requires that you declare an explicit TransitionCollection object element as the value, and then provide object
elements as child elements of TransitionCollection for each of the transition animations you want to use. In Windows
10, version 1809 (SDK 17763) or later, TransitionCollection supports the implicit collection usage, so you can omit the
collection object element. For more info on implicit collections and XAML, see XAML syntax guide.
Transition animations play a particular role in the UI design of your app. The basic idea is that when there is a change
or transition, the animation draws the attention of the user to the change.
It's not common to set the value of the ChildTransitions property directly on a Border that is a direct element of app UI.
It's more common to have a transitions collection be a part of a visual state, template or style. In this case you use
mechanisms such as Setter of a Style to specify the ChildTransitions property. Styles are typically stored as a XAML
resource.
See TransitionCollection
Also
Border.ChildTransitionsProperty Border.ChildTransitions
Property Border.ChildTransitionsProperty
I n this Article
Edit
Identifies the ChildTransitions dependency property.
public : static DependencyProperty ChildTransitionsProperty { get; }
static DependencyProperty ChildTransitionsProperty();
public static DependencyProperty ChildTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the ChildTransitions dependency property.
Border.CornerRadius Border.CornerRadius Border.Corner
Radius
I n this Article
Edit
Gets or sets the radius for the corners of the border.
public : CornerRadius CornerRadius { get; set; }
CornerRadius CornerRadius();

void CornerRadius(CornerRadius cornerradius);


public CornerRadius CornerRadius { get; set; }

<Border CornerRadius="uniformRadius"/>
- or -
<Border CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>

Returns
CornerRadius
The degree to which the corners are rounded, expressed as values of the CornerRadius structure.

Remarks
Member components of a CornerRadius value cannot be negative.
Border.CornerRadiusProperty Border.CornerRadius
Property Border.CornerRadiusProperty
I n this Article
Edit
Identifies the CornerRadius dependency property.
public : static DependencyProperty CornerRadiusProperty { get; }
static DependencyProperty CornerRadiusProperty();
public static DependencyProperty CornerRadiusProperty { get; }

Returns
DependencyProperty
The identifier for the CornerRadius dependency property.
See BorderBorderBorder
Also
Border.Padding Border.Padding Border.Padding
I n this Article
Edit
Gets or sets the distance between the border and its child object.

public : Thickness Padding { get; set; }


Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<Border Padding="uniform"/>
- or -
<Border Padding="left&right,top&bottom"/>
- or -
<Border Padding="left,top,right,bottom"/>

Returns
Thickness
The dimensions of the space between the border and its child as a Thickness value. Thickness is a structure that stores
dimension values using pixel measures.

Remarks
A related property is Margin (a property of FrameworkElement ). For more info about the relationship between margin
and padding, see Alignment, margin, and padding or Define layouts with XAML.
See Thickness
Also Alignment, margin, and padding
Border.PaddingProperty Border.PaddingProperty Border.
PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
Button Button Button Class
Represents a templated button control that interprets a Click user interaction.

D eclaration
public : class Button : ButtonBase, IButton, IButtonWithFlyout
struct winrt::Windows::UI::Xaml::Controls::Button : ButtonBase, IButton, IButtonWithFlyout
public class Button : ButtonBase, IButton, IButtonWithFlyout

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase

Remarks
 Tip

For more info, design guidance, and code examples, see Buttons.
The Button class represents the most basic type of button control. For info on other similar button controls that are
more specialized, see HyperlinkButton or RepeatButton.

B utton interaction
When you tap a Button with a finger or stylus, or press a left mouse button while the pointer is over it, the button raises
the Click event. If a button has keyboard focus, pressing the Enter key or the Spacebar key also raises the Click event.
You generally can't handle low -level PointerPressed events on a Button because it has the Click behavior instead. For
more info, see Events and routed events overview.
You can change how a button raises the Click event by changing the ClickMode property. The default ClickMode value
is Release. If ClickMode is Hover, the Click event can't be raised with the keyboard.
B utton content
Button is a ContentControl. Its XAML content property is Content, and this enables a syntax like this for XAML:
<Button>A button's content</Button> . For more info about XAML content properties, see XAML overview.

B utton derived classes


Button is the parent class for AppBarButton.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the Button control.

R ES O U R CE K EY D ES CR IPTIO N

ButtonBackground Background color at rest

ButtonBackgroundPointerOver Background color on hover

ButtonBackgroundPressed Background color when pressed

ButtonBackgroundDisabled Background color when disabled

ButtonForeground Foreground color at rest

ButtonForegroundPointerOver Foreground color on hover

ButtonForegroundPressed Foreground color when pressed

ButtonForegroundDisabled Foreground color when disabled

ButtonBorderBrush Border color at rest

ButtonBorderBrushPointerOver Border color on hover

ButtonBorderBrushPressed Border color when pressed

ButtonBorderBrushDisabled Border color when disabled

Constructors
Button()
Button()
Button()

Initializes a new instance of the Button class.

Properties
Flyout
Flyout
Flyout

Gets or sets the flyout associated with this button.


FlyoutProperty
FlyoutProperty
FlyoutProperty

Identifies the Flyout dependency property.

See Also
Button Button Button
I n this Article
Edit
Initializes a new instance of the Button class.

public : Button()
Button() const;
public Button()
Button.Flyout Button.Flyout Button.Flyout
I n this Article
Edit
Gets or sets the flyout associated with this button.

public : FlyoutBase Flyout { get; set; }


FlyoutBase Flyout();

void Flyout(FlyoutBase flyout);


public FlyoutBase Flyout { get; set; }

<Button>
<Button.Flyout>flyout</Button.Flyout>
</Button>

Returns
FlyoutBase
The flyout associated with this button, if any; otherwise, null. The default is null.

Remarks
By default, the flyout that's set as the value of the Flyout property displays when the button is tapped or otherwise
invoked, you don't need to call methods to display it. That differs from the behavior of flyouts assigned through the
FlyoutBase.AttachedFlyout attached property; these flyouts must be explicitly displayed by calling ShowAt on the
flyout instance, or the static ShowAttachedFlyout method.
See Quickstart: Adding a Flyout
Also XAML Flyout and MenuFlyout sample
Button.FlyoutProperty Button.FlyoutProperty Button.
FlyoutProperty
I n this Article
Edit
Identifies the Flyout dependency property.
public : static DependencyProperty FlyoutProperty { get; }
static DependencyProperty FlyoutProperty();
public static DependencyProperty FlyoutProperty { get; }

Returns
DependencyProperty
The identifier for the Flyout dependency property.
CalendarDatePicker CalendarDatePicker CalendarDate
Picker Class
Represents a control that allows a user to pick a date from a calendar display.

D eclaration
public : class CalendarDatePicker : Control, ICalendarDatePicker, ICalendarDatePicker2,
ICalendarDatePicker3
struct winrt::Windows::UI::Xaml::Controls::CalendarDatePicker : Control, ICalendarDatePicker,
ICalendarDatePicker2, ICalendarDatePicker3
public class CalendarDatePicker : Control, ICalendarDatePicker, ICalendarDatePicker2,
ICalendarDatePicker3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Calendar date picker.
CalendarDatePicker is a drop down control that’s optimized for picking a single date from a calendar view where
contextual information like the day of the week or fullness of the calendar is important. It’s similar to the DatePicker
control, but the DatePicker is optimized for picking a known date, such as a date of birth, where the context of the
calendar is not important.
You can use the CalendarDatePicker control in its default form with a minimal amount of Extensible Application
Markup Language (XAML ) or other code, or you can customize it in various ways to suit your app. Here's a simple
CalendarDatePicker created in Extensible Application Markup Language (XAML ) and code.
CalendarDatePicker arrivalCalendarDatePicker = new CalendarDatePicker();

<CalendarDatePicker x:Name="arrivalCalendarDatePicker"/>

Here's what the control look like when it's closed and a date is not selected.

Here's what it looks like with the calendar open and a date selected.
CalendarDatePicker has an internal CalendarView for picking a date. A
subset of CalendarView properties, like IsTodayHighlighted and FirstDayOfWeek, exist on CalendarDatePicker and are
forwarded to the internal CalendarView to let you modify it. However, you can't change the SelectionMode of the
internal CalendarView to allow multiple selection. If you need to let a user pick multiple dates or need a calendar to be
always visible, consider using a CalendarView instead of a CalendarDatePicker. See the CalendarView class for more
info on how you can modify the calendar display.
Selecting dates
Use the Date property to get or set the selected date. By default, the Date property is null. When a user selects a date in
the calendar view, this property is updated. A user can clear the date by clicking the selected date in the calendar view
to deselect it.
You can set the date in your code like this.

myCalendarDatePicker.Date = new DateTime(1977, 1, 5);

When you set the Date in code, the value is constrained by the MinDate and MaxDate properties. If Date is smaller
than MinDate, the value is set to MinDate. If Date is greater than MaxDate, the value is set to MaxDate.
You can handle the DateChanged event to be notified when the Date value has changed.
Formatting the selected date
You can change the display format of the day, month, and year of the selected date. The string content of the TextBox
portion of the CalendarDatePicker is created by a DateTimeFormatter. You tell the DateTimeFormatter how to format
the value by providing a string that is either a format template or a format pattern. For the complete list of format
templates and format patterns, see the Remarks section of the DateTimeFormatter class documentation.
Here's how to specify a format in XAML and in code using format patterns.
<CalendarDatePicker x:Name="myCalendarDatePicker"
DateFormat = "{}{dayofweek.full}, {month.full} {day.integer}, {year.full}"/>

myCalendarDatePicker.DateFormat = "{dayofweek.full}, {month.full} {day.integer}, {year.full}";

The selected date looks like this with the date formatted.

Setting a header and placeholder text


You can add a Header (or label) and PlaceholderText (or watermark) to the CalendarDatePicker to give the user an
indication of what it's used for. To customize the look of the header, you can set the HeaderTemplate property instead of
Header. For design info, see Guidelines for labels.
The default placeholder text is "select a date ". You can remove this by setting the PlaceholderText property to an
empty string, or you can provide custom text as shown here.

<CalendarDatePicker x:Name="arrivalCalendarDatePicker" Header="Arrival date" PlaceholderText="Choose


your arrival date"/>

G lobalization
The CalendarDatePicker supports each of the calendar systems supported by Windows. These calendars are specified
in the Windows.Globalization.CalendarIdentifiers class. The CalendarDatePicker uses the correct calendar for your
app's default language, or you can set the CalendarIdentifier property to use a specific calendar system.
D ateTime and Calendar values
The date objects used in a CalendarDatePicker have a different representation depending on your programming
language. C# and Visual Basic use the System.DateTimeOffset structure that is part of .NET. Visual C++ component
extensions (C++/CX) uses the Windows::Foundation::DateTime structure. A related concept is the Calendar class,
which influences how dates are interpreted in context. All Windows Runtime apps can use the
Windows.Globalization.Calendar class. C# and Visual Basic apps can alternatively use the
System.Globalization.Calendar class, which has very similar functionality. (Windows Runtime app can use the base
.NET Calendar class but not the specific implementations for example GregorianCalendar.)
.NET also supports a type named DateTime, which is implicitly convertible to a DateTimeOffset. So you might see a
"DateTime" type being used in .NET code that's used to set values that are really DateTimeOffset. For more info on the
difference between DateTime and DateTimeOffset, see Remarks in DateTimeOffset.
Note

Properties that take date objects can't be set as a XAML attribute string, because the Windows Runtime XAML parser
doesn't have a conversion logic for converting strings to dates as DateTime/DateTimeOffset objects. You typically set
these values in code. Another possible technique is to define a date that's available as a data object or in the data
context, then set the property as a XAML attribute that references a {Binding} markup extension expression that can
access the date as data.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the CalendarDatePicker control.

R ES O U R CE K EY D ES CR IPTIO N
CalendarDatePickerForeground Header text color

CalendarDatePickerForegroundDisabled Foreground color when disabled

CalendarDatePickerCalendarGlyphForeground Calendar icon color

CalendarDatePickerCalendarGlyphForegroundDisabled Calendar icon color when disabled

CalendarDatePickerTextForeground Placeholder text color

CalendarDatePickerTextForegroundDisabled Placeholder text when disabled

CalendarDatePickerTextForegroundSelected Placeholder text when selected

CalendarDatePickerHeaderForegroundDisabled Header text color when disabled

CalendarDatePickerBackground Background color at rest

CalendarDatePickerBackgroundPointerOver Background color on hover

CalendarDatePickerBackgroundPressed Background color when pressed

CalendarDatePickerBackgroundDisabled Background color when disabled

CalendarDatePickerBackgroundFocused Background color when focused

CalendarDatePickerBorderBrush Border color at rest

CalendarDatePickerBorderBrushPointerOver Border color on hover

CalendarDatePickerBorderBrushPressed Border color when pressed

CalendarDatePickerBorderBrushDisabled Border color when disabled

Constructors
CalendarDatePicker()
CalendarDatePicker()
CalendarDatePicker()

Initializes a new instance of the CalendarDatePicker class.

Properties
CalendarIdentifier
CalendarIdentifier
CalendarIdentifier

Gets or sets the calendar system to use.


CalendarIdentifierProperty
CalendarIdentifierProperty
CalendarIdentifierProperty

Identifies the CalendarIdentifier dependency property.

CalendarViewStyle
CalendarViewStyle
CalendarViewStyle

Gets or sets the Style associated with the control's internal CalendarView object.

CalendarViewStyleProperty
CalendarViewStyleProperty
CalendarViewStyleProperty

Identifies the CalendarViewStyle dependency property.

Date
Date
Date

Gets or sets the date currently set in the calendar picker.

DateFormat
DateFormat
DateFormat

Gets or sets the display format for the date value in the picker's text box.

DateFormatProperty
DateFormatProperty
DateFormatProperty

Identifies the DateFormat dependency property.

DateProperty
DateProperty
DateProperty

Identifies the Date dependency property.

DayOfWeekFormat
DayOfWeekFormat
DayOfWeekFormat
Gets or sets the display format for the day of the week headers in the picker's CalendarView.

DayOfWeekFormatProperty
DayOfWeekFormatProperty
DayOfWeekFormatProperty

Identifies the DayOfWeekFormat dependency property.

Description
Description
Description

Gets or sets content that is shown below the control. The content should provide guidance about the input
expected by the control.

DescriptionProperty
DescriptionProperty
DescriptionProperty

Identifies the Description dependency property.

DisplayMode
DisplayMode
DisplayMode

Gets or sets a value that indicates whether the calendar shows selections for month, year, or decade in the picker's
CalendarView.

DisplayModeProperty
DisplayModeProperty
DisplayModeProperty

Identifies the DisplayMode dependency property.

FirstDayOfWeek
FirstDayOfWeek
FirstDayOfWeek

Gets or sets a value that indicates which day is shown as the first day of the week in the picker's CalendarView.

FirstDayOfWeekProperty
FirstDayOfWeekProperty
FirstDayOfWeekProperty

Identifies the FirstDayOfWeek dependency property.


Header
Header
Header

Gets or sets the content for the calendar picker's header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

IsCalendarOpen
IsCalendarOpen
IsCalendarOpen

Gets or sets a value that indicates whether the calendar view of the CalendarDatePicker is currently shown.

IsCalendarOpenProperty
IsCalendarOpenProperty
IsCalendarOpenProperty

Identifies the IsCalendarOpen dependency property.

IsGroupLabelVisible
IsGroupLabelVisible
IsGroupLabelVisible

Gets or sets a value that indicates whether the month name is shown with the first day of the month in the picker's
CalendarView.

IsGroupLabelVisibleProperty
IsGroupLabelVisibleProperty
IsGroupLabelVisibleProperty

Identifies the IsGroupLabelVisible dependency property.

IsOutOfScopeEnabled
IsOutOfScopeEnabled
IsOutOfScopeEnabled

Gets or sets a value that indicates whether out-of-scope calendar items are shown with a unique foreground color
in the picker's CalendarView.

IsOutOfScopeEnabledProperty
IsOutOfScopeEnabledProperty
IsOutOfScopeEnabledProperty

Identifies the IsOutOfScopeEnabled dependency property.

IsTodayHighlighted
IsTodayHighlighted
IsTodayHighlighted

Gets or sets a value that indicates whether the current date is highlighted in the picker's CalendarView.

IsTodayHighlightedProperty
IsTodayHighlightedProperty
IsTodayHighlightedProperty

Identifies the IsTodayHighlighted dependency property.

LightDismissOverlayMode
LightDismissOverlayMode
LightDismissOverlayMode

Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.

LightDismissOverlayModeProperty
LightDismissOverlayModeProperty
LightDismissOverlayModeProperty

Identifies the LightDismissOverlayMode dependency property.

MaxDate
MaxDate
MaxDate

Gets or sets the latest date that can be set in the picker.
MaxDateProperty
MaxDateProperty
MaxDateProperty

Identifies the MaxDate dependency property.

MinDate
MinDate
MinDate

Gets or sets the earliest date that can be set in the picker.

MinDateProperty
MinDateProperty
MinDateProperty

Identifies the MinDate dependency property.

PlaceholderText
PlaceholderText
PlaceholderText

Gets or sets the text that is displayed in the picker's text box until the value is changed by a user action or some
other operation.

PlaceholderTextProperty
PlaceholderTextProperty
PlaceholderTextProperty

Identifies the PlaceholderText dependency property.

Methods
SetDisplayDate(DateTime)
SetDisplayDate(DateTime)
SetDisplayDate(DateTime)

Shows the specified date in the calendar picker.

SetYearDecadeDisplayDimensions(Int32, Int32)
SetYearDecadeDisplayDimensions(Int32, Int32)
SetYearDecadeDisplayDimensions(Int32, Int32)

Sets the number of rows and columns to use in the Year and Decade display modes of the picker's CalendarView.
Events
CalendarViewDayItemChanging
CalendarViewDayItemChanging
CalendarViewDayItemChanging

Occurs when a CalendarViewDayItem is loading in the picker's CalendarView.

Closed
Closed
Closed

Occurs when the picker's CalendarView is hidden.

DateChanged
DateChanged
DateChanged

Occurs when the date value is changed.

Opened
Opened
Opened

Occurs when the picker's CalendarView is shown.

See Also
Control
Control
CalendarDatePicker CalendarDatePicker CalendarDate
Picker
I n this Article
Edit
Initializes a new instance of the CalendarDatePicker class.
public : CalendarDatePicker()
CalendarDatePicker() const;
public CalendarDatePicker()
CalendarDatePicker.CalendarIdentifier CalendarDate
Picker.CalendarIdentifier CalendarDatePicker.Calendar
Identifier
I n this Article
Edit
Gets or sets the calendar system to use.
public : Platform::String CalendarIdentifier { get; set; }
winrt::hstring CalendarIdentifier();

void CalendarIdentifier(winrt::hstring calendaridentifier);


public string CalendarIdentifier { get; set; }

<CalendarDatePicker CalendarIdentifier="calendarSystem"/>

Returns
string
The name of the calendar system to use.
CalendarDatePicker.CalendarIdentifierProperty Calendar
DatePicker.CalendarIdentifierProperty CalendarDate
Picker.CalendarIdentifierProperty
I n this Article
Edit
Identifies the CalendarIdentifier dependency property.
public : static DependencyProperty CalendarIdentifierProperty { get; }
static DependencyProperty CalendarIdentifierProperty();
public static DependencyProperty CalendarIdentifierProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarIdentifier dependency property.
See Dependency properties overview
Also
CalendarDatePicker.CalendarViewDayItemChanging
CalendarDatePicker.CalendarViewDayItemChanging
CalendarDatePicker.CalendarViewDayItemChanging
I n this Article
Edit
Occurs when a CalendarViewDayItem is loading in the picker's CalendarView.
public : event CalendarViewDayItemChangingEventHandler CalendarViewDayItemChanging
// Register
event_token CalendarViewDayItemChanging(CalendarViewDayItemChangingEventHandler const& handler)
const;

// Revoke with event_token


void CalendarViewDayItemChanging(event_token const& cookie) const;

// Revoke with event_revoker


CalendarViewDayItemChanging_revoker CalendarViewDayItemChanging(auto_revoke_t,
CalendarViewDayItemChangingEventHandler const& handler) const;
public event CalendarViewDayItemChangingEventHandler CalendarViewDayItemChanging

<CalendarDatePicker CalendarViewDayItemChanging="eventhandler"/>

Remarks
This method is comes from the CalendarDatePicker 's internal CalendarView. For more info, see
CalendarView.CalendarViewDayItemChanging.
CalendarDatePicker.CalendarViewStyle CalendarDate
Picker.CalendarViewStyle CalendarDatePicker.Calendar
ViewStyle
I n this Article
Edit
Gets or sets the Style associated with the control's internal CalendarView object.
public : Style CalendarViewStyle { get; set; }
Style CalendarViewStyle();

void CalendarViewStyle(Style calendarviewstyle);


public Style CalendarViewStyle { get; set; }

<CalendarDatePicker CalendarViewStyle={StaticResource styleResourceKey}/>

Returns
Style
The current style of the CalendarView object.
CalendarDatePicker.CalendarViewStyleProperty Calendar
DatePicker.CalendarViewStyleProperty CalendarDate
Picker.CalendarViewStyleProperty
I n this Article
Edit
Identifies the CalendarViewStyle dependency property.
public : static DependencyProperty CalendarViewStyleProperty { get; }
static DependencyProperty CalendarViewStyleProperty();
public static DependencyProperty CalendarViewStyleProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarViewStyle dependency property.
See Dependency properties overview
Also
CalendarDatePicker.Closed CalendarDatePicker.Closed
CalendarDatePicker.Closed
I n this Article
Edit
Occurs when the picker's CalendarView is hidden.
public : event EventHandler<Platform::Object> Closed
// Register
event_token Closed(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void Closed(event_token const& cookie) const;

// Revoke with event_revoker


Closed_revoker Closed(auto_revoke_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> Closed

<CalendarDatePicker Closed="eventhandler"/>
CalendarDatePicker.Date CalendarDatePicker.Date
CalendarDatePicker.Date
I n this Article
Edit
Gets or sets the date currently set in the calendar picker.
public : IReference<DateTime> Date { get; set; }
IReference<DateTime> Date();

void Date(IReference<DateTime> date);


public Nullable<DateTimeOffset> Date { get; set; }

Returns
Nullable<DateTimeOffset>
The date currently set in the calendar picker.
CalendarDatePicker.DateChanged CalendarDatePicker.
DateChanged CalendarDatePicker.DateChanged
I n this Article
Edit
Occurs when the date value is changed.
public : event TypedEventHandler<CalendarDatePicker, CalendarDatePickerDateChangedEventArgs>
DateChanged
// Register
event_token DateChanged(TypedEventHandler<CalendarDatePicker,
CalendarDatePickerDateChangedEventArgs> const& handler) const;

// Revoke with event_token


void DateChanged(event_token const& cookie) const;

// Revoke with event_revoker


DateChanged_revoker DateChanged(auto_revoke_t, TypedEventHandler<CalendarDatePicker,
CalendarDatePickerDateChangedEventArgs> const& handler) const;
public event TypedEventHandler<CalendarDatePicker, CalendarDatePickerDateChangedEventArgs>
DateChanged

<CalendarDatePicker DateChanged="eventhandler"/>
CalendarDatePicker.DateFormat CalendarDatePicker.
DateFormat CalendarDatePicker.DateFormat
I n this Article
Edit
Gets or sets the display format for the date value in the picker's text box.
public : Platform::String DateFormat { get; set; }
winrt::hstring DateFormat();

void DateFormat(winrt::hstring dateformat);


public string DateFormat { get; set; }

<CalendarDatePicker DateFormat="formatString"/>

Returns
string
The string format to use to display the date in the picker's text box.
CalendarDatePicker.DateFormatProperty CalendarDate
Picker.DateFormatProperty CalendarDatePicker.Date
FormatProperty
I n this Article
Edit
Identifies the DateFormat dependency property.
public : static DependencyProperty DateFormatProperty { get; }
static DependencyProperty DateFormatProperty();
public static DependencyProperty DateFormatProperty { get; }

Returns
DependencyProperty
The identifier for the DateFormat dependency property.
See Dependency properties overview
Also
CalendarDatePicker.DateProperty CalendarDatePicker.
DateProperty CalendarDatePicker.DateProperty
I n this Article
Edit
Identifies the Date dependency property.
public : static DependencyProperty DateProperty { get; }
static DependencyProperty DateProperty();
public static DependencyProperty DateProperty { get; }

Returns
DependencyProperty
The identifier for the Date dependency property.
See Dependency properties overview
Also
CalendarDatePicker.DayOfWeekFormat CalendarDate
Picker.DayOfWeekFormat CalendarDatePicker.DayOf
WeekFormat
I n this Article
Edit
Gets or sets the display format for the day of the week headers in the picker's CalendarView.
public : Platform::String DayOfWeekFormat { get; set; }
winrt::hstring DayOfWeekFormat();

void DayOfWeekFormat(winrt::hstring dayofweekformat);


public string DayOfWeekFormat { get; set; }

<CalendarDatePicker DayOfWeekFormat="formatString"/>

Returns
string
The string format to use to display the day of the week headers in the picker's CalendarView.

Remarks
This property affects the CalendarDatePicker 's internal CalendarView. For more info, see
CalendarView.DayOfWeekFormat.
CalendarDatePicker.DayOfWeekFormatProperty
CalendarDatePicker.DayOfWeekFormatProperty
CalendarDatePicker.DayOfWeekFormatProperty
I n this Article
Edit
Identifies the DayOfWeekFormat dependency property.
public : static DependencyProperty DayOfWeekFormatProperty { get; }
static DependencyProperty DayOfWeekFormatProperty();
public static DependencyProperty DayOfWeekFormatProperty { get; }

Returns
DependencyProperty
The identifier for the DayOfWeekFormat dependency property.
See Dependency properties overview
Also
CalendarDatePicker.Description CalendarDatePicker.
Description CalendarDatePicker.Description
I n this Article
Edit
Gets or sets content that is shown below the control. The content should provide guidance about the input expected by
the control.
public : Platform::Object Description { get; set; }
winrt::Windows::Foundation::IInspectable Description();

void Description(winrt::Windows::Foundation::IInspectable description);


public object Description { get; set; }

Returns
object
The content to be displayed below the control. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


CalendarDatePicker.DescriptionProperty CalendarDate
Picker.DescriptionProperty CalendarDatePicker.
DescriptionProperty
I n this Article
Edit
Identifies the Description dependency property.
public : static DependencyProperty DescriptionProperty { get; }
static DependencyProperty DescriptionProperty();
public static DependencyProperty DescriptionProperty { get; }

Returns
DependencyProperty
The identifier for the Description dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


CalendarDatePicker.DisplayMode CalendarDatePicker.
DisplayMode CalendarDatePicker.DisplayMode
I n this Article
Edit
Gets or sets a value that indicates whether the calendar shows selections for month, year, or decade in the picker's
CalendarView.
public : CalendarViewDisplayMode DisplayMode { get; set; }
CalendarViewDisplayMode DisplayMode();

void DisplayMode(CalendarViewDisplayMode displaymode);


public CalendarViewDisplayMode DisplayMode { get; set; }

<CalendarDatePicker DisplayMode="calendarViewDisplayModeMemberName" />

Returns
CalendarViewDisplayMode
A value of the enumeration that indicates whether the calendar shows selections for month, year, or decade. The default
is Month.

Remarks
This property affects the CalendarDatePicker 's internal CalendarView. For more info, see CalendarView.DisplayMode.
CalendarDatePicker.DisplayModeProperty CalendarDate
Picker.DisplayModeProperty CalendarDatePicker.Display
ModeProperty
I n this Article
Edit
Identifies the DisplayMode dependency property.
public : static DependencyProperty DisplayModeProperty { get; }
static DependencyProperty DisplayModeProperty();
public static DependencyProperty DisplayModeProperty { get; }

Returns
DependencyProperty
The identifier for the DisplayMode dependency property.
See Dependency properties overview
Also
CalendarDatePicker.FirstDayOfWeek CalendarDatePicker.
FirstDayOfWeek CalendarDatePicker.FirstDayOfWeek
I n this Article
Edit
Gets or sets a value that indicates which day is shown as the first day of the week in the picker's CalendarView.
public : DayOfWeek FirstDayOfWeek { get; set; }
DayOfWeek FirstDayOfWeek();

void FirstDayOfWeek(DayOfWeek firstdayofweek);


public DayOfWeek FirstDayOfWeek { get; set; }

<CalendarDatePicker FirstDayOfWeek="dayOfWeekMemberName"/>

Returns
DayOfWeek
A value of the enumeration that indicates which day is shown as the first day of the week.

Remarks
This property affects the CalendarDatePicker 's internal CalendarView. For more info, see
CalendarView.FirstDayOfWeek.
CalendarDatePicker.FirstDayOfWeekProperty Calendar
DatePicker.FirstDayOfWeekProperty CalendarDatePicker.
FirstDayOfWeekProperty
I n this Article
Edit
Identifies the FirstDayOfWeek dependency property.
public : static DependencyProperty FirstDayOfWeekProperty { get; }
static DependencyProperty FirstDayOfWeekProperty();
public static DependencyProperty FirstDayOfWeekProperty { get; }

Returns
DependencyProperty
The identifier for the FirstDayOfWeek dependency property.
See Dependency properties overview
Also
CalendarDatePicker.Header CalendarDatePicker.Header
CalendarDatePicker.Header
I n this Article
Edit
Gets or sets the content for the calendar picker's header.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<CalendarDatePicker Header="headerString"/>

Returns
object
The content of the header. The default value is null.
CalendarDatePicker.HeaderProperty CalendarDatePicker.
HeaderProperty CalendarDatePicker.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
See Dependency properties overview
Also
CalendarDatePicker.HeaderTemplate CalendarDatePicker.
HeaderTemplate CalendarDatePicker.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<CalendarDatePicker>
<CalendarDatePicker.HeaderTemplate>
singleDataTemplate
</CalendarDatePicker.HeaderTemplate>
</CalendarDatePicker>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
CalendarDatePicker.HeaderTemplateProperty Calendar
DatePicker.HeaderTemplateProperty CalendarDatePicker.
HeaderTemplateProperty
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
See Dependency properties overview
Also
CalendarDatePicker.IsCalendarOpen CalendarDatePicker.
IsCalendarOpen CalendarDatePicker.IsCalendarOpen
I n this Article
Edit
Gets or sets a value that indicates whether the calendar view of the CalendarDatePicker is currently shown.
public : Platform::Boolean IsCalendarOpen { get; set; }
bool IsCalendarOpen();

void IsCalendarOpen(bool iscalendaropen);


public bool IsCalendarOpen { get; set; }

<CalendarDatePicker IsCalendarOpen="bool" .../>

Returns
bool
true if the calendar view is shown; otherwise, false. The default is false.
CalendarDatePicker.IsCalendarOpenProperty Calendar
DatePicker.IsCalendarOpenProperty CalendarDatePicker.
IsCalendarOpenProperty
I n this Article
Edit
Identifies the IsCalendarOpen dependency property.
public : static DependencyProperty IsCalendarOpenProperty { get; }
static DependencyProperty IsCalendarOpenProperty();
public static DependencyProperty IsCalendarOpenProperty { get; }

Returns
DependencyProperty
The identifier for the IsCalendarOpen dependency property.
See Dependency properties overview
Also
CalendarDatePicker.IsGroupLabelVisible CalendarDate
Picker.IsGroupLabelVisible CalendarDatePicker.IsGroup
LabelVisible
I n this Article
Edit
Gets or sets a value that indicates whether the month name is shown with the first day of the month in the picker's
CalendarView.
public : Platform::Boolean IsGroupLabelVisible { get; set; }
bool IsGroupLabelVisible();

void IsGroupLabelVisible(bool isgrouplabelvisible);


public bool IsGroupLabelVisible { get; set; }

<CalendarDatePicker IsGroupLabelVisible="bool" .../>

Returns
bool
true if the month name is shown with the first day of the month; otherwise, false. The default is true.

Remarks
This property affects the CalendarDatePicker 's internal CalendarView. For more info, see
CalendarView.IsGroupLabelVisible.
CalendarDatePicker.IsGroupLabelVisibleProperty
CalendarDatePicker.IsGroupLabelVisibleProperty
CalendarDatePicker.IsGroupLabelVisibleProperty
I n this Article
Edit
Identifies the IsGroupLabelVisible dependency property.
public : static DependencyProperty IsGroupLabelVisibleProperty { get; }
static DependencyProperty IsGroupLabelVisibleProperty();
public static DependencyProperty IsGroupLabelVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsGroupLabelVisible dependency property.
See Dependency properties overview
Also
CalendarDatePicker.IsOutOfScopeEnabled CalendarDate
Picker.IsOutOfScopeEnabled CalendarDatePicker.IsOutOf
ScopeEnabled
I n this Article
Edit
Gets or sets a value that indicates whether out-of-scope calendar items are shown with a unique foreground color in
the picker's CalendarView.
public : Platform::Boolean IsOutOfScopeEnabled { get; set; }
bool IsOutOfScopeEnabled();

void IsOutOfScopeEnabled(bool isoutofscopeenabled);


public bool IsOutOfScopeEnabled { get; set; }

<CalendarDatePicker IsOutOfScopeEnabled="bool" .../>

Returns
bool
true if out-of-scope calendar items are shown with a unique color; false if they are shown with the same color as in-
scope items. The default is true.

Remarks
This property affects the CalendarDatePicker 's internal CalendarView. For more info, see
CalendarView.IsOutOfScopeEnabled.
CalendarDatePicker.IsOutOfScopeEnabledProperty
CalendarDatePicker.IsOutOfScopeEnabledProperty
CalendarDatePicker.IsOutOfScopeEnabledProperty
I n this Article
Edit
Identifies the IsOutOfScopeEnabled dependency property.
public : static DependencyProperty IsOutOfScopeEnabledProperty { get; }
static DependencyProperty IsOutOfScopeEnabledProperty();
public static DependencyProperty IsOutOfScopeEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsOutOfScopeEnabled dependency property.
See Dependency properties overview
Also
CalendarDatePicker.IsTodayHighlighted CalendarDate
Picker.IsTodayHighlighted CalendarDatePicker.IsToday
Highlighted
I n this Article
Edit
Gets or sets a value that indicates whether the current date is highlighted in the picker's CalendarView.
public : Platform::Boolean IsTodayHighlighted { get; set; }
bool IsTodayHighlighted();

void IsTodayHighlighted(bool istodayhighlighted);


public bool IsTodayHighlighted { get; set; }

<CalendarDatePicker IsTodayHighlighted="bool" .../>

Returns
bool
true if the current date is highlighted; otherwise, false. The default is true.

Remarks
This property affects the CalendarDatePicker 's internal CalendarView. For more info, see
CalendarView.IsTodayHighlighted.
CalendarDatePicker.IsTodayHighlightedProperty
CalendarDatePicker.IsTodayHighlightedProperty
CalendarDatePicker.IsTodayHighlightedProperty
I n this Article
Edit
Identifies the IsTodayHighlighted dependency property.
public : static DependencyProperty IsTodayHighlightedProperty { get; }
static DependencyProperty IsTodayHighlightedProperty();
public static DependencyProperty IsTodayHighlightedProperty { get; }

Returns
DependencyProperty
The identifier for the IsTodayHighlighted dependency property.
See Dependency properties overview
Also
CalendarDatePicker.LightDismissOverlayMode Calendar
DatePicker.LightDismissOverlayMode CalendarDate
Picker.LightDismissOverlayMode
I n this Article
Edit
Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.
public : LightDismissOverlayMode LightDismissOverlayMode { get; set; }
LightDismissOverlayMode LightDismissOverlayMode();

void LightDismissOverlayMode(LightDismissOverlayMode lightdismissoverlaymode);


public LightDismissOverlayMode LightDismissOverlayMode { get; set; }

Returns
LightDismissOverlayMode
A value of the enumeration that specifies whether the area outside of a light-dismiss UI is darkened. The default is
Auto.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Transient UI, such as the open calendar view of a CalendarDatePicker, closes when you click or tap outside of it. This is
called light-dismiss. "Overlay" refers to the area outside of a light-dismiss UI.
By default, the "overlay" is darkened on the Xbox, and not darkened on other devices families. You can set
LightDismissOverlayMode to On to make your app darken the "overlay" area on all device families, or set it to Off to
not darken the "overlay" area on all device families.
Version compatibility
The LightDismissOverlayMode property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.CalendarDatePicker",
"LightDismissOverlayMode"))
{
calendarDatePicker1.LightDismissOverlayMode = LightDismissOverlayMode.On;
}
}
CalendarDatePicker.LightDismissOverlayModeProperty
CalendarDatePicker.LightDismissOverlayModeProperty
CalendarDatePicker.LightDismissOverlayModeProperty
I n this Article
Edit
Identifies the LightDismissOverlayMode dependency property.
public : static DependencyProperty LightDismissOverlayModeProperty { get; }
static DependencyProperty LightDismissOverlayModeProperty();
public static DependencyProperty LightDismissOverlayModeProperty { get; }

Returns
DependencyProperty
The identifier for the LightDismissOverlayMode dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


CalendarDatePicker.MaxDate CalendarDatePicker.Max
Date CalendarDatePicker.MaxDate
I n this Article
Edit
Gets or sets the latest date that can be set in the picker.
public : DateTime MaxDate { get; set; }
DateTime MaxDate();

void MaxDate(DateTime maxdate);


public DateTimeOffset MaxDate { get; set; }

Returns
DateTimeOffset
The latest date that can be set.
CalendarDatePicker.MaxDateProperty CalendarDate
Picker.MaxDateProperty CalendarDatePicker.MaxDate
Property
I n this Article
Edit
Identifies the MaxDate dependency property.
public : static DependencyProperty MaxDateProperty { get; }
static DependencyProperty MaxDateProperty();
public static DependencyProperty MaxDateProperty { get; }

Returns
DependencyProperty
The identifier for the MaxDate dependency property.
See Dependency properties overview
Also
CalendarDatePicker.MinDate CalendarDatePicker.Min
Date CalendarDatePicker.MinDate
I n this Article
Edit
Gets or sets the earliest date that can be set in the picker.
public : DateTime MinDate { get; set; }
DateTime MinDate();

void MinDate(DateTime mindate);


public DateTimeOffset MinDate { get; set; }

Returns
DateTimeOffset
The earliest date that can be set.
CalendarDatePicker.MinDateProperty CalendarDate
Picker.MinDateProperty CalendarDatePicker.MinDate
Property
I n this Article
Edit
Identifies the MinDate dependency property.
public : static DependencyProperty MinDateProperty { get; }
static DependencyProperty MinDateProperty();
public static DependencyProperty MinDateProperty { get; }

Returns
DependencyProperty
The identifier for the MinDate dependency property.
See Dependency properties overview
Also
CalendarDatePicker.Opened CalendarDatePicker.Opened
CalendarDatePicker.Opened
I n this Article
Edit
Occurs when the picker's CalendarView is shown.
public : event EventHandler<Platform::Object> Opened
// Register
event_token Opened(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void Opened(event_token const& cookie) const;

// Revoke with event_revoker


Opened_revoker Opened(auto_revoke_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> Opened

<CalendarDatePicker Opened="eventhandler"/>
CalendarDatePicker.PlaceholderText CalendarDatePicker.
PlaceholderText CalendarDatePicker.PlaceholderText
I n this Article
Edit
Gets or sets the text that is displayed in the picker's text box until the value is changed by a user action or some other
operation.
public : Platform::String PlaceholderText { get; set; }
winrt::hstring PlaceholderText();

void PlaceholderText(winrt::hstring placeholdertext);


public string PlaceholderText { get; set; }

<CalendarDatePicker PlaceholderText="string"/>

Returns
string
The text that is displayed in the control when no value is entered. The default is an empty string ("").
CalendarDatePicker.PlaceholderTextProperty Calendar
DatePicker.PlaceholderTextProperty CalendarDatePicker.
PlaceholderTextProperty
I n this Article
Edit
Identifies the PlaceholderText dependency property.
public : static DependencyProperty PlaceholderTextProperty { get; }
static DependencyProperty PlaceholderTextProperty();
public static DependencyProperty PlaceholderTextProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderText dependency property.
See Dependency properties overview
Also
CalendarDatePicker.SetDisplayDate CalendarDatePicker.
SetDisplayDate CalendarDatePicker.SetDisplayDate
I n this Article
Edit
Shows the specified date in the calendar picker.
public : void SetDisplayDate(DateTime date)
void SetDisplayDate(DateTime date) const;
public void SetDisplayDate(DateTimeOffset date)

Parameters
date DateTimeOffset
The date to show.

Remarks
CalendarDatePicker.SetYearDecadeDisplayDimensions
CalendarDatePicker.SetYearDecadeDisplayDimensions
CalendarDatePicker.SetYearDecadeDisplayDimensions
I n this Article
Edit
Sets the number of rows and columns to use in the Year and Decade display modes of the picker's CalendarView.
public : void SetYearDecadeDisplayDimensions(int columns, int rows)
void SetYearDecadeDisplayDimensions(int32_t columns, int32_t rows) const;
public void SetYearDecadeDisplayDimensions(Int32 columns, Int32 rows)

Parameters
columns Int32
The number of columns in the view.
rows Int32
The number of rows in the view.

Remarks
This method affects the CalendarDatePicker 's internal CalendarView. For more info, see
CalendarView.SetYearDecadeDisplayDimensions.
CalendarDatePickerDateChangedEventArgs Calendar
DatePickerDateChangedEventArgs CalendarDatePicker
DateChangedEventArgs Class
Provides event data for the DateChanged event.

D eclaration
public : sealed class CalendarDatePickerDateChangedEventArgs :
ICalendarDatePickerDateChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::CalendarDatePickerDateChangedEventArgs :
ICalendarDatePickerDateChangedEventArgs
public sealed class CalendarDatePickerDateChangedEventArgs :
ICalendarDatePickerDateChangedEventArgs

I nheritance H ierarchy
None

Properties
NewDate
NewDate
NewDate

Gets the date that is currently selected in the CalendarDatePicker.

OldDate
OldDate
OldDate

Gets the date that was previously selected in the CalendarDatePicker.


CalendarDatePickerDateChangedEventArgs.NewDate
CalendarDatePickerDateChangedEventArgs.NewDate
CalendarDatePickerDateChangedEventArgs.NewDate
I n this Article
Edit
Gets the date that is currently selected in the CalendarDatePicker.
public : IReference<DateTime> NewDate { get; }
IReference<DateTime> NewDate();
public Nullable<DateTimeOffset> NewDate { get; }

Returns
Nullable<DateTimeOffset>
The date that is currently selected in the CalendarDatePicker.
CalendarDatePickerDateChangedEventArgs.OldDate
CalendarDatePickerDateChangedEventArgs.OldDate
CalendarDatePickerDateChangedEventArgs.OldDate
I n this Article
Edit
Gets the date that was previously selected in the CalendarDatePicker.
public : IReference<DateTime> OldDate { get; }
IReference<DateTime> OldDate();
public Nullable<DateTimeOffset> OldDate { get; }

Returns
Nullable<DateTimeOffset>
The date that was previously selected in the CalendarDatePicker.
CalendarView CalendarView CalendarView Class
Represents a control that enables a user to select a date by using a visual calendar display.

D eclaration
public : class CalendarView : Control, ICalendarView
struct winrt::Windows::UI::Xaml::Controls::CalendarView : Control, ICalendarView
public class CalendarView : Control, ICalendarView

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Calendar view.
The CalendarView gives you a standardized way to let users view and interact with a calendar. If you need to let a user
select multiple dates, you must use a CalendarView. If you need to let a user pick only a single date and don’t need a
calendar to be always visible, consider using a CalendarDatePicker or DatePicker control. You can use the
CalendarView control in its default form with a minimal amount of Extensible Application Markup Language (XAML )
or other code, or you can customize it in various ways to suit your app.
The CalendarView is made up of 3 separate views: the month view, year view, and decade view. By default, it starts with
the month view open. You can specify a startup view by setting the DisplayMode property.

Users click the header in the month


view to open the year view, and click the header in the year view to open the decade view. Users pick a year in the
decade view to return to the year view, and pick a month in the year view to return to the month view. The two arrows
to the side of the header navigate forward or backward by month, by year, or by decade.
Selecting dates
By default, the SelectionMode property is set to Single. This lets a user pick a single date in the calendar. Set
SelectionMode to None to disable date selection.
Set SelectionMode to Multiple to let a user select multiple dates. You can select multiple dates programmatically by
adding DateTime/DateTimeOffset objects to the SelectedDates collection, as shown here:
calendarView1.SelectedDates.Add(DateTimeOffset.Now);
calendarView1.SelectedDates.Add(new DateTime(1977, 1, 5));

A user can deselect a selected date by clicking or tapping it in the calendar grid.
You can handle the SelectedDatesChanged event to be notified when the SelectedDates collection has changed.
G lobalization
The CalendarView supports each of the calendar systems supported by Windows. These calendars are specified in the
Windows.Globalization.CalendarIdentifiers class. The CalendarView uses the correct calendar for your app's default
language, or you can set the CalendarIdentifier property to use a specific calendar system.
D ateTime and Calendar values
The date objects used in a CalendarView have a different representation depending on your programming language.
C# and Visual Basic use the System.DateTimeOffset structure that is part of .NET. Visual C++ component extensions
(C++/CX) uses the Windows::Foundation::DateTime structure. A related concept is the Calendar class, which
influences how dates are interpreted in context. All Windows Runtime apps can use the
Windows.Globalization.Calendar class. C# and Visual Basic apps can alternatively use the
System.Globalization.Calendar class, which has very similar functionality. (Windows Runtime app can use the base
.NET Calendar class but not the specific implementations for example GregorianCalendar.)
.NET also supports a type named DateTime, which is implicitly convertible to a DateTimeOffset. So you might see a
"DateTime" type being used in .NET code that's used to set values that are really DateTimeOffset. For more info on the
difference between DateTime and DateTimeOffset, see Remarks in DateTimeOffset.
Note

Properties that take date objects can't be set as a XAML attribute string, because the Windows Runtime XAML parser
doesn't have a conversion logic for converting strings to dates as DateTime/DateTimeOffset objects. You typically set
these values in code. Another possible technique is to define a date that's available as a data object or in the data
context, then set the property as a XAML attribute that references a {Binding} markup extension expression that can
access the date as data.
Customizing the CalendarV iew's appearance
The CalendarView is composed of both Extensible Application Markup Language (XAML ) elements defined in the
ControlTemplate and visual elements rendered directly by the control. The Extensible Application Markup Language
(XAML ) elements defined in the control template include the border that encloses the control, the header, previous and
next buttons, and DayOfWeek elements. You can style and re-template these elements like any Extensible Application
Markup Language (XAML ) control. The calendar grid is composed of CalendarViewDayItem objects. You can’t style or
re-template these elements, but various properties are provided to let you to customize their appearance.
This diagram shows the elements that make up the month view of the calendar. For more info, see the Remarks on the
CalendarViewDayItem class.
This table lists the properties you can
change to modify the appearance of calendar elements.
ELEMENT PR O PER TIES

DayOfWeek @Windows.UI.Xaml.Controls.CalendarView.DayOfWeekFormat
?text=DayOfWeekFormat

CalendarItem @Windows.UI.Xaml.Controls.CalendarView.CalendarItemBackg
round?text=CalendarItemBackground,
@Windows.UI.Xaml.Controls.CalendarView.CalendarItemBorde
rBrush?text=CalendarItemBorderBrush,
@Windows.UI.Xaml.Controls.CalendarView.CalendarItemBorde
rThickness?text=CalendarItemBorderThickness,
@Windows.UI.Xaml.Controls.CalendarView.CalendarItemForeg
round?text=CalendarItemForeground

DayItem @Windows.UI.Xaml.Controls.CalendarView.DayItemFontFamily
?text=DayItemFontFamily,
@Windows.UI.Xaml.Controls.CalendarView.DayItemFontSize?
text=DayItemFontSize,
@Windows.UI.Xaml.Controls.CalendarView.DayItemFontStyle?
text=DayItemFontStyle,
@Windows.UI.Xaml.Controls.CalendarView.DayItemFontWeigh
t?text=DayItemFontWeight,
@Windows.UI.Xaml.Controls.CalendarView.HorizontalDayItem
Alignment?text=HorizontalDayItemAlignment,
@Windows.UI.Xaml.Controls.CalendarView.VerticalDayItemAlig
nment?text=VerticalDayItemAlignment,
@Windows.UI.Xaml.Controls.CalendarView.CalendarViewDayIt
emStyle?text=CalendarViewDayItemStyle

MonthYearItem (in the year and decade views, equivalent to @Windows.UI.Xaml.Controls.CalendarView.MonthYearItemFon


DayItem) tFamily?text=MonthYearItemFontFamily,
@Windows.UI.Xaml.Controls.CalendarView.MonthYearItemFon
tSize?text=MonthYearItemFontSize,
@Windows.UI.Xaml.Controls.CalendarView.MonthYearItemFon
tStyle?text=MonthYearItemFontStyle,
@Windows.UI.Xaml.Controls.CalendarView.MonthYearItemFon
tWeight?text=MonthYearItemFontWeight
FirstOfMonthLabel @Windows.UI.Xaml.Controls.CalendarView.FirstOfMonthLabel
FontFamily?text=FirstOfMonthLabelFontFamily,
@Windows.UI.Xaml.Controls.CalendarView.FirstOfMonthLabel
FontSize?text=FirstOfMonthLabelFontSize,
@Windows.UI.Xaml.Controls.CalendarView.FirstOfMonthLabel
FontStyle?text=FirstOfMonthLabelFontStyle,
@Windows.UI.Xaml.Controls.CalendarView.FirstOfMonthLabel
FontWeight?text=FirstOfMonthLabelFontWeight,
@Windows.UI.Xaml.Controls.CalendarView.HorizontalFirstOfM
onthLabelAlignment?
text=HorizontalFirstOfMonthLabelAlignment,
@Windows.UI.Xaml.Controls.CalendarView.VerticalFirstOfMont
hLabelAlignment?text=VerticalFirstOfMonthLabelAlignment,
@Windows.UI.Xaml.Controls.CalendarView.IsGroupLabelVisible
?text=IsGroupLabelVisible

FirstofYearDecadeLabel (in the year and decade views, @Windows.UI.Xaml.Controls.CalendarView.FirstOfYearDecadeL


equivalent to FirstOfMonthLabel) abelFontFamily?text=FirstOfYearDecadeLabelFontFamily,
@Windows.UI.Xaml.Controls.CalendarView.FirstOfYearDecadeL
abelFontSize?text=FirstOfYearDecadeLabelFontSize,
@Windows.UI.Xaml.Controls.CalendarView.FirstOfYearDecadeL
abelFontStyle?text=FirstOfYearDecadeLabelFontStyle,
@Windows.UI.Xaml.Controls.CalendarView.FirstOfYearDecadeL
abelFontWeight?text=FirstOfYearDecadeLabelFontWeight

Visual State Borders @Windows.UI.Xaml.Controls.CalendarView.FocusBorderBrush?


text=FocusBorderBrush,
@Windows.UI.Xaml.Controls.CalendarView.HoverBorderBrush?
text=HoverBorderBrush,
@Windows.UI.Xaml.Controls.CalendarView.PressedBorderBrus
h?text=PressedBorderBrush,
@Windows.UI.Xaml.Controls.CalendarView.SelectedBorderBrus
h?text=SelectedBorderBrush,
@Windows.UI.Xaml.Controls.CalendarView.SelectedForegroun
d?text=SelectedForeground,
@Windows.UI.Xaml.Controls.CalendarView.SelectedHoverBord
erBrush?text=SelectedHoverBorderBrush,
@Windows.UI.Xaml.Controls.CalendarView.SelectedPressedBor
derBrush?text=SelectedPressedBorderBrush

OutofScope @Windows.UI.Xaml.Controls.CalendarView.IsOutOfScopeEnabl
ed?text=IsOutOfScopeEnabled,
@Windows.UI.Xaml.Controls.CalendarView.OutOfScopeBackgr
ound?text=OutOfScopeBackground,
@Windows.UI.Xaml.Controls.CalendarView.OutOfScopeForegr
ound?text=OutOfScopeForeground

Today @Windows.UI.Xaml.Controls.CalendarView.IsTodayHighlighted
?text=IsTodayHighlighted,
@Windows.UI.Xaml.Controls.CalendarView.TodayFontWeight?
text=TodayFontWeight,
@Windows.UI.Xaml.Controls.CalendarView.TodayForeground?
text=TodayForeground

By default, the month view shows 6 weeks at a time. You can change the number of weeks shown by setting the
NumberOfWeeksInView property. The minimum number of weeks to show is 2; the maximum is 8.
By default, the year and decade views show in a 4x4 grid. To change the number of rows or columns, call
SetYearDecadeDisplayDimensions with the your desired number of rows and columns. This will change the grid for
both the year and decade views.
Here, the year and decade views are set to show in a 3x4 grid.

calendarView1.SetYearDecadeDisplayDimensions(3, 4);

By default, the minimum date shown in the CalendarView is 100 years prior to the current date, and the maximum date
shown is 100 years past the current date. You can change the minimum and maximum dates that the calendar shows
by setting the MinDate and MaxDate properties.

calendarView1.MinDate = new DateTime(2000, 1, 1);


calendarView1.MaxDate = new DateTime(2099, 12, 31);

Updating calendar day items


Each day in the calendar is represented by a CalendarViewDayItem object. To access an individual day item and use its
properties and methods, handle the CalendarViewDayItemChanging event and use the Item property of the event args
to access the CalendarViewDayItem.
You can make a day not selectable in the CalendarView by setting its CalendarViewDayItem.IsBlackout property to
true.
You can show contextual information about the density of events in a day by calling the
CalendarViewDayItem.SetDensityColors method. You can show from 0 to 10 density bars for each day, and set the
color of each bar.
Here are some day items in a calendar. Days 1 and 2 are blacked out. Days 2, 3, and 4 have various density bars set.

A @Windows.UI.Xaml.Controls.CalendarView?text=CalendarView can contain a


large number of @Windows.UI.Xaml.Controls.CalendarViewDayItem?text=CalendarViewDayItem objects. To keep the
UI responsive and enable smooth navigation through the calendar, @Windows.UI.Xaml.Controls.CalendarView?
text=CalendarView supports phased rendering. This lets you break up processing of a day item into phases. If a day is
moved out of view before all the phases are complete, no more time is used trying to process and render that item.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the CalendarView control.

R ES O U R CE K EY D ES CR IPTIO N

CalendarViewBorderBrush Border color of the calendar grid


CalendarViewFocusBorderBrush Border color of a calendar item when focused

CalendarViewHoverBorderBrush Border color of a calendar item on hover

CalendarViewPressedBorderBrush Border color of a calendar item when pressed

CalendarViewSelectedBorderBrush Border color of a selected calendar item

CalendarViewSelectedHoverBorderBrush Border color of a selected calendar item on hover

CalendarViewSelectedPressedBorderBrush Border color of a selected calendar item when pressed

CalendarViewBackground Background color of the calendar header

CalendarViewForeground Foreground color of the calendar navigation header

CalendarViewSelectedForeground Foreground color of a selected calendar item

CalendarViewPressedForeground Foreground color of a calendar item when pressed

CalendarViewTodayForeground Foreground color of the today calendar item

CalendarViewBlackoutForeground Foreground color of blacked out calendar items

CalendarViewWeekDayForegroundDisabled Color of week and day labels when disabled

CalendarViewOutOfScopeForeground Foreground color of out of scope calendar items

CalendarViewOutOfScopeBackground Background color of out of scope calendar items

CalendarViewCalendarItemForeground Foreground color of calendar items

CalendarViewCalendarItemBackground Background color of calendar items

CalendarViewNavigationButtonBackground Background color of the calendar navigation header

CalendarViewNavigationButtonForegroundPointerOver Foreground color of the calendar navigation header on hover

CalendarViewNavigationButtonForegroundPressed Foreground color of the calendar navigation header when


pressed

CalendarViewNavigationButtonForegroundDisabled Foreground color of the calendar navigation header when


disabled

Constructors
CalendarView()
CalendarView()
CalendarView()

Initializes a new instance of the CalendarView class.


Properties
BlackoutForeground
BlackoutForeground
BlackoutForeground

Gets or sets a brush that provides the foreground of a date that can't be selected.

BlackoutForegroundProperty
BlackoutForegroundProperty
BlackoutForegroundProperty

Identifies the BlackoutForeground dependency property.

CalendarIdentifier
CalendarIdentifier
CalendarIdentifier

Gets or sets the calendar system to use.

CalendarIdentifierProperty
CalendarIdentifierProperty
CalendarIdentifierProperty

Identifies the CalendarIdentifier dependency property.

CalendarItemBackground
CalendarItemBackground
CalendarItemBackground

Gets or sets a brush that provides the background of a calendar item.

CalendarItemBackgroundProperty
CalendarItemBackgroundProperty
CalendarItemBackgroundProperty

Identifies the CalendarItemBackground dependency property.

CalendarItemBorderBrush
CalendarItemBorderBrush
CalendarItemBorderBrush

Gets or sets a brush that provides the border of a calendar item.

CalendarItemBorderBrushProperty
CalendarItemBorderBrushProperty
CalendarItemBorderBrushProperty

Identifies the CalendarItemBorderBrush dependency property.

CalendarItemBorderThickness
CalendarItemBorderThickness
CalendarItemBorderThickness

Gets or sets the thickness of a calendar item's border.

CalendarItemBorderThicknessProperty
CalendarItemBorderThicknessProperty
CalendarItemBorderThicknessProperty

Identifies the CalendarItemBorderThickness dependency property.

CalendarItemForeground
CalendarItemForeground
CalendarItemForeground

Gets or sets a brush that provides the foreground of a calendar item.

CalendarItemForegroundProperty
CalendarItemForegroundProperty
CalendarItemForegroundProperty

Identifies the CalendarItemForeground dependency property.

CalendarViewDayItemStyle
CalendarViewDayItemStyle
CalendarViewDayItemStyle

Gets or sets the Style associated with the control's internal CalendarViewDayItem object.

CalendarViewDayItemStyleProperty
CalendarViewDayItemStyleProperty
CalendarViewDayItemStyleProperty

Identifies the CalendarViewDayItemStyle dependency property.

DayItemFontFamily
DayItemFontFamily
DayItemFontFamily

Gets or sets the font used to display day values in the calendar.
DayItemFontFamilyProperty
DayItemFontFamilyProperty
DayItemFontFamilyProperty

Identifies the DayItemFontFamily dependency property.

DayItemFontSize
DayItemFontSize
DayItemFontSize

Gets or sets the font size used to display day values in the calendar.

DayItemFontSizeProperty
DayItemFontSizeProperty
DayItemFontSizeProperty

Identifies the DayItemFontSize dependency property.

DayItemFontStyle
DayItemFontStyle
DayItemFontStyle

Gets or sets the font style used to display day values in the calendar.

DayItemFontStyleProperty
DayItemFontStyleProperty
DayItemFontStyleProperty

Identifies the DayItemFontStyle dependency property.

DayItemFontWeight
DayItemFontWeight
DayItemFontWeight

Gets or sets the font weight used to display day values in the calendar.

DayItemFontWeightProperty
DayItemFontWeightProperty
DayItemFontWeightProperty

Identifies the DayItemFontWeight dependency property.

DayOfWeekFormat
DayOfWeekFormat
DayOfWeekFormat
Gets or sets the display format for the day of the week headers.

DayOfWeekFormatProperty
DayOfWeekFormatProperty
DayOfWeekFormatProperty

Identifies the DayOfWeekFormat dependency property.

DisplayMode
DisplayMode
DisplayMode

Gets or sets a value that indicates whether the calendar shows a picker for month, year, or decade.

DisplayModeProperty
DisplayModeProperty
DisplayModeProperty

Identifies the DisplayMode dependency property.

FirstDayOfWeek
FirstDayOfWeek
FirstDayOfWeek

Gets or sets a value that indicates which day is shown as the first day of the week.

FirstDayOfWeekProperty
FirstDayOfWeekProperty
FirstDayOfWeekProperty

Identifies the FirstDayOfWeek dependency property.

FirstOfMonthLabelFontFamily
FirstOfMonthLabelFontFamily
FirstOfMonthLabelFontFamily

Gets or sets the font used to display the first-of-month banner in the calendar.

FirstOfMonthLabelFontFamilyProperty
FirstOfMonthLabelFontFamilyProperty
FirstOfMonthLabelFontFamilyProperty

Identifies the FirstOfMonthLabelFontFamily dependency property.


FirstOfMonthLabelFontSize
FirstOfMonthLabelFontSize
FirstOfMonthLabelFontSize

Gets or sets the font size used to display the first-of-month banner in the calendar.

FirstOfMonthLabelFontSizeProperty
FirstOfMonthLabelFontSizeProperty
FirstOfMonthLabelFontSizeProperty

Identifies the FirstOfMonthLabelFontSize dependency property.

FirstOfMonthLabelFontStyle
FirstOfMonthLabelFontStyle
FirstOfMonthLabelFontStyle

Gets or sets the font style used to display the first-of-month banner in the calendar.

FirstOfMonthLabelFontStyleProperty
FirstOfMonthLabelFontStyleProperty
FirstOfMonthLabelFontStyleProperty

Identifies the FirstOfMonthLabelFontStyle dependency property.

FirstOfMonthLabelFontWeight
FirstOfMonthLabelFontWeight
FirstOfMonthLabelFontWeight

Gets or sets the font weight used to display the first-of-month banner in the calendar.

FirstOfMonthLabelFontWeightProperty
FirstOfMonthLabelFontWeightProperty
FirstOfMonthLabelFontWeightProperty

Identifies the FirstOfMonthLabelFontWeight dependency property.

FirstOfYearDecadeLabelFontFamily
FirstOfYearDecadeLabelFontFamily
FirstOfYearDecadeLabelFontFamily

Gets or sets the font used to display the first-of-year banner in the calendar.

FirstOfYearDecadeLabelFontFamilyProperty
FirstOfYearDecadeLabelFontFamilyProperty
FirstOfYearDecadeLabelFontFamilyProperty
Identifies the FirstOfYearDecadeLabelFontFamily dependency property.

FirstOfYearDecadeLabelFontSize
FirstOfYearDecadeLabelFontSize
FirstOfYearDecadeLabelFontSize

Gets or sets the font size used to display the first-of-year banner in the calendar.

FirstOfYearDecadeLabelFontSizeProperty
FirstOfYearDecadeLabelFontSizeProperty
FirstOfYearDecadeLabelFontSizeProperty

Identifies the FirstOfYearDecadeLabelFontSize dependency property.

FirstOfYearDecadeLabelFontStyle
FirstOfYearDecadeLabelFontStyle
FirstOfYearDecadeLabelFontStyle

Gets or sets the font style used to display the first-of-year banner in the calendar.

FirstOfYearDecadeLabelFontStyleProperty
FirstOfYearDecadeLabelFontStyleProperty
FirstOfYearDecadeLabelFontStyleProperty

Identifies the FirstOfYearDecadeLabelFontStyle dependency property.

FirstOfYearDecadeLabelFontWeight
FirstOfYearDecadeLabelFontWeight
FirstOfYearDecadeLabelFontWeight

Gets or sets the font weight used to display the first-of-year banner in the calendar.

FirstOfYearDecadeLabelFontWeightProperty
FirstOfYearDecadeLabelFontWeightProperty
FirstOfYearDecadeLabelFontWeightProperty

Identifies the FirstOfYearDecadeLabelFontWeight dependency property.

FocusBorderBrush
FocusBorderBrush
FocusBorderBrush

Gets or sets a brush that provides the border of a calendar item that has focus.
FocusBorderBrushProperty
FocusBorderBrushProperty
FocusBorderBrushProperty

Identifies the FocusBorderBrush dependency property.

HorizontalDayItemAlignment
HorizontalDayItemAlignment
HorizontalDayItemAlignment

Gets or sets the horizontal alignment of day items in the calendar.

HorizontalDayItemAlignmentProperty
HorizontalDayItemAlignmentProperty
HorizontalDayItemAlignmentProperty

Identifies the HorizontalDayItemAlignment dependency property.

HorizontalFirstOfMonthLabelAlignment
HorizontalFirstOfMonthLabelAlignment
HorizontalFirstOfMonthLabelAlignment

Gets or sets the horizontal alignment of the first-of-month banner text.

HorizontalFirstOfMonthLabelAlignmentProperty
HorizontalFirstOfMonthLabelAlignmentProperty
HorizontalFirstOfMonthLabelAlignmentProperty

Identifies the HorizontalFirstOfMonthLabelAlignment dependency property.

HoverBorderBrush
HoverBorderBrush
HoverBorderBrush

Gets or sets a brush that provides the border of a calendar item while the pointer is over it.

HoverBorderBrushProperty
HoverBorderBrushProperty
HoverBorderBrushProperty

Identifies the HoverBorderBrush dependency property.

IsGroupLabelVisible
IsGroupLabelVisible
IsGroupLabelVisible
Gets or sets a value that indicates whether the month name is shown with the first day of the month when the
DisplayMode is Month, or whether the year name is shown with the first month of the year when the
DisplayMode is Year.

IsGroupLabelVisibleProperty
IsGroupLabelVisibleProperty
IsGroupLabelVisibleProperty

Identifies the IsGroupLabelVisible dependency property.

IsOutOfScopeEnabled
IsOutOfScopeEnabled
IsOutOfScopeEnabled

Gets or sets a value that indicates whether out-of-scope calendar items are shown with a unique foreground color.

IsOutOfScopeEnabledProperty
IsOutOfScopeEnabledProperty
IsOutOfScopeEnabledProperty

Identifies the IsOutOfScopeEnabled dependency property.

IsTodayHighlighted
IsTodayHighlighted
IsTodayHighlighted

Gets or sets a value that indicates whether the current date is highlighted.

IsTodayHighlightedProperty
IsTodayHighlightedProperty
IsTodayHighlightedProperty

Identifies the IsTodayHighlighted dependency property.

MaxDate
MaxDate
MaxDate

Gets or sets the last date to be displayed.

MaxDateProperty
MaxDateProperty
MaxDateProperty

Identifies the MaxDate dependency property.


MinDate
MinDate
MinDate

Gets or sets the first date to display.

MinDateProperty
MinDateProperty
MinDateProperty

Identifies the MinDate dependency property.

MonthYearItemFontFamily
MonthYearItemFontFamily
MonthYearItemFontFamily

Gets or sets the font used to display the month and year items in the calendar.

MonthYearItemFontFamilyProperty
MonthYearItemFontFamilyProperty
MonthYearItemFontFamilyProperty

Identifies the MonthYearItemFontFamily dependency property.

MonthYearItemFontSize
MonthYearItemFontSize
MonthYearItemFontSize

Gets or sets the font size used to display the month and year items in the calendar.

MonthYearItemFontSizeProperty
MonthYearItemFontSizeProperty
MonthYearItemFontSizeProperty

Identifies the MonthYearItemFontSize dependency property.

MonthYearItemFontStyle
MonthYearItemFontStyle
MonthYearItemFontStyle

Gets or sets the font style used to display the month and year items in the calendar.

MonthYearItemFontStyleProperty
MonthYearItemFontStyleProperty
MonthYearItemFontStyleProperty
Identifies the MonthYearItemFontStyle dependency property.

MonthYearItemFontWeight
MonthYearItemFontWeight
MonthYearItemFontWeight

Gets or sets the font weight used to display the month and year items in the calendar.

MonthYearItemFontWeightProperty
MonthYearItemFontWeightProperty
MonthYearItemFontWeightProperty

Identifies the MonthYearItemFontWeight dependency property.

NumberOfWeeksInView
NumberOfWeeksInView
NumberOfWeeksInView

Gets or sets the number of weeks shown in the calendar view.

NumberOfWeeksInViewProperty
NumberOfWeeksInViewProperty
NumberOfWeeksInViewProperty

Identifies the NumberOfWeeksInView dependency property.

OutOfScopeBackground
OutOfScopeBackground
OutOfScopeBackground

Gets or sets a brush that provides the background of a date that's out of scope.

OutOfScopeBackgroundProperty
OutOfScopeBackgroundProperty
OutOfScopeBackgroundProperty

Identifies the OutOfScopeBackground dependency property.

OutOfScopeForeground
OutOfScopeForeground
OutOfScopeForeground

Gets or sets a brush that provides the foreground of calendar items that are outside the current scope (month,
year, or decade).
OutOfScopeForegroundProperty
OutOfScopeForegroundProperty
OutOfScopeForegroundProperty

Identifies the OutOfScopeForeground dependency property.

PressedBorderBrush
PressedBorderBrush
PressedBorderBrush

Gets or sets a brush that provides the border of a calendar item while it's pressed.

PressedBorderBrushProperty
PressedBorderBrushProperty
PressedBorderBrushProperty

Identifies the PressedBorderBrush dependency property.

PressedForeground
PressedForeground
PressedForeground

Gets or sets a brush that provides the foreground of a calendar item while it's pressed.

PressedForegroundProperty
PressedForegroundProperty
PressedForegroundProperty

Identifies the PressedForeground dependency property.

SelectedBorderBrush
SelectedBorderBrush
SelectedBorderBrush

Gets or sets a brush that provides the border of the currently selected calendar item.

SelectedBorderBrushProperty
SelectedBorderBrushProperty
SelectedBorderBrushProperty

Identifies the SelectedBorderBrush dependency property.

SelectedDates
SelectedDates
SelectedDates
Gets a collection of selected dates.

SelectedDatesProperty
SelectedDatesProperty
SelectedDatesProperty

Identifies the SelectedDates dependency property.

SelectedForeground
SelectedForeground
SelectedForeground

Gets or sets a brush that provides the foreground of a calendar item that's selected.

SelectedForegroundProperty
SelectedForegroundProperty
SelectedForegroundProperty

Identifies the SelectedForeground dependency property.

SelectedHoverBorderBrush
SelectedHoverBorderBrush
SelectedHoverBorderBrush

Gets or sets a brush that provides the border of a selected calendar item while the pointer is over it.

SelectedHoverBorderBrushProperty
SelectedHoverBorderBrushProperty
SelectedHoverBorderBrushProperty

Identifies the SelectedHoverBorderBrush dependency property.

SelectedPressedBorderBrush
SelectedPressedBorderBrush
SelectedPressedBorderBrush

Gets or sets a brush that provides the border of a selected calendar item while it's pressed.

SelectedPressedBorderBrushProperty
SelectedPressedBorderBrushProperty
SelectedPressedBorderBrushProperty

Identifies the SelectedPressedBorderBrush dependency property.


SelectionMode
SelectionMode
SelectionMode

Gets or sets a value that indicates what kind of selections are allowed.

SelectionModeProperty
SelectionModeProperty
SelectionModeProperty

Identifies the SelectionMode dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension
sources when defining templates for a CalendarView control.

TemplateSettingsProperty
TemplateSettingsProperty
TemplateSettingsProperty

Identifies the TemplateSettings dependency property.

TodayFontWeight
TodayFontWeight
TodayFontWeight

Gets or sets the font weight used to display the current date in the calendar.

TodayFontWeightProperty
TodayFontWeightProperty
TodayFontWeightProperty

Identifies the TodayFontWeight dependency property.

TodayForeground
TodayForeground
TodayForeground

Gets or sets a brush that provides the foreground of the calendar item for the current date.

TodayForegroundProperty
TodayForegroundProperty
TodayForegroundProperty

Identifies the TodayForeground dependency property.

VerticalDayItemAlignment
VerticalDayItemAlignment
VerticalDayItemAlignment

Gets or sets the vertical alignment of day items in the calendar.

VerticalDayItemAlignmentProperty
VerticalDayItemAlignmentProperty
VerticalDayItemAlignmentProperty

Identifies the VerticalDayItemAlignment dependency property.

VerticalFirstOfMonthLabelAlignment
VerticalFirstOfMonthLabelAlignment
VerticalFirstOfMonthLabelAlignment

Gets or sets the vertical alignment of the first-of-month banner text.

VerticalFirstOfMonthLabelAlignmentProperty
VerticalFirstOfMonthLabelAlignmentProperty
VerticalFirstOfMonthLabelAlignmentProperty

Identifies the VerticalFirstOfMonthLabelAlignment dependency property.

Methods
SetDisplayDate(DateTime)
SetDisplayDate(DateTime)
SetDisplayDate(DateTime)

Shows the specified date in the calendar.

SetYearDecadeDisplayDimensions(Int32, Int32)
SetYearDecadeDisplayDimensions(Int32, Int32)
SetYearDecadeDisplayDimensions(Int32, Int32)

Sets the number of rows and columns to use in the Year and Decade display modes.

Events
CalendarViewDayItemChanging
CalendarViewDayItemChanging
CalendarViewDayItemChanging

Occurs when a CalendarViewDayItem is loading.

SelectedDatesChanged
SelectedDatesChanged
SelectedDatesChanged

Occurs when the collection of selected dates is changed.

See Also
Control
Control
Control
Control
Control
Control
CalendarView.BlackoutForeground CalendarView.
BlackoutForeground CalendarView.BlackoutForeground
I n this Article
Edit
Gets or sets a brush that provides the foreground of a date that can't be selected.
public : Brush BlackoutForeground { get; set; }
Brush BlackoutForeground();

void BlackoutForeground(Brush blackoutforeground);


public Brush BlackoutForeground { get; set; }

<CalendarView BlackoutForeground="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the foreground of a date that can't be selected.
CalendarView.BlackoutForegroundProperty Calendar
View.BlackoutForegroundProperty CalendarView.
BlackoutForegroundProperty
I n this Article
Edit
Identifies the BlackoutForeground dependency property.
public : static DependencyProperty BlackoutForegroundProperty { get; }
static DependencyProperty BlackoutForegroundProperty();
public static DependencyProperty BlackoutForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the BlackoutForeground dependency property.
See Dependency properties overview
Also
CalendarView.CalendarIdentifier CalendarView.Calendar
Identifier CalendarView.CalendarIdentifier
I n this Article
Edit
Gets or sets the calendar system to use.
public : Platform::String CalendarIdentifier { get; set; }
winrt::hstring CalendarIdentifier();

void CalendarIdentifier(winrt::hstring calendaridentifier);


public string CalendarIdentifier { get; set; }

<CalendarView CalendarIdentifier="calendarSystem"/>

Returns
string
The calendar system to use.

Remarks
CalendarView.CalendarIdentifierProperty CalendarView.
CalendarIdentifierProperty CalendarView.Calendar
IdentifierProperty
I n this Article
Edit
Identifies the CalendarIdentifier dependency property.
public : static DependencyProperty CalendarIdentifierProperty { get; }
static DependencyProperty CalendarIdentifierProperty();
public static DependencyProperty CalendarIdentifierProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarIdentifier dependency property.
See Dependency properties overview
Also
CalendarView.CalendarItemBackground CalendarView.
CalendarItemBackground CalendarView.CalendarItem
Background
I n this Article
Edit
Gets or sets a brush that provides the background of a calendar item.
public : Brush CalendarItemBackground { get; set; }
Brush CalendarItemBackground();

void CalendarItemBackground(Brush calendaritembackground);


public Brush CalendarItemBackground { get; set; }

<CalendarView CalendarItemBackground="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the background of a calendar item.
CalendarView.CalendarItemBackgroundProperty
CalendarView.CalendarItemBackgroundProperty
CalendarView.CalendarItemBackgroundProperty
I n this Article
Edit
Identifies the CalendarItemBackground dependency property.
public : static DependencyProperty CalendarItemBackgroundProperty { get; }
static DependencyProperty CalendarItemBackgroundProperty();
public static DependencyProperty CalendarItemBackgroundProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarItemBackground dependency property.
See Dependency properties overview
Also
CalendarView.CalendarItemBorderBrush CalendarView.
CalendarItemBorderBrush CalendarView.CalendarItem
BorderBrush
I n this Article
Edit
Gets or sets a brush that provides the border of a calendar item.
public : Brush CalendarItemBorderBrush { get; set; }
Brush CalendarItemBorderBrush();

void CalendarItemBorderBrush(Brush calendaritemborderbrush);


public Brush CalendarItemBorderBrush { get; set; }

<CalendarView CalendarItemBorderBrush="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the border of a calendar item.
CalendarView.CalendarItemBorderBrushProperty
CalendarView.CalendarItemBorderBrushProperty
CalendarView.CalendarItemBorderBrushProperty
I n this Article
Edit
Identifies the CalendarItemBorderBrush dependency property.
public : static DependencyProperty CalendarItemBorderBrushProperty { get; }
static DependencyProperty CalendarItemBorderBrushProperty();
public static DependencyProperty CalendarItemBorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarItemBorderBrush dependency property.
See Dependency properties overview
Also
CalendarView.CalendarItemBorderThickness Calendar
View.CalendarItemBorderThickness CalendarView.
CalendarItemBorderThickness
I n this Article
Edit
Gets or sets the thickness of a calendar item's border.
public : Thickness CalendarItemBorderThickness { get; set; }
Thickness CalendarItemBorderThickness();

void CalendarItemBorderThickness(Thickness calendaritemborderthickness);


public Thickness CalendarItemBorderThickness { get; set; }

<CalendarView CalendarItemBorderThickness="uniform"/>
- or -
<CalendarView CalendarItemBorderThickness="left&right,top&bottom"/>
- or -
<CalendarView CalendarItemBorderThickness="left,top,right,bottom"/>

Returns
Thickness
The thickness of a calendar item's border.
CalendarView.CalendarItemBorderThicknessProperty
CalendarView.CalendarItemBorderThicknessProperty
CalendarView.CalendarItemBorderThicknessProperty
I n this Article
Edit
Identifies the CalendarItemBorderThickness dependency property.
public : static DependencyProperty CalendarItemBorderThicknessProperty { get; }
static DependencyProperty CalendarItemBorderThicknessProperty();
public static DependencyProperty CalendarItemBorderThicknessProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarItemBorderThickness dependency property.
See Dependency properties overview
Also
CalendarView.CalendarItemForeground CalendarView.
CalendarItemForeground CalendarView.CalendarItem
Foreground
I n this Article
Edit
Gets or sets a brush that provides the foreground of a calendar item.
public : Brush CalendarItemForeground { get; set; }
Brush CalendarItemForeground();

void CalendarItemForeground(Brush calendaritemforeground);


public Brush CalendarItemForeground { get; set; }

<CalendarView CalendarItemForeground="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the foreground of a calendar item.
CalendarView.CalendarItemForegroundProperty
CalendarView.CalendarItemForegroundProperty
CalendarView.CalendarItemForegroundProperty
I n this Article
Edit
Identifies the CalendarItemForeground dependency property.
public : static DependencyProperty CalendarItemForegroundProperty { get; }
static DependencyProperty CalendarItemForegroundProperty();
public static DependencyProperty CalendarItemForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarItemForeground dependency property.
See Dependency properties overview
Also
CalendarView CalendarView CalendarView
I n this Article
Edit
Initializes a new instance of the CalendarView class.

public : CalendarView()
CalendarView() const;
public CalendarView()
CalendarView.CalendarViewDayItemChanging Calendar
View.CalendarViewDayItemChanging CalendarView.
CalendarViewDayItemChanging
I n this Article
Edit
Occurs when a CalendarViewDayItem is loading.
public : event TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>
CalendarViewDayItemChanging
// Register
event_token CalendarViewDayItemChanging(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs> const& handler) const;

// Revoke with event_token


void CalendarViewDayItemChanging(event_token const& cookie) const;

// Revoke with event_revoker


CalendarViewDayItemChanging_revoker CalendarViewDayItemChanging(auto_revoke_t,
TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs> const& handler) const;
public event TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>
CalendarViewDayItemChanging

<CalendarView CalendarViewDayItemChanging="eventhandler"/>
CalendarView.CalendarViewDayItemStyle CalendarView.
CalendarViewDayItemStyle CalendarView.CalendarView
DayItemStyle
I n this Article
Edit
Gets or sets the Style associated with the control's internal CalendarViewDayItem object.
public : Style CalendarViewDayItemStyle { get; set; }
Style CalendarViewDayItemStyle();

void CalendarViewDayItemStyle(Style calendarviewdayitemstyle);


public Style CalendarViewDayItemStyle { get; set; }

<CalendarView CalendarViewDayItemStyle={StaticResource styleResourceKey}/>

Returns
Style
The Style associated with the control's internal CalendarViewDayItem object.
CalendarView.CalendarViewDayItemStyleProperty
CalendarView.CalendarViewDayItemStyleProperty
CalendarView.CalendarViewDayItemStyleProperty
I n this Article
Edit
Identifies the CalendarViewDayItemStyle dependency property.
public : static DependencyProperty CalendarViewDayItemStyleProperty { get; }
static DependencyProperty CalendarViewDayItemStyleProperty();
public static DependencyProperty CalendarViewDayItemStyleProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarViewDayItemStyle dependency property.
See Dependency properties overview
Also
CalendarView.DayItemFontFamily CalendarView.DayItem
FontFamily CalendarView.DayItemFontFamily
I n this Article
Edit
Gets or sets the font used to display day values in the calendar.
public : FontFamily DayItemFontFamily { get; set; }
FontFamily DayItemFontFamily();

void DayItemFontFamily(FontFamily dayitemfontfamily);


public FontFamily DayItemFontFamily { get; set; }

<CalendarView DayItemFontFamily="fontFamilyValue"/>

Returns
FontFamily
The font used to display day values in the calendar.
CalendarView.DayItemFontFamilyProperty CalendarView.
DayItemFontFamilyProperty CalendarView.DayItemFont
FamilyProperty
I n this Article
Edit
Identifies the DayItemFontFamily dependency property.
public : static DependencyProperty DayItemFontFamilyProperty { get; }
static DependencyProperty DayItemFontFamilyProperty();
public static DependencyProperty DayItemFontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the DayItemFontFamily dependency property.
See Dependency properties overview
Also
CalendarView.DayItemFontSize CalendarView.DayItem
FontSize CalendarView.DayItemFontSize
I n this Article
Edit
Gets or sets the font size used to display day values in the calendar.
public : double DayItemFontSize { get; set; }
double DayItemFontSize();

void DayItemFontSize(double dayitemfontsize);


public double DayItemFontSize { get; set; }

<CalendarView DayItemFontSize="double"/>

Returns
double
The font size used to display day values in the calendar.
CalendarView.DayItemFontSizeProperty CalendarView.
DayItemFontSizeProperty CalendarView.DayItemFont
SizeProperty
I n this Article
Edit
Identifies the DayItemFontSize dependency property.
public : static DependencyProperty DayItemFontSizeProperty { get; }
static DependencyProperty DayItemFontSizeProperty();
public static DependencyProperty DayItemFontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the DayItemFontSize dependency property.
See Dependency properties overview
Also
CalendarView.DayItemFontStyle CalendarView.DayItem
FontStyle CalendarView.DayItemFontStyle
I n this Article
Edit
Gets or sets the font style used to display day values in the calendar.
public : FontStyle DayItemFontStyle { get; set; }
FontStyle DayItemFontStyle();

void DayItemFontStyle(FontStyle dayitemfontstyle);


public FontStyle DayItemFontStyle { get; set; }

<CalendarView DayItemFontStyle="fontStyleMemberName" />

Returns
FontStyle
The font style used to display day values in the calendar.
CalendarView.DayItemFontStyleProperty CalendarView.
DayItemFontStyleProperty CalendarView.DayItemFont
StyleProperty
I n this Article
Edit
Identifies the DayItemFontStyle dependency property.
public : static DependencyProperty DayItemFontStyleProperty { get; }
static DependencyProperty DayItemFontStyleProperty();
public static DependencyProperty DayItemFontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the DayItemFontStyle dependency property.
See Dependency properties overview
Also
CalendarView.DayItemFontWeight CalendarView.Day
ItemFontWeight CalendarView.DayItemFontWeight
I n this Article
Edit
Gets or sets the font weight used to display day values in the calendar.
public : FontWeight DayItemFontWeight { get; set; }
FontWeight DayItemFontWeight();

void DayItemFontWeight(FontWeight dayitemfontweight);


public FontWeight DayItemFontWeight { get; set; }

<CalendarView DayItemFontWeight="fontWeightMemberName"/>

Returns
FontWeight
The font weight used to display day values in the calendar.
CalendarView.DayItemFontWeightProperty Calendar
View.DayItemFontWeightProperty CalendarView.Day
ItemFontWeightProperty
I n this Article
Edit
Identifies the DayItemFontWeight dependency property.
public : static DependencyProperty DayItemFontWeightProperty { get; }
static DependencyProperty DayItemFontWeightProperty();
public static DependencyProperty DayItemFontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the DayItemFontWeight dependency property.
See Dependency properties overview
Also
CalendarView.DayOfWeekFormat CalendarView.DayOf
WeekFormat CalendarView.DayOfWeekFormat
I n this Article
Edit
Gets or sets the display format for the day of the week headers.
public : Platform::String DayOfWeekFormat { get; set; }
winrt::hstring DayOfWeekFormat();

void DayOfWeekFormat(winrt::hstring dayofweekformat);


public string DayOfWeekFormat { get; set; }

<CalendarView DayOfWeekFormat="formatString"/>

Returns
string
The display format for the day of the week header values.

Examples
Here's a CalendarView with the day of week headers formatted to show the 3 letter abbreviation.
<CalendarView DayOfWeekFormat="{}{dayofweek.abbreviated(3)}"/>

Here's the same formatting option set in code.


CalendarView calendarView1 = new CalendarView();
calendarView1.DayOfWeekFormat = "{dayofweek.abbreviated(3)}";

Remarks
Change the format of the day of the week headers by setting the DayOfWeekFormat property.
The string content of each day of the week header is created by a DateTimeFormatter. You inform the
DateTimeFormatter how to format the day value by providing a format pattern string. Common patterns for day
values are listed in the following table.

FO R MAT PAT TER N E X AMPLE

{dayofweek.abbreviated} Sun Mon Tue

{dayofweek.abbreviated(2)} Su Mo Tu

{dayofweek.abbreviated(3)} Sun Mon Tue

{dayofweek.solo.abbreviated} Sun Mon Tue

{dayofweek.solo.abbreviated(2)} Su Mo Tu

{dayofweek.solo.abbreviated(3)} Sun Mon Tue


Cautio n

When you use a format pattern in XAML, you need to include a set of empty braces before the format string, like this:
DayOfWeekFormat="{}{dayofweek.abbreviated}" Also see Examples.

For more info about format patterns, including when to use the solo options, see the Remarks section of the
DateTimeFormatter class documentation.
Note

You can set this property to any valid date/time format, but formats other than those listed previously don't make
sense for the day of week header.
CalendarView.DayOfWeekFormatProperty CalendarView.
DayOfWeekFormatProperty CalendarView.DayOfWeek
FormatProperty
I n this Article
Edit
Identifies the DayOfWeekFormat dependency property.
public : static DependencyProperty DayOfWeekFormatProperty { get; }
static DependencyProperty DayOfWeekFormatProperty();
public static DependencyProperty DayOfWeekFormatProperty { get; }

Returns
DependencyProperty
The identifier for the DayOfWeekFormat dependency property.
See Dependency properties overview
Also
CalendarView.DisplayMode CalendarView.DisplayMode
CalendarView.DisplayMode
I n this Article
Edit
Gets or sets a value that indicates whether the calendar shows a picker for month, year, or decade.
public : CalendarViewDisplayMode DisplayMode { get; set; }
CalendarViewDisplayMode DisplayMode();

void DisplayMode(CalendarViewDisplayMode displaymode);


public CalendarViewDisplayMode DisplayMode { get; set; }

<CalendarView DisplayMode="calendarViewDisplayModeMemberName" />

Returns
CalendarViewDisplayMode
A value of the enumeration that indicates whether the calendar shows a picker for month, year, or decade. The default
is Month.
CalendarView.DisplayModeProperty CalendarView.
DisplayModeProperty CalendarView.DisplayMode
Property
I n this Article
Edit
Identifies the DisplayMode dependency property.
public : static DependencyProperty DisplayModeProperty { get; }
static DependencyProperty DisplayModeProperty();
public static DependencyProperty DisplayModeProperty { get; }

Returns
DependencyProperty
The identifier for the DisplayMode dependency property.
See Dependency properties overview
Also
CalendarView.FirstDayOfWeek CalendarView.FirstDayOf
Week CalendarView.FirstDayOfWeek
I n this Article
Edit
Gets or sets a value that indicates which day is shown as the first day of the week.
public : DayOfWeek FirstDayOfWeek { get; set; }
DayOfWeek FirstDayOfWeek();

void FirstDayOfWeek(DayOfWeek firstdayofweek);


public DayOfWeek FirstDayOfWeek { get; set; }

<CalendarView FirstDayOfWeek="dayOfWeekMemberName"/>

Returns
DayOfWeek
A value of the enumeration that indicates which day is shown as the first day of the week.
CalendarView.FirstDayOfWeekProperty CalendarView.
FirstDayOfWeekProperty CalendarView.FirstDayOfWeek
Property
I n this Article
Edit
Identifies the FirstDayOfWeek dependency property.
public : static DependencyProperty FirstDayOfWeekProperty { get; }
static DependencyProperty FirstDayOfWeekProperty();
public static DependencyProperty FirstDayOfWeekProperty { get; }

Returns
DependencyProperty
The identifier for the FirstDayOfWeek dependency property.
See Dependency properties overview
Also
CalendarView.FirstOfMonthLabelFontFamily Calendar
View.FirstOfMonthLabelFontFamily CalendarView.FirstOf
MonthLabelFontFamily
I n this Article
Edit
Gets or sets the font used to display the first-of-month banner in the calendar.
public : FontFamily FirstOfMonthLabelFontFamily { get; set; }
FontFamily FirstOfMonthLabelFontFamily();

void FirstOfMonthLabelFontFamily(FontFamily firstofmonthlabelfontfamily);


public FontFamily FirstOfMonthLabelFontFamily { get; set; }

<CalendarView FirstOfMonthLabelFontFamily="fontFamilyValue"/>

Returns
FontFamily
The font used to display the first-of-month banner in the calendar.

Remarks
To make the first of month label visible or not, use the IsGroupLabelVisible property.
CalendarView.FirstOfMonthLabelFontFamilyProperty
CalendarView.FirstOfMonthLabelFontFamilyProperty
CalendarView.FirstOfMonthLabelFontFamilyProperty
I n this Article
Edit
Identifies the FirstOfMonthLabelFontFamily dependency property.
public : static DependencyProperty FirstOfMonthLabelFontFamilyProperty { get; }
static DependencyProperty FirstOfMonthLabelFontFamilyProperty();
public static DependencyProperty FirstOfMonthLabelFontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the FirstOfMonthLabelFontFamily dependency property.
See Dependency properties overview
Also
CalendarView.FirstOfMonthLabelFontSize CalendarView.
FirstOfMonthLabelFontSize CalendarView.FirstOfMonth
LabelFontSize
I n this Article
Edit
Gets or sets the font size used to display the first-of-month banner in the calendar.
public : double FirstOfMonthLabelFontSize { get; set; }
double FirstOfMonthLabelFontSize();

void FirstOfMonthLabelFontSize(double firstofmonthlabelfontsize);


public double FirstOfMonthLabelFontSize { get; set; }

<CalendarView FirstOfMonthLabelFontSize="double"/>

Returns
double
The font size used to display the first-of-month banner in the calendar.

Remarks
To make the first of month label visible or not, use the IsGroupLabelVisible property.
CalendarView.FirstOfMonthLabelFontSizeProperty
CalendarView.FirstOfMonthLabelFontSizeProperty
CalendarView.FirstOfMonthLabelFontSizeProperty
I n this Article
Edit
Identifies the FirstOfMonthLabelFontSize dependency property.
public : static DependencyProperty FirstOfMonthLabelFontSizeProperty { get; }
static DependencyProperty FirstOfMonthLabelFontSizeProperty();
public static DependencyProperty FirstOfMonthLabelFontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the FirstOfMonthLabelFontSize dependency property.
See Dependency properties overview
Also
CalendarView.FirstOfMonthLabelFontStyle Calendar
View.FirstOfMonthLabelFontStyle CalendarView.FirstOf
MonthLabelFontStyle
I n this Article
Edit
Gets or sets the font style used to display the first-of-month banner in the calendar.
public : FontStyle FirstOfMonthLabelFontStyle { get; set; }
FontStyle FirstOfMonthLabelFontStyle();

void FirstOfMonthLabelFontStyle(FontStyle firstofmonthlabelfontstyle);


public FontStyle FirstOfMonthLabelFontStyle { get; set; }

<CalendarView FirstOfMonthLabelFontStyle="fontStyleMemberName" />

Returns
FontStyle
The font style used to display the first-of-month banner in the calendar.

Remarks
To make the first of month label visible or not, use the IsGroupLabelVisible property.
CalendarView.FirstOfMonthLabelFontStyleProperty
CalendarView.FirstOfMonthLabelFontStyleProperty
CalendarView.FirstOfMonthLabelFontStyleProperty
I n this Article
Edit
Identifies the FirstOfMonthLabelFontStyle dependency property.
public : static DependencyProperty FirstOfMonthLabelFontStyleProperty { get; }
static DependencyProperty FirstOfMonthLabelFontStyleProperty();
public static DependencyProperty FirstOfMonthLabelFontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the FirstOfMonthLabelFontStyle dependency property.
See Dependency properties overview
Also
CalendarView.FirstOfMonthLabelFontWeight Calendar
View.FirstOfMonthLabelFontWeight CalendarView.First
OfMonthLabelFontWeight
I n this Article
Edit
Gets or sets the font weight used to display the first-of-month banner in the calendar.
public : FontWeight FirstOfMonthLabelFontWeight { get; set; }
FontWeight FirstOfMonthLabelFontWeight();

void FirstOfMonthLabelFontWeight(FontWeight firstofmonthlabelfontweight);


public FontWeight FirstOfMonthLabelFontWeight { get; set; }

<CalendarView FirstOfMonthLabelFontWeight="fontWeightMemberName"/>

Returns
FontWeight
The font weight used to display the first-of-month banner in the calendar.

Remarks
To make the first of month label visible or not, use the IsGroupLabelVisible property.
CalendarView.FirstOfMonthLabelFontWeightProperty
CalendarView.FirstOfMonthLabelFontWeightProperty
CalendarView.FirstOfMonthLabelFontWeightProperty
I n this Article
Edit
Identifies the FirstOfMonthLabelFontWeight dependency property.
public : static DependencyProperty FirstOfMonthLabelFontWeightProperty { get; }
static DependencyProperty FirstOfMonthLabelFontWeightProperty();
public static DependencyProperty FirstOfMonthLabelFontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the FirstOfMonthLabelFontWeight dependency property.
See Dependency properties overview
Also
CalendarView.FirstOfYearDecadeLabelFontFamily
CalendarView.FirstOfYearDecadeLabelFontFamily
CalendarView.FirstOfYearDecadeLabelFontFamily
I n this Article
Edit
Gets or sets the font used to display the first-of-year banner in the calendar.
public : FontFamily FirstOfYearDecadeLabelFontFamily { get; set; }
FontFamily FirstOfYearDecadeLabelFontFamily();

void FirstOfYearDecadeLabelFontFamily(FontFamily firstofyeardecadelabelfontfamily);


public FontFamily FirstOfYearDecadeLabelFontFamily { get; set; }

<CalendarView FirstOfYearDecadeLabelFontFamily="fontFamilyValue"/>

Returns
FontFamily
The font used to display the first-of-year banner in the calendar.

Remarks
To make the first month of year label visible or not, use the IsGroupLabelVisible property.
CalendarView.FirstOfYearDecadeLabelFontFamily
Property CalendarView.FirstOfYearDecadeLabelFont
FamilyProperty CalendarView.FirstOfYearDecadeLabel
FontFamilyProperty
I n this Article
Edit
Identifies the FirstOfYearDecadeLabelFontFamily dependency property.
public : static DependencyProperty FirstOfYearDecadeLabelFontFamilyProperty { get; }
static DependencyProperty FirstOfYearDecadeLabelFontFamilyProperty();
public static DependencyProperty FirstOfYearDecadeLabelFontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the FirstOfYearDecadeLabelFontFamily dependency property.
See Dependency properties overview
Also
CalendarView.FirstOfYearDecadeLabelFontSize Calendar
View.FirstOfYearDecadeLabelFontSize CalendarView.First
OfYearDecadeLabelFontSize
I n this Article
Edit
Gets or sets the font size used to display the first-of-year banner in the calendar.
public : double FirstOfYearDecadeLabelFontSize { get; set; }
double FirstOfYearDecadeLabelFontSize();

void FirstOfYearDecadeLabelFontSize(double firstofyeardecadelabelfontsize);


public double FirstOfYearDecadeLabelFontSize { get; set; }

<CalendarView FirstOfYearDecadeLabelFontSize="double"/>

Returns
double
The font size used to display the first-of-year banner in the calendar.

Remarks
To make the first month of year label visible or not, use the IsGroupLabelVisible property.
CalendarView.FirstOfYearDecadeLabelFontSizeProperty
CalendarView.FirstOfYearDecadeLabelFontSizeProperty
CalendarView.FirstOfYearDecadeLabelFontSizeProperty
I n this Article
Edit
Identifies the FirstOfYearDecadeLabelFontSize dependency property.
public : static DependencyProperty FirstOfYearDecadeLabelFontSizeProperty { get; }
static DependencyProperty FirstOfYearDecadeLabelFontSizeProperty();
public static DependencyProperty FirstOfYearDecadeLabelFontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the FirstOfYearDecadeLabelFontSize dependency property.
See Dependency properties overview
Also
CalendarView.FirstOfYearDecadeLabelFontStyle
CalendarView.FirstOfYearDecadeLabelFontStyle
CalendarView.FirstOfYearDecadeLabelFontStyle
I n this Article
Edit
Gets or sets the font style used to display the first-of-year banner in the calendar.
public : FontStyle FirstOfYearDecadeLabelFontStyle { get; set; }
FontStyle FirstOfYearDecadeLabelFontStyle();

void FirstOfYearDecadeLabelFontStyle(FontStyle firstofyeardecadelabelfontstyle);


public FontStyle FirstOfYearDecadeLabelFontStyle { get; set; }

<CalendarView FirstOfYearDecadeLabelFontStyle="fontStyleMemberName" />

Returns
FontStyle
The font style used to display the first-of-year banner in the calendar.

Remarks
To make the first month of year label visible or not, use the IsGroupLabelVisible property.
CalendarView.FirstOfYearDecadeLabelFontStyleProperty
CalendarView.FirstOfYearDecadeLabelFontStyleProperty
CalendarView.FirstOfYearDecadeLabelFontStyleProperty
I n this Article
Edit
Identifies the FirstOfYearDecadeLabelFontStyle dependency property.
public : static DependencyProperty FirstOfYearDecadeLabelFontStyleProperty { get; }
static DependencyProperty FirstOfYearDecadeLabelFontStyleProperty();
public static DependencyProperty FirstOfYearDecadeLabelFontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the FirstOfYearDecadeLabelFontStyle dependency property.
See Dependency properties overview
Also
CalendarView.FirstOfYearDecadeLabelFontWeight
CalendarView.FirstOfYearDecadeLabelFontWeight
CalendarView.FirstOfYearDecadeLabelFontWeight
I n this Article
Edit
Gets or sets the font weight used to display the first-of-year banner in the calendar.
public : FontWeight FirstOfYearDecadeLabelFontWeight { get; set; }
FontWeight FirstOfYearDecadeLabelFontWeight();

void FirstOfYearDecadeLabelFontWeight(FontWeight firstofyeardecadelabelfontweight);


public FontWeight FirstOfYearDecadeLabelFontWeight { get; set; }

<CalendarView FirstOfYearDecadeLabelFontWeight="fontWeightMemberName"/>

Returns
FontWeight
The font weight used to display the first-of-year banner in the calendar.

Remarks
To make the first month of year label visible or not, use the IsGroupLabelVisible property.
CalendarView.FirstOfYearDecadeLabelFontWeight
Property CalendarView.FirstOfYearDecadeLabelFont
WeightProperty CalendarView.FirstOfYearDecadeLabel
FontWeightProperty
I n this Article
Edit
Identifies the FirstOfYearDecadeLabelFontWeight dependency property.
public : static DependencyProperty FirstOfYearDecadeLabelFontWeightProperty { get; }
static DependencyProperty FirstOfYearDecadeLabelFontWeightProperty();
public static DependencyProperty FirstOfYearDecadeLabelFontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the FirstOfYearDecadeLabelFontWeight dependency property.
See Dependency properties overview
Also
CalendarView.FocusBorderBrush CalendarView.Focus
BorderBrush CalendarView.FocusBorderBrush
I n this Article
Edit
Gets or sets a brush that provides the border of a calendar item that has focus.
public : Brush FocusBorderBrush { get; set; }
Brush FocusBorderBrush();

void FocusBorderBrush(Brush focusborderbrush);


public Brush FocusBorderBrush { get; set; }

<CalendarView FocusBorderBrush="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the border of a calendar item that has focus.
CalendarView.FocusBorderBrushProperty CalendarView.
FocusBorderBrushProperty CalendarView.FocusBorder
BrushProperty
I n this Article
Edit
Identifies the FocusBorderBrush dependency property.
public : static DependencyProperty FocusBorderBrushProperty { get; }
static DependencyProperty FocusBorderBrushProperty();
public static DependencyProperty FocusBorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the FocusBorderBrush dependency property.
See Dependency properties overview
Also
CalendarView.HorizontalDayItemAlignment Calendar
View.HorizontalDayItemAlignment CalendarView.
HorizontalDayItemAlignment
I n this Article
Edit
Gets or sets the horizontal alignment of day items in the calendar.
public : HorizontalAlignment HorizontalDayItemAlignment { get; set; }
HorizontalAlignment HorizontalDayItemAlignment();

void HorizontalDayItemAlignment(HorizontalAlignment horizontaldayitemalignment);


public HorizontalAlignment HorizontalDayItemAlignment { get; set; }

<CalendarView HorizontalDayItemAlignment="horizontalAlignmentMemberName" />

Returns
HorizontalAlignment
An enumeration value that indicates the horizontal alignment of day items in the calendar.
CalendarView.HorizontalDayItemAlignmentProperty
CalendarView.HorizontalDayItemAlignmentProperty
CalendarView.HorizontalDayItemAlignmentProperty
I n this Article
Edit
Identifies the HorizontalDayItemAlignment dependency property.
public : static DependencyProperty HorizontalDayItemAlignmentProperty { get; }
static DependencyProperty HorizontalDayItemAlignmentProperty();
public static DependencyProperty HorizontalDayItemAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalDayItemAlignment dependency property.
See Dependency properties overview
Also
CalendarView.HorizontalFirstOfMonthLabelAlignment
CalendarView.HorizontalFirstOfMonthLabelAlignment
CalendarView.HorizontalFirstOfMonthLabelAlignment
I n this Article
Edit
Gets or sets the horizontal alignment of the first-of-month banner text.
public : HorizontalAlignment HorizontalFirstOfMonthLabelAlignment { get; set; }
HorizontalAlignment HorizontalFirstOfMonthLabelAlignment();

void HorizontalFirstOfMonthLabelAlignment(HorizontalAlignment horizontalfirstofmonthlabelalignment);


public HorizontalAlignment HorizontalFirstOfMonthLabelAlignment { get; set; }

<CalendarView HorizontalFirstOfMonthLabelAlignment="horizontalAlignmentMemberName" />

Returns
HorizontalAlignment
An enumeration value that indicates the horizontal alignment of the first-of-month banner text.
CalendarView.HorizontalFirstOfMonthLabelAlignment
Property CalendarView.HorizontalFirstOfMonthLabel
AlignmentProperty CalendarView.HorizontalFirstOf
MonthLabelAlignmentProperty
I n this Article
Edit
Identifies the HorizontalFirstOfMonthLabelAlignment dependency property.
public : static DependencyProperty HorizontalFirstOfMonthLabelAlignmentProperty { get; }
static DependencyProperty HorizontalFirstOfMonthLabelAlignmentProperty();
public static DependencyProperty HorizontalFirstOfMonthLabelAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalFirstOfMonthLabelAlignment dependency property.
See Dependency properties overview
Also
CalendarView.HoverBorderBrush CalendarView.Hover
BorderBrush CalendarView.HoverBorderBrush
I n this Article
Edit
Gets or sets a brush that provides the border of a calendar item while the pointer is over it.
public : Brush HoverBorderBrush { get; set; }
Brush HoverBorderBrush();

void HoverBorderBrush(Brush hoverborderbrush);


public Brush HoverBorderBrush { get; set; }

<CalendarView HoverBorderBrush="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the border of a calendar item while the pointer is over it.
CalendarView.HoverBorderBrushProperty CalendarView.
HoverBorderBrushProperty CalendarView.HoverBorder
BrushProperty
I n this Article
Edit
Identifies the HoverBorderBrush dependency property.
public : static DependencyProperty HoverBorderBrushProperty { get; }
static DependencyProperty HoverBorderBrushProperty();
public static DependencyProperty HoverBorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the HoverBorderBrush dependency property.
See Dependency properties overview
Also
CalendarView.IsGroupLabelVisible CalendarView.IsGroup
LabelVisible CalendarView.IsGroupLabelVisible
I n this Article
Edit
Gets or sets a value that indicates whether the month name is shown with the first day of the month when the
DisplayMode is Month, or whether the year name is shown with the first month of the year when the DisplayMode is
Year.

public : Platform::Boolean IsGroupLabelVisible { get; set; }


bool IsGroupLabelVisible();

void IsGroupLabelVisible(bool isgrouplabelvisible);


public bool IsGroupLabelVisible { get; set; }

<CalendarView IsGroupLabelVisible="bool" .../>

Returns
bool
true if the month name is shown with the first day of the month; otherwise, false. The default is false.
The formatting of the group label can be set with the FirstOfMonthLabel properties (for example
FirstOfMonthLabelFontSize ) and FirstOfMonthYearDecadeLabel properties (for example
FirstOfYearDecadeLabelFontSize ).
CalendarView.IsGroupLabelVisibleProperty Calendar
View.IsGroupLabelVisibleProperty CalendarView.IsGroup
LabelVisibleProperty
I n this Article
Edit
Identifies the IsGroupLabelVisible dependency property.
public : static DependencyProperty IsGroupLabelVisibleProperty { get; }
static DependencyProperty IsGroupLabelVisibleProperty();
public static DependencyProperty IsGroupLabelVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsGroupLabelVisible dependency property.
See Dependency properties overview
Also
CalendarView.IsOutOfScopeEnabled CalendarView.IsOut
OfScopeEnabled CalendarView.IsOutOfScopeEnabled
I n this Article
Edit
Gets or sets a value that indicates whether out-of-scope calendar items are shown with a unique foreground color.
public : Platform::Boolean IsOutOfScopeEnabled { get; set; }
bool IsOutOfScopeEnabled();

void IsOutOfScopeEnabled(bool isoutofscopeenabled);


public bool IsOutOfScopeEnabled { get; set; }

<CalendarView IsOutOfScopeEnabled="bool" .../>

Returns
bool
true if out-of-scope calendar items are shown with a unique color; false if they are shown with the same color as in-
scope items. The default is true.
CalendarView.IsOutOfScopeEnabledProperty Calendar
View.IsOutOfScopeEnabledProperty CalendarView.IsOut
OfScopeEnabledProperty
I n this Article
Edit
Identifies the IsOutOfScopeEnabled dependency property.
public : static DependencyProperty IsOutOfScopeEnabledProperty { get; }
static DependencyProperty IsOutOfScopeEnabledProperty();
public static DependencyProperty IsOutOfScopeEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsOutOfScopeEnabled dependency property.
See Dependency properties overview
Also
CalendarView.IsTodayHighlighted CalendarView.IsToday
Highlighted CalendarView.IsTodayHighlighted
I n this Article
Edit
Gets or sets a value that indicates whether the current date is highlighted.
public : Platform::Boolean IsTodayHighlighted { get; set; }
bool IsTodayHighlighted();

void IsTodayHighlighted(bool istodayhighlighted);


public bool IsTodayHighlighted { get; set; }

<CalendarView IsTodayHighlighted="bool" .../>

Returns
bool
true if the current date is highlighted; otherwise, false. The default is true.
CalendarView.IsTodayHighlightedProperty CalendarView.
IsTodayHighlightedProperty CalendarView.IsToday
HighlightedProperty
I n this Article
Edit
Identifies the IsTodayHighlighted dependency property.
public : static DependencyProperty IsTodayHighlightedProperty { get; }
static DependencyProperty IsTodayHighlightedProperty();
public static DependencyProperty IsTodayHighlightedProperty { get; }

Returns
DependencyProperty
The identifier for the IsTodayHighlighted dependency property.
See Dependency properties overview
Also
CalendarView.MaxDate CalendarView.MaxDate Calendar
View.MaxDate
I n this Article
Edit
Gets or sets the last date to be displayed.
public : DateTime MaxDate { get; set; }
DateTime MaxDate();

void MaxDate(DateTime maxdate);


public DateTimeOffset MaxDate { get; set; }

Returns
DateTimeOffset
The last date to display.
CalendarView.MaxDateProperty CalendarView.MaxDate
Property CalendarView.MaxDateProperty
I n this Article
Edit
Identifies the MaxDate dependency property.
public : static DependencyProperty MaxDateProperty { get; }
static DependencyProperty MaxDateProperty();
public static DependencyProperty MaxDateProperty { get; }

Returns
DependencyProperty
The identifier for the MaxDate dependency property.
See Dependency properties overview
Also
CalendarView.MinDate CalendarView.MinDate Calendar
View.MinDate
I n this Article
Edit
Gets or sets the first date to display.
public : DateTime MinDate { get; set; }
DateTime MinDate();

void MinDate(DateTime mindate);


public DateTimeOffset MinDate { get; set; }

Returns
DateTimeOffset
The first date to display.
CalendarView.MinDateProperty CalendarView.MinDate
Property CalendarView.MinDateProperty
I n this Article
Edit
Identifies the MinDate dependency property.
public : static DependencyProperty MinDateProperty { get; }
static DependencyProperty MinDateProperty();
public static DependencyProperty MinDateProperty { get; }

Returns
DependencyProperty
The identifier for the MinDate dependency property.
See Dependency properties overview
Also
CalendarView.MonthYearItemFontFamily CalendarView.
MonthYearItemFontFamily CalendarView.MonthYearItem
FontFamily
I n this Article
Edit
Gets or sets the font used to display the month and year items in the calendar.
public : FontFamily MonthYearItemFontFamily { get; set; }
FontFamily MonthYearItemFontFamily();

void MonthYearItemFontFamily(FontFamily monthyearitemfontfamily);


public FontFamily MonthYearItemFontFamily { get; set; }

<CalendarView MonthYearItemFontFamily="fontFamilyValue"/>

Returns
FontFamily
The font used to display the month and year items in the calendar.
CalendarView.MonthYearItemFontFamilyProperty
CalendarView.MonthYearItemFontFamilyProperty
CalendarView.MonthYearItemFontFamilyProperty
I n this Article
Edit
Identifies the MonthYearItemFontFamily dependency property.
public : static DependencyProperty MonthYearItemFontFamilyProperty { get; }
static DependencyProperty MonthYearItemFontFamilyProperty();
public static DependencyProperty MonthYearItemFontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the MonthYearItemFontFamily dependency property.
See Dependency properties overview
Also
CalendarView.MonthYearItemFontSize CalendarView.
MonthYearItemFontSize CalendarView.MonthYearItem
FontSize
I n this Article
Edit
Gets or sets the font size used to display the month and year items in the calendar.
public : double MonthYearItemFontSize { get; set; }
double MonthYearItemFontSize();

void MonthYearItemFontSize(double monthyearitemfontsize);


public double MonthYearItemFontSize { get; set; }

<CalendarView MonthYearItemFontSize="double"/>

Returns
double
The font size used to display the month and year items in the calendar.
CalendarView.MonthYearItemFontSizeProperty Calendar
View.MonthYearItemFontSizeProperty CalendarView.
MonthYearItemFontSizeProperty
I n this Article
Edit
Identifies the MonthYearItemFontSize dependency property.
public : static DependencyProperty MonthYearItemFontSizeProperty { get; }
static DependencyProperty MonthYearItemFontSizeProperty();
public static DependencyProperty MonthYearItemFontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the MonthYearItemFontSize dependency property.
See Dependency properties overview
Also
CalendarView.MonthYearItemFontStyle CalendarView.
MonthYearItemFontStyle CalendarView.MonthYearItem
FontStyle
I n this Article
Edit
Gets or sets the font style used to display the month and year items in the calendar.
public : FontStyle MonthYearItemFontStyle { get; set; }
FontStyle MonthYearItemFontStyle();

void MonthYearItemFontStyle(FontStyle monthyearitemfontstyle);


public FontStyle MonthYearItemFontStyle { get; set; }

<CalendarView MonthYearItemFontStyle="fontStyleMemberName" />

Returns
FontStyle
The font style used to display the month and year items in the calendar.
CalendarView.MonthYearItemFontStyleProperty
CalendarView.MonthYearItemFontStyleProperty
CalendarView.MonthYearItemFontStyleProperty
I n this Article
Edit
Identifies the MonthYearItemFontStyle dependency property.
public : static DependencyProperty MonthYearItemFontStyleProperty { get; }
static DependencyProperty MonthYearItemFontStyleProperty();
public static DependencyProperty MonthYearItemFontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the MonthYearItemFontStyle dependency property.
See Dependency properties overview
Also
CalendarView.MonthYearItemFontWeight CalendarView.
MonthYearItemFontWeight CalendarView.MonthYearItem
FontWeight
I n this Article
Edit
Gets or sets the font weight used to display the month and year items in the calendar.
public : FontWeight MonthYearItemFontWeight { get; set; }
FontWeight MonthYearItemFontWeight();

void MonthYearItemFontWeight(FontWeight monthyearitemfontweight);


public FontWeight MonthYearItemFontWeight { get; set; }

<CalendarView MonthYearItemFontWeight="fontWeightMemberName"/>

Returns
FontWeight
The font weight used to display the month and year items in the calendar.
CalendarView.MonthYearItemFontWeightProperty
CalendarView.MonthYearItemFontWeightProperty
CalendarView.MonthYearItemFontWeightProperty
I n this Article
Edit
Identifies the MonthYearItemFontWeight dependency property.
public : static DependencyProperty MonthYearItemFontWeightProperty { get; }
static DependencyProperty MonthYearItemFontWeightProperty();
public static DependencyProperty MonthYearItemFontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the MonthYearItemFontWeight dependency property.
See Dependency properties overview
Also
CalendarView.NumberOfWeeksInView CalendarView.
NumberOfWeeksInView CalendarView.NumberOfWeeks
InView
I n this Article
Edit
Gets or sets the number of weeks shown in the calendar view.
public : int NumberOfWeeksInView { get; set; }
int32_t NumberOfWeeksInView();

void NumberOfWeeksInView(int32_t numberofweeksinview);


public int NumberOfWeeksInView { get; set; }

<CalendarView NumberOfWeeksInView="int"/>

Returns
int
The number of weeks shown in the calendar view. The default is 6.
CalendarView.NumberOfWeeksInViewProperty Calendar
View.NumberOfWeeksInViewProperty CalendarView.
NumberOfWeeksInViewProperty
I n this Article
Edit
Identifies the NumberOfWeeksInView dependency property.
public : static DependencyProperty NumberOfWeeksInViewProperty { get; }
static DependencyProperty NumberOfWeeksInViewProperty();
public static DependencyProperty NumberOfWeeksInViewProperty { get; }

Returns
DependencyProperty
The identifier for the NumberOfWeeksInView dependency property.
See Dependency properties overview
Also
CalendarView.OutOfScopeBackground CalendarView.Out
OfScopeBackground CalendarView.OutOfScope
Background
I n this Article
Edit
Gets or sets a brush that provides the background of a date that's out of scope.
public : Brush OutOfScopeBackground { get; set; }
Brush OutOfScopeBackground();

void OutOfScopeBackground(Brush outofscopebackground);


public Brush OutOfScopeBackground { get; set; }

<CalendarView OutOfScopeBackground="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the background of a date that's out of scope.
CalendarView.OutOfScopeBackgroundProperty Calendar
View.OutOfScopeBackgroundProperty CalendarView.Out
OfScopeBackgroundProperty
I n this Article
Edit
Identifies the OutOfScopeBackground dependency property.
public : static DependencyProperty OutOfScopeBackgroundProperty { get; }
static DependencyProperty OutOfScopeBackgroundProperty();
public static DependencyProperty OutOfScopeBackgroundProperty { get; }

Returns
DependencyProperty
The identifier for the OutOfScopeBackground dependency property.
See Dependency properties overview
Also
CalendarView.OutOfScopeForeground CalendarView.Out
OfScopeForeground CalendarView.OutOfScope
Foreground
I n this Article
Edit
Gets or sets a brush that provides the foreground of calendar items that are outside the current scope (month, year, or
decade).
public : Brush OutOfScopeForeground { get; set; }
Brush OutOfScopeForeground();

void OutOfScopeForeground(Brush outofscopeforeground);


public Brush OutOfScopeForeground { get; set; }

<CalendarView OutOfScopeForeground="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the foreground of calendar items that are outside the current scope.
CalendarView.OutOfScopeForegroundProperty Calendar
View.OutOfScopeForegroundProperty CalendarView.Out
OfScopeForegroundProperty
I n this Article
Edit
Identifies the OutOfScopeForeground dependency property.
public : static DependencyProperty OutOfScopeForegroundProperty { get; }
static DependencyProperty OutOfScopeForegroundProperty();
public static DependencyProperty OutOfScopeForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the OutOfScopeForeground dependency property.
See Dependency properties overview
Also
CalendarView.PressedBorderBrush CalendarView.Pressed
BorderBrush CalendarView.PressedBorderBrush
I n this Article
Edit
Gets or sets a brush that provides the border of a calendar item while it's pressed.
public : Brush PressedBorderBrush { get; set; }
Brush PressedBorderBrush();

void PressedBorderBrush(Brush pressedborderbrush);


public Brush PressedBorderBrush { get; set; }

<CalendarView PressedBorderBrush="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the border of a calendar item while it's pressed.
CalendarView.PressedBorderBrushProperty Calendar
View.PressedBorderBrushProperty CalendarView.Pressed
BorderBrushProperty
I n this Article
Edit
Identifies the PressedBorderBrush dependency property.
public : static DependencyProperty PressedBorderBrushProperty { get; }
static DependencyProperty PressedBorderBrushProperty();
public static DependencyProperty PressedBorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the PressedBorderBrush dependency property.
See Dependency properties overview
Also
CalendarView.PressedForeground CalendarView.Pressed
Foreground CalendarView.PressedForeground
I n this Article
Edit
Gets or sets a brush that provides the foreground of a calendar item while it's pressed.
public : Brush PressedForeground { get; set; }
Brush PressedForeground();

void PressedForeground(Brush pressedforeground);


public Brush PressedForeground { get; set; }

<CalendarView PressedForeground="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the foreground of a calendar item while it's pressed.
CalendarView.PressedForegroundProperty CalendarView.
PressedForegroundProperty CalendarView.Pressed
ForegroundProperty
I n this Article
Edit
Identifies the PressedForeground dependency property.
public : static DependencyProperty PressedForegroundProperty { get; }
static DependencyProperty PressedForegroundProperty();
public static DependencyProperty PressedForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the PressedForeground dependency property.
See Dependency properties overview
Also
CalendarView.SelectedBorderBrush CalendarView.
SelectedBorderBrush CalendarView.SelectedBorderBrush
I n this Article
Edit
Gets or sets a brush that provides the border of the currently selected calendar item.
public : Brush SelectedBorderBrush { get; set; }
Brush SelectedBorderBrush();

void SelectedBorderBrush(Brush selectedborderbrush);


public Brush SelectedBorderBrush { get; set; }

<CalendarView SelectedBorderBrush="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the border of the currently selected calendar item.
CalendarView.SelectedBorderBrushProperty Calendar
View.SelectedBorderBrushProperty CalendarView.
SelectedBorderBrushProperty
I n this Article
Edit
Identifies the SelectedBorderBrush dependency property.
public : static DependencyProperty SelectedBorderBrushProperty { get; }
static DependencyProperty SelectedBorderBrushProperty();
public static DependencyProperty SelectedBorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedBorderBrush dependency property.
See Dependency properties overview
Also
CalendarView.SelectedDates CalendarView.Selected
Dates CalendarView.SelectedDates
I n this Article
Edit
Gets a collection of selected dates.
public : IVector<DateTime> SelectedDates { get; }
IVector<DateTime> SelectedDates();
public IList<DateTimeOffset> SelectedDates { get; }

Returns
IList<DateTimeOffset>
A collection that contains the currently selected dates. The default is an empty collection.
CalendarView.SelectedDatesChanged CalendarView.
SelectedDatesChanged CalendarView.SelectedDates
Changed
I n this Article
Edit
Occurs when the collection of selected dates is changed.
public : event TypedEventHandler<CalendarView, CalendarViewSelectedDatesChangedEventArgs>
SelectedDatesChanged
// Register
event_token SelectedDatesChanged(TypedEventHandler<CalendarView,
CalendarViewSelectedDatesChangedEventArgs> const& handler) const;

// Revoke with event_token


void SelectedDatesChanged(event_token const& cookie) const;

// Revoke with event_revoker


SelectedDatesChanged_revoker SelectedDatesChanged(auto_revoke_t, TypedEventHandler<CalendarView,
CalendarViewSelectedDatesChangedEventArgs> const& handler) const;
public event TypedEventHandler<CalendarView, CalendarViewSelectedDatesChangedEventArgs>
SelectedDatesChanged

<CalendarView SelectedDatesChanged="eventhandler"/>
CalendarView.SelectedDatesProperty CalendarView.
SelectedDatesProperty CalendarView.SelectedDates
Property
I n this Article
Edit
Identifies the SelectedDates dependency property.
public : static DependencyProperty SelectedDatesProperty { get; }
static DependencyProperty SelectedDatesProperty();
public static DependencyProperty SelectedDatesProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedDates dependency property.
See Dependency properties overview
Also
CalendarView.SelectedForeground CalendarView.
SelectedForeground CalendarView.SelectedForeground
I n this Article
Edit
Gets or sets a brush that provides the foreground of a calendar item that's selected.
public : Brush SelectedForeground { get; set; }
Brush SelectedForeground();

void SelectedForeground(Brush selectedforeground);


public Brush SelectedForeground { get; set; }

<CalendarView SelectedForeground="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the foreground of a calendar item that's selected.
CalendarView.SelectedForegroundProperty Calendar
View.SelectedForegroundProperty CalendarView.
SelectedForegroundProperty
I n this Article
Edit
Identifies the SelectedForeground dependency property.
public : static DependencyProperty SelectedForegroundProperty { get; }
static DependencyProperty SelectedForegroundProperty();
public static DependencyProperty SelectedForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedForeground dependency property.
See Dependency properties overview
Also
CalendarView.SelectedHoverBorderBrush CalendarView.
SelectedHoverBorderBrush CalendarView.SelectedHover
BorderBrush
I n this Article
Edit
Gets or sets a brush that provides the border of a selected calendar item while the pointer is over it.
public : Brush SelectedHoverBorderBrush { get; set; }
Brush SelectedHoverBorderBrush();

void SelectedHoverBorderBrush(Brush selectedhoverborderbrush);


public Brush SelectedHoverBorderBrush { get; set; }

<CalendarView SelectedHoverBorderBrush="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the border of a selected calendar item while the pointer is over it.
CalendarView.SelectedHoverBorderBrushProperty
CalendarView.SelectedHoverBorderBrushProperty
CalendarView.SelectedHoverBorderBrushProperty
I n this Article
Edit
Identifies the SelectedHoverBorderBrush dependency property.
public : static DependencyProperty SelectedHoverBorderBrushProperty { get; }
static DependencyProperty SelectedHoverBorderBrushProperty();
public static DependencyProperty SelectedHoverBorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedHoverBorderBrush dependency property.
See Dependency properties overview
Also
CalendarView.SelectedPressedBorderBrush Calendar
View.SelectedPressedBorderBrush CalendarView.Selected
PressedBorderBrush
I n this Article
Edit
Gets or sets a brush that provides the border of a selected calendar item while it's pressed.
public : Brush SelectedPressedBorderBrush { get; set; }
Brush SelectedPressedBorderBrush();

void SelectedPressedBorderBrush(Brush selectedpressedborderbrush);


public Brush SelectedPressedBorderBrush { get; set; }

<CalendarView SelectedPressedBorderBrush="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the border of a selected calendar item while it's pressed.
CalendarView.SelectedPressedBorderBrushProperty
CalendarView.SelectedPressedBorderBrushProperty
CalendarView.SelectedPressedBorderBrushProperty
I n this Article
Edit
Identifies the SelectedPressedBorderBrush dependency property.
public : static DependencyProperty SelectedPressedBorderBrushProperty { get; }
static DependencyProperty SelectedPressedBorderBrushProperty();
public static DependencyProperty SelectedPressedBorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedPressedBorderBrush dependency property.
See Dependency properties overview
Also
CalendarView.SelectionMode CalendarView.Selection
Mode CalendarView.SelectionMode
I n this Article
Edit
Gets or sets a value that indicates what kind of selections are allowed.
public : CalendarViewSelectionMode SelectionMode { get; set; }
CalendarViewSelectionMode SelectionMode();

void SelectionMode(CalendarViewSelectionMode selectionmode);


public CalendarViewSelectionMode SelectionMode { get; set; }

<CalendarView SelectionMode="calendarViewSelectionModeMemberName" />

Returns
CalendarViewSelectionMode
An enumeration value that indicates the current selection mode. The default is Single.
CalendarView.SelectionModeProperty CalendarView.
SelectionModeProperty CalendarView.SelectionMode
Property
I n this Article
Edit
Identifies the SelectionMode dependency property.
public : static DependencyProperty SelectionModeProperty { get; }
static DependencyProperty SelectionModeProperty();
public static DependencyProperty SelectionModeProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionMode dependency property.
See Dependency properties overview
Also
CalendarView.SetDisplayDate CalendarView.SetDisplay
Date CalendarView.SetDisplayDate
I n this Article
Edit
Shows the specified date in the calendar.
public : void SetDisplayDate(DateTime date)
void SetDisplayDate(DateTime date) const;
public void SetDisplayDate(DateTimeOffset date)

Parameters
date DateTimeOffset
The date to show in the calendar.
CalendarView.SetYearDecadeDisplayDimensions
CalendarView.SetYearDecadeDisplayDimensions
CalendarView.SetYearDecadeDisplayDimensions
I n this Article
Edit
Sets the number of rows and columns to use in the Year and Decade display modes.
public : void SetYearDecadeDisplayDimensions(int columns, int rows)
void SetYearDecadeDisplayDimensions(int32_t columns, int32_t rows) const;
public void SetYearDecadeDisplayDimensions(Int32 columns, Int32 rows)

Parameters
columns Int32
The number of columns in the view.
rows Int32
The number of rows in the view.
CalendarView.TemplateSettings CalendarView.Template
Settings CalendarView.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension sources
when defining templates for a CalendarView control.
public : CalendarViewTemplateSettings TemplateSettings { get; }
CalendarViewTemplateSettings TemplateSettings();
public CalendarViewTemplateSettings TemplateSettings { get; }

Returns
CalendarViewTemplateSettings
An object that provides calculated values for templates.
CalendarView.TemplateSettingsProperty CalendarView.
TemplateSettingsProperty CalendarView.Template
SettingsProperty
I n this Article
Edit
Identifies the TemplateSettings dependency property.
public : static DependencyProperty TemplateSettingsProperty { get; }
static DependencyProperty TemplateSettingsProperty();
public static DependencyProperty TemplateSettingsProperty { get; }

Returns
DependencyProperty
The identifier for the TemplateSettings dependency property.
See Dependency properties overview
Also
CalendarView.TodayFontWeight CalendarView.TodayFont
Weight CalendarView.TodayFontWeight
I n this Article
Edit
Gets or sets the font weight used to display the current date in the calendar.
public : FontWeight TodayFontWeight { get; set; }
FontWeight TodayFontWeight();

void TodayFontWeight(FontWeight todayfontweight);


public FontWeight TodayFontWeight { get; set; }

<CalendarView TodayFontWeight="fontWeightMemberName"/>

Returns
FontWeight
The font weight used to display the current date in the calendar.
CalendarView.TodayFontWeightProperty CalendarView.
TodayFontWeightProperty CalendarView.TodayFont
WeightProperty
I n this Article
Edit
Identifies the TodayFontWeight dependency property.
public : static DependencyProperty TodayFontWeightProperty { get; }
static DependencyProperty TodayFontWeightProperty();
public static DependencyProperty TodayFontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the TodayFontWeight dependency property.
See Dependency properties overview
Also
CalendarView.TodayForeground CalendarView.Today
Foreground CalendarView.TodayForeground
I n this Article
Edit
Gets or sets a brush that provides the foreground of the calendar item for the current date.
public : Brush TodayForeground { get; set; }
Brush TodayForeground();

void TodayForeground(Brush todayforeground);


public Brush TodayForeground { get; set; }

<CalendarView TodayForeground="{StaticResource resourceName}"/>

Returns
Brush
A brush that provides the foreground of the calendar item for the current date.
CalendarView.TodayForegroundProperty CalendarView.
TodayForegroundProperty CalendarView.Today
ForegroundProperty
I n this Article
Edit
Identifies the TodayForeground dependency property.
public : static DependencyProperty TodayForegroundProperty { get; }
static DependencyProperty TodayForegroundProperty();
public static DependencyProperty TodayForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the TodayForeground dependency property.
See Dependency properties overview
Also
CalendarView.VerticalDayItemAlignment CalendarView.
VerticalDayItemAlignment CalendarView.VerticalDayItem
Alignment
I n this Article
Edit
Gets or sets the vertical alignment of day items in the calendar.
public : VerticalAlignment VerticalDayItemAlignment { get; set; }
VerticalAlignment VerticalDayItemAlignment();

void VerticalDayItemAlignment(VerticalAlignment verticaldayitemalignment);


public VerticalAlignment VerticalDayItemAlignment { get; set; }

<CalendarView VerticalDayItemAlignment="verticalAlignmentMemberName" />

Returns
VerticalAlignment
An enumeration value that indicates the vertical alignment of day items in the calendar.
CalendarView.VerticalDayItemAlignmentProperty
CalendarView.VerticalDayItemAlignmentProperty
CalendarView.VerticalDayItemAlignmentProperty
I n this Article
Edit
Identifies the VerticalDayItemAlignment dependency property.
public : static DependencyProperty VerticalDayItemAlignmentProperty { get; }
static DependencyProperty VerticalDayItemAlignmentProperty();
public static DependencyProperty VerticalDayItemAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalDayItemAlignment dependency property.
See Dependency properties overview
Also
CalendarView.VerticalFirstOfMonthLabelAlignment
CalendarView.VerticalFirstOfMonthLabelAlignment
CalendarView.VerticalFirstOfMonthLabelAlignment
I n this Article
Edit
Gets or sets the vertical alignment of the first-of-month banner text.
public : VerticalAlignment VerticalFirstOfMonthLabelAlignment { get; set; }
VerticalAlignment VerticalFirstOfMonthLabelAlignment();

void VerticalFirstOfMonthLabelAlignment(VerticalAlignment verticalfirstofmonthlabelalignment);


public VerticalAlignment VerticalFirstOfMonthLabelAlignment { get; set; }

<CalendarView VerticalFirstOfMonthLabelAlignment="verticalAlignmentMemberName" />

Returns
VerticalAlignment
An enumeration value that indicates the vertical alignment of the first-of-month banner text.
CalendarView.VerticalFirstOfMonthLabelAlignment
Property CalendarView.VerticalFirstOfMonthLabel
AlignmentProperty CalendarView.VerticalFirstOfMonth
LabelAlignmentProperty
I n this Article
Edit
Identifies the VerticalFirstOfMonthLabelAlignment dependency property.
public : static DependencyProperty VerticalFirstOfMonthLabelAlignmentProperty { get; }
static DependencyProperty VerticalFirstOfMonthLabelAlignmentProperty();
public static DependencyProperty VerticalFirstOfMonthLabelAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalFirstOfMonthLabelAlignment dependency property.
See Dependency properties overview
Also
CalendarViewDayItem CalendarViewDayItem Calendar
ViewDayItem Class
Represents a day on a CalendarView.

D eclaration
public : class CalendarViewDayItem : Control, ICalendarViewDayItem
struct winrt::Windows::UI::Xaml::Controls::CalendarViewDayItem : Control, ICalendarViewDayItem
public class CalendarViewDayItem : Control, ICalendarViewDayItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
The calendar grid of a CalendarView control is composed of CalendarViewDayItem objects. You typically modify the
day item in the CalendarViewDayItemChanging event of either a CalendarView or CalendarDatePicker control. Use
the Item property of the CalendarViewDayItemChangingEventArgs to access the CalendarViewDayItem object. For
more info, see the, "Updating calendar day items ", section of the CalendarView class remarks.
To improve performance, the visual elements of a CalendarViewDayItem are rendered directly by the control, not
defined in the control template as XAML elements. This means you can’t style or re-template these elements. However,
CalendarView provides several "calendar item" and "day item" properties that you can use to customize these
elements, such as CalendarItemBackground, CalendarItemBorderBrush, and DayItemFontSize.
Even though the visual elements of a CalendarViewDayItem are rendered directly by the control, you can use
CalendarView.CalendarViewDayItemStyle to set properties like MinWidth, MinHeight, Margin, and Padding. The
default Style (see CalendarViewDayItem styles and template) also includes an empty ControlTemplate that you can use
to inject custom XAML elements into the CalendarViewDayItem. Your XAML elements are rendered on top of the
background elements, and below the day number and labels.
Use the Date property to get the date represented by this day item. The time portions of this property's DateTime
value are ignored. If you compare two dates from a CalendarView, be sure to compare only the Date portion of the
DateTime value.
Use the IsBlackout property to get or set a value that indicates whether the date is unavailable.
Call the SetDensityColors method to set the collection of Color values used to display the density bar.
Note

The IsBlackout property and the density colors collection are reset each time the day item container is recycled. If you
use these features, you should set the values each time the CalendarViewDayItemChanging event occurs.

Constructors
CalendarViewDayItem()
CalendarViewDayItem()
CalendarViewDayItem()
Initializes a new instance of the CalendarViewDayItem class.

Properties
Date
Date
Date

Gets the date represented by this item.

DateProperty
DateProperty
DateProperty

Identifies the Date dependency property.

IsBlackout
IsBlackout
IsBlackout

Gets or sets a value that indicates whether the date is unavailable.

IsBlackoutProperty
IsBlackoutProperty
IsBlackoutProperty

Identifies the IsBlackout dependency property.

Methods
SetDensityColors(IIterable<Color>)
SetDensityColors(IIterable<Color>)
SetDensityColors(IIterable<Color>)

Sets the collection of Color values used to display the density bar.

See Also
Control
Control
CalendarViewDayItem CalendarViewDayItem Calendar
ViewDayItem
I n this Article
Edit
Initializes a new instance of the CalendarViewDayItem class.
public : CalendarViewDayItem()
CalendarViewDayItem() const;
public CalendarViewDayItem()
CalendarViewDayItem.Date CalendarViewDayItem.Date
CalendarViewDayItem.Date
I n this Article
Edit
Gets the date represented by this item.
public : DateTime Date { get; }
DateTime Date();
public DateTimeOffset Date { get; }

Returns
DateTimeOffset
The date represented by this item.
CalendarViewDayItem.DateProperty CalendarViewDay
Item.DateProperty CalendarViewDayItem.DateProperty
I n this Article
Edit
Identifies the Date dependency property.
public : static DependencyProperty DateProperty { get; }
static DependencyProperty DateProperty();
public static DependencyProperty DateProperty { get; }

Returns
DependencyProperty
The identifier for the Date dependency property.
See Dependency properties overview
Also
CalendarViewDayItem.IsBlackout CalendarViewDayItem.
IsBlackout CalendarViewDayItem.IsBlackout
I n this Article
Edit
Gets or sets a value that indicates whether the date is unavailable.
public : Platform::Boolean IsBlackout { get; set; }
bool IsBlackout();

void IsBlackout(bool isblackout);


public bool IsBlackout { get; set; }

<CalendarViewDayItem IsBlackout="bool" .../>

Returns
bool
true if the date unavailable; otherwise, false. The default is false.
CalendarViewDayItem.IsBlackoutProperty CalendarView
DayItem.IsBlackoutProperty CalendarViewDayItem.Is
BlackoutProperty
I n this Article
Edit
Identifies the IsBlackout dependency property.
public : static DependencyProperty IsBlackoutProperty { get; }
static DependencyProperty IsBlackoutProperty();
public static DependencyProperty IsBlackoutProperty { get; }

Returns
DependencyProperty
The identifier for the IsBlackout dependency property.
See Dependency properties overview
Also
CalendarViewDayItem.SetDensityColors CalendarView
DayItem.SetDensityColors CalendarViewDayItem.Set
DensityColors
I n this Article
Edit
Sets the collection of Color values used to display the density bar.
public : void SetDensityColors(IIterable<Color> colors)
void SetDensityColors(IIterable<Color> colors) const;
public void SetDensityColors(IEnumerable<Color> colors)

Parameters
colors IEnumerable<Color>
The collection of Color values used to display the density bar.
CalendarViewDayItemChangingEventArgs CalendarView
DayItemChangingEventArgs CalendarViewDayItem
ChangingEventArgs Class
Provides data for the CalendarViewDayItemChanging event.

D eclaration
public : sealed class CalendarViewDayItemChangingEventArgs :
ICalendarViewDayItemChangingEventArgs
struct winrt::Windows::UI::Xaml::Controls::CalendarViewDayItemChangingEventArgs :
ICalendarViewDayItemChangingEventArgs
public sealed class CalendarViewDayItemChangingEventArgs : ICalendarViewDayItemChangingEventArgs

I nheritance H ierarchy
None

Properties
InRecycleQueue
InRecycleQueue
InRecycleQueue

Gets a value that indicates whether this container is in the recycle queue of the CalendarView and is not being
used to visualize a calendar item.

Item
Item
Item

Gets the calendar day item associated with this container.

Phase
Phase
Phase

Gets the number of times this container and day item pair has been called.

Methods
RegisterUpdateCallback(UInt32, TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>)
RegisterUpdateCallback(UInt32, TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>)
RegisterUpdateCallback(UInt32, TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>)

Registers the event handler to be called again during the specified phase.
RegisterUpdateCallback(TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>)
RegisterUpdateCallback(TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>)
RegisterUpdateCallback(TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>)

Registers the event handler to be called again during the next phase.
CalendarViewDayItemChangingEventArgs.InRecycle
Queue CalendarViewDayItemChangingEventArgs.In
RecycleQueue CalendarViewDayItemChangingEvent
Args.InRecycleQueue
I n this Article
Edit
Gets a value that indicates whether this container is in the recycle queue of the CalendarView and is not being used to
visualize a calendar item.
public : Platform::Boolean InRecycleQueue { get; }
bool InRecycleQueue();
public bool InRecycleQueue { get; }

Returns
bool
true if the container is in the recycle queue of the CalendarView; otherwise, false.
CalendarViewDayItemChangingEventArgs.Item Calendar
ViewDayItemChangingEventArgs.Item CalendarViewDay
ItemChangingEventArgs.Item
I n this Article
Edit
Gets the calendar day item associated with this container.
public : CalendarViewDayItem Item { get; }
CalendarViewDayItem Item();
public CalendarViewDayItem Item { get; }

Returns
CalendarViewDayItem
The CalendarViewDayItem associated with this container, or null if no item is associated with this container.
CalendarViewDayItemChangingEventArgs.Phase
CalendarViewDayItemChangingEventArgs.Phase
CalendarViewDayItemChangingEventArgs.Phase
I n this Article
Edit
Gets the number of times this container and day item pair has been called.
public : unsigned int Phase { get; }
uint32_t Phase();
public uint Phase { get; }

Returns
uint
The number of times this container and day item pair has been called.
CalendarViewDayItemChangingEventArgs.Register
UpdateCallback CalendarViewDayItemChangingEvent
Args.RegisterUpdateCallback CalendarViewDayItem
ChangingEventArgs.RegisterUpdateCallback
I n this Article

Overloads
RegisterUpdateCallback(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>) RegisterUpdate Registers the event handler to be called again during the next
Callback(TypedEventHandler<CalendarView, CalendarViewDay phase.
ItemChangingEventArgs>) RegisterUpdateCallback(Typed
EventHandler<CalendarView, CalendarViewDayItemChanging
EventArgs>)

RegisterUpdateCallback(UInt32, TypedEventHandler<Calendar
View, CalendarViewDayItemChangingEventArgs>) Register Registers the event handler to be called again during the
UpdateCallback(UInt32, TypedEventHandler<CalendarView, specified phase.
CalendarViewDayItemChangingEventArgs>) RegisterUpdate
Callback(UInt32, TypedEventHandler<CalendarView, Calendar
ViewDayItemChangingEventArgs>)

RegisterUpdateCallback(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)
RegisterUpdateCallback(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)
RegisterUpdateCallback(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)
Edit
Registers the event handler to be called again during the next phase.
public : void RegisterUpdateCallback(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs> callback)
void RegisterUpdateCallback(TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>
callback) const;
public void RegisterUpdateCallback(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs> callback)

Parameters
callback TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>
The event handler function.
Attributes OverloadAttribute
See
Also
RegisterUpdateCallback(UInt32, TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)RegisterUpdateCallback(UInt32,
TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)RegisterUpdateCallback(UInt32,
TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>)

RegisterUpdateCallback(UInt32,
TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)
RegisterUpdateCallback(UInt32,
TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)
RegisterUpdateCallback(UInt32,
TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)
Edit
Registers the event handler to be called again during the specified phase.
public : void RegisterUpdateCallback(unsigned int callbackPhase, TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs> callback)
void RegisterUpdateCallback(uint32_t callbackPhase, TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs> callback) const;
public void RegisterUpdateCallback(UInt32 callbackPhase, TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs> callback)

Parameters
callbackPhase UInt32
The phase during which the callback should occur.
callback TypedEventHandler<CalendarView, CalendarViewDayItemChangingEventArgs>
The event handler function.
Attributes OverloadAttribute
See
Also
RegisterUpdateCallback(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)RegisterUpdateCallback(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)RegisterUpdateCallback(TypedEventHandler<CalendarView,
CalendarViewDayItemChangingEventArgs>)
CalendarViewDayItemChangingEventHandler Calendar
ViewDayItemChangingEventHandler CalendarViewDay
ItemChangingEventHandler Delegate
Represents the method that will handle the CalendarViewDayItemChanging event.

D eclaration
public : delegate void CalendarViewDayItemChangingEventHandler(CalendarView sender,
CalendarViewDayItemChangingEventArgs e)
struct CalendarViewDayItemChangingEventHandler : winrt::Windows::Foundation::IUnknown
{
CalendarViewDayItemChangingEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> CalendarViewDayItemChangingEventHandler(L lambda);
template <typename F> CalendarViewDayItemChangingEventHandler(F* function);
template <typename O, typename M> CalendarViewDayItemChangingEventHandler(O* object, M
method);
void operator()(winrt::Windows::UI::Xaml::Controls::CalendarView const& sender,
winrt::Windows::UI::Xaml::Controls::CalendarViewDayItemChangingEventArgs const& e) const;
};
public delegate void CalendarViewDayItemChangingEventHandler(CalendarView sender,
CalendarViewDayItemChangingEventArgs e)

I nheritance H ierarchy
None
CalendarViewDisplayMode CalendarViewDisplayMode
CalendarViewDisplayMode Enum
Defines constants that specify which view of the calendar is shown.

D eclaration
public : enum class CalendarViewDisplayMode
enum class winrt::Windows::UI::Xaml::Controls::CalendarViewDisplayMode : int32_t
public enum CalendarViewDisplayMode

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the CalendarView.DisplayMode and CalandarDatePicker.DisplayMode
properties.

Fields
Decade Decade Decade The decade selector view is shown.

Month Month Month The month view is shown.

Year Year Year The year selector view is shown.


CalendarViewSelectedDatesChangedEventArgs Calendar
ViewSelectedDatesChangedEventArgs CalendarView
SelectedDatesChangedEventArgs Class
Provides data for the SelectedDatesChanged event.

D eclaration
public : sealed class CalendarViewSelectedDatesChangedEventArgs :
ICalendarViewSelectedDatesChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::CalendarViewSelectedDatesChangedEventArgs :
ICalendarViewSelectedDatesChangedEventArgs
public sealed class CalendarViewSelectedDatesChangedEventArgs :
ICalendarViewSelectedDatesChangedEventArgs

I nheritance H ierarchy
None

Properties
AddedDates
AddedDates
AddedDates

Gets a collection that contains the items that were selected.

RemovedDates
RemovedDates
RemovedDates

Gets a collection that contains the items that were unselected.


CalendarViewSelectedDatesChangedEventArgs.Added
Dates CalendarViewSelectedDatesChangedEventArgs.
AddedDates CalendarViewSelectedDatesChangedEvent
Args.AddedDates
I n this Article
Edit
Gets a collection that contains the items that were selected.
public : IVectorView<DateTime> AddedDates { get; }
IVectorView<DateTime> AddedDates();
public IReadOnlyList<DateTimeOffset> AddedDates { get; }

Returns
IReadOnlyList<DateTimeOffset>
The items that were selected since the last time the SelectedDatesChanged event occurred.
CalendarViewSelectedDatesChangedEventArgs.Removed
Dates CalendarViewSelectedDatesChangedEventArgs.
RemovedDates CalendarViewSelectedDatesChanged
EventArgs.RemovedDates
I n this Article
Edit
Gets a collection that contains the items that were unselected.
public : IVectorView<DateTime> RemovedDates { get; }
IVectorView<DateTime> RemovedDates();
public IReadOnlyList<DateTimeOffset> RemovedDates { get; }

Returns
IReadOnlyList<DateTimeOffset>
The items that were unselected since the last time the SelectedDatesChanged event occurred.
CalendarViewSelectionMode CalendarViewSelection
Mode CalendarViewSelectionMode Enum
Defines constants that specify what kind of date selections are allowed in the calendar.

D eclaration
public : enum class CalendarViewSelectionMode
enum class winrt::Windows::UI::Xaml::Controls::CalendarViewSelectionMode : int32_t
public enum CalendarViewSelectionMode

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the CalendarView.SelectionMode property.

Fields
Multiple Multiple Multiple One or more dates can be selected at a time.

None None None Date selection is disabled.

Single Single Single One date can be selected at a time.


CandidateWindowAlignment CandidateWindow
Alignment CandidateWindowAlignment Enum
Defines constants that specify how the Input Method Editor (IME ) window for text predictions is aligned with a text edit
control.

D eclaration
public : enum class CandidateWindowAlignment
enum class winrt::Windows::UI::Xaml::Controls::CandidateWindowAlignment : int32_t
public enum CandidateWindowAlignment

I nheritance H ierarchy
None

Remarks
This enumeration is used by the TextBox.DesiredCandidateWindowAlignment and
RichEditBox.DesiredCandidateWindowAlignment properties.

Fields
BottomEdge When the hardware keyboard is used, the Input Method Editor (IME) aligns to the bottom edge and left
BottomEdge side of the text edit control. When the Soft Input Panel (SIP) is used, the Input Method Editor (IME) is
BottomEdge docked to the Soft Input Panel (SIP).

Default When the hardware keyboard is used, the Input Method Editor (IME) follows the cursor. When the Soft
Default Input Panel (SIP) is used, the Input Method Editor (IME) is docked to the Soft Input Panel (SIP).
Default
CandidateWindowBoundsChangedEventArgs Candidate
WindowBoundsChangedEventArgs CandidateWindow
BoundsChangedEventArgs Class
Provides event data for the CandidateWindowBoundsChanged event.

D eclaration
public : sealed class CandidateWindowBoundsChangedEventArgs :
ICandidateWindowBoundsChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::CandidateWindowBoundsChangedEventArgs :
ICandidateWindowBoundsChangedEventArgs
public sealed class CandidateWindowBoundsChangedEventArgs :
ICandidateWindowBoundsChangedEventArgs

I nheritance H ierarchy
None

Remarks
For more info, see TextBox.CandidateWindowBoundsChanged and RichEditBox.CandidateWindowBoundsChanged.

Properties
Bounds
Bounds
Bounds

Gets the Rect that defines the size and location of the Input Method Editor (IME ) window, in the coordinate space
of the text edit control.
CandidateWindowBoundsChangedEventArgs.Bounds
CandidateWindowBoundsChangedEventArgs.Bounds
CandidateWindowBoundsChangedEventArgs.Bounds
I n this Article
Edit
Gets the Rect that defines the size and location of the Input Method Editor (IME ) window, in the coordinate space of the
text edit control.
public : Rect Bounds { get; }
Rect Bounds();
public Rect Bounds { get; }

Returns
Rect
The Rect that defines the size and location of the Input Method Editor (IME ) window

Remarks
This property gets a Rect that defines the size and location of the Input Method Editor (IME ), in the coordinate space of
the text control (upper left hand corner). This is (0,0,0,0) if there is no window, or if the Input Method Editor (IME ) is
aligned to the Soft Input Panel (SIP ).
Canvas Canvas Canvas Class
Defines an area within which you can explicitly position child objects, using coordinates that are relative to the Canvas
area.

D eclaration
public : class Canvas : Panel, ICanvas
struct winrt::Windows::UI::Xaml::Controls::Canvas : Panel, ICanvas
public class Canvas : Panel, ICanvas

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel

Remarks
 Tip

For more info, design guidance, and code examples, see Layout panels.
Canvas is a layout panel that supports absolute positioning of child elements relative to the top left corner of the
canvas.

A Canvas is one of the Panel elements that enable layout. Canvas uses absolute positioning as its layout technique for
its contained child elements. Each child element is rendered within the Canvas area. You control the positioning of
elements inside the Canvas by specifying x and y coordinates. These coordinates are in pixels. The x and y coordinates
are often specified by using the Canvas.Left and Canvas.Top attached properties. Canvas.Left specifies the object's
distance from the left side of the containing Canvas (the x-coordinate), and Canvas.Top specifies the object's distance
from the top of the containing Canvas (the y-coordinate).
Note

Because absolute positioning does not take into account the size of the app window, scaling, or other user-selected
sizing, using a container element that adapts to different orientations and screen settings, such as Grid or StackPanel, is
often a better choice than using Canvas. For more information, see Define layouts with XAML.
You can nest Canvas objects. When you nest objects, the coordinates used by each object are relative to its immediate
containing Canvas.
Each child object of a Canvas must be a UIElement. In XAML, you declare child objects as content of a Canvas object
element. In code, you can manipulate the collection of Canvas child objects by getting the collection that is accessed by
the Children property.
In many cases, a Canvas is used solely as a container for other objects and does not have any visible properties. A
Canvas and its children (if any) are not visible if any of these conditions are true:
The Visibility property is set to Collapsed.
The Opacity property of the Canvas is 0.
The children of a Canvas (if any) are still visible even if the Canvas has any of these conditions:
The Background property of the Canvas is null.
The Height or Width property of the Canvas is 0.
A Canvas with no children and with a default Height and Width of Auto doesn't have dimensions. This is also the case
if the Canvas has children but all the children have Visibility of Collapsed, or zero Height or Width.
Canvas X A ML attached properties
Canvas is the host service class for several XAML attached properties. The purpose of these attached properties is to
enable child elements in layout to report how they should be positioned in a Canvas parent.
These XAML attached properties are supported by Canvas:
Canvas.Left
Canvas.Top
Canvas.ZIndex In order to support XAML processor access to the attached properties, and also to expose equivalent
get and set operations to code, each XAML attached property has a pair of Get and Set accessor methods. For
example, the GetLeft and SetLeft methods support and provide the equivalent code-only support for Canvas.Left.
Alternatively, you can use the dependency property system to get or set the value of the attached property. Call
GetValue or SetValue, passing the arguments of the dependency property identifier to set, and a reference to the target
object on which to get or set the value.
For example, to change the position of the child element using C#, first define the object inside a Canvas, making sure
to include the Canvas.Left and Canvas.Top properties.
<Canvas >
<Grid x:Name="mySquare" Width="64" Height="64" Background="Red" Canvas.Left="0" Canvas.Top = "0">
</Grid>
</Canvas>

In the code-behind page, you can then access the position of the element, like this:

mySquare.SetValue(Canvas.LeftProperty,100);
mySquare.SetValue(Canvas.TopProperty, 100);

Constructors
Canvas()
Canvas()
Canvas()

Initializes a new instance of the Canvas class.

Properties
LeftProperty
LeftProperty
LeftProperty
Identifies the Canvas.Left XAML attached property.

TopProperty
TopProperty
TopProperty

Identifies the Canvas.Top XAML attached property.

ZIndexProperty
ZIndexProperty
ZIndexProperty

Identifies the Canvas.ZIndex XAML attached property.

Methods
GetLeft(UIElement)
GetLeft(UIElement)
GetLeft(UIElement)

Gets the value of the Canvas.Left XAML attached property for the target element.

GetTop(UIElement)
GetTop(UIElement)
GetTop(UIElement)

Gets the value of the Canvas.Top XAML attached property for the target element.

GetZIndex(UIElement)
GetZIndex(UIElement)
GetZIndex(UIElement)

Gets the value of the Canvas.ZIndex XAML attached property for the target element.

SetLeft(UIElement, Double)
SetLeft(UIElement, Double)
SetLeft(UIElement, Double)

Sets the value of the Canvas.Left XAML attached property for a target element.

SetTop(UIElement, Double)
SetTop(UIElement, Double)
SetTop(UIElement, Double)

Sets the value of the Canvas.Top XAML attached property for a target element.
SetZIndex(UIElement, Int32)
SetZIndex(UIElement, Int32)
SetZIndex(UIElement, Int32)

Sets the value of the Canvas.ZIndex XAML attached property for a target element.

See Also
Panel
Panel
Panel
Panel
Panel
Panel
Canvas Canvas Canvas
I n this Article
Edit
Initializes a new instance of the Canvas class.

public : Canvas()
Canvas() const;
public Canvas()
Canvas.GetLeft Canvas.GetLeft Canvas.GetLeft
I n this Article
Edit
Gets the value of the Canvas.Left XAML attached property for the target element.

public : static double GetLeft(UIElement element)


static double GetLeft(UIElement element) const;
public static double GetLeft(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
double
The Canvas.Left XAML attached property value of the specified object.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Canvas.Left XAML attached property in XAML and won't need this method. For more info, see the Canvas.Left
attached property.
See Canvas.Left
Also
Canvas.GetTop Canvas.GetTop Canvas.GetTop
I n this Article
Edit
Gets the value of the Canvas.Top XAML attached property for the target element.

public : static double GetTop(UIElement element)


static double GetTop(UIElement element) const;
public static double GetTop(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
double
The Canvas.Top XAML attached property value of the specified object.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Canvas.Top XAML attached property in XAML and won't need this method. For more info, see the Canvas.Top
attached property.
See Canvas.Top
Also
Canvas.GetZIndex Canvas.GetZIndex Canvas.GetZIndex
I n this Article
Edit
Gets the value of the Canvas.ZIndex XAML attached property for the target element.

public : static int GetZIndex(UIElement element)


static int32_t GetZIndex(UIElement element) const;
public static int GetZIndex(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
int
The Canvas.ZIndex XAML attached property value of the requested object.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Canvas.ZIndex XAML attached property in XAML and won't need this method. For more info, see the Canvas.ZIndex
attached property.
See Canvas.ZIndex
Also
Canvas.LeftProperty Canvas.LeftProperty Canvas.Left
Property
I n this Article
Edit
Identifies the Canvas.Left XAML attached property.
public : static DependencyProperty LeftProperty { get; }
static DependencyProperty LeftProperty();
public static DependencyProperty LeftProperty { get; }

Returns
DependencyProperty
The identifier for the Canvas.Left XAML attached property.
Attributes IndependentlyAnimatableAttribute

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the Canvas.Left XAML attached property in XAML and won't need this identifier.
Canvas.SetLeft Canvas.SetLeft Canvas.SetLeft
I n this Article
Edit
Sets the value of the Canvas.Left XAML attached property for a target element.

public : static void SetLeft(UIElement element, double length)


static void SetLeft(UIElement element, double length) const;
public static void SetLeft(UIElement element, Double length)

Parameters
element UIElement
The object to which the property value is written.
length Double
The value to set.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Canvas.Left XAML attached property in XAML and won't need this method. For more info, see the Canvas.Left
attached property.
See Canvas.Left
Also
Canvas.SetTop Canvas.SetTop Canvas.SetTop
I n this Article
Edit
Sets the value of the Canvas.Top XAML attached property for a target element.

public : static void SetTop(UIElement element, double length)


static void SetTop(UIElement element, double length) const;
public static void SetTop(UIElement element, Double length)

Parameters
element UIElement
The object to which the property value is written.
length Double
The value to set.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Canvas.Top XAML attached property in XAML and won't need this method. For more info, see the Canvas.Top
attached property.
See Canvas.Top
Also
Canvas.SetZIndex Canvas.SetZIndex Canvas.SetZIndex
I n this Article
Edit
Sets the value of the Canvas.ZIndex XAML attached property for a target element.

public : static void SetZIndex(UIElement element, int value)


static void SetZIndex(UIElement element, int32_t value) const;
public static void SetZIndex(UIElement element, Int32 value)

Parameters
element UIElement
The object to which the property value is written.
value Int32
The value to set.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Canvas.ZIndex XAML attached property in XAML and won't need this method. For more info, see the Canvas.ZIndex
attached property.
See Canvas.ZIndex
Also
Canvas.TopProperty Canvas.TopProperty Canvas.Top
Property
I n this Article
Edit
Identifies the Canvas.Top XAML attached property.
public : static DependencyProperty TopProperty { get; }
static DependencyProperty TopProperty();
public static DependencyProperty TopProperty { get; }

Returns
DependencyProperty
The identifier for the Canvas.Top XAML attached property.
Attributes IndependentlyAnimatableAttribute

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the Canvas.Top XAML attached property in XAML and won't need this identifier.
Canvas.ZIndexProperty Canvas.ZIndexProperty Canvas.
ZIndexProperty
I n this Article
Edit
Identifies the Canvas.ZIndex XAML attached property.
public : static DependencyProperty ZIndexProperty { get; }
static DependencyProperty ZIndexProperty();
public static DependencyProperty ZIndexProperty { get; }

Returns
DependencyProperty
The identifier for the Canvas.ZIndex XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the Canvas.ZIndex XAML attached property in XAML and won't need this identifier.
The maximum allowed value is 1000000 (one million).
CaptureElement CaptureElement CaptureElement Class
Renders a stream from a capture device, such as a camera or webcam. CaptureElement is used in conjunction with the
Windows.Media.Capture.MediaCapture API, and must be hooked up in the code behind.

D eclaration
public : sealed class CaptureElement : FrameworkElement, ICaptureElement
struct winrt::Windows::UI::Xaml::Controls::CaptureElement : FrameworkElement, ICaptureElement
public sealed class CaptureElement : FrameworkElement, ICaptureElement

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
CaptureElement is used in conjunction with the Windows.Media.Capture.MediaCapture API. Make sure your project
has specified device capabilities for Webcam and Microphone to use this API. For more info on how to use
CaptureElement, see Capture photos and video with MediaCapture.
Use the MediaCapture object to control the stream and set options on the capture device. The CaptureElement is the
UI portion of the stream that is associated with the MediaCapture.
You can use at most one CaptureElement to render a stream from a single capture device.
Note

If your app manually sets the size of the CaptureElement control, you must make sure that the dimensions of the
control do not exceed the device's native display resolution.

Constructors
CaptureElement()
CaptureElement()
CaptureElement()

Initializes a new instance of the CaptureElement class.

Properties
Source
Source
Source

Gets or sets the source MediaCapture that this CaptureElement represents.

SourceProperty
SourceProperty
SourceProperty
Identifies the Source dependency property.

Stretch
Stretch
Stretch

Gets or sets how content from Source is resized to fill its allocated space, as declared by the Height and Width
properties of the CaptureElement.

StretchProperty
StretchProperty
StretchProperty

Identifies the Stretch dependency property.

See Also
FrameworkElement
MediaCapture
FrameworkElement
FrameworkElement
FrameworkElement
FrameworkElement
CaptureElement CaptureElement CaptureElement
I n this Article
Edit
Initializes a new instance of the CaptureElement class.

public : CaptureElement()
CaptureElement() const;
public CaptureElement()
CaptureElement.Source CaptureElement.Source Capture
Element.Source
I n this Article
Edit
Gets or sets the source MediaCapture that this CaptureElement represents.
public : MediaCapture Source { get; set; }
MediaCapture Source();

void Source(MediaCapture source);


public MediaCapture Source { get; set; }

Returns
MediaCapture
The source MediaCapture

Remarks
This property should not be set in XAML, because XAML represents initial state, and there is no good way to reference
a MediaCapture through XAML resources. Initializing a MediaCapture is typically done by async operations or only
when a capture is about to begin.
Im p o rt a nt

You should always set the Source property to null when you are shutting down media capture in your app. For more
information on properly cleaning up media capture resources, see Capture photos and video with MediaCapture.
CaptureElement.SourceProperty CaptureElement.Source
Property CaptureElement.SourceProperty
I n this Article
Edit
Identifies the Source dependency property.
public : static DependencyProperty SourceProperty { get; }
static DependencyProperty SourceProperty();
public static DependencyProperty SourceProperty { get; }

Returns
DependencyProperty
The identifier for the Source dependency property.
CaptureElement.Stretch CaptureElement.Stretch Capture
Element.Stretch
I n this Article
Edit
Gets or sets how content from Source is resized to fill its allocated space, as declared by the Height and Width
properties of the CaptureElement.
public : Stretch Stretch { get; set; }
Stretch Stretch();

void Stretch(Stretch stretch);


public Stretch Stretch { get; set; }

<CaptureElement Stretch="stretchMemberName" />

Returns
Stretch
A value of the enumeration.
CaptureElement.StretchProperty CaptureElement.Stretch
Property CaptureElement.StretchProperty
I n this Article
Edit
Identifies the Stretch dependency property.
public : static DependencyProperty StretchProperty { get; }
static DependencyProperty StretchProperty();
public static DependencyProperty StretchProperty { get; }

Returns
DependencyProperty
The identifier for the Stretch dependency property.
CharacterCasing CharacterCasing CharacterCasing
Enum
Defines constants that specify how a control modifies the case of characters as they are typed.

D eclaration
public : enum class CharacterCasing
enum class winrt::Windows::UI::Xaml::Controls::CharacterCasing : int32_t
public enum CharacterCasing

I nheritance H ierarchy
None

Fields
Lower Lower Lower Characters are changed to lowercase.

Normal Normal Normal The case of characters is left unchanged.

Upper Upper Upper Characters are changed to uppercase.


CheckBox CheckBox CheckBox Class
Represents a control that a user can select (check) or clear (uncheck). A CheckBox can also report its value as
indeterminate.

D eclaration
public : class CheckBox : ToggleButton, ICheckBox
struct winrt::Windows::UI::Xaml::Controls::CheckBox : ToggleButton, ICheckBox
public class CheckBox : ToggleButton, ICheckBox

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton

Remarks
 Tip

For more info, design guidance, and code examples, see Check boxes.
CheckBox is a control that a user can select or clear.

Use the CheckBox control to provide a list of options that a user can select, such as a list of settings to apply to an
application. Both CheckBox and RadioButton controls allow the user to select from a list of options. CheckBox controls
allow the user to select a combination of options. In contrast, RadioButton controls allow the user to select from
mutually exclusive options.
The CheckBox control inherits from ToggleButton and can have three states:

S TATE PR O PER T Y V ALU E

checked @Windows.UI.Xaml.Controls.Primitives.T **true**


oggleButton.IsChecked?text= IsChecked

unchecked @Windows.UI.Xaml.Controls.Primitives.T **false**


oggleButton.IsChecked?text= IsChecked

indeterminate @Windows.UI.Xaml.Controls.Primitives.T **null**


oggleButton.IsChecked?text= IsChecked

For the CheckBox to report the indeterminate state, you must set the IsThreeState property to true.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the CheckBox control.

R ES O U R CE K EY D ES CR IPTIO N

CheckBoxForegroundUnchecked Label text color at rest and unchecked

CheckBoxForegroundUncheckedPointerOver Label text color on hover and unchecked

CheckBoxForegroundUncheckedPressed Label text color when pressed and unchecked

CheckBoxForegroundUncheckedDisabled Label text color when disabled and unchecked

CheckBoxForegroundChecked Label text color at rest and checked

CheckBoxForegroundCheckedPointerOver Label text color on hover and checked

CheckBoxForegroundCheckedPressed Label text color when pressed and checked

CheckBoxForegroundCheckedDisabled Label text color when disabled and checked

CheckBoxForegroundIndeterminate Label text color at rest and indeterminate

CheckBoxForegroundIndeterminatePointerOver Label text color on hover and indeterminate

CheckBoxForegroundIndeterminatePressed Label text color when pressed and indeterminate

CheckBoxForegroundIndeterminateDisabled Label text color when disabled and indeterminate

CheckBoxBackgroundUnchecked Background color of entire control at rest and unchecked

CheckBoxBackgroundUncheckedPointerOver Background color of entire control on hover and unchecked

CheckBoxBackgroundUncheckedPressed Background color of entire control when pressed and


unchecked

CheckBoxBackgroundUncheckedDisabled Background color of entire control when disabled and


unchecked

CheckBoxBackgroundChecked Background color of entire control at rest and checked

CheckBoxBackgroundCheckedPointerOver Background color of entire control on hover and checked


CheckBoxBackgroundCheckedPressed Background color of entire control when pressed and checked

CheckBoxBackgroundCheckedDisabled Background color of entire control when disabled and checked

CheckBoxBackgroundIndeterminate Background color of entire control at rest and indeterminate

CheckBoxBackgroundIndeterminatePointerOver Background color of entire control on hover and


indeterminate

CheckBoxBackgroundIndeterminatePressed Background color of entire control when pressed and


indeterminate

CheckBoxBackgroundIndeterminateDisabled Background color of entire control when disabled and


indeterminate

CheckBoxBorderBrushUnchecked Border color of entire control at rest and unchecked

CheckBoxBorderBrushUncheckedPointerOver Border color of entire control on hover and unchecked

CheckBoxBorderBrushUncheckedPressed Border color of entire control when pressed and unchecked

CheckBoxBorderBrushUncheckedDisabled Border color of entire control when disabled and unchecked

CheckBoxBorderBrushChecked Border color of entire control at rest and checked

CheckBoxBorderBrushCheckedPointerOver Border color of entire control on hover and checked

CheckBoxBorderBrushCheckedPressed Border color of entire control when pressed and checked

CheckBoxBorderBrushCheckedDisabled Border color of entire control when disabled and checked

CheckBoxBorderBrushIndeterminate Border color of entire control at rest and indeterminate

CheckBoxBorderBrushIndeterminatePointerOver Border color of entire control on hover and indeterminate

CheckBoxBorderBrushIndeterminatePressed Border color of entire control when pressed and indeterminate

CheckBoxBorderBrushIndeterminateDisabled Border color of entire control when disabled and


indeterminate

CheckBoxCheckBackgroundStrokeUnchecked Border color of checkmark box at rest and unchecked

CheckBoxCheckBackgroundStrokeUncheckedPointerOver Border color of checkmark box on hover and unchecked

CheckBoxCheckBackgroundStrokeUncheckedPressed Border color of checkmark box when pressed and unchecked

CheckBoxCheckBackgroundStrokeUncheckedDisabled Border color of checkmark box when disabled and unchecked

CheckBoxCheckBackgroundStrokeChecked Border color of checkmark box at rest and checked

CheckBoxCheckBackgroundStrokeCheckedPointerOver Border color of checkmark box on hover and checked

CheckBoxCheckBackgroundStrokeCheckedPressed Border color of checkmark box when pressed and checked


CheckBoxCheckBackgroundStrokeCheckedDisabled Border color of checkmark box when disabled and checked

CheckBoxCheckBackgroundStrokeIndeterminate Border color of checkmark box at rest and indeterminate

CheckBoxCheckBackgroundStrokeIndeterminatePointerOver Border color of checkmark box on hover and indeterminate

CheckBoxCheckBackgroundStrokeIndeterminatePressed Border color of checkmark box when pressed and


indeterminate

CheckBoxCheckBackgroundStrokeIndeterminateDisabled Border color of checkmark box when disabled and


indeterminate

CheckBoxCheckBackgroundFillUnchecked Background color of checkmark box at rest and unchecked

CheckBoxCheckBackgroundFillUncheckedPointerOver Background color of checkmark box on hover and unchecked

CheckBoxCheckBackgroundFillUncheckedPressed Background color of checkmark box when pressed and


unchecked

CheckBoxCheckBackgroundFillUncheckedDisabled Background color of checkmark box when disabled and


unchecked

CheckBoxCheckBackgroundFillChecked Background color of checkmark box at rest and checked

CheckBoxCheckBackgroundFillCheckedPointerOver Background color of checkmark box on hover and checked

CheckBoxCheckBackgroundFillCheckedPressed Background color of checkmark box when pressed and


checked

CheckBoxCheckBackgroundFillCheckedDisabled Background color of checkmark box when disabled and


checked

CheckBoxCheckBackgroundFillIndeterminate Background color of checkmark box at rest and indeterminate

CheckBoxCheckBackgroundFillIndeterminatePointerOver Background color of checkmark box on hover and


indeterminate

CheckBoxCheckBackgroundFillIndeterminatePressed Background color of checkmark box when pressed and


indeterminate

CheckBoxCheckBackgroundFillIndeterminateDisabled Background color of checkmark box when disabled and


indeterminate

CheckBoxCheckGlyphForegroundUnchecked Check mark color at rest and unchecked

CheckBoxCheckGlyphForegroundUncheckedPointerOver Check mark color on hover and unchecked

CheckBoxCheckGlyphForegroundUncheckedPressed Check mark color when pressed and unchecked

CheckBoxCheckGlyphForegroundUncheckedDisabled Check mark color when disabled and unchecked

CheckBoxCheckGlyphForegroundChecked Check mark color at rest and checked

CheckBoxCheckGlyphForegroundCheckedPointerOver Check mark color on hover and checked


CheckBoxCheckGlyphForegroundCheckedPressed Check mark color when pressed and checked

CheckBoxCheckGlyphForegroundCheckedDisabled Check mark color when disabled and checked

CheckBoxCheckGlyphForegroundIndeterminate Check mark color at rest and indeterminate

CheckBoxCheckGlyphForegroundIndeterminatePointerOver Check mark color on hover and indeterminate

CheckBoxCheckGlyphForegroundIndeterminatePressed Check mark color when pressed and indeterminate

CheckBoxCheckGlyphForegroundIndeterminateDisabled Check mark color when disabled and indeterminate

Constructors
CheckBox()
CheckBox()
CheckBox()

Initializes a new instance of the CheckBox class.

See Also
ToggleButton
CheckBox CheckBox CheckBox
I n this Article
Edit
Initializes a new instance of the CheckBox class.

public : CheckBox()
CheckBox() const;
public CheckBox()
ChoosingGroupHeaderContainerEventArgs Choosing
GroupHeaderContainerEventArgs ChoosingGroup
HeaderContainerEventArgs Class
Provides event data for the ListViewBase.ChoosingGroupHeaderContainer event.

D eclaration
public : sealed class ChoosingGroupHeaderContainerEventArgs :
IChoosingGroupHeaderContainerEventArgs
struct winrt::Windows::UI::Xaml::Controls::ChoosingGroupHeaderContainerEventArgs :
IChoosingGroupHeaderContainerEventArgs
public sealed class ChoosingGroupHeaderContainerEventArgs :
IChoosingGroupHeaderContainerEventArgs

I nheritance H ierarchy
None

Constructors
ChoosingGroupHeaderContainerEventArgs()
ChoosingGroupHeaderContainerEventArgs()
ChoosingGroupHeaderContainerEventArgs()

Initializes a new instance of the ChoosingGroupHeaderContainerEventArgs class.

Properties
Group
Group
Group

Gets the data group associated with this GroupHeaderContainer.

GroupHeaderContainer
GroupHeaderContainer
GroupHeaderContainer

Gets or sets the UI container that will be used to display the current data group.

GroupIndex
GroupIndex
GroupIndex

Gets the index in the ItemsSource of the data group for which a container is being selected.
ChoosingGroupHeaderContainerEventArgs Choosing
GroupHeaderContainerEventArgs ChoosingGroup
HeaderContainerEventArgs
I n this Article
Edit
Initializes a new instance of the ChoosingGroupHeaderContainerEventArgs class.
public : ChoosingGroupHeaderContainerEventArgs()
ChoosingGroupHeaderContainerEventArgs() const;
public ChoosingGroupHeaderContainerEventArgs()
ChoosingGroupHeaderContainerEventArgs.Group
ChoosingGroupHeaderContainerEventArgs.Group
ChoosingGroupHeaderContainerEventArgs.Group
I n this Article
Edit
Gets the data group associated with this GroupHeaderContainer.
public : Platform::Object Group { get; }
winrt::Windows::Foundation::IInspectable Group();
public object Group { get; }

Returns
object
The data group associated with this GroupHeaderContainer.
ChoosingGroupHeaderContainerEventArgs.GroupHeader
Container ChoosingGroupHeaderContainerEventArgs.
GroupHeaderContainer ChoosingGroupHeaderContainer
EventArgs.GroupHeaderContainer
I n this Article
Edit
Gets or sets the UI container that will be used to display the current data group.
public : ListViewBaseHeaderItem GroupHeaderContainer { get; set; }
ListViewBaseHeaderItem GroupHeaderContainer();

void GroupHeaderContainer(ListViewBaseHeaderItem groupheadercontainer);


public ListViewBaseHeaderItem GroupHeaderContainer { get; set; }

Returns
ListViewBaseHeaderItem
The UI container that will be used to display the current data group.
ChoosingGroupHeaderContainerEventArgs.GroupIndex
ChoosingGroupHeaderContainerEventArgs.GroupIndex
ChoosingGroupHeaderContainerEventArgs.GroupIndex
I n this Article
Edit
Gets the index in the ItemsSource of the data group for which a container is being selected.
public : int GroupIndex { get; }
int32_t GroupIndex();
public int GroupIndex { get; }

Returns
int
The index in the ItemsSource of the data group for which a container is being selected.
ChoosingItemContainerEventArgs ChoosingItem
ContainerEventArgs ChoosingItemContainerEventArgs
Class
Provides event data for the ListViewBase.ChoosingItemContainer event.

D eclaration
public : sealed class ChoosingItemContainerEventArgs : IChoosingItemContainerEventArgs
struct winrt::Windows::UI::Xaml::Controls::ChoosingItemContainerEventArgs :
IChoosingItemContainerEventArgs
public sealed class ChoosingItemContainerEventArgs : IChoosingItemContainerEventArgs

I nheritance H ierarchy
None

Constructors
ChoosingItemContainerEventArgs()
ChoosingItemContainerEventArgs()
ChoosingItemContainerEventArgs()

Initializes a new instance of the ChoosingItemContainerEventArgs class.

Properties
IsContainerPrepared
IsContainerPrepared
IsContainerPrepared

Gets or sets a value that indicates whether the container is ready for use.

Item
Item
Item

Gets the data item associated with this ItemContainer.

ItemContainer
ItemContainer
ItemContainer

Gets or sets the UI container that will be used to display the current data item.

ItemIndex
ItemIndex
ItemIndex

Gets the index in the ItemsSource of the data item for which a container is being selected.
ChoosingItemContainerEventArgs ChoosingItem
ContainerEventArgs ChoosingItemContainerEventArgs
I n this Article
Edit
Initializes a new instance of the ChoosingItemContainerEventArgs class.
public : ChoosingItemContainerEventArgs()
ChoosingItemContainerEventArgs() const;
public ChoosingItemContainerEventArgs()
ChoosingItemContainerEventArgs.IsContainerPrepared
ChoosingItemContainerEventArgs.IsContainerPrepared
ChoosingItemContainerEventArgs.IsContainerPrepared
I n this Article
Edit
Gets or sets a value that indicates whether the container is ready for use.
public : Platform::Boolean IsContainerPrepared { get; set; }
bool IsContainerPrepared();

void IsContainerPrepared(bool iscontainerprepared);


public bool IsContainerPrepared { get; set; }

Returns
bool
true if the container is ready for use; otherwise, false.
ChoosingItemContainerEventArgs.Item ChoosingItem
ContainerEventArgs.Item ChoosingItemContainerEvent
Args.Item
I n this Article
Edit
Gets the data item associated with this ItemContainer.
public : Platform::Object Item { get; }
winrt::Windows::Foundation::IInspectable Item();
public object Item { get; }

Returns
object
The data item associated with this ItemContainer.
ChoosingItemContainerEventArgs.ItemContainer
ChoosingItemContainerEventArgs.ItemContainer
ChoosingItemContainerEventArgs.ItemContainer
I n this Article
Edit
Gets or sets the UI container that will be used to display the current data item.
public : SelectorItem ItemContainer { get; set; }
SelectorItem ItemContainer();

void ItemContainer(SelectorItem itemcontainer);


public SelectorItem ItemContainer { get; set; }

Returns
SelectorItem
The UI container that will be used to display the current data item.
ChoosingItemContainerEventArgs.ItemIndex Choosing
ItemContainerEventArgs.ItemIndex ChoosingItem
ContainerEventArgs.ItemIndex
I n this Article
Edit
Gets the index in the ItemsSource of the data item for which a container is being selected.
public : int ItemIndex { get; }
int32_t ItemIndex();
public int ItemIndex { get; }

Returns
int
The index in the ItemsSource of the data item for which a container is being selected.
CleanUpVirtualizedItemEventArgs CleanUpVirtualized
ItemEventArgs CleanUpVirtualizedItemEventArgs Class
Provides data for the CleanUpVirtualizedItemEvent event.

D eclaration
public : sealed class CleanUpVirtualizedItemEventArgs : RoutedEventArgs,
ICleanUpVirtualizedItemEventArgs
struct winrt::Windows::UI::Xaml::Controls::CleanUpVirtualizedItemEventArgs : RoutedEventArgs,
ICleanUpVirtualizedItemEventArgs
public sealed class CleanUpVirtualizedItemEventArgs : RoutedEventArgs,
ICleanUpVirtualizedItemEventArgs

I nheritance H ierarchy
RoutedEventArgs

Properties
Cancel
Cancel
Cancel

Gets or sets a value that indicates whether this item should not be revirtualized.

UIElement
UIElement
UIElement

Gets an instance of the visual element that represents the data value.

Value
Value
Value

Gets an object that represents the original data value.

See Also
RoutedEventArgs
CleanUpVirtualizedItemEventArgs.Cancel CleanUp
VirtualizedItemEventArgs.Cancel CleanUpVirtualizedItem
EventArgs.Cancel
I n this Article
Edit
Gets or sets a value that indicates whether this item should not be revirtualized.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
true if you want to prevent revirtualization of this item; otherwise, false.
CleanUpVirtualizedItemEventArgs.UIElement CleanUp
VirtualizedItemEventArgs.UIElement CleanUpVirtualized
ItemEventArgs.UIElement
I n this Article
Edit
Gets an instance of the visual element that represents the data value.
public : UIElement UIElement { get; }
UIElement UIElement();
public UIElement UIElement { get; }

Returns
UIElement
The UIElement that represents the data value.
CleanUpVirtualizedItemEventArgs.Value CleanUp
VirtualizedItemEventArgs.Value CleanUpVirtualizedItem
EventArgs.Value
I n this Article
Edit
Gets an object that represents the original data value.
public : Platform::Object Value { get; }
winrt::Windows::Foundation::IInspectable Value();
public object Value { get; }

Returns
object
The Object that represents the original data value.
CleanUpVirtualizedItemEventHandler CleanUp
VirtualizedItemEventHandler CleanUpVirtualizedItem
EventHandler Delegate
Represents the method that handles the CleanUpVirtualizedItemEvent attached event.

D eclaration
public : delegate void CleanUpVirtualizedItemEventHandler(Platform::Object sender,
CleanUpVirtualizedItemEventArgs e)
struct CleanUpVirtualizedItemEventHandler : winrt::Windows::Foundation::IUnknown
{
CleanUpVirtualizedItemEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> CleanUpVirtualizedItemEventHandler(L lambda);
template <typename F> CleanUpVirtualizedItemEventHandler(F* function);
template <typename O, typename M> CleanUpVirtualizedItemEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::CleanUpVirtualizedItemEventArgs const& e) const;
};
public delegate void CleanUpVirtualizedItemEventHandler(Object sender,
CleanUpVirtualizedItemEventArgs e)

I nheritance H ierarchy
None
ClickMode ClickMode ClickMode Enum
Specifies when the Click event should be raised for a control.

D eclaration
public : enum class ClickMode
enum class winrt::Windows::UI::Xaml::Controls::ClickMode : int32_t
public enum ClickMode

I nheritance H ierarchy
None

Fields
Hover Specifies that the Click event should be raised when the mouse pointer moves over the control.
Hover
Hover

Press Specifies that the Click event should be raised when the mouse button is pressed and the mouse pointer is over the
Press control. If you are using the keyboard, specifies that the Click event should be raised when the SPACEBAR or ENTER
Press key is pressed and the control has keyboard focus.

Release Specifies that the Click event should be raised when the left mouse button is pressed and released, and the mouse
Release pointer is over the control. If you are using the keyboard, specifies that the Click event should be raised when the
Release SPACEBAR or ENTER key is pressed and released, and the control has keyboard focus.
ColorChangedEventArgs ColorChangedEventArgs Color
ChangedEventArgs Class
Provides event data for the ColorChanged event.

D eclaration
public : sealed class ColorChangedEventArgs : IColorChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::ColorChangedEventArgs : IColorChangedEventArgs
public sealed class ColorChangedEventArgs : IColorChangedEventArgs

I nheritance H ierarchy
None

Properties
NewColor
NewColor
NewColor

Gets the color that is currently selected in the control.

OldColor
OldColor
OldColor

Gets the color that was previously selected in the control.


ColorChangedEventArgs.NewColor ColorChangedEvent
Args.NewColor ColorChangedEventArgs.NewColor
I n this Article
Edit
Gets the color that is currently selected in the control.
public : Color NewColor { get; }
Color NewColor();
public Color NewColor { get; }

Returns
Color
The color that is currently selected in the control.
ColorChangedEventArgs.OldColor ColorChangedEvent
Args.OldColor ColorChangedEventArgs.OldColor
I n this Article
Edit
Gets the color that was previously selected in the control.
public : Color OldColor { get; }
Color OldColor();
public Color OldColor { get; }

Returns
Color
The color that was previously selected in the control.
ColorPicker ColorPicker ColorPicker Class
Represents a control that lets a user pick a color using a color spectrum, sliders, and text input.

D eclaration
public : class ColorPicker : Control, IColorPicker
struct winrt::Windows::UI::Xaml::Controls::ColorPicker : Control, IColorPicker
public class ColorPicker : Control, IColorPicker

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
A color picker is used to browse through and select colors. By default, it lets a user navigate through colors on a color
spectrum, or specify a color in either Red-Green-Blue (RGB ), Hue-Saturation-Value (HSV ), or Hexadecimal textboxes.
For more info about the ColorPicker control, see Color picker.

Constructors
ColorPicker()
ColorPicker()
ColorPicker()

Initializes a new instance of the ColorPicker class.

Properties
Color
Color
Color

Gets or sets the current color value.

ColorProperty
ColorProperty
ColorProperty

Identifies the Color dependency property.

ColorSpectrumComponents
ColorSpectrumComponents
ColorSpectrumComponents

Gets or sets a value that indicates how the Hue-Saturation-Value (HSV ) color components are mapped onto the
ColorSpectrum.

ColorSpectrumComponentsProperty
ColorSpectrumComponentsProperty
ColorSpectrumComponentsProperty

Identifies the ColorSpectrumComponents dependency property.

ColorSpectrumShape
ColorSpectrumShape
ColorSpectrumShape

Gets or sets a value that indicates whether the ColorSpectrum is shown as a square or a circle.

ColorSpectrumShapeProperty
ColorSpectrumShapeProperty
ColorSpectrumShapeProperty

Identifies the ColorSpectrumShape dependency property.

IsAlphaEnabled
IsAlphaEnabled
IsAlphaEnabled
Gets or sets a value that indicates whether the alpha channel can be modified.

IsAlphaEnabledProperty
IsAlphaEnabledProperty
IsAlphaEnabledProperty

Identifies the IsAlphaEnabled dependency property.

IsAlphaSliderVisible
IsAlphaSliderVisible
IsAlphaSliderVisible

Gets or sets a value that indicates whether the slider control for the alpha channel is shown.

IsAlphaSliderVisibleProperty
IsAlphaSliderVisibleProperty
IsAlphaSliderVisibleProperty

Identifies the IsAlphaSliderVisible dependency property.

IsAlphaTextInputVisible
IsAlphaTextInputVisible
IsAlphaTextInputVisible

Gets or sets a value that indicates whether the text input box for the alpha channel is shown.

IsAlphaTextInputVisibleProperty
IsAlphaTextInputVisibleProperty
IsAlphaTextInputVisibleProperty

Identifies the IsAlphaTextInputVisible dependency property.

IsColorChannelTextInputVisible
IsColorChannelTextInputVisible
IsColorChannelTextInputVisible

Gets or sets a value that indicates whether the text input boxes for the color channels are shown.

IsColorChannelTextInputVisibleProperty
IsColorChannelTextInputVisibleProperty
IsColorChannelTextInputVisibleProperty

Identifies the IsColorChannelTextInputVisible dependency property.


IsColorPreviewVisible
IsColorPreviewVisible
IsColorPreviewVisible

Gets or sets a value that indicates whether the color preview bar is shown.

IsColorPreviewVisibleProperty
IsColorPreviewVisibleProperty
IsColorPreviewVisibleProperty

Identifies the IsColorPreviewVisible dependency property.

IsColorSliderVisible
IsColorSliderVisible
IsColorSliderVisible

Gets or sets a value that indicates whether the slider control for the color value is shown.

IsColorSliderVisibleProperty
IsColorSliderVisibleProperty
IsColorSliderVisibleProperty

Identifies the IsColorSliderVisible dependency property.

IsColorSpectrumVisible
IsColorSpectrumVisible
IsColorSpectrumVisible

Gets or sets a value that indicates whether the color spectrum control is shown.

IsColorSpectrumVisibleProperty
IsColorSpectrumVisibleProperty
IsColorSpectrumVisibleProperty

Identifies the IsColorSpectrumVisible dependency property.

IsHexInputVisible
IsHexInputVisible
IsHexInputVisible

Gets or sets a value that indicates whether the text input box for a HEX color value is shown.

IsHexInputVisibleProperty
IsHexInputVisibleProperty
IsHexInputVisibleProperty
Identifies the IsHexInputVisible dependency property.

IsMoreButtonVisible
IsMoreButtonVisible
IsMoreButtonVisible

Gets or sets a value that indicates whether the 'more' button is shown.

IsMoreButtonVisibleProperty
IsMoreButtonVisibleProperty
IsMoreButtonVisibleProperty

Identifies the IsMoreButtonVisible dependency property.

MaxHue
MaxHue
MaxHue

Gets or sets the maximum Hue value in the range 0-359.

MaxHueProperty
MaxHueProperty
MaxHueProperty

Identifies the MaxHue dependency property.

MaxSaturation
MaxSaturation
MaxSaturation

Gets or sets the maximum Saturation value in the range 0-100.

MaxSaturationProperty
MaxSaturationProperty
MaxSaturationProperty

Identifies the MaxSaturation dependency property.

MaxValue
MaxValue
MaxValue

Gets or sets the maximum Value value in the range 0-100.


MaxValueProperty
MaxValueProperty
MaxValueProperty

Identifies the MaxValue dependency property.

MinHue
MinHue
MinHue

Gets or sets the minimum Hue value in the range 0-359.

MinHueProperty
MinHueProperty
MinHueProperty

Identifies the MinHue dependency property.

MinSaturation
MinSaturation
MinSaturation

Gets or sets the minimum Saturation value in the range 0-100.

MinSaturationProperty
MinSaturationProperty
MinSaturationProperty

Identifies the MinSaturation dependency property.

MinValue
MinValue
MinValue

Gets or sets the minimum Value value in the range 0-100.

MinValueProperty
MinValueProperty
MinValueProperty

Identifies the MinValue dependency property.

PreviousColor
PreviousColor
PreviousColor
Gets or sets the previous color.

PreviousColorProperty
PreviousColorProperty
PreviousColorProperty

Identifies the PreviousColor dependency property.

Events
ColorChanged
ColorChanged
ColorChanged

Occurs when the Color property has changed.

See Also
ColorPicker.Color ColorPicker.Color ColorPicker.Color
I n this Article
Edit
Gets or sets the current color value.

public : Color Color { get; set; }


Color Color();

void Color(Color color);


public Color Color { get; set; }

<ColorPicker Color="colorString" .../>

Returns
Color
The current color value.
ColorPicker.ColorChanged ColorPicker.ColorChanged
ColorPicker.ColorChanged
I n this Article
Edit
Occurs when the Color property has changed.
public : event TypedEventHandler<ColorPicker, ColorChangedEventArgs> ColorChanged
// Register
event_token ColorChanged(TypedEventHandler<ColorPicker, ColorChangedEventArgs> const& handler)
const;

// Revoke with event_token


void ColorChanged(event_token const& cookie) const;

// Revoke with event_revoker


ColorChanged_revoker ColorChanged(auto_revoke_t, TypedEventHandler<ColorPicker,
ColorChangedEventArgs> const& handler) const;
public event TypedEventHandler<ColorPicker, ColorChangedEventArgs> ColorChanged

<ColorPicker ColorChanged="eventhandler" .../>


ColorPicker ColorPicker ColorPicker
I n this Article
Edit
Initializes a new instance of the ColorPicker class.

public : ColorPicker()
ColorPicker() const;
public ColorPicker()
ColorPicker.ColorProperty ColorPicker.ColorProperty
ColorPicker.ColorProperty
I n this Article
Edit
Identifies the Color dependency property.
public : static DependencyProperty ColorProperty { get; }
static DependencyProperty ColorProperty();
public static DependencyProperty ColorProperty { get; }

Returns
DependencyProperty
The identifier for the Color dependency property.
ColorPicker.ColorSpectrumComponents ColorPicker.
ColorSpectrumComponents ColorPicker.ColorSpectrum
Components
I n this Article
Edit
Gets or sets a value that indicates how the Hue-Saturation-Value (HSV ) color components are mapped onto the
ColorSpectrum.
public : ColorSpectrumComponents ColorSpectrumComponents { get; set; }
ColorSpectrumComponents ColorSpectrumComponents();

void ColorSpectrumComponents(ColorSpectrumComponents colorspectrumcomponents);


public ColorSpectrumComponents ColorSpectrumComponents { get; set; }

<ColorPicker ColorSpectrumComponents="colorSpectrumComponentsName" .../>

Returns
ColorSpectrumComponents
A value of the enumeration. The default is HueSaturation.
ColorPicker.ColorSpectrumComponentsProperty Color
Picker.ColorSpectrumComponentsProperty ColorPicker.
ColorSpectrumComponentsProperty
I n this Article
Edit
Identifies the ColorSpectrumComponents dependency property.
public : static DependencyProperty ColorSpectrumComponentsProperty { get; }
static DependencyProperty ColorSpectrumComponentsProperty();
public static DependencyProperty ColorSpectrumComponentsProperty { get; }

Returns
DependencyProperty
The identifier for the ColorSpectrumComponents dependency property.
ColorPicker.ColorSpectrumShape ColorPicker.Color
SpectrumShape ColorPicker.ColorSpectrumShape
I n this Article
Edit
Gets or sets a value that indicates whether the ColorSpectrum is shown as a square or a circle.
public : ColorSpectrumShape ColorSpectrumShape { get; set; }
ColorSpectrumShape ColorSpectrumShape();

void ColorSpectrumShape(ColorSpectrumShape colorspectrumshape);


public ColorSpectrumShape ColorSpectrumShape { get; set; }

<ColorPicker ColorSpectrumShape="colorSpectrumShapeName" .../>

Returns
ColorSpectrumShape
A value of the enumeration. The default is Box, which shows the spectrum as a square.
ColorPicker.ColorSpectrumShapeProperty ColorPicker.
ColorSpectrumShapeProperty ColorPicker.Color
SpectrumShapeProperty
I n this Article
Edit
Identifies the ColorSpectrumShape dependency property.
public : static DependencyProperty ColorSpectrumShapeProperty { get; }
static DependencyProperty ColorSpectrumShapeProperty();
public static DependencyProperty ColorSpectrumShapeProperty { get; }

Returns
DependencyProperty
The identifier for the ColorSpectrumShape dependency property.
ColorPicker.IsAlphaEnabled ColorPicker.IsAlphaEnabled
ColorPicker.IsAlphaEnabled
I n this Article
Edit
Gets or sets a value that indicates whether the alpha channel can be modified.
public : Platform::Boolean IsAlphaEnabled { get; set; }
bool IsAlphaEnabled();

void IsAlphaEnabled(bool isalphaenabled);


public bool IsAlphaEnabled { get; set; }

<ColorPicker IsAlphaEnabled="bool" .../>

Returns
bool
true if the alpha channel is enabled; otherwise, false. The default is false.

Remarks
The IsAlphaSliderVisible and IsAlphaTextInputVisible properties are ignored if IsAlphaEnabled is false.
ColorPicker.IsAlphaEnabledProperty ColorPicker.IsAlpha
EnabledProperty ColorPicker.IsAlphaEnabledProperty
I n this Article
Edit
Identifies the IsAlphaEnabled dependency property.
public : static DependencyProperty IsAlphaEnabledProperty { get; }
static DependencyProperty IsAlphaEnabledProperty();
public static DependencyProperty IsAlphaEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsAlphaEnabled dependency property.
ColorPicker.IsAlphaSliderVisible ColorPicker.IsAlphaSlider
Visible ColorPicker.IsAlphaSliderVisible
I n this Article
Edit
Gets or sets a value that indicates whether the slider control for the alpha channel is shown.
public : Platform::Boolean IsAlphaSliderVisible { get; set; }
bool IsAlphaSliderVisible();

void IsAlphaSliderVisible(bool isalphaslidervisible);


public bool IsAlphaSliderVisible { get; set; }

<ColorPicker IsAlphaSliderVisible="bool" .../>

Returns
bool
true if the alpha channel slider is shown; otherwise, false. The default is true.

Remarks
The IsAlphaSliderVisible and IsAlphaTextInputVisible properties are ignored if IsAlphaEnabled is false.
ColorPicker.IsAlphaSliderVisibleProperty ColorPicker.Is
AlphaSliderVisibleProperty ColorPicker.IsAlphaSlider
VisibleProperty
I n this Article
Edit
Identifies the IsAlphaSliderVisible dependency property.
public : static DependencyProperty IsAlphaSliderVisibleProperty { get; }
static DependencyProperty IsAlphaSliderVisibleProperty();
public static DependencyProperty IsAlphaSliderVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsAlphaSliderVisible dependency property.
ColorPicker.IsAlphaTextInputVisible ColorPicker.IsAlpha
TextInputVisible ColorPicker.IsAlphaTextInputVisible
I n this Article
Edit
Gets or sets a value that indicates whether the text input box for the alpha channel is shown.
public : Platform::Boolean IsAlphaTextInputVisible { get; set; }
bool IsAlphaTextInputVisible();

void IsAlphaTextInputVisible(bool isalphatextinputvisible);


public bool IsAlphaTextInputVisible { get; set; }

<ColorPicker IsAlphaTextInputVisible="bool" .../>

Returns
bool
true if the alpha channel text input box is shown; otherwise, false. The default is true.

Remarks
The IsAlphaSliderVisible and IsAlphaTextInputVisible properties are ignored if IsAlphaEnabled is false.
ColorPicker.IsAlphaTextInputVisibleProperty ColorPicker.
IsAlphaTextInputVisibleProperty ColorPicker.IsAlphaText
InputVisibleProperty
I n this Article
Edit
Identifies the IsAlphaTextInputVisible dependency property.
public : static DependencyProperty IsAlphaTextInputVisibleProperty { get; }
static DependencyProperty IsAlphaTextInputVisibleProperty();
public static DependencyProperty IsAlphaTextInputVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsAlphaTextInputVisible dependency property.
ColorPicker.IsColorChannelTextInputVisible ColorPicker.Is
ColorChannelTextInputVisible ColorPicker.IsColorChannel
TextInputVisible
I n this Article
Edit
Gets or sets a value that indicates whether the text input boxes for the color channels are shown.
public : Platform::Boolean IsColorChannelTextInputVisible { get; set; }
bool IsColorChannelTextInputVisible();

void IsColorChannelTextInputVisible(bool iscolorchanneltextinputvisible);


public bool IsColorChannelTextInputVisible { get; set; }

<ColorPicker IsColorChannelTextInputVisible="bool" .../>

Returns
bool
true if the color channel text input boxes are shown; otherwise, false. The default is true.
ColorPicker.IsColorChannelTextInputVisibleProperty
ColorPicker.IsColorChannelTextInputVisibleProperty
ColorPicker.IsColorChannelTextInputVisibleProperty
I n this Article
Edit
Identifies the IsColorChannelTextInputVisible dependency property.
public : static DependencyProperty IsColorChannelTextInputVisibleProperty { get; }
static DependencyProperty IsColorChannelTextInputVisibleProperty();
public static DependencyProperty IsColorChannelTextInputVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsColorChannelTextInputVisible dependency property.
ColorPicker.IsColorPreviewVisible ColorPicker.IsColor
PreviewVisible ColorPicker.IsColorPreviewVisible
I n this Article
Edit
Gets or sets a value that indicates whether the color preview bar is shown.
public : Platform::Boolean IsColorPreviewVisible { get; set; }
bool IsColorPreviewVisible();

void IsColorPreviewVisible(bool iscolorpreviewvisible);


public bool IsColorPreviewVisible { get; set; }

<ColorPicker IsColorPreviewVisible="bool" .../>

Returns
bool
true if the color preview bar is shown; otherwise, false. The default is true.
ColorPicker.IsColorPreviewVisibleProperty ColorPicker.Is
ColorPreviewVisibleProperty ColorPicker.IsColorPreview
VisibleProperty
I n this Article
Edit
Identifies the IsColorPreviewVisible dependency property.
public : static DependencyProperty IsColorPreviewVisibleProperty { get; }
static DependencyProperty IsColorPreviewVisibleProperty();
public static DependencyProperty IsColorPreviewVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsColorPreviewVisible dependency property.
ColorPicker.IsColorSliderVisible ColorPicker.IsColorSlider
Visible ColorPicker.IsColorSliderVisible
I n this Article
Edit
Gets or sets a value that indicates whether the slider control for the color value is shown.
public : Platform::Boolean IsColorSliderVisible { get; set; }
bool IsColorSliderVisible();

void IsColorSliderVisible(bool iscolorslidervisible);


public bool IsColorSliderVisible { get; set; }

<ColorPicker IsColorSliderVisible="bool" .../>

Returns
bool
true if the color slider is shown; otherwise, false. The default is true.
ColorPicker.IsColorSliderVisibleProperty ColorPicker.Is
ColorSliderVisibleProperty ColorPicker.IsColorSlider
VisibleProperty
I n this Article
Edit
Identifies the IsColorSliderVisible dependency property.
public : static DependencyProperty IsColorSliderVisibleProperty { get; }
static DependencyProperty IsColorSliderVisibleProperty();
public static DependencyProperty IsColorSliderVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsColorSliderVisible dependency property.
ColorPicker.IsColorSpectrumVisible ColorPicker.IsColor
SpectrumVisible ColorPicker.IsColorSpectrumVisible
I n this Article
Edit
Gets or sets a value that indicates whether the color spectrum control is shown.
public : Platform::Boolean IsColorSpectrumVisible { get; set; }
bool IsColorSpectrumVisible();

void IsColorSpectrumVisible(bool iscolorspectrumvisible);


public bool IsColorSpectrumVisible { get; set; }

<ColorPicker IsColorSpectrumVisible="bool" .../>

Returns
bool
true if the color spectrum is shown; otherwise, false. The default is true.
ColorPicker.IsColorSpectrumVisibleProperty ColorPicker.
IsColorSpectrumVisibleProperty ColorPicker.IsColor
SpectrumVisibleProperty
I n this Article
Edit
Identifies the IsColorSpectrumVisible dependency property.
public : static DependencyProperty IsColorSpectrumVisibleProperty { get; }
static DependencyProperty IsColorSpectrumVisibleProperty();
public static DependencyProperty IsColorSpectrumVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsColorSpectrumVisible dependency property.
ColorPicker.IsHexInputVisible ColorPicker.IsHexInput
Visible ColorPicker.IsHexInputVisible
I n this Article
Edit
Gets or sets a value that indicates whether the text input box for a HEX color value is shown.
public : Platform::Boolean IsHexInputVisible { get; set; }
bool IsHexInputVisible();

void IsHexInputVisible(bool ishexinputvisible);


public bool IsHexInputVisible { get; set; }

<ColorPicker IsHexInputVisible="bool" .../>

Returns
bool
true if the HEX color text input box is shown; otherwise, false. The default is true.
ColorPicker.IsHexInputVisibleProperty ColorPicker.IsHex
InputVisibleProperty ColorPicker.IsHexInputVisible
Property
I n this Article
Edit
Identifies the IsHexInputVisible dependency property.
public : static DependencyProperty IsHexInputVisibleProperty { get; }
static DependencyProperty IsHexInputVisibleProperty();
public static DependencyProperty IsHexInputVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsHexInputVisible dependency property.
ColorPicker.IsMoreButtonVisible ColorPicker.IsMore
ButtonVisible ColorPicker.IsMoreButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the 'more' button is shown.
public : Platform::Boolean IsMoreButtonVisible { get; set; }
bool IsMoreButtonVisible();

void IsMoreButtonVisible(bool ismorebuttonvisible);


public bool IsMoreButtonVisible { get; set; }

<ColorPicker IsMoreButtonVisible="bool" .../>

Returns
bool
true if the 'more' button is shown; otherwise, false. The default is false.
ColorPicker.IsMoreButtonVisibleProperty ColorPicker.Is
MoreButtonVisibleProperty ColorPicker.IsMoreButton
VisibleProperty
I n this Article
Edit
Identifies the IsMoreButtonVisible dependency property.
public : static DependencyProperty IsMoreButtonVisibleProperty { get; }
static DependencyProperty IsMoreButtonVisibleProperty();
public static DependencyProperty IsMoreButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsMoreButtonVisible dependency property.
ColorPicker.MaxHue ColorPicker.MaxHue ColorPicker.
MaxHue
I n this Article
Edit
Gets or sets the maximum Hue value in the range 0-359.
public : int MaxHue { get; set; }
int32_t MaxHue();

void MaxHue(int32_t maxhue);


public int MaxHue { get; set; }

<ColorPicker MaxHue="int" .../>

Returns
int
The maximum Hue value in the range 0-359. The default is 359.

Remarks
The valid range for Hue values is 0-359. Setting a value outside of this range will cause an exception.
ColorPicker.MaxHueProperty ColorPicker.MaxHue
Property ColorPicker.MaxHueProperty
I n this Article
Edit
Identifies the MaxHue dependency property.
public : static DependencyProperty MaxHueProperty { get; }
static DependencyProperty MaxHueProperty();
public static DependencyProperty MaxHueProperty { get; }

Returns
DependencyProperty
The identifier for the MaxHue dependency property.
ColorPicker.MaxSaturation ColorPicker.MaxSaturation
ColorPicker.MaxSaturation
I n this Article
Edit
Gets or sets the maximum Saturation value in the range 0-100.
public : int MaxSaturation { get; set; }
int32_t MaxSaturation();

void MaxSaturation(int32_t maxsaturation);


public int MaxSaturation { get; set; }

<ColorPicker MaxSaturation="int" .../>

Returns
int
The maximum Saturation value in the range 0-100. The default is 100.

Remarks
The valid range for Saturation values is 0-100. Setting a value outside of this range will cause an exception.
ColorPicker.MaxSaturationProperty ColorPicker.Max
SaturationProperty ColorPicker.MaxSaturationProperty
I n this Article
Edit
Identifies the MaxSaturation dependency property.
public : static DependencyProperty MaxSaturationProperty { get; }
static DependencyProperty MaxSaturationProperty();
public static DependencyProperty MaxSaturationProperty { get; }

Returns
DependencyProperty
The identifier for the MaxSaturation dependency property.
ColorPicker.MaxValue ColorPicker.MaxValue ColorPicker.
MaxValue
I n this Article
Edit
Gets or sets the maximum Value value in the range 0-100.
public : int MaxValue { get; set; }
int32_t MaxValue();

void MaxValue(int32_t maxvalue);


public int MaxValue { get; set; }

<ColorPicker MaxValue="int" .../>

Returns
int
The maximum Value value in the range 0-100. The default is 100.

Remarks
The valid range for Value values is 0-100. Setting a value outside of this range will cause an exception.
ColorPicker.MaxValueProperty ColorPicker.MaxValue
Property ColorPicker.MaxValueProperty
I n this Article
Edit
Identifies the MaxValue dependency property.
public : static DependencyProperty MaxValueProperty { get; }
static DependencyProperty MaxValueProperty();
public static DependencyProperty MaxValueProperty { get; }

Returns
DependencyProperty
The identifier for the MaxValue dependency property.
ColorPicker.MinHue ColorPicker.MinHue ColorPicker.Min
Hue
I n this Article
Edit
Gets or sets the minimum Hue value in the range 0-359.
public : int MinHue { get; set; }
int32_t MinHue();

void MinHue(int32_t minhue);


public int MinHue { get; set; }

<ColorPicker MinHue="int" .../>

Returns
int
The minimum Hue value in the range 0-359. The default is 0.

Remarks
The valid range for Hue values is 0-359. Setting a value outside of this range will cause an exception.
ColorPicker.MinHueProperty ColorPicker.MinHue
Property ColorPicker.MinHueProperty
I n this Article
Edit
Identifies the MinHue dependency property.
public : static DependencyProperty MinHueProperty { get; }
static DependencyProperty MinHueProperty();
public static DependencyProperty MinHueProperty { get; }

Returns
DependencyProperty
The identifier for the MinHue dependency property.
ColorPicker.MinSaturation ColorPicker.MinSaturation
ColorPicker.MinSaturation
I n this Article
Edit
Gets or sets the minimum Saturation value in the range 0-100.
public : int MinSaturation { get; set; }
int32_t MinSaturation();

void MinSaturation(int32_t minsaturation);


public int MinSaturation { get; set; }

<ColorPicker MinSaturation="int" .../>

Returns
int
The minimum Saturation value in the range 0-100. The default is 100.

Remarks
The valid range for Saturation values is 0-100. Setting a value outside of this range will cause an exception.
ColorPicker.MinSaturationProperty ColorPicker.Min
SaturationProperty ColorPicker.MinSaturationProperty
I n this Article
Edit
Identifies the MinSaturation dependency property.
public : static DependencyProperty MinSaturationProperty { get; }
static DependencyProperty MinSaturationProperty();
public static DependencyProperty MinSaturationProperty { get; }

Returns
DependencyProperty
The identifier for the MinSaturation dependency property.
ColorPicker.MinValue ColorPicker.MinValue ColorPicker.
MinValue
I n this Article
Edit
Gets or sets the minimum Value value in the range 0-100.
public : int MinValue { get; set; }
int32_t MinValue();

void MinValue(int32_t minvalue);


public int MinValue { get; set; }

<ColorPicker MinValue="int" .../>

Returns
int
The minimum Value value in the range 0-100. The default is 100.

Remarks
The valid range for Value values is 0-100. Setting a value outside of this range will cause an exception.
ColorPicker.MinValueProperty ColorPicker.MinValue
Property ColorPicker.MinValueProperty
I n this Article
Edit
Identifies the MinValue dependency property.
public : static DependencyProperty MinValueProperty { get; }
static DependencyProperty MinValueProperty();
public static DependencyProperty MinValueProperty { get; }

Returns
DependencyProperty
The identifier for the MinValue dependency property.
ColorPicker.PreviousColor ColorPicker.PreviousColor
ColorPicker.PreviousColor
I n this Article
Edit
Gets or sets the previous color.
public : IReference<Color> PreviousColor { get; set; }
IReference<Color> PreviousColor();

void PreviousColor(IReference<Color> previouscolor);


public Nullable<Color> PreviousColor { get; set; }

<ColorPicker PreviousColor="colorString" .../>

Returns
Nullable<Color>
The previous color. The default is null.
ColorPicker.PreviousColorProperty ColorPicker.Previous
ColorProperty ColorPicker.PreviousColorProperty
I n this Article
Edit
Identifies the PreviousColor dependency property.
public : static DependencyProperty PreviousColorProperty { get; }
static DependencyProperty PreviousColorProperty();
public static DependencyProperty PreviousColorProperty { get; }

Returns
DependencyProperty
The identifier for the PreviousColor dependency property.
ColorPickerHsvChannel ColorPickerHsvChannel Color
PickerHsvChannel Enum
Defines contstants that specify which Hue-Saturation-Value-Alpha component a slider in a ColorPicker controls.

D eclaration
public : enum class ColorPickerHsvChannel
enum class winrt::Windows::UI::Xaml::Controls::ColorPickerHsvChannel : int32_t
public enum ColorPickerHsvChannel

I nheritance H ierarchy
None

Fields
Alpha Alpha Alpha The slider controls the Alpha channel.

Hue Hue Hue The slider controls the Hue channel.

Saturation Saturation Saturation The slider controls the Saturation channel.

Value Value Value The slider controls the Value channel.


ColorSpectrumComponents ColorSpectrumComponents
ColorSpectrumComponents Enum
Defines constants that specify how the Hue-Saturation-Value (HSV ) color components are mapped onto the
ColorSpectrum.

D eclaration
public : enum class ColorSpectrumComponents
enum class winrt::Windows::UI::Xaml::Controls::ColorSpectrumComponents : int32_t
public enum ColorSpectrumComponents

I nheritance H ierarchy
None

Remarks
The order of the two components in each value indicates the X/Y axis when the spectrum is a box, or the degree/radius
when the spectrum is a ring.

Fields
HueSaturation HueSaturation HueSaturation Hue is mapped to the X axis. Saturation is mapped to the Y axis.

HueValue HueValue HueValue Hue is mapped to the X axis. Value is mapped to the Y axis.

SaturationHue SaturationHue SaturationHue Saturation is mapped to the X axis. Hue is mapped to the Y axis.

SaturationValue SaturationValue Saturation is mapped to the X axis. Value is mapped to the Y


SaturationValue axis.

ValueHue ValueHue ValueHue Value is mapped to the X axis. Hue is mapped to the Y axis.

ValueSaturation ValueSaturation Value is mapped to the X axis. Saturation is mapped to the Y


ValueSaturation axis.
ColorSpectrumShape ColorSpectrumShape Color
SpectrumShape Enum
Defines constants that specify how the ColorSpectrum control is shown.

D eclaration
public : enum class ColorSpectrumShape
enum class winrt::Windows::UI::Xaml::Controls::ColorSpectrumShape : int32_t
public enum ColorSpectrumShape

I nheritance H ierarchy
None

Fields
Box Box Box The ColorSpectrum control is shown as a square.

Ring Ring Ring The ColorSpectrum control is shown as a circle.


ColumnDefinition ColumnDefinition ColumnDefinition
Class
Defines column-specific properties that apply to Grid objects.

D eclaration
public : sealed class ColumnDefinition : DependencyObject, IColumnDefinition
struct winrt::Windows::UI::Xaml::Controls::ColumnDefinition : DependencyObject,
IColumnDefinition
public sealed class ColumnDefinition : DependencyObject, IColumnDefinition

I nheritance H ierarchy
DependencyObject

Constructors
ColumnDefinition()
ColumnDefinition()
ColumnDefinition()

Initializes a new instance of the ColumnDefinition class.

Properties
ActualWidth
ActualWidth
ActualWidth

Gets a value that represents the actual calculated width of a ColumnDefinition.

MaxWidth
MaxWidth
MaxWidth

Gets or sets a value that represents the maximum width of a ColumnDefinition.

MaxWidthProperty
MaxWidthProperty
MaxWidthProperty

Identifies the MaxWidth dependency property.

MinWidth
MinWidth
MinWidth

Gets or sets a value that represents the minimum width of a ColumnDefinition.


MinWidthProperty
MinWidthProperty
MinWidthProperty

Identifies the MinWidth dependency property.

Width
Width
Width

Gets the calculated width of a ColumnDefinition element, or sets the GridLength value of a column that is defined
by the ColumnDefinition.

WidthProperty
WidthProperty
WidthProperty

Identifies the Width dependency property.

See Also
DependencyObject
ColumnDefinition.ActualWidth ColumnDefinition.Actual
Width ColumnDefinition.ActualWidth
I n this Article
Edit
Gets a value that represents the actual calculated width of a ColumnDefinition.
public : double ActualWidth { get; }
double ActualWidth();
public double ActualWidth { get; }

Returns
double
A Double that represents the actual calculated width in pixels. The default is 0.
ColumnDefinition ColumnDefinition ColumnDefinition
I n this Article
Edit
Initializes a new instance of the ColumnDefinition class.

public : ColumnDefinition()
ColumnDefinition() const;
public ColumnDefinition()
ColumnDefinition.MaxWidth ColumnDefinition.Max
Width ColumnDefinition.MaxWidth
I n this Article
Edit
Gets or sets a value that represents the maximum width of a ColumnDefinition.
public : double MaxWidth { get; set; }
double MaxWidth();

void MaxWidth(double maxwidth);


public double MaxWidth { get; set; }

<ColumnDefinition MaxWidth="double"/>

Returns
double
A Double that represents the maximum width in pixels. The default is PositiveInfinity.
ColumnDefinition.MaxWidthProperty ColumnDefinition.
MaxWidthProperty ColumnDefinition.MaxWidthProperty
I n this Article
Edit
Identifies the MaxWidth dependency property.
public : static DependencyProperty MaxWidthProperty { get; }
static DependencyProperty MaxWidthProperty();
public static DependencyProperty MaxWidthProperty { get; }

Returns
DependencyProperty
The identifier for the MaxWidth dependency property.
ColumnDefinition.MinWidth ColumnDefinition.MinWidth
ColumnDefinition.MinWidth
I n this Article
Edit
Gets or sets a value that represents the minimum width of a ColumnDefinition.
public : double MinWidth { get; set; }
double MinWidth();

void MinWidth(double minwidth);


public double MinWidth { get; set; }

<ColumnDefinition MinWidth="double"/>

Returns
double
A Double that represents the minimum width in pixels. The default is 0.
ColumnDefinition.MinWidthProperty ColumnDefinition.
MinWidthProperty ColumnDefinition.MinWidthProperty
I n this Article
Edit
Identifies the MinWidth dependency property.
public : static DependencyProperty MinWidthProperty { get; }
static DependencyProperty MinWidthProperty();
public static DependencyProperty MinWidthProperty { get; }

Returns
DependencyProperty
The identifier for the MinWidth dependency property.
ColumnDefinition.Width ColumnDefinition.Width
ColumnDefinition.Width
I n this Article
Edit
Gets the calculated width of a ColumnDefinition element, or sets the GridLength value of a column that is defined by
the ColumnDefinition.
public : GridLength Width { get; set; }
GridLength Width();

void Width(GridLength width);


public GridLength Width { get; set; }

<ColumnDefinition Width="doubleValue"/>
- or -
<ColumnDefinition Width="starSizing"/>
-or-
<ColumnDefinition Width="Auto"/>

Returns
GridLength
The GridLength that represents the width of the column. The default value is a GridLength representing a "1*" sizing.

Remarks
The default value of Width is a GridLength representing a "1*" sizing. This structure value has a Value data value of
1.0, and a GridUnitType data value of Star. With this default, each new ColumnDefinition you define for a Grid will
have "1*" sizing, and each will be allotted an equal number of pixels for width of its content in layout handling. It's not
uncommon to define ColumnDefinition as an object element in XAML without any attributes set and to just use this
default behavior. The same is true for RowDefinition.
The value you set for Width can be constrained if you also set a value for MinWidth or MaxWidth. Each of these
properties can take only pixel measurements, not Star sizing. If a ColumnDefinition uses Star or Auto sizing but also
has MinWidth or MaxWidth constraints, the MinWidth or MaxWidth must be honored by the Grid layout behavior,
even if that means giving or taking layout space from other Star sizing columns defined in the Grid that don't have
constraints.
It's more common to use Star sizing than absolute pixel values for a Grid definition in a UWP app using C++, C#, or
Visual Basic. Star sizing supports the dynamic layout concept, which helps your app look great on screens with
different sizes, pixel densities and orientations. For more info, see Define layouts with XAML.
See Grid.Column
Also Define layouts with XAML
ColumnDefinition.WidthProperty ColumnDefinition.
WidthProperty ColumnDefinition.WidthProperty
I n this Article
Edit
Identifies the Width dependency property.
public : static DependencyProperty WidthProperty { get; }
static DependencyProperty WidthProperty();
public static DependencyProperty WidthProperty { get; }

Returns
DependencyProperty
The identifier for the Width dependency property.
ColumnDefinitionCollection ColumnDefinitionCollection
ColumnDefinitionCollection Class
Provides access to an ordered, strongly typed collection of ColumnDefinition objects.

D eclaration
public : sealed class ColumnDefinitionCollection : IIterable<ColumnDefinition>,
IVector<ColumnDefinition>
struct winrt::Windows::UI::Xaml::Controls::ColumnDefinitionCollection :
IIterable<ColumnDefinition>, IVector<ColumnDefinition>
public sealed class ColumnDefinitionCollection : IEnumerable<ColumnDefinition>,
IList<ColumnDefinition>

I nheritance H ierarchy
None

Remarks
Enumerating the collection in C# or Microsoft V isual B asic
A ColumnDefinitionCollection is enumerable, so you can use language-specific syntax such as foreach in C# to
enumerate the items in the collection. The compiler does the type-casting for you and you won't need to cast to
IEnumerable<ColumnDefinition> explicitly. If you do need to cast explicitly, for example if you want to call
GetEnumerator, cast to IEnumerable with a ColumnDefinition constraint.

Properties
Item[Int32]
Item[Int32]
Item[Int32]

Gets or sets the element at the specified index.

Size
Size
Size

Gets the size (count) of the collection.

Methods
Append(ColumnDefinition)
Append(ColumnDefinition)
Append(ColumnDefinition)

Adds a new item to the collection.

Clear()
Clear()
Clear()

Removes all items from the collection.

First()
First()
First()

Returns the iterator for iteration over the items in the collection.

GetAt(UInt32)
GetAt(UInt32)
GetAt(UInt32)

Returns the ColumnDefinition located at the specified index.

GetEnumerator()
GetEnumerator()
GetEnumerator()

Returns an enumerator that iterates through the collection.

GetMany(UInt32, ColumnDefinition[])
GetMany(UInt32, ColumnDefinition[])
GetMany(UInt32, ColumnDefinition[])

Retrieves multiple elements in a single pass through the iterator.

GetView()
GetView()
GetView()

Gets an immutable view into the collection.

IndexOf(T)
IndexOf(T)
IndexOf(T)

Determines the index of a specific item in the System.Collections.Generic.IList`1.

IndexOf(ColumnDefinition, UInt32)
IndexOf(ColumnDefinition, UInt32)
IndexOf(ColumnDefinition, UInt32)

Retrieves the index of the specified item.


Insert(Int32, T)
Insert(Int32, T)
Insert(Int32, T)

Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

InsertAt(UInt32, ColumnDefinition)
InsertAt(UInt32, ColumnDefinition)
InsertAt(UInt32, ColumnDefinition)

Inserts the specified item at the specified index.

RemoveAt(Int32)
RemoveAt(Int32)
RemoveAt(Int32)

Removes the System.Collections.Generic.IList`1 item at the specified index.

RemoveAt(UInt32)
RemoveAt(UInt32)
RemoveAt(UInt32)

Removes the item at the specified index.

RemoveAtEnd()
RemoveAtEnd()
RemoveAtEnd()

Removes the last item in the collection.

ReplaceAll(ColumnDefinition[])
ReplaceAll(ColumnDefinition[])
ReplaceAll(ColumnDefinition[])

Initially clears the collection, then inserts the provided array as new items.

SetAt(UInt32, ColumnDefinition)
SetAt(UInt32, ColumnDefinition)
SetAt(UInt32, ColumnDefinition)

Sets the value at the specified index to the ColumnDefinition value specified.

See Also
ColumnDefinition
ColumnDefinition
ColumnDefinitionCollection.Append ColumnDefinition
Collection.Append ColumnDefinitionCollection.Append
I n this Article
Edit
Adds a new item to the collection.
public : void Append(ColumnDefinition value)
void Append(ColumnDefinition value) const;
// This member is not implemented in C#

Parameters
value ColumnDefinition
The new item to add.
ColumnDefinitionCollection.Clear ColumnDefinition
Collection.Clear ColumnDefinitionCollection.Clear
I n this Article
Edit
Removes all items from the collection.
public : void Clear()
void Clear() const;
// This member is not implemented in C#
ColumnDefinitionCollection.First ColumnDefinition
Collection.First ColumnDefinitionCollection.First
I n this Article
Edit
Returns the iterator for iteration over the items in the collection.
public : IIterator<ColumnDefinition> First()
IIterator<ColumnDefinition> First() const;
// This member is not implemented in C#

Returns
IIterator<ColumnDefinition>
The iterator object. The iterator's current position is at the 0-index position, or at the collection end if the collection is
empty.
ColumnDefinitionCollection.GetAt ColumnDefinition
Collection.GetAt ColumnDefinitionCollection.GetAt
I n this Article
Edit
Returns the ColumnDefinition located at the specified index.
public : ColumnDefinition GetAt(unsigned int index)
ColumnDefinition GetAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The integer index for the value to retrieve.
Returns
ColumnDefinition
The ColumnDefinition value at the specified index.
IEnumerable<T>.GetEnumerator IEnumerable<T>.Get
Enumerator
I n this Article
Edit
Returns an enumerator that iterates through the collection.
// This member is not implemented in C++/CX
IEnumerator<T> GetEnumerator()

Returns
An enumerator that can be used to iterate through the collection.
ColumnDefinitionCollection.GetMany ColumnDefinition
Collection.GetMany ColumnDefinitionCollection.Get
Many
I n this Article
Edit
Retrieves multiple elements in a single pass through the iterator.
public : unsigned int GetMany(unsigned int startIndex, ColumnDefinition[] items)
uint32_t GetMany(uint32_t startIndex, ColumnDefinition[] items) const;
// This member is not implemented in C#

Parameters
startIndex UInt32
The index from which to start retrieval.
items ColumnDefinition[]
Provides the destination for the result. Size the initial array size as a "capacity" in order to specify how many results
should be retrieved.
Returns
uint
The number of items retrieved.
ColumnDefinitionCollection.GetView ColumnDefinition
Collection.GetView ColumnDefinitionCollection.GetView
I n this Article
Edit
Gets an immutable view into the collection.
public : IVectorView<ColumnDefinition> GetView()
IVectorView<ColumnDefinition> GetView() const;
// This member is not implemented in C#

Returns
IReadOnlyList<ColumnDefinition>
An object representing the immutable collection view.
ColumnDefinitionCollection.IndexOf ColumnDefinition
Collection.IndexOf ColumnDefinitionCollection.IndexOf
I n this Article

Overloads
IndexOf(T) IndexOf(T)
Determines the index of a specific item in the
System.Collections.Generic.IList`1.

IndexOf(ColumnDefinition, UInt32) IndexOf(ColumnDefinition,


UInt32) IndexOf(ColumnDefinition, UInt32) Retrieves the index of the specified item.

IndexOf(T) IndexOf(T)
Edit
Determines the index of a specific item in the System.Collections.Generic.IList`1.
// This member is not implemented in C++/CX
int IndexOf(T item)

Parameters
item TTT
The object to locate in the System.Collections.Generic.IList`1.
Returns
The index of item if found in the list; otherwise, -1.

IndexOf(ColumnDefinition, UInt32) IndexOf(ColumnDefinition,


UInt32) IndexOf(ColumnDefinition, UInt32)
Edit
Retrieves the index of the specified item.
public : Platform::Boolean IndexOf(ColumnDefinition value, unsigned int index)
bool IndexOf(ColumnDefinition value, uint32_t const& index) const;
// This member is not implemented in C#

Parameters
value ColumnDefinition
The item to find in the collection.
index UInt32
The index of the item, if it is found.
Returns
bool
true if an item with the specified value was found; otherwise, false.
IList<T>.Insert IList<T>.Insert
I n this Article
Edit
Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

// This member is not implemented in C++/CX


void Insert(int index, T item)

Parameters
index
The zero-based index at which item should be inserted.
item TT
The object to insert into the System.Collections.Generic.IList`1.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.
ColumnDefinitionCollection.InsertAt ColumnDefinition
Collection.InsertAt ColumnDefinitionCollection.InsertAt
I n this Article
Edit
Inserts the specified item at the specified index.
public : void InsertAt(unsigned int index, ColumnDefinition value)
void InsertAt(uint32_t index, ColumnDefinition value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value ColumnDefinition
The value to set.
IList<T>.Item IList<T>.Item
I n this Article
Edit
Gets or sets the element at the specified index.

// This member is not implemented in C++/CX


T this[int index] { get; set; }

Parameters
index
The zero-based index of the element to get or set.
Returns
TT
The element at the specified index.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The property is set and the System.Collections.Generic.IList`1 is read-only.
ColumnDefinitionCollection.RemoveAt ColumnDefinition
Collection.RemoveAt ColumnDefinitionCollection.
RemoveAt
I n this Article

Overloads
RemoveAt(Int32) RemoveAt(Int32)
Removes the System.Collections.Generic.IList`1 item at the
specified index.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Removes the item at the specified index.

RemoveAt(Int32) RemoveAt(Int32)
Edit
Removes the System.Collections.Generic.IList`1 item at the specified index.
// This member is not implemented in C++/CX
void RemoveAt(int index)

Parameters
index
The zero-based index of the item to remove.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Edit
Removes the item at the specified index.
public : void RemoveAt(unsigned int index)
void RemoveAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The index position of the item to remove.
ColumnDefinitionCollection.RemoveAtEnd Column
DefinitionCollection.RemoveAtEnd ColumnDefinition
Collection.RemoveAtEnd
I n this Article
Edit
Removes the last item in the collection.
public : void RemoveAtEnd()
void RemoveAtEnd() const;
// This member is not implemented in C#
ColumnDefinitionCollection.ReplaceAll ColumnDefinition
Collection.ReplaceAll ColumnDefinitionCollection.
ReplaceAll
I n this Article
Edit
Initially clears the collection, then inserts the provided array as new items.
public : void ReplaceAll(ColumnDefinition[] items)
void ReplaceAll(ColumnDefinition[] items) const;
// This member is not implemented in C#

Parameters
items ColumnDefinition[]
The new collection items.
ColumnDefinitionCollection.SetAt ColumnDefinition
Collection.SetAt ColumnDefinitionCollection.SetAt
I n this Article
Edit
Sets the value at the specified index to the ColumnDefinition value specified.
public : void SetAt(unsigned int index, ColumnDefinition value)
void SetAt(uint32_t index, ColumnDefinition value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value ColumnDefinition
The value to set.
ColumnDefinitionCollection.Size ColumnDefinition
Collection.Size ColumnDefinitionCollection.Size
I n this Article
Edit
Gets the size (count) of the collection.
public : unsigned int Size { get; }
uint32_t Size();
// This member is not implemented in C#

Returns
uint
The count of items in the collection.
ComboBox ComboBox ComboBox Class
Represents a selection control that combines a non-editable text box and a drop-down list box that allows users to
select an item from a list.

D eclaration
public : class ComboBox : Selector, IComboBox, IComboBox2, IComboBox3, IComboBox4, IComboBox5,
IComboBox6, IComboBoxOverrides
struct winrt::Windows::UI::Xaml::Controls::ComboBox : Selector, IComboBox, IComboBox2,
IComboBox3, IComboBox4, IComboBox5, IComboBox6, IComboBoxOverrides
public class ComboBox : Selector, IComboBox, IComboBox2, IComboBox3, IComboBox4, IComboBox5,
IComboBox6, IComboBoxOverrides

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Selector

Remarks
 Tip

For more info, design guidance, and code examples, see Combo box.
ComboBox presents a drop-down list of items a user can select from.

Use a ComboBox to present a list of items that a user can select from. When the ComboBox is closed, it either displays
the current selection or is empty if there is no selected item. When the ComboBox is open, it displays the list of
selectable items. You can get or set the combo box's selected item by using the SelectedItem property, and get or set
the index of the selected item by using the SelectedIndex property.
You populate the ComboBox by adding objects directly to the Items collection or by binding the ItemsSource property
to a data source. Items added to the ComboBox are wrapped in ComboBoxItem containers.
Note

ComboBox uses a CarouselPanel as its ItemsPanel. Using a different panel as the ItemsPanel is not supported and
might result in undesired behavior.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the ComboBox control.

R ES O U R CE K EY D ES CR IPTIO N

ComboBoxBackground Background color at rest

ComboBoxBackgroundPointerOver Background color on hover

ComboBoxBackgroundPressed Background color when pressed

ComboBoxBackgroundDisabled Background color when disabled

ComboBoxBackgroundUnfocused Background color when unfocused

ComboBoxBackgroundBorderBrushFocused Border color around box after item has been selected and
control has focus

ComboBoxBackgroundBorderBrushUnfocused Border color around box after item has been selected and
control is unfocused

ComboBoxForeground Text color of selected item at rest

ComboBoxForegroundDisabled Text color of selected item when disabled

ComboBoxForegroundFocused Text color of selected item when focused

ComboBoxForegroundFocusedPressed Text color of selected item pressed and focused

ComboBoxPlaceHolderForeground Placeholder text color

ComboBoxPlaceHolderForegroundFocusedPressed Placeholder text color when pressed and focused

ComboBoxBorderBrush Border color at rest

ComboBoxBorderBrushPointerOver Border color on hover

ComboBoxBorderBrushPressed Border color when pressed

ComboBoxBorderBrushDisabled Border color when disabled


ComboBoxDropDownGlyphForeground Drop down arrow color at rest

ComboBoxDropDownGlyphForegroundDisabled Drop down arrow color when disabled

ComboBoxDropDownGlyphForegroundFocused Drop down arrow color when focused

ComboBoxDropDownGlyphForegroundFocusedPressed Drop down arrow color when focused and pressed

ComboBoxDropDownBackground Background color of drop down arrow control bounds

ComboBoxDropDownForeground Not used

ComboBoxDropDownBorderBrush Border color around control's popup when selecting items

Constructors
ComboBox()
ComboBox()
ComboBox()

Initializes a new instance of the ComboBox class.

Properties
Description
Description
Description

Gets or sets content that is shown below the control. The content should provide guidance about the input
expected by the control.

DescriptionProperty
DescriptionProperty
DescriptionProperty

Identifies the Description dependency property.

Header
Header
Header

Gets or sets the content for the control's header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.


HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the control's header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

IsDropDownOpen
IsDropDownOpen
IsDropDownOpen

Gets or sets a value that indicates whether the drop-down portion of the ComboBox is currently open.

IsDropDownOpenProperty
IsDropDownOpenProperty
IsDropDownOpenProperty

Identifies the IsDropDownOpen dependency property.

IsEditable
IsEditable
IsEditable

Gets or sets a value that indicates whether the user can edit text in the text box portion of the ComboBox. See
remarks.

IsEditableProperty
IsEditableProperty
IsEditableProperty

Identifies the IsEditable dependency property.

IsSelectionBoxHighlighted
IsSelectionBoxHighlighted
IsSelectionBoxHighlighted

Gets a value that indicates whether the SelectionBoxItem component is highlighted.

IsTextSearchEnabled
IsTextSearchEnabled
IsTextSearchEnabled

Gets or sets a value that specifies whether a user can jump to a value by typing.

IsTextSearchEnabledProperty
IsTextSearchEnabledProperty
IsTextSearchEnabledProperty

Identifies the IsTextSearchEnabled dependency property.

LightDismissOverlayMode
LightDismissOverlayMode
LightDismissOverlayMode

Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.

LightDismissOverlayModeProperty
LightDismissOverlayModeProperty
LightDismissOverlayModeProperty

Identifies the LightDismissOverlayMode dependency property.

MaxDropDownHeight
MaxDropDownHeight
MaxDropDownHeight

Gets or sets the maximum height for a combo box drop-down.

MaxDropDownHeightProperty
MaxDropDownHeightProperty
MaxDropDownHeightProperty

Identifies the MaxDropDownHeight dependency property.

PlaceholderForeground
PlaceholderForeground
PlaceholderForeground

Gets or sets a brush that describes the color of placeholder text.

PlaceholderForegroundProperty
PlaceholderForegroundProperty
PlaceholderForegroundProperty

Identifies the PlaceholderForeground dependency property.


PlaceholderText
PlaceholderText
PlaceholderText

Gets or sets the text that is displayed in the control until the value is changed by a user action or some other
operation.

PlaceholderTextProperty
PlaceholderTextProperty
PlaceholderTextProperty

Identifies the PlaceholderText dependency property.

SelectionBoxItem
SelectionBoxItem
SelectionBoxItem

Gets the item shown when the ComboBox is closed.

SelectionBoxItemTemplate
SelectionBoxItemTemplate
SelectionBoxItemTemplate

Gets the template applied to the selection box content.

SelectionChangedTrigger
SelectionChangedTrigger
SelectionChangedTrigger

Gets or sets a value that indicates what action causes a SelectionChanged event to occur.

SelectionChangedTriggerProperty
SelectionChangedTriggerProperty
SelectionChangedTriggerProperty

Identifies the SelectionChangedTrigger dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ComboBox control.

Text
Text
Text

Gets or sets the text in the ComboBox.

TextBoxStyle
TextBoxStyle
TextBoxStyle

Gets or sets the style of the TextBox in the ComboBox when the ComboBox is editable.

TextBoxStyleProperty
TextBoxStyleProperty
TextBoxStyleProperty

Identifies the TextBoxStyle dependency property.

TextProperty
TextProperty
TextProperty

Identifies the Text dependency property.

Methods
OnDropDownClosed(Object)
OnDropDownClosed(Object)
OnDropDownClosed(Object)

Invoked when the DropDownClosed event is raised.

OnDropDownOpened(Object)
OnDropDownOpened(Object)
OnDropDownOpened(Object)

Invoked when the DropDownOpened event is raised.

Events
DropDownClosed
DropDownClosed
DropDownClosed

Occurs when the drop-down portion of the ComboBox closes.

DropDownOpened
DropDownOpened
DropDownOpened

Occurs when the drop-down portion of the ComboBox opens.

TextSubmitted
TextSubmitted
TextSubmitted

Occurs when the user submits some text that does not correspond to an item in the ComboBox dropdown list.

See Also
Selector
Selector
Selector
Selector
ComboBox ComboBox ComboBox
I n this Article
Edit
Initializes a new instance of the ComboBox class.

public : ComboBox()
ComboBox() const;
public ComboBox()
ComboBox.Description ComboBox.Description Combo
Box.Description
I n this Article
Edit
Gets or sets content that is shown below the control. The content should provide guidance about the input expected by
the control.
public : Platform::Object Description { get; set; }
winrt::Windows::Foundation::IInspectable Description();

void Description(winrt::Windows::Foundation::IInspectable description);


public object Description { get; set; }

Returns
object
The content to be displayed below the control. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ComboBox.DescriptionProperty ComboBox.Description
Property ComboBox.DescriptionProperty
I n this Article
Edit
Identifies the Description dependency property.
public : static DependencyProperty DescriptionProperty { get; }
static DependencyProperty DescriptionProperty();
public static DependencyProperty DescriptionProperty { get; }

Returns
DependencyProperty
The identifier for the Description dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ComboBox.DropDownClosed ComboBox.DropDown
Closed ComboBox.DropDownClosed
I n this Article
Edit
Occurs when the drop-down portion of the ComboBox closes.
public : event EventHandler<Platform::Object> DropDownClosed
// Register
event_token DropDownClosed(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void DropDownClosed(event_token const& cookie) const;

// Revoke with event_revoker


DropDownClosed_revoker DropDownClosed(auto_revoke_t, EventHandler<Platform::Object> const& handler)
const;
public event EventHandler<object> DropDownClosed

<ComboBox DropDownClosed="eventhandler"/>

Remarks
The drop-down portion of ComboBox is implemented basically as a Popup.
ComboBox.DropDownOpened ComboBox.DropDown
Opened ComboBox.DropDownOpened
I n this Article
Edit
Occurs when the drop-down portion of the ComboBox opens.
public : event EventHandler<Platform::Object> DropDownOpened
// Register
event_token DropDownOpened(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void DropDownOpened(event_token const& cookie) const;

// Revoke with event_revoker


DropDownOpened_revoker DropDownOpened(auto_revoke_t, EventHandler<Platform::Object> const& handler)
const;
public event EventHandler<object> DropDownOpened

<ComboBox DropDownOpened="eventhandler"/>
ComboBox.Header ComboBox.Header ComboBox.
Header
I n this Article
Edit
Gets or sets the content for the control's header.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<ComboBox Header="headerString"/>

Returns
object
The content of the control's header. The default is null.

Remarks
You can set a data template for the Header by using the HeaderTemplate property.
ComboBox.HeaderProperty ComboBox.HeaderProperty
ComboBox.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
ComboBox.HeaderTemplate ComboBox.HeaderTemplate
ComboBox.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the control's header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<ComboBox>
<ComboBox.HeaderTemplate>
singleDataTemplate
</ComboBox.HeaderTemplate>
</ComboBox>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
ComboBox.HeaderTemplateProperty ComboBox.Header
TemplateProperty ComboBox.HeaderTemplateProperty
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
ComboBox.IsDropDownOpen ComboBox.IsDropDown
Open ComboBox.IsDropDownOpen
I n this Article
Edit
Gets or sets a value that indicates whether the drop-down portion of the ComboBox is currently open.
public : Platform::Boolean IsDropDownOpen { get; set; }
bool IsDropDownOpen();

void IsDropDownOpen(bool isdropdownopen);


public bool IsDropDownOpen { get; set; }

<ComboBox IsDropDownOpen="bool"/>

Returns
bool
True if the drop-down portion is open; otherwise, false. The default is false.
ComboBox.IsDropDownOpenProperty ComboBox.IsDrop
DownOpenProperty ComboBox.IsDropDownOpen
Property
I n this Article
Edit
Identifies the IsDropDownOpen dependency property.
public : static DependencyProperty IsDropDownOpenProperty { get; }
static DependencyProperty IsDropDownOpenProperty();
public static DependencyProperty IsDropDownOpenProperty { get; }

Returns
DependencyProperty
The identifier for the IsDropDownOpen dependency property.
ComboBox.IsEditable ComboBox.IsEditable ComboBox.Is
Editable
I n this Article
Edit
Gets or sets a value that indicates whether the user can edit text in the text box portion of the ComboBox. See remarks.
public : Platform::Boolean IsEditable { get; set; }
bool IsEditable();

void IsEditable(bool iseditable);


public bool IsEditable { get; set; }

<ComboBox IsEditable="bool"/>

Returns
bool
true if the user can edit text in the ComboBox, otherwise false. The default is false. See remarks.

Remarks
The behavior of this property is changed in the next major release of Windows 10. In earlier versions of Windows, this
property is read-only and always returns false.
ComboBox.IsEditableProperty ComboBox.IsEditable
Property ComboBox.IsEditableProperty
I n this Article
Edit
Identifies the IsEditable dependency property.
public : static DependencyProperty IsEditableProperty { get; }
static DependencyProperty IsEditableProperty();
public static DependencyProperty IsEditableProperty { get; }

Returns
DependencyProperty
The identifier for the IsEditable dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ComboBox.IsSelectionBoxHighlighted ComboBox.Is
SelectionBoxHighlighted ComboBox.IsSelectionBox
Highlighted
I n this Article
Edit
Gets a value that indicates whether the SelectionBoxItem component is highlighted.
public : Platform::Boolean IsSelectionBoxHighlighted { get; }
bool IsSelectionBoxHighlighted();
public bool IsSelectionBoxHighlighted { get; }

Returns
bool
True if the SelectionBoxItem is highlighted; otherwise, false. The default is true.
ComboBox.IsTextSearchEnabled ComboBox.IsTextSearch
Enabled ComboBox.IsTextSearchEnabled
I n this Article
Edit
Gets or sets a value that specifies whether a user can jump to a value by typing.
public : Platform::Boolean IsTextSearchEnabled { get; set; }
bool IsTextSearchEnabled();

void IsTextSearchEnabled(bool istextsearchenabled);


public bool IsTextSearchEnabled { get; set; }

<ComboBox IsTextSearchEnabled="bool"/>

Returns
bool
true if a user can jump to a value by typing; otherwise, false. The default is true.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Starting in Windows 10, version 1607, ComboBox introduces a text search feature. By default, the ComboBox jumps to
a relevant value as the user types. You can set the IsTextSearchEnabled property to false to disable this behavior. This is
useful, for example, if you have extended ComboBox with custom text search.
Version compatibility
The IsTextSearchEnabled property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
Note

The text search feature is available when your app is compiled for Windows 10, version 1607 and running on version
1607 (or later). It is not available when your app is compiled for a previous version or is running on a previous version.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<ComboBox x:Name="comboBox1" Loaded="ComboBox_Loaded"/>
private void ComboBox_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.ComboBox",
"IsTextSearchEnabled"))
{
comboBox1.IsTextSearchEnabled = false;
}
}
ComboBox.IsTextSearchEnabledProperty ComboBox.Is
TextSearchEnabledProperty ComboBox.IsTextSearch
EnabledProperty
I n this Article
Edit
Identifies the IsTextSearchEnabled dependency property.
public : static DependencyProperty IsTextSearchEnabledProperty { get; }
static DependencyProperty IsTextSearchEnabledProperty();
public static DependencyProperty IsTextSearchEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextSearchEnabled dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


ComboBox.LightDismissOverlayMode ComboBox.Light
DismissOverlayMode ComboBox.LightDismissOverlay
Mode
I n this Article
Edit
Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.
public : LightDismissOverlayMode LightDismissOverlayMode { get; set; }
LightDismissOverlayMode LightDismissOverlayMode();

void LightDismissOverlayMode(LightDismissOverlayMode lightdismissoverlaymode);


public LightDismissOverlayMode LightDismissOverlayMode { get; set; }

Returns
LightDismissOverlayMode
A value of the enumeration that specifies whether the area outside of a light-dismiss UI is darkened. The default is
Auto.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Transient UI, such as the open drop-down of a ComboBox, closes when you click or tap outside of it. This is called light-
dismiss. "Overlay" refers to the area outside of a light-dismiss UI.
By default, the "overlay" is darkened on the Xbox, and not darkened on other devices families. You can set
LightDismissOverlayMode to On to make your app darken the "overlay" area on all device families, or set it to Off to
not darken the "overlay" area on all device families.
Version compatibility
The LightDismissOverlayMode property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.ComboBox",
"LightDismissOverlayMode"))
{
comboBox1.LightDismissOverlayMode = LightDismissOverlayMode.On;
}
}
ComboBox.LightDismissOverlayModeProperty Combo
Box.LightDismissOverlayModeProperty ComboBox.Light
DismissOverlayModeProperty
I n this Article
Edit
Identifies the LightDismissOverlayMode dependency property.
public : static DependencyProperty LightDismissOverlayModeProperty { get; }
static DependencyProperty LightDismissOverlayModeProperty();
public static DependencyProperty LightDismissOverlayModeProperty { get; }

Returns
DependencyProperty
The identifier for the LightDismissOverlayMode dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


ComboBox.MaxDropDownHeight ComboBox.MaxDrop
DownHeight ComboBox.MaxDropDownHeight
I n this Article
Edit
Gets or sets the maximum height for a combo box drop-down.
public : double MaxDropDownHeight { get; set; }
double MaxDropDownHeight();

void MaxDropDownHeight(double maxdropdownheight);


public double MaxDropDownHeight { get; set; }

<ComboBox MaxDropDownHeight="double"/>

Returns
double
The maximum height of the drop-down. The default is infinity.

Remarks
Note

In Windows 8, this property is ignored. If this property is set incorrectly (set to 0, for example) in an app that's
compiled for Windows 8, the app might behave incorrectly or crash when it's run in Windows 8.1. You should set this
property to a value of 76 or greater to make sure the scroll buttons show and behave correctly when the ComboBox is
open.
ComboBox.MaxDropDownHeightProperty ComboBox.
MaxDropDownHeightProperty ComboBox.MaxDrop
DownHeightProperty
I n this Article
Edit
Identifies the MaxDropDownHeight dependency property.
public : static DependencyProperty MaxDropDownHeightProperty { get; }
static DependencyProperty MaxDropDownHeightProperty();
public static DependencyProperty MaxDropDownHeightProperty { get; }

Returns
DependencyProperty
The identifier for the MaxDropDownHeight dependency property.
ComboBox.OnDropDownClosed ComboBox.OnDrop
DownClosed ComboBox.OnDropDownClosed
I n this Article
Edit
Invoked when the DropDownClosed event is raised.
protected : virtual void OnDropDownClosed(Platform::Object e)
virtual void OnDropDownClosed(winrt::Windows::Foundation::IInspectable e) const;
protected virtual void OnDropDownClosed(Object e)

Parameters
e Object
Event data for the event.
ComboBox.OnDropDownOpened ComboBox.OnDrop
DownOpened ComboBox.OnDropDownOpened
I n this Article
Edit
Invoked when the DropDownOpened event is raised.
protected : virtual void OnDropDownOpened(Platform::Object e)
virtual void OnDropDownOpened(winrt::Windows::Foundation::IInspectable e) const;
protected virtual void OnDropDownOpened(Object e)

Parameters
e Object
Event data for the event.
ComboBox.PlaceholderForeground ComboBox.
PlaceholderForeground ComboBox.Placeholder
Foreground
I n this Article
Edit
Gets or sets a brush that describes the color of placeholder text.
public : Brush PlaceholderForeground { get; set; }
Brush PlaceholderForeground();

void PlaceholderForeground(Brush placeholderforeground);


public Brush PlaceholderForeground { get; set; }

<ComboBox PlaceholderForeground="{StaticResource resourceName}" .../>

Returns
Brush
The brush that describes the color of placeholder text.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


ComboBox.PlaceholderForegroundProperty ComboBox.
PlaceholderForegroundProperty ComboBox.Placeholder
ForegroundProperty
I n this Article
Edit
Identifies the PlaceholderForeground dependency property.
public : static DependencyProperty PlaceholderForegroundProperty { get; }
static DependencyProperty PlaceholderForegroundProperty();
public static DependencyProperty PlaceholderForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderForeground dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


ComboBox.PlaceholderText ComboBox.PlaceholderText
ComboBox.PlaceholderText
I n this Article
Edit
Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation.
public : Platform::String PlaceholderText { get; set; }
winrt::hstring PlaceholderText();

void PlaceholderText(winrt::hstring placeholdertext);


public string PlaceholderText { get; set; }

<ComboBox PlaceholderText="placeholderString"/>

Returns
string
The text that is displayed in the control when no value is selected. The default is an empty string ("").

Examples
Here's how to add placeholder text to a ComboBox.
<ComboBox Header="Colors" PlaceholderText="Pick a color">
<x:String>Blue</x:String>
<x:String>Green</x:String>
<x:String>Red</x:String>
<x:String>Yellow</x:String>
</ComboBox>

Remarks
The placeholder text is shown when the SelectedIndex is -1 and the SelectedItem is null. (These two properties are
kept in sync.) A user can't display the placeholder text once an item has been selected. However, you can
programmatically set either the SelectedIndex to -1 or the SelectedItem to null to cause the placeholder text to be
shown again.
ComboBox.PlaceholderTextProperty ComboBox.
PlaceholderTextProperty ComboBox.PlaceholderText
Property
I n this Article
Edit
Identifies the PlaceholderText dependency property.
public : static DependencyProperty PlaceholderTextProperty { get; }
static DependencyProperty PlaceholderTextProperty();
public static DependencyProperty PlaceholderTextProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderText dependency property.
ComboBox.SelectionBoxItem ComboBox.SelectionBox
Item ComboBox.SelectionBoxItem
I n this Article
Edit
Gets the item shown when the ComboBox is closed.
public : Platform::Object SelectionBoxItem { get; }
winrt::Windows::Foundation::IInspectable SelectionBoxItem();
public object SelectionBoxItem { get; }

Returns
object
The item shown when the ComboBox is closed.

Remarks
The selection box is the text box that's shown when the ComboBox is closed.
ComboBox.SelectionBoxItemTemplate ComboBox.
SelectionBoxItemTemplate ComboBox.SelectionBoxItem
Template
I n this Article
Edit
Gets the template applied to the selection box content.
public : DataTemplate SelectionBoxItemTemplate { get; }
DataTemplate SelectionBoxItemTemplate();
public DataTemplate SelectionBoxItemTemplate { get; }

Returns
DataTemplate
The template applied to the selection box content.
ComboBox.SelectionChangedTrigger ComboBox.
SelectionChangedTrigger ComboBox.SelectionChanged
Trigger
I n this Article
Edit
Gets or sets a value that indicates what action causes a SelectionChanged event to occur.
public : ComboBoxSelectionChangedTrigger SelectionChangedTrigger { get; set; }
ComboBoxSelectionChangedTrigger SelectionChangedTrigger();

void SelectionChangedTrigger(ComboBoxSelectionChangedTrigger selectionchangedtrigger);


public ComboBoxSelectionChangedTrigger SelectionChangedTrigger { get; set; }

Returns
ComboBoxSelectionChangedTrigger
A value of the enumeration. The default is Committed.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ComboBox.SelectionChangedTriggerProperty Combo
Box.SelectionChangedTriggerProperty ComboBox.
SelectionChangedTriggerProperty
I n this Article
Edit
Identifies the SelectionChangedTrigger dependency property.
public : static DependencyProperty SelectionChangedTriggerProperty { get; }
static DependencyProperty SelectionChangedTriggerProperty();
public static DependencyProperty SelectionChangedTriggerProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionChangedTrigger dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ComboBox.TemplateSettings ComboBox.Template
Settings ComboBox.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ComboBox control.
public : ComboBoxTemplateSettings TemplateSettings { get; }
ComboBoxTemplateSettings TemplateSettings();
public ComboBoxTemplateSettings TemplateSettings { get; }

Returns
ComboBoxTemplateSettings
An object that provides calculated values for templates.
ComboBox.Text ComboBox.Text ComboBox.Text
I n this Article
Edit
Gets or sets the text in the ComboBox.

public : Platform::String Text { get; set; }


winrt::hstring Text();

void Text(winrt::hstring text);


public string Text { get; set; }

Returns
string
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ComboBox.TextBoxStyle ComboBox.TextBoxStyle Combo
Box.TextBoxStyle
I n this Article
Edit
Gets or sets the style of the TextBox in the ComboBox when the ComboBox is editable.
public : Style TextBoxStyle { get; set; }
Style TextBoxStyle();

void TextBoxStyle(Style textboxstyle);


public Style TextBoxStyle { get; set; }

Returns
Style
The style of the TextBox in the ComboBox when the ComboBox is editable.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ComboBox.TextBoxStyleProperty ComboBox.TextBoxStyle
Property ComboBox.TextBoxStyleProperty
I n this Article
Edit
Identifies the TextBoxStyle dependency property.
public : static DependencyProperty TextBoxStyleProperty { get; }
static DependencyProperty TextBoxStyleProperty();
public static DependencyProperty TextBoxStyleProperty { get; }

Returns
DependencyProperty
The identifier for the TextBoxStyle dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ComboBox.TextProperty ComboBox.TextProperty Combo
Box.TextProperty
I n this Article
Edit
Identifies the Text dependency property.
public : static DependencyProperty TextProperty { get; }
static DependencyProperty TextProperty();
public static DependencyProperty TextProperty { get; }

Returns
DependencyProperty
The identifier for the Text dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ComboBox.TextSubmitted ComboBox.TextSubmitted
ComboBox.TextSubmitted
I n this Article
Edit
Occurs when the user submits some text that does not correspond to an item in the ComboBox dropdown list.
public : event TypedEventHandler<ComboBox, ComboBoxTextSubmittedEventArgs> TextSubmitted
// Register
event_token TextSubmitted(TypedEventHandler<ComboBox, ComboBoxTextSubmittedEventArgs> const&
handler) const;

// Revoke with event_token


void TextSubmitted(event_token const& cookie) const;

// Revoke with event_revoker


TextSubmitted_revoker TextSubmitted(auto_revoke_t, TypedEventHandler<ComboBox,
ComboBoxTextSubmittedEventArgs> const& handler) const;
public event TypedEventHandler<ComboBox, ComboBoxTextSubmittedEventArgs> TextSubmitted
ComboBoxItem ComboBoxItem ComboBoxItem Class
Represents the container for an item in a ComboBox control.

D eclaration
public : class ComboBoxItem : SelectorItem, IComboBoxItem
struct winrt::Windows::UI::Xaml::Controls::ComboBoxItem : SelectorItem, IComboBoxItem
public class ComboBoxItem : SelectorItem, IComboBoxItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem

Remarks
The ComboBoxItem class provides the container for items displayed in a ComboBox control. You populate the
ComboBox by adding objects directly to its Items collection or by binding its ItemsSource property to a data source.
When items are added to the ComboBox, a ComboBoxItem container is created automatically for each item in the
collection.
You can specify the look of the ComboBoxItem by setting the ComboBox 's ItemContainerStyle property to a Style with
a TargetType of ComboBoxItem.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the ComboBoxItem control.

R ES O U R CE K EY D ES CR IPTIO N

ComboBoxItemForeground Text color at rest

ComboBoxItemForegroundPointerOver Text color on hover

ComboBoxItemForegroundPressed Text color when pressed


ComboBoxItemForegroundDisabled Text color when disabled

ComboBoxItemForegroundSelected Text color when selected

ComboBoxItemForegroundSelectedUnfocused Text color when unfocused and selected

ComboBoxItemForegroundSelectedPointerOver Text color on hover and selected

ComboBoxItemForegroundSelectedPressed Text color when pressed and selected

ComboBoxItemForegroundSelectedDisabled Text color when disabled and selected

ComboBoxItemBackground Background color at rest

ComboBoxItemBackgroundPointerOver Background color on hover

ComboBoxItemBackgroundPressed Background color when pressed

ComboBoxItemBackgroundDisabled Background color when disabled

ComboBoxItemBackgroundSelected Background color when selected

ComboBoxItemBackgroundSelectedUnfocused Background color when unfocused and selected

ComboBoxItemBackgroundSelectedPointerOver Background color on hover and selected

ComboBoxItemBackgroundSelectedPressed Background color when pressed and selected

ComboBoxItemBackgroundSelectedDisabled Background color when disabled and selected

ComboBoxItemBorderBrush Border color at rest

ComboBoxItemBorderBrushPointerOver Border color on hover

ComboBoxItemBorderBrushPressed Border color when pressed

ComboBoxItemBorderBrushDisabled Border color when disabled

ComboBoxItemBorderBrushSelected Border color when selected

ComboBoxItemBorderBrushSelectedUnfocused Border color when unfocused and selected

ComboBoxItemBorderBrushSelectedPointerOver Border color on hover and selected

ComboBoxItemBorderBrushSelectedPressed Border color when pressed and selected

ComboBoxItemBorderBrushSelectedDisabled Border color when disabled and selected

Constructors
ComboBoxItem()
ComboBoxItem()
ComboBoxItem()

Initializes a new instance of the ComboBoxItem class.

See Also
SelectorItem
SelectorItem
ComboBoxItem ComboBoxItem ComboBoxItem
I n this Article
Edit
Initializes a new instance of the ComboBoxItem class.

public : ComboBoxItem()
ComboBoxItem() const;
public ComboBoxItem()
ComboBoxSelectionChangedTrigger ComboBoxSelection
ChangedTrigger ComboBoxSelectionChangedTrigger
Enum
Defines constants that specify what action causes a SelectionChanged event to occur.

D eclaration
public : enum class ComboBoxSelectionChangedTrigger
enum class winrt::Windows::UI::Xaml::Controls::ComboBoxSelectionChangedTrigger : int32_t
public enum ComboBoxSelectionChangedTrigger

I nheritance H ierarchy
None

Remarks
This enumeration is used by the ComboBox.SelectionChangedTrigger property.

Fields
Always Always Always A change event occurs each time the user navigates to a new selection in the combo
box.

Committed Committed A change event occurs when the user commits a selection in the combo box.
Committed
ComboBoxTextSubmittedEventArgs ComboBoxText
SubmittedEventArgs ComboBoxTextSubmittedEventArgs
Class
Provides data when the user enters custom text into the ComboBox.

D eclaration
public : sealed class ComboBoxTextSubmittedEventArgs : IComboBoxTextSubmittedEventArgs
struct winrt::Windows::UI::Xaml::Controls::ComboBoxTextSubmittedEventArgs :
IComboBoxTextSubmittedEventArgs
public sealed class ComboBoxTextSubmittedEventArgs : IComboBoxTextSubmittedEventArgs

I nheritance H ierarchy
None

Properties
Handled
Handled
Handled

Gets or sets whether the TextSubmitted event was handled or not. If true, the framework will not automatically
update the selected item of the ComboBox to the new value.

Text
Text
Text

Gets the custom text value entered by the user.


ComboBoxTextSubmittedEventArgs.Handled ComboBox
TextSubmittedEventArgs.Handled ComboBoxText
SubmittedEventArgs.Handled
I n this Article
Edit
Gets or sets whether the TextSubmitted event was handled or not. If true, the framework will not automatically update
the selected item of the ComboBox to the new value.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
ComboBoxTextSubmittedEventArgs.Text ComboBoxText
SubmittedEventArgs.Text ComboBoxTextSubmittedEvent
Args.Text
I n this Article
Edit
Gets the custom text value entered by the user.
public : Platform::String Text { get; }
winrt::hstring Text();
public string Text { get; }

Returns
string
CommandBar CommandBar CommandBar Class
Represents a specialized app bar that provides layout for AppBarButton and related command elements.

D eclaration
public : class CommandBar : AppBar, ICommandBar, ICommandBar2, ICommandBar3
struct winrt::Windows::UI::Xaml::Controls::CommandBar : AppBar, ICommandBar, ICommandBar2,
ICommandBar3
public class CommandBar : AppBar, ICommandBar, ICommandBar2, ICommandBar3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
AppBar

Remarks
 Tip

For more info, design guidance, and code examples, see Command bar.
Use a CommandBar to provide users with quick access to your app’s most common tasks. It's a general-purpose,
flexible, light-weight control that can display both complex content, such as images, progress bars, or text blocks, as
well as simple commands such as AppBarButton, AppBarToggleButton, and AppBarSeparator controls.
Anatomy
By default, the CommandBar shows a row of icon buttons and a "More" button, which is represented by an ellipsis
[••• ]. Here's the CommandBar created by the example code shown later. It's shown in its default closed state.

Here's the same CommandBar shown in its open state. The labels show the main parts of the control.

The CommandBar is divided into 4 main areas:


The content area is shown on the left.
The "More" button is shown on the right. Pressing the "More" button has 2 effects: it reveals the labels on the primary
command buttons, and it opens the overflow menu if any secondary commands are present.
The primary commands are shown to the left of the "More" button.
The overflow menu is shown only when the CommandBar is open and contains secondary commands.
The layout is reversed when the FlowDirection is RightToLeft.
Content and commands
CommandBar has 3 properties you can use to add content and commands: Content, PrimaryCommands, and
SecondaryCommands.
You can add any XAML elements to the content area by setting the Content property.
Both the PrimaryCommands and SecondaryCommands can be populated only with AppBarButton,
AppBarToggleButton, and AppBarSeparator command elements. By default, items you add to the CommandBar are
added to the PrimaryCommands collection. These commands are shown to the left of the "More" button. You can add
commands to the SecondaryCommands collection, and these items are shown in the overflow menu. You can
programmatically move commands between the PrimaryCommands and SecondaryCommands as needed.
The app bar button controls are characterized by an icon and associated label. They have two sizes; normal and
compact. By default, the text label is shown. When the IsCompact property is set to true, the text label is hidden. When
used in a CommandBar control, the CommandBar sets the IsCompact property automatically as the control is opened
and closed.
If the width of a button needs to be greater than the default when shown in the PrimaryCommands, use the MinWidth
property to achieve the desired size. Then, if you later move it to the SecondaryCommands, it will still stretch to fill the
width of the overflow menu.
If a text label for an app bar button is too long to fit on one line it will wrap to another line, increasing the overall height
of the bar when it’s opened. You can include a soft-hyphen character (0x00AD ) in the text for a label to hint at the
character boundary where a word break should occur. In XAML, you express this using an escape sequence, like this:

<AppBarButton Icon="Back" Label="Areally&#x00AD;longlabel"/>

When the label wraps at the hinted location, it looks like this.

Open and closed states


The CommandBar can be open or closed. A user can switch between these states by pressing the "More" button. You
can switch between them programmatically by setting the IsOpen property. You can use the Opening, Opened,
Closing, and Closed events to respond to the CommandBar being opened or closed.
When open, the primary command buttons are shown with text labels and the overflow menu is open if secondary
commands are present. The default overflow menu is styled to be distinct from the bar. You can adjust the styling by
setting the CommandBarOverflowPresenterStyle property to a Style that targets the CommandBarOverflowPresenter.
You can control how the CommandBar is shown in its closed state by setting the ClosedDisplayMode property. By
default, it’s shown in the Compact mode, with content, icons without labels, and the "More" button. You can set the
mode to Minimal to show only a thin bar that acts as the "More" button. In Minimal mode, the user can press
anywhere on the bar to open it. Here's how the CommandBar looks in Minimal mode.

Changing the ClosedDisplayMode to provide more or less of a hint to the user affects the layout of surrounding
elements. When the CommandBar transitions between closed and open, it does not affect the layout of other elements.
I sSticky
After opening the CommandBar, if the user interacts with the app anywhere outside of the control then by default the
overflow menu is dismissed and the labels are hidden. Closing it in this way is called light dismiss. You can control how
the bar is dismissed by setting the IsSticky property. When the bar is sticky (IsSticky ="true "), it's not closed by a light
dismiss gesture. The app bar remains visible until the user presses the "More" button or, if present, selects an item from
the overflow menu.
P lacement
You can place a CommandBar inline with your app content, anywhere in your XAML. If the CommandBar must remain
visible to a user when the touch keyboard, or Soft Input Panel (SIP ), appears then you can assign it to the
BottomAppBar property of a Page and it will move to remain visible when the Soft Input Panel (SIP ) is present.
Otherwise, you should place it inline and positioned relative to your app content. Where you place the CommandBar
will influence things like whether you make it sticky, or use the minimal mode when it's closed. For more info and
guidance, see Guidelines for command bars.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the CommandBar control.

R ES O U R CE K EY D ES CR IPTIO N

CommandBarBackground Background color at rest

CommandBarForeground Text color at rest

CommandBarHighContrastBorder Border color for high-contrast

CommandBarEllipsisIconForegroundDisabled Color of ellipsis icon when disabled

AppBarEllipsisButtonBackground Background color of ellipsis at rest

AppBarEllipsisButtonBackgroundPointerOver Background color of ellipsis on hover

AppBarEllipsisButtonBackgroundPressed Background color of ellipsis when pressed

AppBarEllipsisButtonBackgroundDisabled Background color of ellipsis when disabled

AppBarEllipsisButtonForeground Foreground color of ellipsis at rest

AppBarEllipsisButtonForegroundPointerOver Foreground color of ellipsis on hover


AppBarEllipsisButtonForegroundPressed Foreground color of ellipsis when pressed

AppBarEllipsisButtonForegroundDisabled Foreground color of ellipsis when disabled

AppBarEllipsisButtonBorderBrush Border color of ellipsis at rest

AppBarEllipsisButtonBorderBrushPointerOver Border color of ellipsis on hover

AppBarEllipsisButtonBorderBrushPressed Border color of ellipsis when pressed

AppBarEllipsisButtonBorderBrushDisabled Border color of ellipsis when disabled

Constructors
CommandBar()
CommandBar()
CommandBar()

Initializes a new instance of the CommandBar class.

Properties
CommandBarOverflowPresenterStyle
CommandBarOverflowPresenterStyle
CommandBarOverflowPresenterStyle

Gets or sets the Style applied to the overflow content of the CommandBar.

CommandBarOverflowPresenterStyleProperty
CommandBarOverflowPresenterStyleProperty
CommandBarOverflowPresenterStyleProperty

Identifies the CommandBarOverflowPresenterStyle dependency property.

CommandBarTemplateSettings
CommandBarTemplateSettings
CommandBarTemplateSettings

Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension
sources when defining templates for a CommandBar control.

DefaultLabelPosition
DefaultLabelPosition
DefaultLabelPosition

Gets or sets a value that indicates the placement and visibility of the labels on the command bar's buttons.
DefaultLabelPositionProperty
DefaultLabelPositionProperty
DefaultLabelPositionProperty

Identifies the DefaultLabelPosition dependency property.

IsDynamicOverflowEnabled
IsDynamicOverflowEnabled
IsDynamicOverflowEnabled

Gets or sets a value that indicates whether primary commands automatically move to the overflow menu when
space is limited.

IsDynamicOverflowEnabledProperty
IsDynamicOverflowEnabledProperty
IsDynamicOverflowEnabledProperty

Identifies the IsDynamicOverflowEnabled dependency property.

OverflowButtonVisibility
OverflowButtonVisibility
OverflowButtonVisibility

Gets or sets a value that indicates when a command bar's overflow button is shown.

OverflowButtonVisibilityProperty
OverflowButtonVisibilityProperty
OverflowButtonVisibilityProperty

Identifies the OverflowButtonVisibility dependency property.

PrimaryCommands
PrimaryCommands
PrimaryCommands

Gets the collection of primary command elements for the CommandBar.

PrimaryCommandsProperty
PrimaryCommandsProperty
PrimaryCommandsProperty

Identifies the PrimaryCommands dependency property.

SecondaryCommands
SecondaryCommands
SecondaryCommands

Gets the collection of secondary command elements for the CommandBar.

SecondaryCommandsProperty
SecondaryCommandsProperty
SecondaryCommandsProperty

Identifies the SecondaryCommands dependency property.

Events
DynamicOverflowItemsChanging
DynamicOverflowItemsChanging
DynamicOverflowItemsChanging

Occurs when items move into or out of the overflow menu.

See Also
CommandBar CommandBar CommandBar
I n this Article
Edit
Initializes a new instance of the CommandBar class.

public : CommandBar()
CommandBar() const;
public CommandBar()
CommandBar.CommandBarOverflowPresenterStyle
CommandBar.CommandBarOverflowPresenterStyle
CommandBar.CommandBarOverflowPresenterStyle
I n this Article
Edit
Gets or sets the Style applied to the overflow content of the CommandBar.
public : Style CommandBarOverflowPresenterStyle { get; set; }
Style CommandBarOverflowPresenterStyle();

void CommandBarOverflowPresenterStyle(Style commandbaroverflowpresenterstyle);


public Style CommandBarOverflowPresenterStyle { get; set; }

<CommandBar CommandBarOverflowPresenterStyle={StaticResource styleResourceKey}/>

Returns
Style
The applied Style for the overflow content of the CommandBar, if present; otherwise, null. The default is null.

Remarks
The Style element you use for a CommandBarOverflowPresenter value must specify
TargetType="CommandBarOverflowPresenter" .

You can style the properties of the internal CommandBarOverflowPresenter that is presenting the overflow content
(SecondaryCommands ) of a CommandBar. The properties that can be styled are the dependency properties of the
base ItemsControl class or Control class, such as FontSize or Padding, or base element properties such as
FrameworkElement.Margin that the CommandBarOverflowPresenter class inherits.
CommandBar.CommandBarOverflowPresenterStyle
Property CommandBar.CommandBarOverflowPresenter
StyleProperty CommandBar.CommandBarOverflow
PresenterStyleProperty
I n this Article
Edit
Identifies the CommandBarOverflowPresenterStyle dependency property.
public : static DependencyProperty CommandBarOverflowPresenterStyleProperty { get; }
static DependencyProperty CommandBarOverflowPresenterStyleProperty();
public static DependencyProperty CommandBarOverflowPresenterStyleProperty { get; }

Returns
DependencyProperty
The identifier for the CommandBarOverflowPresenterStyle dependency property.
CommandBar.CommandBarTemplateSettings Command
Bar.CommandBarTemplateSettings CommandBar.
CommandBarTemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension sources
when defining templates for a CommandBar control.
public : CommandBarTemplateSettings CommandBarTemplateSettings { get; }
CommandBarTemplateSettings CommandBarTemplateSettings();
public CommandBarTemplateSettings CommandBarTemplateSettings { get; }

Returns
CommandBarTemplateSettings
An object that provides calculated values for templates.
CommandBar.DefaultLabelPosition CommandBar.Default
LabelPosition CommandBar.DefaultLabelPosition
I n this Article
Edit
Gets or sets a value that indicates the placement and visibility of the labels on the command bar's buttons.
public : CommandBarDefaultLabelPosition DefaultLabelPosition { get; set; }
CommandBarDefaultLabelPosition DefaultLabelPosition();

void DefaultLabelPosition(CommandBarDefaultLabelPosition defaultlabelposition);


public CommandBarDefaultLabelPosition DefaultLabelPosition { get; set; }

<CommandBar DefaultLabelPosition="commandBarDefaultLabelPositionMemberName" />

Returns
CommandBarDefaultLabelPosition
An enumeration value that indicates the placement and visibility of the labels on the command bar's buttons. The
default is Bottom.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
By default, an app bar button's label is displayed below the icon. You can set this property to show labels to the right of
the icon, or to hide labels.
You can set the AppBarButton.LabelPosition property to override this value and make the label always collapsed for a
specific app bar button.
Version compatibility
The DefaultLabelPosition property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
...
</CommandBar>
private void CommandBar_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.CommandBar",
"DefaultLabelPosition"))
{
commandBar1.DefaultLabelPosition = CommandBarDefaultLabelPosition.Right;
}
}
CommandBar.DefaultLabelPositionProperty Command
Bar.DefaultLabelPositionProperty CommandBar.Default
LabelPositionProperty
I n this Article
Edit
Identifies the DefaultLabelPosition dependency property.
public : static DependencyProperty DefaultLabelPositionProperty { get; }
static DependencyProperty DefaultLabelPositionProperty();
public static DependencyProperty DefaultLabelPositionProperty { get; }

Returns
DependencyProperty
The identifier for the DefaultLabelPosition dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


CommandBar.DynamicOverflowItemsChanging
CommandBar.DynamicOverflowItemsChanging
CommandBar.DynamicOverflowItemsChanging
I n this Article
Edit
Occurs when items move into or out of the overflow menu.
public : event TypedEventHandler<CommandBar, DynamicOverflowItemsChangingEventArgs>
DynamicOverflowItemsChanging
// Register
event_token DynamicOverflowItemsChanging(TypedEventHandler<CommandBar,
DynamicOverflowItemsChangingEventArgs> const& handler) const;

// Revoke with event_token


void DynamicOverflowItemsChanging(event_token const& cookie) const;

// Revoke with event_revoker


DynamicOverflowItemsChanging_revoker DynamicOverflowItemsChanging(auto_revoke_t,
TypedEventHandler<CommandBar, DynamicOverflowItemsChangingEventArgs> const& handler) const;
public event TypedEventHandler<CommandBar, DynamicOverflowItemsChangingEventArgs>
DynamicOverflowItemsChanging

<CommandBar DynamicOverflowItemsChanging="eventhandler"/>

Remarks
For event data, see DynamicOverflowItemsChangingEventArgs.
Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default,
PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for
example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable
this behavior.
Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the
PrimaryCommands collection to SecondaryCommands.
Version compatibility
The IsDynamicOverflowEnabled event is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607
(or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a
previous version.
To avoid exceptions when your app runs on previous versions of Windows 10, do not connect this event without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
event before you use it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
...
</CommandBar>

private void CommandBar_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsEventPresent("Windows.UI.Xaml.Controls.CommandBar",
"DynamicOverflowItemsChanging"))
{
commandBar1.DynamicOverflowItemsChanging += CommandBar1_DynamicOverflowItemsChanging;
}
}

See App bar and command bar


Also
CommandBar.IsDynamicOverflowEnabled CommandBar.
IsDynamicOverflowEnabled CommandBar.IsDynamic
OverflowEnabled
I n this Article
Edit
Gets or sets a value that indicates whether primary commands automatically move to the overflow menu when space
is limited.
public : Platform::Boolean IsDynamicOverflowEnabled { get; set; }
bool IsDynamicOverflowEnabled();

void IsDynamicOverflowEnabled(bool isdynamicoverflowenabled);


public bool IsDynamicOverflowEnabled { get; set; }

<CommandBar IsDynamicOverflowEnabled="bool"/>

Returns
bool
true if primary commands automatically move to the overflow menu when space is limited; otherwise, false. The
default is true.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
For more info and guidelines, see the App bar and command bar article.
Starting in Windows 10, version 1607, CommandBar introduces a dynamic overflow feature. By default,
PrimaryCommands automatically move in or out of the overflow area as the command bar width changes, for
example, when users resize their app window. You can set the IsDynamicOverflowEnabled property to false to disable
this behavior.
Dynamic overflow affects only the UI presentation of the commands, it doesn’t move commands from the
PrimaryCommands collection to SecondaryCommands.
Version compatibility
The IsDynamicOverflowEnabled property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
Note

Dynamic overflow is available when your app is compiled for Windows 10, version 1607 and running on version 1607
(or later). Dynamic overflow is not available when your app is compiled for a previous version or is running on a
previous version.
To avoid exceptions when your app runs on previous versions of Windows 10, do not use this property without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
property before you use it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
...
</CommandBar>

private void CommandBar_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.CommandBar",
"IsDynamicOverflowEnabled"))
{
commandBar1.IsDynamicOverflowEnabled = true;
}
}
CommandBar.IsDynamicOverflowEnabledProperty
CommandBar.IsDynamicOverflowEnabledProperty
CommandBar.IsDynamicOverflowEnabledProperty
I n this Article
Edit
Identifies the IsDynamicOverflowEnabled dependency property.
public : static DependencyProperty IsDynamicOverflowEnabledProperty { get; }
static DependencyProperty IsDynamicOverflowEnabledProperty();
public static DependencyProperty IsDynamicOverflowEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsDynamicOverflowEnabled dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


CommandBar.OverflowButtonVisibility CommandBar.
OverflowButtonVisibility CommandBar.OverflowButton
Visibility
I n this Article
Edit
Gets or sets a value that indicates when a command bar's overflow button is shown.
public : CommandBarOverflowButtonVisibility OverflowButtonVisibility { get; set; }
CommandBarOverflowButtonVisibility OverflowButtonVisibility();

void OverflowButtonVisibility(CommandBarOverflowButtonVisibility overflowbuttonvisibility);


public CommandBarOverflowButtonVisibility OverflowButtonVisibility { get; set; }

<CommandBar OverflowButtonVisibility="commandBarOverflowButtonVisibilityMemberName" />

Returns
CommandBarOverflowButtonVisibility
An enumeration value that indicates when a command bar's overflow button is shown. The default is Auto.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


CommandBar.OverflowButtonVisibilityProperty
CommandBar.OverflowButtonVisibilityProperty
CommandBar.OverflowButtonVisibilityProperty
I n this Article
Edit
Identifies the OverflowButtonVisibility dependency property.
public : static DependencyProperty OverflowButtonVisibilityProperty { get; }
static DependencyProperty OverflowButtonVisibilityProperty();
public static DependencyProperty OverflowButtonVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the OverflowButtonVisibility dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


CommandBar.PrimaryCommands CommandBar.Primary
Commands CommandBar.PrimaryCommands
I n this Article
Edit
Gets the collection of primary command elements for the CommandBar.
public : IObservableVector<ICommandBarElement> PrimaryCommands { get; }
IObservableVector<ICommandBarElement> PrimaryCommands();
public IObservableVector<ICommandBarElement> PrimaryCommands { get; }

<CommandBar>
<CommandBar.PrimaryCommands>
commandBarElements
</CommandBar.PrimaryCommands>
</CommandBar>

Returns
IObservableVector<ICommandBarElement>
The collection of primary command elements for the CommandBar. The default is an empty collection.

Remarks
The PrimaryCommands collection can contain only AppBarButton, AppBarToggleButton, or AppBarSeparator
command elements. The primary commands are shown on the right side of the CommandBar, to the left of the More
button (...) when the FlowDirection is LeftToRight. The layout is reversed when the FlowDirection is RightToLeft.
CommandBar.PrimaryCommandsProperty CommandBar.
PrimaryCommandsProperty CommandBar.Primary
CommandsProperty
I n this Article
Edit
Identifies the PrimaryCommands dependency property.
public : static DependencyProperty PrimaryCommandsProperty { get; }
static DependencyProperty PrimaryCommandsProperty();
public static DependencyProperty PrimaryCommandsProperty { get; }

Returns
DependencyProperty
The identifier for the PrimaryCommands dependency property.
CommandBar.SecondaryCommands CommandBar.
SecondaryCommands CommandBar.Secondary
Commands
I n this Article
Edit
Gets the collection of secondary command elements for the CommandBar.
public : IObservableVector<ICommandBarElement> SecondaryCommands { get; }
IObservableVector<ICommandBarElement> SecondaryCommands();
public IObservableVector<ICommandBarElement> SecondaryCommands { get; }

<CommandBar>
<CommandBar.SecondaryCommands>
commandBarElements
</CommandBar.SecondaryCommands>
</CommandBar>

Returns
IObservableVector<ICommandBarElement>
The collection of secondary command elements for the CommandBar. The default is an empty collection.

Remarks
The SecondaryCommands collection can contain only AppBarButton, AppBarToggleButton, or AppBarSeparator
command elements. The secondary commands are shown in the overflow menu when the CommandBar is open.
CommandBar.SecondaryCommandsProperty Command
Bar.SecondaryCommandsProperty CommandBar.
SecondaryCommandsProperty
I n this Article
Edit
Identifies the SecondaryCommands dependency property.
public : static DependencyProperty SecondaryCommandsProperty { get; }
static DependencyProperty SecondaryCommandsProperty();
public static DependencyProperty SecondaryCommandsProperty { get; }

Returns
DependencyProperty
The identifier for the SecondaryCommands dependency property.
CommandBarDefaultLabelPosition CommandBarDefault
LabelPosition CommandBarDefaultLabelPosition Enum
Defines constants that specify the placement and visibility of AppBarButton labels in a CommandBar.

D eclaration
public : enum class CommandBarDefaultLabelPosition
enum class winrt::Windows::UI::Xaml::Controls::CommandBarDefaultLabelPosition : int32_t
public enum CommandBarDefaultLabelPosition

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the CommandBar.DefaultLabelPosition property.

Fields
Bottom Bottom Bottom App bar button labels are shown below the icon. Labels are visible only when the command
bar is open.

Collapsed Collapsed App bar button labels are always hidden whether the command bar is open or closed.
Collapsed

Right Right Right App bar button labels are shown to the right of the icon. Labels are visible even when the
command bar is closed.
CommandBarDynamicOverflowAction CommandBar
DynamicOverflowAction CommandBarDynamicOverflow
Action Enum
Defines constants that specify whether items were added to or removed from the CommandBar overflow menu.

D eclaration
public : enum class CommandBarDynamicOverflowAction
enum class winrt::Windows::UI::Xaml::Controls::CommandBarDynamicOverflowAction : int32_t
public enum CommandBarDynamicOverflowAction

I nheritance H ierarchy
None

Fields
AddingToOverflow AddingToOverflow AddingToOverflow Items are added to the overflow menu.

RemovingFromOverflow RemovingFromOverflow Items are removed from the overflow


RemovingFromOverflow menu.
CommandBarFlyout CommandBarFlyout CommandBar
Flyout Class
Represents a specialized flyout that provides layout for AppBarButton and related command elements.

D eclaration
public : class CommandBarFlyout : FlyoutBase, ICommandBarFlyout
struct winrt::Windows::UI::Xaml::Controls::CommandBarFlyout : FlyoutBase, ICommandBarFlyout
public class CommandBarFlyout : FlyoutBase, ICommandBarFlyout

I nheritance H ierarchy
DependencyObject
FlyoutBase

Constructors
CommandBarFlyout()
CommandBarFlyout()
CommandBarFlyout()

Initializes a new instance of the CommandBarFlyout class.

Properties
PrimaryCommands
PrimaryCommands
PrimaryCommands

Gets the collection of primary command elements for the CommandBarFlyout.

SecondaryCommands
SecondaryCommands
SecondaryCommands

Gets the collection of secondary command elements for the CommandBarFlyout.


CommandBarFlyout CommandBarFlyout CommandBar
Flyout
I n this Article
Edit
Initializes a new instance of the CommandBarFlyout class.
public : CommandBarFlyout()
CommandBarFlyout() const;
public CommandBarFlyout()
CommandBarFlyout.PrimaryCommands CommandBar
Flyout.PrimaryCommands CommandBarFlyout.Primary
Commands
I n this Article
Edit
Gets the collection of primary command elements for the CommandBarFlyout.
public : IObservableVector<ICommandBarElement> PrimaryCommands { get; }
IObservableVector<ICommandBarElement> PrimaryCommands();
public IObservableVector<ICommandBarElement> PrimaryCommands { get; }

<CommandBarFlyout>
<CommandBarFlyout.PrimaryCommands>
commandBarElements
</CommandBarFlyout.PrimaryCommands>
</CommandBarFlyout>

Returns
IObservableVector<ICommandBarElement>
The collection of primary command elements for the CommandBarFlyout. The default is an empty collection.

Remarks
The PrimaryCommands collection can directly contain only AppBarButton, AppBarToggleButton, AppBarSeparator
command elements. Other elements must be wrapped in an AppBarElementContainer.
The primary commands are shown in the command bar portion of the flyout.
CommandBarFlyout.SecondaryCommands CommandBar
Flyout.SecondaryCommands CommandBarFlyout.
SecondaryCommands
I n this Article
Edit
Gets the collection of secondary command elements for the CommandBarFlyout.
public : IObservableVector<ICommandBarElement> SecondaryCommands { get; }
IObservableVector<ICommandBarElement> SecondaryCommands();
public IObservableVector<ICommandBarElement> SecondaryCommands { get; }

<CommandBarFlyout>
<CommandBarFlyout.SecondaryCommands>
commandBarElements
</CommandBarFlyout.SecondaryCommands>
</CommandBarFlyout>

Returns
IObservableVector<ICommandBarElement>
The collection of secondary command elements for the CommandBarFlyout. The default is an empty collection.

Remarks
The SecondaryCommands collection can directly contain only AppBarButton, AppBarToggleButton, or
AppBarSeparator command elements. Other elements must be wrapped in an AppBarElementContainer.
The secondary commands are shown in the menu portion of the flyout when the CommandBarFlyout is expanded.
CommandBarLabelPosition CommandBarLabelPosition
CommandBarLabelPosition Enum
Defines constants that specify the placement and visibility of an app bar button's label.

D eclaration
public : enum class CommandBarLabelPosition
enum class winrt::Windows::UI::Xaml::Controls::CommandBarLabelPosition : int32_t
public enum CommandBarLabelPosition

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the LabelPosition property on AppBarButton and AppBarToggleButton.

Fields
Collapsed Collapsed The app bar button's label is always hidden whether the command bar is open or closed.
Collapsed

Default Default The placement and visibility of the app bar button's label is determined by the value of the
Default CommandBar.DefaultLabelPosition property.
CommandBarOverflowButtonVisibility CommandBar
OverflowButtonVisibility CommandBarOverflowButton
Visibility Enum
Defines constants that specify when a command bar's overflow button is shown.

D eclaration
public : enum class CommandBarOverflowButtonVisibility
enum class winrt::Windows::UI::Xaml::Controls::CommandBarOverflowButtonVisibility : int32_t
public enum CommandBarOverflowButtonVisibility

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the CommandBar.OverflowButtonVisibility property.

Fields
Auto Auto Auto The overflow button automatically hides when there are no secondary commands and the closed
state of the CommandBar is the same as the open state.

Collapsed The overflow button is never shown.


Collapsed
Collapsed

Visible Visible The overflow button is always shown.


Visible
CommandBarOverflowPresenter CommandBarOverflow
Presenter CommandBarOverflowPresenter Class
Displays the overflow content of a CommandBar.

D eclaration
public : class CommandBarOverflowPresenter : ItemsControl, ICommandBarOverflowPresenter
struct winrt::Windows::UI::Xaml::Controls::CommandBarOverflowPresenter : ItemsControl,
ICommandBarOverflowPresenter
public class CommandBarOverflowPresenter : ItemsControl, ICommandBarOverflowPresenter

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl

Remarks
You don't typically declare object elements for CommandBarOverflowPresenter in XAML. There are no properties that
a CommandBarOverflowPresenter can set in XAML syntax and there's no reason to declare a
CommandBarOverflowPresenter as a resource.
The main purpose of the CommandBarOverflowPresenter class is to be the default internal presenter for the
SecondaryCommands value of a CommandBar. You extend presentation behavior of the
CommandBarOverflowPresenter by setting a value for the CommandBarOverflowPresenterStyle property of the
CommandBar. The Style you declare that fills the CommandBarOverflowPresenterStyle property must specify
TargetType="CommandBarOverflowPresenter" . The properties that can be styled are the dependency properties of the
base ItemsControl class or Control class, such as FontSize or Padding, or base element properties such as
FrameworkElement.Margin that the CommandBarOverflowPresenter class inherits.
CommandBarOverflowPresenter exists as a class and has a default constructor basically to satisfy XAML infrastructure
support, when it's specified as the TargetType of the Style used for a CommandBarOverflowPresenterStyle value.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the CommandBarOverflowPresenter control.
R ES O U R CE K EY D ES CR IPTIO N

CommandBarOverflowPresenterBackground Background color at rest

CommandBarOverflowPresenterBorderBrush Border color at rest

Constructors
CommandBarOverflowPresenter()
CommandBarOverflowPresenter()
CommandBarOverflowPresenter()

Initializes a new instance of the CommandBarOverflowPresenter class.

See Also
ItemsControl
ItemsControl
CommandBarOverflowPresenter CommandBarOverflow
Presenter CommandBarOverflowPresenter
I n this Article
Edit
Initializes a new instance of the CommandBarOverflowPresenter class.
public : CommandBarOverflowPresenter()
CommandBarOverflowPresenter() const;
public CommandBarOverflowPresenter()
ContainerContentChangingEventArgs ContainerContent
ChangingEventArgs ContainerContentChangingEvent
Args Class
Provides data for the ContainerContentChanging event.

D eclaration
public : sealed class ContainerContentChangingEventArgs : IContainerContentChangingEventArgs
struct winrt::Windows::UI::Xaml::Controls::ContainerContentChangingEventArgs :
IContainerContentChangingEventArgs
public sealed class ContainerContentChangingEventArgs : IContainerContentChangingEventArgs

I nheritance H ierarchy
None

Constructors
ContainerContentChangingEventArgs()
ContainerContentChangingEventArgs()
ContainerContentChangingEventArgs()

Initializes a new instance of the ContainerContentChangingEventArgs class.

Properties
Handled
Handled
Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers
along the event route from handling the same event again.

InRecycleQueue
InRecycleQueue
InRecycleQueue

Gets a value that indicates whether this container is in the recycle queue of the ListViewBase and is not being used
to visualize a data item.

Item
Item
Item

Gets the data item associated with this container.


ItemContainer
ItemContainer
ItemContainer

Gets the UI container used to display the current data item.

ItemIndex
ItemIndex
ItemIndex

Gets the index in the ItemsSource of the data item associated with this container.

Phase
Phase
Phase

Gets the number of times this container and data item pair has been called.

Methods
RegisterUpdateCallback(UInt32, TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>)
RegisterUpdateCallback(UInt32, TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>)
RegisterUpdateCallback(UInt32, TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>)

Registers the event handler to be called again during the specified phase.

RegisterUpdateCallback(TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>)
RegisterUpdateCallback(TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>)
RegisterUpdateCallback(TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>)

Registers the event handler to be called again during the next phase.
ContainerContentChangingEventArgs ContainerContent
ChangingEventArgs ContainerContentChangingEvent
Args
I n this Article
Edit
Initializes a new instance of the ContainerContentChangingEventArgs class.
public : ContainerContentChangingEventArgs()
ContainerContentChangingEventArgs() const;
public ContainerContentChangingEventArgs()
ContainerContentChangingEventArgs.Handled Container
ContentChangingEventArgs.Handled ContainerContent
ChangingEventArgs.Handled
I n this Article
Edit
Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along
the event route from handling the same event again.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
true to mark the routed event handled. false to leave the routed event unhandled, which permits the event to
potentially route further and be acted on by other handlers. The default is false.
ContainerContentChangingEventArgs.InRecycleQueue
ContainerContentChangingEventArgs.InRecycleQueue
ContainerContentChangingEventArgs.InRecycleQueue
I n this Article
Edit
Gets a value that indicates whether this container is in the recycle queue of the ListViewBase and is not being used to
visualize a data item.
public : Platform::Boolean InRecycleQueue { get; }
bool InRecycleQueue();
public bool InRecycleQueue { get; }

Returns
bool
true if the container is in the recycle queue of the ListViewBase; otherwise, false.

Remarks
You can check this property in a ContainerContentChanging event to determine if you should release references to the
data item. If this property is true, ItemIndex is -1 and Item is null.
ContainerContentChangingEventArgs.Item Container
ContentChangingEventArgs.Item ContainerContent
ChangingEventArgs.Item
I n this Article
Edit
Gets the data item associated with this container.
public : Platform::Object Item { get; }
winrt::Windows::Foundation::IInspectable Item();
public object Item { get; }

Returns
object
The data item associated with this container, or null if no data is associated with this container.
ContainerContentChangingEventArgs.ItemContainer
ContainerContentChangingEventArgs.ItemContainer
ContainerContentChangingEventArgs.ItemContainer
I n this Article
Edit
Gets the UI container used to display the current data item.
public : SelectorItem ItemContainer { get; }
SelectorItem ItemContainer();
public SelectorItem ItemContainer { get; }

Returns
SelectorItem
The UI container used to display the current data item.

Remarks
Use this container to visualize data.
ContainerContentChangingEventArgs.ItemIndex
ContainerContentChangingEventArgs.ItemIndex
ContainerContentChangingEventArgs.ItemIndex
I n this Article
Edit
Gets the index in the ItemsSource of the data item associated with this container.
public : int ItemIndex { get; }
int32_t ItemIndex();
public int ItemIndex { get; }

Returns
int
The index in the ItemsSource of the data item associated with this container. The default is -1.
ContainerContentChangingEventArgs.Phase Container
ContentChangingEventArgs.Phase ContainerContent
ChangingEventArgs.Phase
I n this Article
Edit
Gets the number of times this container and data item pair has been called.
public : unsigned int Phase { get; }
uint32_t Phase();
public uint Phase { get; }

Returns
uint
The number of times this container and data item pair has been called.
ContainerContentChangingEventArgs.RegisterUpdate
Callback ContainerContentChangingEventArgs.Register
UpdateCallback ContainerContentChangingEventArgs.
RegisterUpdateCallback
I n this Article

Overloads
RegisterUpdateCallback(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>) RegisterUpdate Registers the event handler to be called again during the next
Callback(TypedEventHandler<ListViewBase, ContainerContent phase.
ChangingEventArgs>) RegisterUpdateCallback(TypedEvent
Handler<ListViewBase, ContainerContentChangingEvent
Args>)

RegisterUpdateCallback(UInt32, TypedEventHandler<ListView
Base, ContainerContentChangingEventArgs>) RegisterUpdate Registers the event handler to be called again during the
Callback(UInt32, TypedEventHandler<ListViewBase, Container specified phase.
ContentChangingEventArgs>) RegisterUpdateCallback(UInt32,
TypedEventHandler<ListViewBase, ContainerContentChanging
EventArgs>)

RegisterUpdateCallback(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)
RegisterUpdateCallback(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)
RegisterUpdateCallback(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)
Edit
Registers the event handler to be called again during the next phase.
public : void RegisterUpdateCallback(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs> callback)
void RegisterUpdateCallback(TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>
callback) const;
public void RegisterUpdateCallback(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs> callback)

Parameters
callback TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>
The event handler function.
Attributes OverloadAttribute
See
Also
RegisterUpdateCallback(UInt32, TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)RegisterUpdateCallback(UInt32, TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)RegisterUpdateCallback(UInt32, TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)

RegisterUpdateCallback(UInt32,
TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)
RegisterUpdateCallback(UInt32,
TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)
RegisterUpdateCallback(UInt32,
TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)
Edit
Registers the event handler to be called again during the specified phase.

public : void RegisterUpdateCallback(unsigned int callbackPhase, TypedEventHandler<ListViewBase,


ContainerContentChangingEventArgs> callback)
void RegisterUpdateCallback(uint32_t callbackPhase, TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs> callback) const;
public void RegisterUpdateCallback(UInt32 callbackPhase, TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs> callback)

Parameters
callbackPhase UInt32
The phase during which the callback should occur.
callback TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>
The event handler function.
Attributes OverloadAttribute
See
Also
RegisterUpdateCallback(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)RegisterUpdateCallback(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)RegisterUpdateCallback(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs>)
ContentControl ContentControl ContentControl Class
Represents a control with a single piece of content. Controls such as Button, CheckBox, and ScrollViewer directly or
indirectly inherit from this class.

D eclaration
public : class ContentControl : Control, IContentControl, IContentControl2,
IContentControlOverrides
struct winrt::Windows::UI::Xaml::Controls::ContentControl : Control, IContentControl,
IContentControl2, IContentControlOverrides
public class ContentControl : Control, IContentControl, IContentControl2,
IContentControlOverrides

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
The Content property of a ContentControl can be any type of object, such as a string, a UIElement, or a DateTime. By
default, when the Content property is set to a UIElement, the UIElement is displayed in the ContentControl. When
Content is set to another type of object, a string representation of the object is displayed in the ContentControl. A
ContentControl has a limited default style. If you want to enhance the appearance of the control, you can create a new
DataTemplate and set it to the ContentTemplate property of the control.
A ContentControl can use a string as the value for its Content property. However, whether a string is useful as content,
and how it displays, is potentially handled differently by each control that derives from ContentControl. Specifically, the
ability to display a content string is related to how a control uses a ContentPresenter in its compositing. This behavior
can also change by applying a custom control template to an existing control. Examples of content controls where
string content displays by default include Button and related button controls. Frame is an example of a ContentControl
that does not display string content. If a ContentControl doesn't have a ContentPresenter within it that has a
{TemplateBinding} markup extension for ContentControl.Content to ContentPresenter.Content, then the value of
ContentControl.Content might not display anywhere.
Note that string content is specifically enabled only on ContentControl, not Control. For example, TextBox does not
support string content like this: <TextBox>Initial text</TextBox> , because it is not derived from ContentControl.
Rather than using a literal string, a ContentControl might use a reference to a string that is defined in a resource
dictionary, or a binding. Either of these techniques can simplify the task of localizing the parts of the UI that are defined
in Extensible Application Markup Language (XAML ), by gathering the necessary string resources in one location rather
than scattered throughout various Extensible Application Markup Language (XAML ) files. Because apps usually need a
way to maintain strings as resources for localization reasons or for general versatility, it is more common to not use
string content, and to instead set Content as an attribute, with a value that is a {Binding} or {StaticResource}.
Instead of text, a ContentControl might also display a single element for its own visual root, but using some container
or panel so that there can be further UI compositing within. For example, if you really wanted to, you could declare a
StackPanel for adaptive layout within a Button as its Content, and then the Button would appear to have multiple UI
child elements that are children of the StackPanel.
ContentControl derived classes
ContentControl is the parent class for these immediately derived control classes:
AppBar
ButtonBase
FlyoutPresenter
Frame
GroupItem
ListViewBaseHeaderItem
ScrollViewer
SelectorItem
SettingsFlyout
ToolTip
Note

Page is a UserControl, not a ContentControl. ListView and GridView (and others) descend from ItemsControl.

Constructors
ContentControl()
ContentControl()
ContentControl()

Initializes a new instance of the ContentControl class.

Properties
Content
Content
Content

Gets or sets the content of a ContentControl.

ContentProperty
ContentProperty
ContentProperty

Identifies the Content dependency property.

ContentTemplate
ContentTemplate
ContentTemplate

Gets or sets the data template that is used to display the content of the ContentControl.

ContentTemplateProperty
ContentTemplateProperty
ContentTemplateProperty

Identifies the ContentTemplate dependency property


ContentTemplateRoot
ContentTemplateRoot
ContentTemplateRoot

Gets the root element of the data template specified by the ContentTemplate property.

ContentTemplateSelector
ContentTemplateSelector
ContentTemplateSelector

Gets or sets a selection object that changes the DataTemplate to apply for content, based on processing
information about the content item or its container at run time.

ContentTemplateSelectorProperty
ContentTemplateSelectorProperty
ContentTemplateSelectorProperty

Identifies the ContentTemplateSelector dependency property.

ContentTransitions
ContentTransitions
ContentTransitions

Gets or sets the collection of Transition style elements that apply to the content of a ContentControl.

ContentTransitionsProperty
ContentTransitionsProperty
ContentTransitionsProperty

Identifies the ContentTransitions dependency property.

Methods
OnContentChanged(Object, Object)
OnContentChanged(Object, Object)
OnContentChanged(Object, Object)

Invoked when the value of the Content property changes.

OnContentTemplateChanged(DataTemplate, DataTemplate)
OnContentTemplateChanged(DataTemplate, DataTemplate)
OnContentTemplateChanged(DataTemplate, DataTemplate)

Invoked when the value of the ContentTemplate property changes.

OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)

Invoked when the value of the ContentTemplateSelector property changes.

See Also
Control
Control
ContentControl.Content ContentControl.Content
ContentControl.Content
I n this Article
Edit
Gets or sets the content of a ContentControl.
public : Platform::Object Content { get; set; }
winrt::Windows::Foundation::IInspectable Content();

void Content(winrt::Windows::Foundation::IInspectable content);


public object Content { get; set; }

<contentControl>
singleObject
</contentControl>
-or-
<contentControl>stringContent</contentControl>

Returns
object
An object that contains the control's content. The default is null.
ContentControl ContentControl ContentControl
I n this Article
Edit
Initializes a new instance of the ContentControl class.

public : ContentControl()
ContentControl() const;
public ContentControl()
ContentControl.ContentProperty ContentControl.
ContentProperty ContentControl.ContentProperty
I n this Article
Edit
Identifies the Content dependency property.
public : static DependencyProperty ContentProperty { get; }
static DependencyProperty ContentProperty();
public static DependencyProperty ContentProperty { get; }

Returns
DependencyProperty
The identifier for the Content dependency property.
ContentControl.ContentTemplate ContentControl.
ContentTemplate ContentControl.ContentTemplate
I n this Article
Edit
Gets or sets the data template that is used to display the content of the ContentControl.
public : DataTemplate ContentTemplate { get; set; }
DataTemplate ContentTemplate();

void ContentTemplate(DataTemplate contenttemplate);


public DataTemplate ContentTemplate { get; set; }

<contentControl>
<contentControl.ContentTemplate>
dataTemplate
</contentControl.ContentTemplate>
</contentControl>

Returns
DataTemplate
The data template that is used to display the content of the ContentControl.

Remarks
Instead of declaring a fixed DataTemplate, you can also implement a DataTemplateSelector and use it to set the
ContentTemplateSelector property. This technique enables custom template switching based on input data, at the
application level. For more information, see DataTemplateSelector.
ContentControl.ContentTemplateProperty Content
Control.ContentTemplateProperty ContentControl.
ContentTemplateProperty
I n this Article
Edit
Identifies the ContentTemplate dependency property
public : static DependencyProperty ContentTemplateProperty { get; }
static DependencyProperty ContentTemplateProperty();
public static DependencyProperty ContentTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the ContentTemplate dependency property.
ContentControl.ContentTemplateRoot ContentControl.
ContentTemplateRoot ContentControl.ContentTemplate
Root
I n this Article
Edit
Gets the root element of the data template specified by the ContentTemplate property.
public : UIElement ContentTemplateRoot { get; }
UIElement ContentTemplateRoot();
public UIElement ContentTemplateRoot { get; }

Returns
UIElement
The root element of the data template specified by the ContentTemplate property. The default is null.
ContentControl.ContentTemplateSelector Content
Control.ContentTemplateSelector ContentControl.
ContentTemplateSelector
I n this Article
Edit
Gets or sets a selection object that changes the DataTemplate to apply for content, based on processing information
about the content item or its container at run time.
public : DataTemplateSelector ContentTemplateSelector { get; set; }
DataTemplateSelector ContentTemplateSelector();

void ContentTemplateSelector(DataTemplateSelector contenttemplateselector);


public DataTemplateSelector ContentTemplateSelector { get; set; }

<contentControl ContentTemplateSelector="selectorReference" />

Returns
DataTemplateSelector
A selection object that changes the DataTemplate to apply for content.
See DataTemplateSelector
Also
ContentControl.ContentTemplateSelectorProperty
ContentControl.ContentTemplateSelectorProperty
ContentControl.ContentTemplateSelectorProperty
I n this Article
Edit
Identifies the ContentTemplateSelector dependency property.
public : static DependencyProperty ContentTemplateSelectorProperty { get; }
static DependencyProperty ContentTemplateSelectorProperty();
public static DependencyProperty ContentTemplateSelectorProperty { get; }

Returns
DependencyProperty
The identifier for the ContentTemplateSelector dependency property.
ContentControl.ContentTransitions ContentControl.
ContentTransitions ContentControl.ContentTransitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to the content of a ContentControl.
public : TransitionCollection ContentTransitions { get; set; }
TransitionCollection ContentTransitions();

void ContentTransitions(TransitionCollection contenttransitions);


public TransitionCollection ContentTransitions { get; set; }

<contentControl>
<contentControl.ContentTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</contentControl.ContentTransitions>
</contentControl>

Returns
TransitionCollection
The strongly typed collection of Transition style elements.

Remarks
Note

Prior to Windows 10, version 1809 (SDK 17763), the XAML syntax for properties that have a TransitionCollection
value requires that you declare an explicit TransitionCollection object element as the value, and then provide object
elements as child elements of TransitionCollection for each of the transition animations you want to use. In Windows
10, version 1809 (SDK 17763) or later, TransitionCollection supports the implicit collection usage, so you can omit the
collection object element. For more info on implicit collections and XAML, see XAML syntax guide.
Transition animations play a particular role in UI design of your app. The basic idea is that when there is a change or
transition, the animation draws the attention of the user to the change.
It's not common to set the value of the ContentTransitions property directly on a ContentControl type that is a direct
element of app UI. It's more common to have a transitions collection be a part of a visual state, template or style. In this
case you use mechanisms such as Setter of a Style to specify the ContentTransitions property. Styles are typically
stored as a XAML resource.
ContentControl.ContentTransitionsProperty Content
Control.ContentTransitionsProperty ContentControl.
ContentTransitionsProperty
I n this Article
Edit
Identifies the ContentTransitions dependency property.
public : static DependencyProperty ContentTransitionsProperty { get; }
static DependencyProperty ContentTransitionsProperty();
public static DependencyProperty ContentTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the ContentTransitions dependency property.
ContentControl.OnContentChanged ContentControl.On
ContentChanged ContentControl.OnContentChanged
I n this Article
Edit
Invoked when the value of the Content property changes.
protected : virtual void OnContentChanged(Platform::Object oldContent, Platform::Object newContent)
virtual void OnContentChanged(winrt::Windows::Foundation::IInspectable oldContent,
winrt::Windows::Foundation::IInspectable newContent) const;
protected virtual void OnContentChanged(Object oldContent, Object newContent)

Parameters
oldContent Object
The old value of the Content property.
newContent Object
The new value of the Content property.

Remarks
If a value for ContentTemplateSelector exists, then the default implementation calls SelectTemplate on the
implemented DataTemplateSelector, passing the newContent value as item, and the calling ContentControl as
container. The return value then sets ContentTemplate automatically on the caller.
ContentControl.OnContentTemplateChanged Content
Control.OnContentTemplateChanged ContentControl.On
ContentTemplateChanged
I n this Article
Edit
Invoked when the value of the ContentTemplate property changes.
protected : virtual void OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate
newContentTemplate)
virtual void OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate
newContentTemplate) const;
protected virtual void OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate
newContentTemplate)

Parameters
oldContentTemplate DataTemplate
The old value of the ContentTemplate property.
newContentTemplate DataTemplate
The new value of the ContentTemplate property.

Remarks
Classes that derive from ContentControl can override this method in order to perform any custom logic that should
apply, in cases where the DataTemplate that presents the content changes.
ContentControl.OnContentTemplateSelectorChanged
ContentControl.OnContentTemplateSelectorChanged
ContentControl.OnContentTemplateSelectorChanged
I n this Article
Edit
Invoked when the value of the ContentTemplateSelector property changes.
protected : virtual void OnContentTemplateSelectorChanged(DataTemplateSelector
oldContentTemplateSelector, DataTemplateSelector newContentTemplateSelector)
virtual void OnContentTemplateSelectorChanged(DataTemplateSelector oldContentTemplateSelector,
DataTemplateSelector newContentTemplateSelector) const;
protected virtual void OnContentTemplateSelectorChanged(DataTemplateSelector
oldContentTemplateSelector, DataTemplateSelector newContentTemplateSelector)

Parameters
oldContentTemplateSelector DataTemplateSelector
The old value of the ContentTemplateSelector property.
newContentTemplateSelector DataTemplateSelector
The new value of the ContentTemplateSelector property.

Remarks
Classes that derive from ContentControl can override this method in order to perform any custom logic that should
apply, in cases where the selector logic that automatically chooses the DataTemplate based on context changes.
ContentDialog ContentDialog ContentDialog Class
Represents a dialog box that can be customized to contain checkboxes, hyperlinks, buttons and any other XAML
content.

D eclaration
public : class ContentDialog : ContentControl, IContentDialog, IContentDialog2, IContentDialog3
struct winrt::Windows::UI::Xaml::Controls::ContentDialog : ContentControl, IContentDialog,
IContentDialog2, IContentDialog3
public class ContentDialog : ContentControl, IContentDialog, IContentDialog2, IContentDialog3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
 Tip

For more info, design guidance, and code examples, see Dialog controls.
Use a ContentDialog to request input from the user, or to show information in a modal dialog. You can add a
ContentDialog to an app page using code or XAML, or you can create a custom dialog class that's derived from
ContentDialog. Both ways are shown in the examples section of this topic.
Use the Title property to put a title on the dialog. To add a complex title element with more than simple text, you can
use the TitleTemplate property.
The ContentDialog has 3 built-in buttons that describe the actions that the user may take in response to the dialog's
prompt. All dialogs should have a safe, non-destructive action. Dialogs may also optionally contain one or two specific
"do it" actions in response to the prompt.
Use the CloseButtonText and property to set the display text for the safe, non-destructive button. The dialog's close
button will also be invoked when the user performs a Cancel action, like pressing the ESC key or pressing the system
back button. Use the PrimaryButtonText and SecondaryButtonText properties to display responses to the main
question or action posed by the dialog.
The CloseButtonText property is not available prior to Windows 10, version 1703. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you should use the SecondaryButtonText property instead. For more info, see Version adaptive code.
To show the dialog, call the ShowAsync method. Use the result of this method to determine which of the buttons was
clicked, if any button was clicked. If the user presses ESC, the system back arrow, or Gamepad B, the result of this
method will be None.
You may optionally choose to differentiate one of the three buttons as the dialog's default button. Use the
DefaultButton property to differentiate one of the buttons. This button will receive the Accent Button visual treatment,
respond to the ENTER key automatically, and receive focus when the Dialog is opened unless the dialog's content
contains focusable elements.
You may wish to do some work before the dialog closes (for example, to verify that the user entered into form fields
before submitting a request). You have two ways to do work before the dialog closes. You can handle the
PrimaryButtonClick, SecondaryButtonClick, or CloseButtonClick events to get the user's response when the user
presses a button and verify the state of the dialog before it closes. You can also handle the Closing event to do work
before the dialog closes.
Only one ContentDialog can be shown at a time. To chain together more than one ContentDialog, handle the Closing
event of the first ContentDialog. In the Closing event handler, call ShowAsync on the second dialog to show it.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the ContentDialog control.

R ES O U R CE K EY D ES CR IPTIO N

ContentDialogForeground Text color in dialog

ContentDialogBackground Background color

ContentDialogBorderBrush Border color

Constructors
ContentDialog()
ContentDialog()
ContentDialog()

Initializes a new instance of the ContentDialog class.

Properties
CloseButtonCommand
CloseButtonCommand
CloseButtonCommand

Gets or sets the command to invoke when the close button is tapped.

CloseButtonCommandParameter
CloseButtonCommandParameter
CloseButtonCommandParameter
Gets or sets the parameter to pass to the command for the close button.

CloseButtonCommandParameterProperty
CloseButtonCommandParameterProperty
CloseButtonCommandParameterProperty

Gets the identifier of the CloseButtonCommandParameter dependency property.

CloseButtonCommandProperty
CloseButtonCommandProperty
CloseButtonCommandProperty

Gets the identifier of the CloseButtonCommand dependency property.

CloseButtonStyle
CloseButtonStyle
CloseButtonStyle

Gets or sets the Style to apply to the dialog's close button.

CloseButtonStyleProperty
CloseButtonStyleProperty
CloseButtonStyleProperty

Gets the identifier of the CloseButtonStyle dependency property.

CloseButtonText
CloseButtonText
CloseButtonText

Gets or sets the text to display on the close button.

CloseButtonTextProperty
CloseButtonTextProperty
CloseButtonTextProperty

Gets the identifier of the CloseButtonText dependency property.

DefaultButton
DefaultButton
DefaultButton

Gets or sets a value that indicates which button on the dialog is the default action.
DefaultButtonProperty
DefaultButtonProperty
DefaultButtonProperty

Gets the identifier of the DefaultButton dependency property.

FullSizeDesired
FullSizeDesired
FullSizeDesired

Gets or sets a value that indicates whether a request is being made to display the dialog full screen.

FullSizeDesiredProperty
FullSizeDesiredProperty
FullSizeDesiredProperty

Gets the identifier of the FullSizeDesired dependency property.

IsPrimaryButtonEnabled
IsPrimaryButtonEnabled
IsPrimaryButtonEnabled

Gets or sets whether the dialog's primary button is enabled.

IsPrimaryButtonEnabledProperty
IsPrimaryButtonEnabledProperty
IsPrimaryButtonEnabledProperty

Gets the identifier of the IsPrimaryButtonEnabled dependency property.

IsSecondaryButtonEnabled
IsSecondaryButtonEnabled
IsSecondaryButtonEnabled

Gets or sets whether the dialog's secondary button is enabled.

IsSecondaryButtonEnabledProperty
IsSecondaryButtonEnabledProperty
IsSecondaryButtonEnabledProperty

Gets the identifier of the IsSecondaryButtonEnabled dependency property.

PrimaryButtonCommand
PrimaryButtonCommand
PrimaryButtonCommand
Gets or sets the command to invoke when the primary button is tapped.

PrimaryButtonCommandParameter
PrimaryButtonCommandParameter
PrimaryButtonCommandParameter

Gets or sets the parameter to pass to the command for the primary button.

PrimaryButtonCommandParameterProperty
PrimaryButtonCommandParameterProperty
PrimaryButtonCommandParameterProperty

Gets the identifier of the PrimaryButtonCommandParameter dependency property.

PrimaryButtonCommandProperty
PrimaryButtonCommandProperty
PrimaryButtonCommandProperty

Gets the identifier of the PrimaryButtonCommand dependency property.

PrimaryButtonStyle
PrimaryButtonStyle
PrimaryButtonStyle

Gets or sets the Style to apply to the dialog's primary button.

PrimaryButtonStyleProperty
PrimaryButtonStyleProperty
PrimaryButtonStyleProperty

Gets the identifier of the PrimaryButtonStyle dependency property.

PrimaryButtonText
PrimaryButtonText
PrimaryButtonText

Gets or sets the text to display on the primary button.

PrimaryButtonTextProperty
PrimaryButtonTextProperty
PrimaryButtonTextProperty

Gets the identifier of the PrimaryButtonText dependency property.


SecondaryButtonCommand
SecondaryButtonCommand
SecondaryButtonCommand

Gets or sets the command to invoke when the secondary button is tapped.

SecondaryButtonCommandParameter
SecondaryButtonCommandParameter
SecondaryButtonCommandParameter

Gets or sets the parameter to pass to the command for the secondary button.

SecondaryButtonCommandParameterProperty
SecondaryButtonCommandParameterProperty
SecondaryButtonCommandParameterProperty

Gets the identifier of the SecondaryButtonCommandParameter dependency property.

SecondaryButtonCommandProperty
SecondaryButtonCommandProperty
SecondaryButtonCommandProperty

Gets the identifier of the SecondaryButtonCommand dependency property.

SecondaryButtonStyle
SecondaryButtonStyle
SecondaryButtonStyle

Gets or sets the Style to apply to the dialog's secondary button.

SecondaryButtonStyleProperty
SecondaryButtonStyleProperty
SecondaryButtonStyleProperty

Gets the identifier of the SecondaryButtonStyle dependency property.

SecondaryButtonText
SecondaryButtonText
SecondaryButtonText

Gets or sets the text to be displayed on the secondary button.

SecondaryButtonTextProperty
SecondaryButtonTextProperty
SecondaryButtonTextProperty
Gets the identifier of the SecondaryButtonText dependency property.

Title
Title
Title

Gets or sets the title of the dialog.

TitleProperty
TitleProperty
TitleProperty

Gets the identifier of the Title dependency property.

TitleTemplate
TitleTemplate
TitleTemplate

Gets or sets the title template.

TitleTemplateProperty
TitleTemplateProperty
TitleTemplateProperty

Gets the identifier of the TitleTemplate dependency property.

Methods
Hide()
Hide()
Hide()

Hides the dialog.

ShowAsync()
ShowAsync()
ShowAsync()

Begins an asynchronous operation to show the dialog.

ShowAsync(ContentDialogPlacement)
ShowAsync(ContentDialogPlacement)
ShowAsync(ContentDialogPlacement)

Begins an asynchronous operation to show the dialog with the specified placement.
Events
CloseButtonClick
CloseButtonClick
CloseButtonClick

Occurs after the close button has been tapped.

Closed
Closed
Closed

Occurs after the dialog is closed.

Closing
Closing
Closing

Occurs after the dialog starts to close, but before it is closed and before the Closed event occurs.

Opened
Opened
Opened

Occurs after the dialog is opened.

PrimaryButtonClick
PrimaryButtonClick
PrimaryButtonClick

Occurs after the primary button has been tapped.

SecondaryButtonClick
SecondaryButtonClick
SecondaryButtonClick

Occurs after the secondary button has been tapped.

See Also
ContentControl
ContentControl
ContentControl
ContentDialog.CloseButtonClick ContentDialog.Close
ButtonClick ContentDialog.CloseButtonClick
I n this Article
Edit
Occurs after the close button has been tapped.
public : event TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs> CloseButtonClick
// Register
event_token CloseButtonClick(TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs>
const& handler) const;

// Revoke with event_token


void CloseButtonClick(event_token const& cookie) const;

// Revoke with event_revoker


CloseButtonClick_revoker CloseButtonClick(auto_revoke_t, TypedEventHandler<ContentDialog,
ContentDialogButtonClickEventArgs> const& handler) const;
public event TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs> CloseButtonClick

<ContentDialog CloseButtonClick="eventhandler"/>
ContentDialog.CloseButtonCommand ContentDialog.
CloseButtonCommand ContentDialog.CloseButton
Command
I n this Article
Edit
Gets or sets the command to invoke when the close button is tapped.
public : ICommand CloseButtonCommand { get; set; }
ICommand CloseButtonCommand();

void CloseButtonCommand(ICommand closebuttoncommand);


public ICommand CloseButtonCommand { get; set; }

<ContentDialog CloseButtonCommand="commandReference"/>

Returns
ICommand
The command to invoke when the primary button is tapped.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.CloseButtonCommandParameter Content
Dialog.CloseButtonCommandParameter ContentDialog.
CloseButtonCommandParameter
I n this Article
Edit
Gets or sets the parameter to pass to the command for the close button.
public : Platform::Object CloseButtonCommandParameter { get; set; }
winrt::Windows::Foundation::IInspectable CloseButtonCommandParameter();

void CloseButtonCommandParameter(winrt::Windows::Foundation::IInspectable
closebuttoncommandparameter);
public object CloseButtonCommandParameter { get; set; }

<ContentDialog>
<ContentDialog.CloseButtonCommandParameter>
object
</ContentDialog.CloseButtonCommandParameter>
</ContentDialog>

Returns
object
The parameter to pass to the command for the close button. The default is null.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.CloseButtonCommandParameterProperty
ContentDialog.CloseButtonCommandParameterProperty
ContentDialog.CloseButtonCommandParameterProperty
I n this Article
Edit
Gets the identifier of the CloseButtonCommandParameter dependency property.
public : static DependencyProperty CloseButtonCommandParameterProperty { get; }
static DependencyProperty CloseButtonCommandParameterProperty();
public static DependencyProperty CloseButtonCommandParameterProperty { get; }

Returns
DependencyProperty
The identifier of the CloseButtonCommandParameter dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.CloseButtonCommandProperty Content
Dialog.CloseButtonCommandProperty ContentDialog.
CloseButtonCommandProperty
I n this Article
Edit
Gets the identifier of the CloseButtonCommand dependency property.
public : static DependencyProperty CloseButtonCommandProperty { get; }
static DependencyProperty CloseButtonCommandProperty();
public static DependencyProperty CloseButtonCommandProperty { get; }

Returns
DependencyProperty
The identifier of the CloseButtonCommand dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.CloseButtonStyle ContentDialog.Close
ButtonStyle ContentDialog.CloseButtonStyle
I n this Article
Edit
Gets or sets the Style to apply to the dialog's close button.
public : Style CloseButtonStyle { get; set; }
Style CloseButtonStyle();

void CloseButtonStyle(Style closebuttonstyle);


public Style CloseButtonStyle { get; set; }

<contentDialog CloseButtonStyle="{StaticResource styleResourceKey}"//>

Returns
Style
The applied style for the button, if present; otherwise, null.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.CloseButtonStyleProperty ContentDialog.
CloseButtonStyleProperty ContentDialog.CloseButton
StyleProperty
I n this Article
Edit
Gets the identifier of the CloseButtonStyle dependency property.
public : static DependencyProperty CloseButtonStyleProperty { get; }
static DependencyProperty CloseButtonStyleProperty();
public static DependencyProperty CloseButtonStyleProperty { get; }

Returns
DependencyProperty
The identifier of the CloseButtonStyle dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.CloseButtonText ContentDialog.Close
ButtonText ContentDialog.CloseButtonText
I n this Article
Edit
Gets or sets the text to display on the close button.
public : Platform::String CloseButtonText { get; set; }
winrt::hstring CloseButtonText();

void CloseButtonText(winrt::hstring closebuttontext);


public string CloseButtonText { get; set; }

<ContentDialog CloseButtonText="string"/>

Returns
string
The text to display on the close button.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Remarks
Every dialog should contain a safe, nondestructive action button that enables the user to confidently exit the dialog.
Use the close button to create this button. This allows you to create the right user experience for all inputs including
mouse, keyboard, touch, and gamepad. The dialog will close when:
The user clicks or taps on the close button
The user presses the system back button
The user presses the ESC button on keyboard
The user presses Gamepad B
Invoking the close button returns ContentDialogResult.None.
Version compatibility
The CloseButtonText property is not available prior to Windows 10, version 1703. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you should use the SecondaryButtonText property instead. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<ContentDialog x:Name="contentDialog1" Loaded="ContentDialog_Loaded">
...
</ContentDialog>
private void ContentDialog_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.ContentDialog",
"CloseButtonText"))
{
contentDialog1.CloseButtonText = "Cancel";
}
else
{
contentDialog1.SecondaryButtonText = "Cancel";
}
}
ContentDialog.CloseButtonTextProperty ContentDialog.
CloseButtonTextProperty ContentDialog.CloseButtonText
Property
I n this Article
Edit
Gets the identifier of the CloseButtonText dependency property.
public : static DependencyProperty CloseButtonTextProperty { get; }
static DependencyProperty CloseButtonTextProperty();
public static DependencyProperty CloseButtonTextProperty { get; }

Returns
DependencyProperty
The identifier of the CloseButtonText dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.Closed ContentDialog.Closed Content
Dialog.Closed
I n this Article
Edit
Occurs after the dialog is closed.
public : event TypedEventHandler<ContentDialog, ContentDialogClosedEventArgs> Closed
// Register
event_token Closed(TypedEventHandler<ContentDialog, ContentDialogClosedEventArgs> const& handler)
const;

// Revoke with event_token


void Closed(event_token const& cookie) const;

// Revoke with event_revoker


Closed_revoker Closed(auto_revoke_t, TypedEventHandler<ContentDialog, ContentDialogClosedEventArgs>
const& handler) const;
public event TypedEventHandler<ContentDialog, ContentDialogClosedEventArgs> Closed

<ContentDialog Closed="eventhandler"/>
ContentDialog.Closing ContentDialog.Closing Content
Dialog.Closing
I n this Article
Edit
Occurs after the dialog starts to close, but before it is closed and before the Closed event occurs.
public : event TypedEventHandler<ContentDialog, ContentDialogClosingEventArgs> Closing
// Register
event_token Closing(TypedEventHandler<ContentDialog, ContentDialogClosingEventArgs> const& handler)
const;

// Revoke with event_token


void Closing(event_token const& cookie) const;

// Revoke with event_revoker


Closing_revoker Closing(auto_revoke_t, TypedEventHandler<ContentDialog,
ContentDialogClosingEventArgs> const& handler) const;
public event TypedEventHandler<ContentDialog, ContentDialogClosingEventArgs> Closing

<ContentDialog Closing="eventhandler"/>
ContentDialog ContentDialog ContentDialog
I n this Article
Edit
Initializes a new instance of the ContentDialog class.

public : ContentDialog()
ContentDialog() const;
public ContentDialog()
ContentDialog.DefaultButton ContentDialog.Default
Button ContentDialog.DefaultButton
I n this Article
Edit
Gets or sets a value that indicates which button on the dialog is the default action.
public : ContentDialogButton DefaultButton { get; set; }
ContentDialogButton DefaultButton();

void DefaultButton(ContentDialogButton defaultbutton);


public ContentDialogButton DefaultButton { get; set; }

Returns
ContentDialogButton
A value of the enumeration. The default is None.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Remarks
You may optionally choose to differentiate one of the three buttons as the default button. Specifying the default button
causes the following to happen:
The button receives the Accent Button visual treatment
The button will respond to the ENTER key automatically
When the user presses the ENTER key on the keyboard, the click handler associated with the default button will fire
and the ContentDialogResult will return the value associated with the default button
If the user has placed focus on a control that handles ENTER, the default button will not respond to ENTER presses
The button will receive focus automatically when the dialog is opened unless the dialog’s content contains focusable UI
Version compatibility
The DefaultButton property is not available prior to Windows 10, version 1703. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<ContentDialog x:Name="contentDialog1" Loaded="ContentDialog_Loaded">
...
</ContentDialog>
private void ContentDialog_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.ContentDialog", "DefaultButton"))
{
contentDialog1.DefaultButton = ContentDialogButton.Primary;
}
}
ContentDialog.DefaultButtonProperty ContentDialog.
DefaultButtonProperty ContentDialog.DefaultButton
Property
I n this Article
Edit
Gets the identifier of the DefaultButton dependency property.
public : static DependencyProperty DefaultButtonProperty { get; }
static DependencyProperty DefaultButtonProperty();
public static DependencyProperty DefaultButtonProperty { get; }

Returns
DependencyProperty
The identifier of the DefaultButton dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.FullSizeDesired ContentDialog.FullSize
Desired ContentDialog.FullSizeDesired
I n this Article
Edit
Gets or sets a value that indicates whether a request is being made to display the dialog full screen.
public : Platform::Boolean FullSizeDesired { get; set; }
bool FullSizeDesired();

void FullSizeDesired(bool fullsizedesired);


public bool FullSizeDesired { get; set; }

<ContentDialog FullSizeDesired="bool"/>

Returns
bool
true to request that the dialog is displayed full screen; otherwise, false. The default is false.
ContentDialog.FullSizeDesiredProperty ContentDialog.
FullSizeDesiredProperty ContentDialog.FullSizeDesired
Property
I n this Article
Edit
Gets the identifier of the FullSizeDesired dependency property.
public : static DependencyProperty FullSizeDesiredProperty { get; }
static DependencyProperty FullSizeDesiredProperty();
public static DependencyProperty FullSizeDesiredProperty { get; }

Returns
DependencyProperty
The identifier of the FullSizeDesired dependency property.
ContentDialog.Hide ContentDialog.Hide ContentDialog.
Hide
I n this Article
Edit
Hides the dialog.
public : void Hide()
void Hide() const;
public void Hide()
ContentDialog.IsPrimaryButtonEnabled ContentDialog.Is
PrimaryButtonEnabled ContentDialog.IsPrimaryButton
Enabled
I n this Article
Edit
Gets or sets whether the dialog's primary button is enabled.
public : Platform::Boolean IsPrimaryButtonEnabled { get; set; }
bool IsPrimaryButtonEnabled();

void IsPrimaryButtonEnabled(bool isprimarybuttonenabled);


public bool IsPrimaryButtonEnabled { get; set; }

<ContentDialog IsPrimaryButtonEnabled="bool"/>

Returns
bool
True if the primary button of the dialog is enabled; Otherwise, false.
ContentDialog.IsPrimaryButtonEnabledProperty Content
Dialog.IsPrimaryButtonEnabledProperty ContentDialog.
IsPrimaryButtonEnabledProperty
I n this Article
Edit
Gets the identifier of the IsPrimaryButtonEnabled dependency property.
public : static DependencyProperty IsPrimaryButtonEnabledProperty { get; }
static DependencyProperty IsPrimaryButtonEnabledProperty();
public static DependencyProperty IsPrimaryButtonEnabledProperty { get; }

Returns
DependencyProperty
The identifier of the IsPrimaryButtonEnabled dependency property.
ContentDialog.IsSecondaryButtonEnabled Content
Dialog.IsSecondaryButtonEnabled ContentDialog.Is
SecondaryButtonEnabled
I n this Article
Edit
Gets or sets whether the dialog's secondary button is enabled.
public : Platform::Boolean IsSecondaryButtonEnabled { get; set; }
bool IsSecondaryButtonEnabled();

void IsSecondaryButtonEnabled(bool issecondarybuttonenabled);


public bool IsSecondaryButtonEnabled { get; set; }

<ContentDialog IsSecondaryButtonEnabled="bool"/>

Returns
bool
True if the secondary button of the dialog is enabled; Otherwise, false.
ContentDialog.IsSecondaryButtonEnabledProperty
ContentDialog.IsSecondaryButtonEnabledProperty
ContentDialog.IsSecondaryButtonEnabledProperty
I n this Article
Edit
Gets the identifier of the IsSecondaryButtonEnabled dependency property.
public : static DependencyProperty IsSecondaryButtonEnabledProperty { get; }
static DependencyProperty IsSecondaryButtonEnabledProperty();
public static DependencyProperty IsSecondaryButtonEnabledProperty { get; }

Returns
DependencyProperty
The identifier of the IsSecondaryButtonEnabled dependency property.
ContentDialog.Opened ContentDialog.Opened Content
Dialog.Opened
I n this Article
Edit
Occurs after the dialog is opened.
public : event TypedEventHandler<ContentDialog, ContentDialogOpenedEventArgs> Opened
// Register
event_token Opened(TypedEventHandler<ContentDialog, ContentDialogOpenedEventArgs> const& handler)
const;

// Revoke with event_token


void Opened(event_token const& cookie) const;

// Revoke with event_revoker


Opened_revoker Opened(auto_revoke_t, TypedEventHandler<ContentDialog, ContentDialogOpenedEventArgs>
const& handler) const;
public event TypedEventHandler<ContentDialog, ContentDialogOpenedEventArgs> Opened

<ContentDialog Opened="eventhandler"/>
ContentDialog.PrimaryButtonClick ContentDialog.
PrimaryButtonClick ContentDialog.PrimaryButtonClick
I n this Article
Edit
Occurs after the primary button has been tapped.
public : event TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs>
PrimaryButtonClick
// Register
event_token PrimaryButtonClick(TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs>
const& handler) const;

// Revoke with event_token


void PrimaryButtonClick(event_token const& cookie) const;

// Revoke with event_revoker


PrimaryButtonClick_revoker PrimaryButtonClick(auto_revoke_t, TypedEventHandler<ContentDialog,
ContentDialogButtonClickEventArgs> const& handler) const;
public event TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs> PrimaryButtonClick

<ContentDialog PrimaryButtonClick="eventhandler"/>
ContentDialog.PrimaryButtonCommand ContentDialog.
PrimaryButtonCommand ContentDialog.PrimaryButton
Command
I n this Article
Edit
Gets or sets the command to invoke when the primary button is tapped.
public : ICommand PrimaryButtonCommand { get; set; }
ICommand PrimaryButtonCommand();

void PrimaryButtonCommand(ICommand primarybuttoncommand);


public ICommand PrimaryButtonCommand { get; set; }

<ContentDialog PrimaryButtonCommand="commandReference"/>

Returns
ICommand
The command to invoke when the primary button is tapped.
ContentDialog.PrimaryButtonCommandParameter
ContentDialog.PrimaryButtonCommandParameter
ContentDialog.PrimaryButtonCommandParameter
I n this Article
Edit
Gets or sets the parameter to pass to the command for the primary button.
public : Platform::Object PrimaryButtonCommandParameter { get; set; }
winrt::Windows::Foundation::IInspectable PrimaryButtonCommandParameter();

void PrimaryButtonCommandParameter(winrt::Windows::Foundation::IInspectable
primarybuttoncommandparameter);
public object PrimaryButtonCommandParameter { get; set; }

<ContentDialog>
<ContentDialog.PrimaryButtonCommandParameter>
object
</ContentDialog.PrimaryButtonCommandParameter>
</ContentDialog>

Returns
object
The parameter to pass to the command for the primary button. The default is null.
ContentDialog.PrimaryButtonCommandParameter
Property ContentDialog.PrimaryButtonCommand
ParameterProperty ContentDialog.PrimaryButton
CommandParameterProperty
I n this Article
Edit
Gets the identifier of the PrimaryButtonCommandParameter dependency property.
public : static DependencyProperty PrimaryButtonCommandParameterProperty { get; }
static DependencyProperty PrimaryButtonCommandParameterProperty();
public static DependencyProperty PrimaryButtonCommandParameterProperty { get; }

Returns
DependencyProperty
The identifier of the PrimaryButtonCommandParameter dependency property
ContentDialog.PrimaryButtonCommandProperty
ContentDialog.PrimaryButtonCommandProperty
ContentDialog.PrimaryButtonCommandProperty
I n this Article
Edit
Gets the identifier of the PrimaryButtonCommand dependency property.
public : static DependencyProperty PrimaryButtonCommandProperty { get; }
static DependencyProperty PrimaryButtonCommandProperty();
public static DependencyProperty PrimaryButtonCommandProperty { get; }

Returns
DependencyProperty
The identifier of the PrimaryButtonCommand dependency property.
ContentDialog.PrimaryButtonStyle ContentDialog.
PrimaryButtonStyle ContentDialog.PrimaryButtonStyle
I n this Article
Edit
Gets or sets the Style to apply to the dialog's primary button.
public : Style PrimaryButtonStyle { get; set; }
Style PrimaryButtonStyle();

void PrimaryButtonStyle(Style primarybuttonstyle);


public Style PrimaryButtonStyle { get; set; }

<contentDialog CloseButtonStyle="{StaticResource styleResourceKey}"//>

Returns
Style
The applied style for the button, if present; otherwise, null.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.PrimaryButtonStyleProperty Content
Dialog.PrimaryButtonStyleProperty ContentDialog.
PrimaryButtonStyleProperty
I n this Article
Edit
Gets the identifier of the PrimaryButtonStyle dependency property.
public : static DependencyProperty PrimaryButtonStyleProperty { get; }
static DependencyProperty PrimaryButtonStyleProperty();
public static DependencyProperty PrimaryButtonStyleProperty { get; }

Returns
DependencyProperty
The identifier of the PrimaryButtonStyle dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.PrimaryButtonText ContentDialog.
PrimaryButtonText ContentDialog.PrimaryButtonText
I n this Article
Edit
Gets or sets the text to display on the primary button.
public : Platform::String PrimaryButtonText { get; set; }
winrt::hstring PrimaryButtonText();

void PrimaryButtonText(winrt::hstring primarybuttontext);


public string PrimaryButtonText { get; set; }

<ContentDialog PrimaryButtonText="string"/>

Returns
string
The text to display on the primary button. To hide this button, set the text to null or string.empty. The default is empty.
ContentDialog.PrimaryButtonTextProperty Content
Dialog.PrimaryButtonTextProperty ContentDialog.
PrimaryButtonTextProperty
I n this Article
Edit
Gets the identifier of the PrimaryButtonText dependency property.
public : static DependencyProperty PrimaryButtonTextProperty { get; }
static DependencyProperty PrimaryButtonTextProperty();
public static DependencyProperty PrimaryButtonTextProperty { get; }

Returns
DependencyProperty
The identifier of the PrimaryButtonText dependency property.
ContentDialog.SecondaryButtonClick ContentDialog.
SecondaryButtonClick ContentDialog.SecondaryButton
Click
I n this Article
Edit
Occurs after the secondary button has been tapped.
public : event TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs>
SecondaryButtonClick
// Register
event_token SecondaryButtonClick(TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs>
const& handler) const;

// Revoke with event_token


void SecondaryButtonClick(event_token const& cookie) const;

// Revoke with event_revoker


SecondaryButtonClick_revoker SecondaryButtonClick(auto_revoke_t, TypedEventHandler<ContentDialog,
ContentDialogButtonClickEventArgs> const& handler) const;
public event TypedEventHandler<ContentDialog, ContentDialogButtonClickEventArgs>
SecondaryButtonClick

<ContentDialog SecondaryButtonClick="eventhandler"/>
ContentDialog.SecondaryButtonCommand Content
Dialog.SecondaryButtonCommand ContentDialog.
SecondaryButtonCommand
I n this Article
Edit
Gets or sets the command to invoke when the secondary button is tapped.
public : ICommand SecondaryButtonCommand { get; set; }
ICommand SecondaryButtonCommand();

void SecondaryButtonCommand(ICommand secondarybuttoncommand);


public ICommand SecondaryButtonCommand { get; set; }

<ContentDialog SecondaryButtonCommand="commandReference"/>

Returns
ICommand
The command to invoke when the secondary button is tapped.
ContentDialog.SecondaryButtonCommandParameter
ContentDialog.SecondaryButtonCommandParameter
ContentDialog.SecondaryButtonCommandParameter
I n this Article
Edit
Gets or sets the parameter to pass to the command for the secondary button.
public : Platform::Object SecondaryButtonCommandParameter { get; set; }
winrt::Windows::Foundation::IInspectable SecondaryButtonCommandParameter();

void SecondaryButtonCommandParameter(winrt::Windows::Foundation::IInspectable
secondarybuttoncommandparameter);
public object SecondaryButtonCommandParameter { get; set; }

<ContentDialog>
<ContentDialog.SecondaryButtonCommandParameter>
object
</ContentDialog.SecondaryButtonCommandParameter>
</ContentDialog>

Returns
object
The command parameter for the secondary button. The default is null.
ContentDialog.SecondaryButtonCommandParameter
Property ContentDialog.SecondaryButtonCommand
ParameterProperty ContentDialog.SecondaryButton
CommandParameterProperty
I n this Article
Edit
Gets the identifier of the SecondaryButtonCommandParameter dependency property.
public : static DependencyProperty SecondaryButtonCommandParameterProperty { get; }
static DependencyProperty SecondaryButtonCommandParameterProperty();
public static DependencyProperty SecondaryButtonCommandParameterProperty { get; }

Returns
DependencyProperty
The identifier of the SecondaryButtonCommandParameter dependency property.
ContentDialog.SecondaryButtonCommandProperty
ContentDialog.SecondaryButtonCommandProperty
ContentDialog.SecondaryButtonCommandProperty
I n this Article
Edit
Gets the identifier of the SecondaryButtonCommand dependency property.
public : static DependencyProperty SecondaryButtonCommandProperty { get; }
static DependencyProperty SecondaryButtonCommandProperty();
public static DependencyProperty SecondaryButtonCommandProperty { get; }

Returns
DependencyProperty
The identifier of the SecondaryButtonCommand dependency property.
ContentDialog.SecondaryButtonStyle ContentDialog.
SecondaryButtonStyle ContentDialog.SecondaryButton
Style
I n this Article
Edit
Gets or sets the Style to apply to the dialog's secondary button.
public : Style SecondaryButtonStyle { get; set; }
Style SecondaryButtonStyle();

void SecondaryButtonStyle(Style secondarybuttonstyle);


public Style SecondaryButtonStyle { get; set; }

<contentDialog CloseButtonStyle="{StaticResource styleResourceKey}"//>

Returns
Style
The applied style for the button, if present; otherwise, null.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.SecondaryButtonStyleProperty Content
Dialog.SecondaryButtonStyleProperty ContentDialog.
SecondaryButtonStyleProperty
I n this Article
Edit
Gets the identifier of the SecondaryButtonStyle dependency property.
public : static DependencyProperty SecondaryButtonStyleProperty { get; }
static DependencyProperty SecondaryButtonStyleProperty();
public static DependencyProperty SecondaryButtonStyleProperty { get; }

Returns
DependencyProperty
The identifier of the SecondaryButtonStyle dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ContentDialog.SecondaryButtonText ContentDialog.
SecondaryButtonText ContentDialog.SecondaryButton
Text
I n this Article
Edit
Gets or sets the text to be displayed on the secondary button.
public : Platform::String SecondaryButtonText { get; set; }
winrt::hstring SecondaryButtonText();

void SecondaryButtonText(winrt::hstring secondarybuttontext);


public string SecondaryButtonText { get; set; }

<ContentDialog SecondaryButtonText="string"/>

Returns
string
The text to be displayed on the secondary button. To hide this button, set the value to null or string.empty.
ContentDialog.SecondaryButtonTextProperty Content
Dialog.SecondaryButtonTextProperty ContentDialog.
SecondaryButtonTextProperty
I n this Article
Edit
Gets the identifier of the SecondaryButtonText dependency property.
public : static DependencyProperty SecondaryButtonTextProperty { get; }
static DependencyProperty SecondaryButtonTextProperty();
public static DependencyProperty SecondaryButtonTextProperty { get; }

Returns
DependencyProperty
The identifier of the SecondaryButtonText dependency property.
ContentDialog.ShowAsync ContentDialog.ShowAsync
ContentDialog.ShowAsync
I n this Article

Overloads
ShowAsync() ShowAsync() ShowAsync()
Begins an asynchronous operation to show the dialog.

ShowAsync(ContentDialogPlacement) ShowAsync(Content
DialogPlacement) ShowAsync(ContentDialogPlacement) Begins an asynchronous operation to show the dialog with the
specified placement.

ShowAsync() ShowAsync() ShowAsync()


Edit
Begins an asynchronous operation to show the dialog.
public : IAsyncOperation<ContentDialogResult> ShowAsync()
IAsyncOperation<ContentDialogResult> ShowAsync() const;
public IAsyncOperation<ContentDialogResult> ShowAsync()

Returns
IAsyncOperation<ContentDialogResult>
An asynchronous operation showing the dialog. When complete, returns a ContentDialogResult.
Attributes OverloadAttribute RemoteAsyncAttribute

ShowAsync(ContentDialogPlacement)
ShowAsync(ContentDialogPlacement)
ShowAsync(ContentDialogPlacement)
Edit
Begins an asynchronous operation to show the dialog with the specified placement.
public : IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement placement)
IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement placement) const;
public IAsyncOperation<ContentDialogResult> ShowAsync(ContentDialogPlacement placement)

Parameters
placement ContentDialogPlacement
A value that specifies whether the dialog is placed in the PopupRoot or in its parent's visual tree.
Returns
IAsyncOperation<ContentDialogResult>
An asynchronous operation showing the dialog. When complete, returns a ContentDialogResult.
Attributes OverloadAttribute RemoteAsyncAttribute
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
When you call this method with the ContentDialogPlacement.Popup parameter value, the dialog is rooted in the
PopupRoot element of the XAML Window. This is the default behavior, and is equivilent to calling the ShowAsync
method with no parameters.
When you call this method with the ContentDialogPlacement.InPlace parameter value:
If the dialog has a parent element, the dialog is rooted in the parent's visual tree. It's shown inline along with the
parent’s other child elements, and participates in the parent container’s layout.
If the dialog has no parent, the dialog falls back to the default behavior and is shown in the PopupRoot.
ContentDialog.Title ContentDialog.Title ContentDialog.
Title
I n this Article
Edit
Gets or sets the title of the dialog.
public : Platform::Object Title { get; set; }
winrt::Windows::Foundation::IInspectable Title();

void Title(winrt::Windows::Foundation::IInspectable title);


public object Title { get; set; }

<ContentDialog Title="string"/>

Returns
object
The title of the dialog.
ContentDialog.TitleProperty ContentDialog.TitleProperty
ContentDialog.TitleProperty
I n this Article
Edit
Gets the identifier of the Title dependency property.
public : static DependencyProperty TitleProperty { get; }
static DependencyProperty TitleProperty();
public static DependencyProperty TitleProperty { get; }

Returns
DependencyProperty
The identifier of the Title dependency property.
ContentDialog.TitleTemplate ContentDialog.Title
Template ContentDialog.TitleTemplate
I n this Article
Edit
Gets or sets the title template.
public : DataTemplate TitleTemplate { get; set; }
DataTemplate TitleTemplate();

void TitleTemplate(DataTemplate titletemplate);


public DataTemplate TitleTemplate { get; set; }

<ContentDialog>
<ContentDialog.TitleTemplate>
singleDataTemplate
</ContentDialog.TitleTemplate>
</ContentDialog>

Returns
DataTemplate
The title template.
ContentDialog.TitleTemplateProperty ContentDialog.
TitleTemplateProperty ContentDialog.TitleTemplate
Property
I n this Article
Edit
Gets the identifier of the TitleTemplate dependency property.
public : static DependencyProperty TitleTemplateProperty { get; }
static DependencyProperty TitleTemplateProperty();
public static DependencyProperty TitleTemplateProperty { get; }

Returns
DependencyProperty
The identifier of the TitleTemplate dependency property.
ContentDialogButton ContentDialogButton Content
DialogButton Enum
Defines constants that specify the default button on a content dialog.

D eclaration
public : enum class ContentDialogButton
enum class winrt::Windows::UI::Xaml::Controls::ContentDialogButton : int32_t
public enum ContentDialogButton

I nheritance H ierarchy
None

Remarks
This enumeration is used by the ContentDialog.DefaultButton property. The default button responds to the Enter key
and has a different visual style.

Fields
Close Close Close The close button is the default.

None None None No button is specified as the default.

Primary Primary Primary The primary button is the default.

Secondary Secondary Secondary The secondary button is the default.


ContentDialogButtonClickDeferral ContentDialogButton
ClickDeferral ContentDialogButtonClickDeferral Class
Represents a deferral that can be used by an app to respond asynchronously to a button click event.

D eclaration
public : sealed class ContentDialogButtonClickDeferral : IContentDialogButtonClickDeferral
struct winrt::Windows::UI::Xaml::Controls::ContentDialogButtonClickDeferral :
IContentDialogButtonClickDeferral
public sealed class ContentDialogButtonClickDeferral : IContentDialogButtonClickDeferral

I nheritance H ierarchy
None

Remarks
You can get an instance of this class by calling ContentDialogButtonClickEventArgs.GetDeferral.

Methods
Complete()
Complete()
Complete()

Notifies the system that the app has finished processing the button click event.
ContentDialogButtonClickDeferral.Complete Content
DialogButtonClickDeferral.Complete ContentDialog
ButtonClickDeferral.Complete
I n this Article
Edit
Notifies the system that the app has finished processing the button click event.
public : void Complete()
void Complete() const;
public void Complete()
ContentDialogButtonClickEventArgs ContentDialog
ButtonClickEventArgs ContentDialogButtonClickEvent
Args Class
Provides data for the button click events.

D eclaration
public : sealed class ContentDialogButtonClickEventArgs : IContentDialogButtonClickEventArgs
struct winrt::Windows::UI::Xaml::Controls::ContentDialogButtonClickEventArgs :
IContentDialogButtonClickEventArgs
public sealed class ContentDialogButtonClickEventArgs : IContentDialogButtonClickEventArgs

I nheritance H ierarchy
None

Properties
Cancel
Cancel
Cancel

Gets or sets a value that can cancel the button click. A true value for Cancel cancels the default behavior.

Methods
GetDeferral()
GetDeferral()
GetDeferral()

Gets a ContentDialogButtonClickDeferral that the app can use to respond asynchronously to a button click event.
ContentDialogButtonClickEventArgs.Cancel Content
DialogButtonClickEventArgs.Cancel ContentDialog
ButtonClickEventArgs.Cancel
I n this Article
Edit
Gets or sets a value that can cancel the button click. A true value for Cancel cancels the default behavior.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
True to cancel the button click; Otherwise, false.
ContentDialogButtonClickEventArgs.GetDeferral Content
DialogButtonClickEventArgs.GetDeferral ContentDialog
ButtonClickEventArgs.GetDeferral
I n this Article
Edit
Gets a ContentDialogButtonClickDeferral that the app can use to respond asynchronously to a button click event.
public : ContentDialogButtonClickDeferral GetDeferral()
ContentDialogButtonClickDeferral GetDeferral() const;
public ContentDialogButtonClickDeferral GetDeferral()

Returns
ContentDialogButtonClickDeferral
A ContentDialogButtonClickDeferral that the app can use to respond asynchronously to a button click event.
ContentDialogClosedEventArgs ContentDialogClosed
EventArgs ContentDialogClosedEventArgs Class
Provides data for the Closed event.

D eclaration
public : sealed class ContentDialogClosedEventArgs : IContentDialogClosedEventArgs
struct winrt::Windows::UI::Xaml::Controls::ContentDialogClosedEventArgs :
IContentDialogClosedEventArgs
public sealed class ContentDialogClosedEventArgs : IContentDialogClosedEventArgs

I nheritance H ierarchy
None

Properties
Result
Result
Result

Gets the ContentDialogResult of the button click event.


ContentDialogClosedEventArgs.Result ContentDialog
ClosedEventArgs.Result ContentDialogClosedEventArgs.
Result
I n this Article
Edit
Gets the ContentDialogResult of the button click event.
public : ContentDialogResult Result { get; }
ContentDialogResult Result();
public ContentDialogResult Result { get; }

Returns
ContentDialogResult
The result of the button click event.
ContentDialogClosingDeferral ContentDialogClosing
Deferral ContentDialogClosingDeferral Class
Represents a deferral that can be used by an app to respond asynchronously to the closing event of the ContentDialog.

D eclaration
public : sealed class ContentDialogClosingDeferral : IContentDialogClosingDeferral
struct winrt::Windows::UI::Xaml::Controls::ContentDialogClosingDeferral :
IContentDialogClosingDeferral
public sealed class ContentDialogClosingDeferral : IContentDialogClosingDeferral

I nheritance H ierarchy
None

Remarks
You can get an instance of this class by calling ContentDialogClosingEventArgs.GetDeferral.

Methods
Complete()
Complete()
Complete()

Notifies the system that the app has finished processing the closing event.
ContentDialogClosingDeferral.Complete ContentDialog
ClosingDeferral.Complete ContentDialogClosing
Deferral.Complete
I n this Article
Edit
Notifies the system that the app has finished processing the closing event.
public : void Complete()
void Complete() const;
public void Complete()
ContentDialogClosingEventArgs ContentDialogClosing
EventArgs ContentDialogClosingEventArgs Class
Provides data for the closing event.

D eclaration
public : sealed class ContentDialogClosingEventArgs : IContentDialogClosingEventArgs
struct winrt::Windows::UI::Xaml::Controls::ContentDialogClosingEventArgs :
IContentDialogClosingEventArgs
public sealed class ContentDialogClosingEventArgs : IContentDialogClosingEventArgs

I nheritance H ierarchy
None

Properties
Cancel
Cancel
Cancel

Gets or sets a value that can cancel the closing of the dialog.. A true value for Cancel cancels the default behavior.

Result
Result
Result

Gets the ContentDialogResult of the closing event.

Methods
GetDeferral()
GetDeferral()
GetDeferral()

Gets a ContentDialogClosingDeferral that the app can use to respond asynchronously to the closing event.
ContentDialogClosingEventArgs.Cancel ContentDialog
ClosingEventArgs.Cancel ContentDialogClosingEvent
Args.Cancel
I n this Article
Edit
Gets or sets a value that can cancel the closing of the dialog.. A true value for Cancel cancels the default behavior.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
True to cancel the closing of the dialog; Otherwise, false.
ContentDialogClosingEventArgs.GetDeferral Content
DialogClosingEventArgs.GetDeferral ContentDialog
ClosingEventArgs.GetDeferral
I n this Article
Edit
Gets a ContentDialogClosingDeferral that the app can use to respond asynchronously to the closing event.
public : ContentDialogClosingDeferral GetDeferral()
ContentDialogClosingDeferral GetDeferral() const;
public ContentDialogClosingDeferral GetDeferral()

Returns
ContentDialogClosingDeferral
A ContentDialogClosingDeferral that the app can use to respond asynchronously to the closing event.
ContentDialogClosingEventArgs.Result ContentDialog
ClosingEventArgs.Result ContentDialogClosingEvent
Args.Result
I n this Article
Edit
Gets the ContentDialogResult of the closing event.
public : ContentDialogResult Result { get; }
ContentDialogResult Result();
public ContentDialogResult Result { get; }

Returns
ContentDialogResult
The ContentDialogResult of the closing event.
ContentDialogOpenedEventArgs ContentDialogOpened
EventArgs ContentDialogOpenedEventArgs Class
Provides data for the Opened event.

D eclaration
public : sealed class ContentDialogOpenedEventArgs : IContentDialogOpenedEventArgs
struct winrt::Windows::UI::Xaml::Controls::ContentDialogOpenedEventArgs :
IContentDialogOpenedEventArgs
public sealed class ContentDialogOpenedEventArgs : IContentDialogOpenedEventArgs

I nheritance H ierarchy
None
ContentDialogPlacement ContentDialogPlacement
ContentDialogPlacement Enum
Defines constants that specify where in the XAML visual tree a ContentDialog is rooted.

D eclaration
public : enum class ContentDialogPlacement
enum class winrt::Windows::UI::Xaml::Controls::ContentDialogPlacement : int32_t
public enum ContentDialogPlacement

I nheritance H ierarchy
None

Fields
InPlace InPlace If the dialog has a parent element, the dialog is rooted in the parent's visual tree. Otherwise, it falls
InPlace back to the Popup behavior.

Popup Popup Popup The dialog is rooted in the PopupRoot element of the XAML Window.
ContentDialogResult ContentDialogResult Content
DialogResult Enum
Specifies identifiers to indicate the return value of a ContentDialog

D eclaration
public : enum class ContentDialogResult
enum class winrt::Windows::UI::Xaml::Controls::ContentDialogResult : int32_t
public enum ContentDialogResult

I nheritance H ierarchy
None

Fields
None None None No button was tapped.

Primary Primary Primary The primary button was tapped by the user.

Secondary Secondary Secondary The secondary button was tapped by the user.
ContentLinkChangedEventArgs ContentLinkChanged
EventArgs ContentLinkChangedEventArgs Class
Provides data for the RichEditBox.ContentLinkChanged event.

D eclaration
public : sealed class ContentLinkChangedEventArgs : IContentLinkChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::ContentLinkChangedEventArgs :
IContentLinkChangedEventArgs
public sealed class ContentLinkChangedEventArgs : IContentLinkChangedEventArgs

I nheritance H ierarchy
None

Properties
ChangeKind
ChangeKind
ChangeKind

Gets a value that indicates how the content link is changed.

ContentLinkInfo
ContentLinkInfo
ContentLinkInfo

Gets an object that contains information about the content link.

TextRange
TextRange
TextRange

Gets the text range that contains the content link.


ContentLinkChangedEventArgs.ChangeKind ContentLink
ChangedEventArgs.ChangeKind ContentLinkChanged
EventArgs.ChangeKind
I n this Article
Edit
Gets a value that indicates how the content link is changed.
public : ContentLinkChangeKind ChangeKind { get; }
ContentLinkChangeKind ChangeKind();
public ContentLinkChangeKind ChangeKind { get; }

Returns
ContentLinkChangeKind
An enumeration value that indicates how the content link is changed.
ContentLinkChangedEventArgs.ContentLinkInfo Content
LinkChangedEventArgs.ContentLinkInfo ContentLink
ChangedEventArgs.ContentLinkInfo
I n this Article
Edit
Gets an object that contains information about the content link.
public : ContentLinkInfo ContentLinkInfo { get; }
ContentLinkInfo ContentLinkInfo();
public ContentLinkInfo ContentLinkInfo { get; }

Returns
ContentLinkInfo
An object that contains information about the content link.
ContentLinkChangedEventArgs.TextRange ContentLink
ChangedEventArgs.TextRange ContentLinkChangedEvent
Args.TextRange
I n this Article
Edit
Gets the text range that contains the content link.
public : TextRange TextRange { get; }
TextRange TextRange();
public TextRange TextRange { get; }

Returns
TextRange
The text range that contains the content link.
ContentLinkChangeKind ContentLinkChangeKind
ContentLinkChangeKind Enum
Defines constants that specify what kind of change is being made to a ContentLink.

D eclaration
public : enum class ContentLinkChangeKind
enum class winrt::Windows::UI::Xaml::Controls::ContentLinkChangeKind : int32_t
public enum ContentLinkChangeKind

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the ContentLinkChangedEventArgs.ChangeKind property.

Fields
Edited Edited Edited The content link is being changed.

Inserted Inserted Inserted The content link is being added.

Removed Removed Removed The content link is being removed.


ContentPresenter ContentPresenter ContentPresenter
Class
Displays the content of a ContentControl. Can also provide content presentation for non-controls. Provides a base
class for specialized presenters such as ScrollContentPresenter.

D eclaration
public : class ContentPresenter : FrameworkElement, IContentPresenter, IContentPresenter2,
IContentPresenter3, IContentPresenter4, IContentPresenter5, IContentPresenterOverrides
struct winrt::Windows::UI::Xaml::Controls::ContentPresenter : FrameworkElement,
IContentPresenter, IContentPresenter2, IContentPresenter3, IContentPresenter4,
IContentPresenter5, IContentPresenterOverrides
public class ContentPresenter : FrameworkElement, IContentPresenter, IContentPresenter2,
IContentPresenter3, IContentPresenter4, IContentPresenter5, IContentPresenterOverrides

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
Typically, you use the ContentPresenter directly within the ControlTemplate of a ContentControl to mark where the
content to be presented appears.
A ContentPresenter is often used to apply characteristics to text content, which are set into a Content property using
only a string for the text (or some indirect equivalent such as a Binding or a RESX resource). For this reason the
properties of a ContentPresenter are similar to the properties of the TextElement class. (The TextElement class is a base
class for several elements that aren't controls but are used to format the text that might appear in a control or layout
container.)
 Tip

Starting in Windows 10, ContentPresenter defines new border properties that let you draw a border around the
ContentPresenter without using an additional Border element. The new properties are ContentPresenter.BorderBrush,
ContentPresenter.BorderThickness, ContentPresenter.CornerRadius, and ContentPresenter.Padding.
<ContentPresenter BorderBrush="Red" BorderThickness="2" CornerRadius="10" Padding="12">
</ContentPresenter>

A ContentPresenter can use a logic class to influence which template to use for templated data content at run-time. For
more info, see the ContentTemplateSelector property.
If the ContentPresenter is in the ControlTemplate of a ContentControl, the ContentPresenter behavior will implicitly
bind to the ContentTemplate and Content properties of the templated ContentControl.
ContentP resenter derived classes
ContentPresenter is the parent class for these classes:
ScrollContentPresenter
GridViewItemPresenter
ListViewItemPresenter
Constructors
ContentPresenter()
ContentPresenter()
ContentPresenter()

Initializes a new instance of the ContentPresenter class.

Properties
Background
Background
Background

Gets or sets the Brush to apply to the background of content handled by the ContentPresenter.

BackgroundProperty
BackgroundProperty
BackgroundProperty

Identifies the Background dependency property.

BackgroundSizing
BackgroundSizing
BackgroundSizing

Gets or sets a value that indicates how far the background extends in relation to this element's border.

BackgroundSizingProperty
BackgroundSizingProperty
BackgroundSizingProperty

Identifies the BackgroundSizing dependency property.

BackgroundTransition
BackgroundTransition
BackgroundTransition

Gets or sets an instance of BrushTransition to automatically animate changes to the Background property.

BorderBrush
BorderBrush
BorderBrush

Gets or sets a brush that describes the border fill of the content presenter.
BorderBrushProperty
BorderBrushProperty
BorderBrushProperty

Identifies the BorderBrush dependency property.

BorderThickness
BorderThickness
BorderThickness

Gets or sets the border thickness of the content presenter.

BorderThicknessProperty
BorderThicknessProperty
BorderThicknessProperty

Identifies the BorderThickness dependency property.

CharacterSpacing
CharacterSpacing
CharacterSpacing

Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.

CharacterSpacingProperty
CharacterSpacingProperty
CharacterSpacingProperty

Identifies the CharacterSpacing dependency property.

Content
Content
Content

Gets or sets the data that is used to generate the child elements of a ContentPresenter.

ContentProperty
ContentProperty
ContentProperty

Identifies the Content dependency property

ContentTemplate
ContentTemplate
ContentTemplate
Gets or sets the template that is used to display the content of the control.

ContentTemplateProperty
ContentTemplateProperty
ContentTemplateProperty

Identifies the ContentTemplate dependency property.

ContentTemplateSelector
ContentTemplateSelector
ContentTemplateSelector

Gets or sets a selection object that changes the DataTemplate to apply for content presented in the
ContentPresenter, based on processing information about the content item or its container at run time.

ContentTemplateSelectorProperty
ContentTemplateSelectorProperty
ContentTemplateSelectorProperty

Identifies the ContentTemplateSelector dependency property.

ContentTransitions
ContentTransitions
ContentTransitions

Gets or sets the collection of Transition style elements that apply to content presented by the ContentPresenter.

ContentTransitionsProperty
ContentTransitionsProperty
ContentTransitionsProperty

Identifies the ContentTransitions dependency property.

CornerRadius
CornerRadius
CornerRadius

Gets or sets the radius for the corners of the content presenter's border.

CornerRadiusProperty
CornerRadiusProperty
CornerRadiusProperty

Identifies the CornerRadius dependency property.


FontFamily
FontFamily
FontFamily

Gets or sets the preferred top-level font family for the text content presented by the ContentPresenter.

FontFamilyProperty
FontFamilyProperty
FontFamilyProperty

Identifies the FontFamily dependency property.

FontSize
FontSize
FontSize

Gets or sets the font size for the text content presented by the ContentPresenter.

FontSizeProperty
FontSizeProperty
FontSizeProperty

Identifies the FontSize dependency property.

FontStretch
FontStretch
FontStretch

Gets or sets the font stretch for the text content presented by the ContentPresenter.

FontStretchProperty
FontStretchProperty
FontStretchProperty

Identifies the FontStretch dependency property.

FontStyle
FontStyle
FontStyle

Gets or sets the font style for the presented content.

FontStyleProperty
FontStyleProperty
FontStyleProperty
Identifies the FontStyle dependency property.

FontWeight
FontWeight
FontWeight

Gets or sets the top-level font weight for the text content presented by the ContentPresenter.

FontWeightProperty
FontWeightProperty
FontWeightProperty

Identifies the FontWeight dependency property.

Foreground
Foreground
Foreground

Gets or sets the Brush to apply to the text content handled by the ContentPresenter.

ForegroundProperty
ForegroundProperty
ForegroundProperty

Identifies the Foreground dependency property.

HorizontalContentAlignment
HorizontalContentAlignment
HorizontalContentAlignment

Gets or sets the horizontal alignment of the content.

HorizontalContentAlignmentProperty
HorizontalContentAlignmentProperty
HorizontalContentAlignmentProperty

Identifies the HorizontalContentAlignment dependency property.

IsTextScaleFactorEnabled
IsTextScaleFactorEnabled
IsTextScaleFactorEnabled

Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.
IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty

Identifies the IsTextScaleFactorEnabled dependency property.

LineHeight
LineHeight
LineHeight

Gets or sets the height of each line of text content presented by the ContentPresenter.

LineHeightProperty
LineHeightProperty
LineHeightProperty

Identifies the LineHeight dependency property.

LineStackingStrategy
LineStackingStrategy
LineStackingStrategy

Gets or sets a value that indicates how a line box is determined for each line of text.

LineStackingStrategyProperty
LineStackingStrategyProperty
LineStackingStrategyProperty

Identifies the LineStackingStrategy dependency property.

MaxLines
MaxLines
MaxLines

Gets or sets the maximum lines of text shown.

MaxLinesProperty
MaxLinesProperty
MaxLinesProperty

Identifies the MaxLines dependency property.

OpticalMarginAlignment
OpticalMarginAlignment
OpticalMarginAlignment
Get or sets a value that indicates how the font is modified to align with fonts of different sizes.

OpticalMarginAlignmentProperty
OpticalMarginAlignmentProperty
OpticalMarginAlignmentProperty

Identifies the OpticalMarginAlignment dependency property.

Padding
Padding
Padding

Gets or sets the distance between the border and its child object.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.

TextLineBounds
TextLineBounds
TextLineBounds

Gets or sets a value that indicates how the line box height is determined for each line of text displayed in the
ContentPresenter.

TextLineBoundsProperty
TextLineBoundsProperty
TextLineBoundsProperty

Identifies the TextLineBounds dependency property.

TextWrapping
TextWrapping
TextWrapping

Gets or sets how the element wraps text.

TextWrappingProperty
TextWrappingProperty
TextWrappingProperty

Identifies the TextWrapping dependency property.


VerticalContentAlignment
VerticalContentAlignment
VerticalContentAlignment

Gets or sets the vertical alignment of the content.

VerticalContentAlignmentProperty
VerticalContentAlignmentProperty
VerticalContentAlignmentProperty

Identifies the VerticalContentAlignment dependency property.

Methods
OnContentTemplateChanged(DataTemplate, DataTemplate)
OnContentTemplateChanged(DataTemplate, DataTemplate)
OnContentTemplateChanged(DataTemplate, DataTemplate)

Invoked when the value of the ContentTemplate property changes.

OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)

Invoked when the value of the ContentTemplateSelector property changes.

See Also
FrameworkElement
FrameworkElement
ContentPresenter.Background ContentPresenter.
Background ContentPresenter.Background
I n this Article
Edit
Gets or sets the Brush to apply to the background of content handled by the ContentPresenter.
public : Brush Background { get; set; }
Brush Background();

void Background(Brush background);


public Brush Background { get; set; }

<ContentPresenter Background="{StaticResource resourceName}"/>

Returns
Brush
The brush used as the background brush for the contents. The default is a null brush from a pure code perspective, but
system style defaults set this to White (for Light theme) or Black (for Dark theme).
ContentPresenter.BackgroundProperty ContentPresenter.
BackgroundProperty ContentPresenter.Background
Property
I n this Article
Edit
Identifies the Background dependency property.
public : static DependencyProperty BackgroundProperty { get; }
static DependencyProperty BackgroundProperty();
public static DependencyProperty BackgroundProperty { get; }

Returns
DependencyProperty
The identifier for the Background dependency property.
See Dependency properties overview
Also
ContentPresenter.BackgroundSizing ContentPresenter.
BackgroundSizing ContentPresenter.BackgroundSizing
I n this Article
Edit
Gets or sets a value that indicates how far the background extends in relation to this element's border.
public : BackgroundSizing BackgroundSizing { get; set; }
BackgroundSizing BackgroundSizing();

void BackgroundSizing(BackgroundSizing backgroundsizing);


public BackgroundSizing BackgroundSizing { get; set; }

Returns
BackgroundSizing
A value of the enumeration that indicates how far the background extends. The default is InnerBorderEdge.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
You can set this property to OuterBorderEdge to make the element's background extend under the border. If the
border is transparent, the background will show through it.
See BackgroundSizing
Also
ContentPresenter.BackgroundSizingProperty Content
Presenter.BackgroundSizingProperty ContentPresenter.
BackgroundSizingProperty
I n this Article
Edit
Identifies the BackgroundSizing dependency property.
public : static DependencyProperty BackgroundSizingProperty { get; }
static DependencyProperty BackgroundSizingProperty();
public static DependencyProperty BackgroundSizingProperty { get; }

Returns
DependencyProperty
The identifier for the BackgroundSizing dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ContentPresenter.BackgroundTransition Content
Presenter.BackgroundTransition ContentPresenter.
BackgroundTransition
I n this Article
Edit
Gets or sets an instance of BrushTransition to automatically animate changes to the Background property.
public : BrushTransition BackgroundTransition { get; set; }
BrushTransition BackgroundTransition();

void BackgroundTransition(BrushTransition backgroundtransition);


public BrushTransition BackgroundTransition { get; set; }

Returns
BrushTransition
An instance of BrushTransition to automatically animate changes to the Background; otherwise, null. The default is
null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Examples
This example shows how to apply a background transition to a ContentPresenter. Each time PresenterBackground is
updated, the background will animate from the old brush to the new brush.
<ContentPresenter Background="{x:Bind PresenterBackground}">
<ContentPresenter.BackgroundTransition>
<BrushTransition />
</ContentPresenter.BackgroundTransition>
</ContentPresenter>

Remarks
Use this property to animate any change to the Background property. When a new value is set from code or through
data binding, the change is animated from the old value to the new value, rather than happening instantaneously.
Even though the transition animation takes time, the change to the actual property value is instantaneous. For example,
if you change a property from code and then read it back, you’ll see the new value, even though the visual effect of the
property change is somewhere between the new and the old.
If a property value changes a second time while the first change is still animating, the animation will use the currently
animated value as the "starting" value for the next animation, and then animate to the new "final" value. The duration
will be reset.
See BrushTransition
Also
ContentPresenter.BorderBrush ContentPresenter.Border
Brush ContentPresenter.BorderBrush
I n this Article
Edit
Gets or sets a brush that describes the border fill of the content presenter.
public : Brush BorderBrush { get; set; }
Brush BorderBrush();

void BorderBrush(Brush borderbrush);


public Brush BorderBrush { get; set; }

<ContentPresenter BorderBrush="{StaticResource resourceName}"/>

Returns
Brush
The brush that is used to fill the content presenter's border. The default is null, (a null brush) which is evaluated as
Transparent for rendering.

Remarks
The BorderThickness value must be greater than 0 in order to see the BorderBrush value take effect.
ContentPresenter.BorderBrushProperty ContentPresenter.
BorderBrushProperty ContentPresenter.BorderBrush
Property
I n this Article
Edit
Identifies the BorderBrush dependency property.
public : static DependencyProperty BorderBrushProperty { get; }
static DependencyProperty BorderBrushProperty();
public static DependencyProperty BorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the BorderBrush dependency property.
See Dependency properties overview
Also
ContentPresenter.BorderThickness ContentPresenter.
BorderThickness ContentPresenter.BorderThickness
I n this Article
Edit
Gets or sets the border thickness of the content presenter.
public : Thickness BorderThickness { get; set; }
Thickness BorderThickness();

void BorderThickness(Thickness borderthickness);


public Thickness BorderThickness { get; set; }

<ContentPresenter BorderThickness="uniform"/>
- or -
<ContentPresenter BorderThickness="left&right,top&bottom"/>
- or -
<ContentPresenter BorderThickness="left,top,right,bottom"/>

Returns
Thickness
The border thickness of the content presenter, as a Thickness value.
ContentPresenter.BorderThicknessProperty Content
Presenter.BorderThicknessProperty ContentPresenter.
BorderThicknessProperty
I n this Article
Edit
Identifies the BorderThickness dependency property.
public : static DependencyProperty BorderThicknessProperty { get; }
static DependencyProperty BorderThicknessProperty();
public static DependencyProperty BorderThicknessProperty { get; }

Returns
DependencyProperty
The identifier for the BorderThickness dependency property.
See Dependency properties overview
Also
ContentPresenter.CharacterSpacing ContentPresenter.
CharacterSpacing ContentPresenter.CharacterSpacing
I n this Article
Edit
Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.
public : int CharacterSpacing { get; set; }
int32_t CharacterSpacing();

void CharacterSpacing(int32_t characterspacing);


public int CharacterSpacing { get; set; }

<ContentPresenter CharacterSpacing="int"/>

Returns
int
The uniform spacing between characters, in units of 1/1000 of an em. The default is 0. Positive values increase tracking
and loosen character spacing. Negative values decrease tracking and tighten the character spacing.
ContentPresenter.CharacterSpacingProperty Content
Presenter.CharacterSpacingProperty ContentPresenter.
CharacterSpacingProperty
I n this Article
Edit
Identifies the CharacterSpacing dependency property.
public : static DependencyProperty CharacterSpacingProperty { get; }
static DependencyProperty CharacterSpacingProperty();
public static DependencyProperty CharacterSpacingProperty { get; }

Returns
DependencyProperty
The identifier for the CharacterSpacing dependency property.
ContentPresenter.Content ContentPresenter.Content
ContentPresenter.Content
I n this Article
Edit
Gets or sets the data that is used to generate the child elements of a ContentPresenter.
public : Platform::Object Content { get; set; }
winrt::Windows::Foundation::IInspectable Content();

void Content(winrt::Windows::Foundation::IInspectable content);


public object Content { get; set; }

<ContentPresenter Content="{Binding}"/>

Returns
object
The data that is used to generate the child elements. The default is null.
ContentPresenter ContentPresenter ContentPresenter
I n this Article
Edit
Initializes a new instance of the ContentPresenter class.

public : ContentPresenter()
ContentPresenter() const;
public ContentPresenter()
ContentPresenter.ContentProperty ContentPresenter.
ContentProperty ContentPresenter.ContentProperty
I n this Article
Edit
Identifies the Content dependency property
public : static DependencyProperty ContentProperty { get; }
static DependencyProperty ContentProperty();
public static DependencyProperty ContentProperty { get; }

Returns
DependencyProperty
The identifier for the Content dependency property.
ContentPresenter.ContentTemplate ContentPresenter.
ContentTemplate ContentPresenter.ContentTemplate
I n this Article
Edit
Gets or sets the template that is used to display the content of the control.
public : DataTemplate ContentTemplate { get; set; }
DataTemplate ContentTemplate();

void ContentTemplate(DataTemplate contenttemplate);


public DataTemplate ContentTemplate { get; set; }

<ContentPresenter ContentTemplate="{Binding}"/>

Returns
DataTemplate
A DataTemplate that defines the visualization of the content. The default is null.
ContentPresenter.ContentTemplateProperty Content
Presenter.ContentTemplateProperty ContentPresenter.
ContentTemplateProperty
I n this Article
Edit
Identifies the ContentTemplate dependency property.
public : static DependencyProperty ContentTemplateProperty { get; }
static DependencyProperty ContentTemplateProperty();
public static DependencyProperty ContentTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the ContentTemplate dependency property.
ContentPresenter.ContentTemplateSelector Content
Presenter.ContentTemplateSelector ContentPresenter.
ContentTemplateSelector
I n this Article
Edit
Gets or sets a selection object that changes the DataTemplate to apply for content presented in the ContentPresenter,
based on processing information about the content item or its container at run time.
public : DataTemplateSelector ContentTemplateSelector { get; set; }
DataTemplateSelector ContentTemplateSelector();

void ContentTemplateSelector(DataTemplateSelector contenttemplateselector);


public DataTemplateSelector ContentTemplateSelector { get; set; }

<ContentPresenter ContentTemplateSelector="selectorReference" />

Returns
DataTemplateSelector
A selection object that changes the DataTemplate to apply for content.
ContentPresenter.ContentTemplateSelectorProperty
ContentPresenter.ContentTemplateSelectorProperty
ContentPresenter.ContentTemplateSelectorProperty
I n this Article
Edit
Identifies the ContentTemplateSelector dependency property.
public : static DependencyProperty ContentTemplateSelectorProperty { get; }
static DependencyProperty ContentTemplateSelectorProperty();
public static DependencyProperty ContentTemplateSelectorProperty { get; }

Returns
DependencyProperty
The identifier for the ContentTemplateSelector dependency property.
ContentPresenter.ContentTransitions ContentPresenter.
ContentTransitions ContentPresenter.ContentTransitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to content presented by the ContentPresenter.
public : TransitionCollection ContentTransitions { get; set; }
TransitionCollection ContentTransitions();

void ContentTransitions(TransitionCollection contenttransitions);


public TransitionCollection ContentTransitions { get; set; }

<contentPresenter>
<contentPresenter.ContentTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</contentPresenter.ContentTransitions>
</contentPresenter>

Returns
TransitionCollection
The strongly typed collection of Transition style elements.

Remarks
Im p o rt a nt

The XAML syntax for all properties that use a TransitionCollection value is unusual in that you must declare an explicit
TransitionCollection object element as the value, and then provide object elements as child elements of
TransitionCollection for each of the transition animations you want to use. For most other XAML collection properties
you could omit the collection object element because it can be implicit, but properties that use TransitionCollection
don't support the implicit collection usage. For more info on implicit collections and XAML, see XAML syntax guide.
Transition animations play a particular role in UI design of your app. The basic idea is that when there is a change or
transition, the animation draws the attention of the user to the change.
See TransitionCollection
Also
ContentPresenter.ContentTransitionsProperty Content
Presenter.ContentTransitionsProperty ContentPresenter.
ContentTransitionsProperty
I n this Article
Edit
Identifies the ContentTransitions dependency property.
public : static DependencyProperty ContentTransitionsProperty { get; }
static DependencyProperty ContentTransitionsProperty();
public static DependencyProperty ContentTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the ContentTransitions dependency property.
ContentPresenter.CornerRadius ContentPresenter.Corner
Radius ContentPresenter.CornerRadius
I n this Article
Edit
Gets or sets the radius for the corners of the content presenter's border.
public : CornerRadius CornerRadius { get; set; }
CornerRadius CornerRadius();

void CornerRadius(CornerRadius cornerradius);


public CornerRadius CornerRadius { get; set; }

<ContentPresenter CornerRadius="uniformRadius"/>
- or -
<ContentPresenter CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>

Returns
CornerRadius
The degree to which the corners are rounded, expressed as values of the CornerRadius structure.

Remarks
Member components of a CornerRadius value cannot be negative.
ContentPresenter.CornerRadiusProperty Content
Presenter.CornerRadiusProperty ContentPresenter.Corner
RadiusProperty
I n this Article
Edit
Identifies the CornerRadius dependency property.
public : static DependencyProperty CornerRadiusProperty { get; }
static DependencyProperty CornerRadiusProperty();
public static DependencyProperty CornerRadiusProperty { get; }

Returns
DependencyProperty
The identifier for the CornerRadius dependency property.
See Dependency properties overview
Also
ContentPresenter.FontFamily ContentPresenter.Font
Family ContentPresenter.FontFamily
I n this Article
Edit
Gets or sets the preferred top-level font family for the text content presented by the ContentPresenter.
public : FontFamily FontFamily { get; set; }
FontFamily FontFamily();

void FontFamily(FontFamily fontfamily);


public FontFamily FontFamily { get; set; }

<ContentPresenter FontFamily="fontFamily" />


-or-
<ContentPresenter FontFamily="fontFamilyName[,fallbackFontFamilyName]" />
-or-
<ContentPresenter FontFamily="fontURI#fontFamily" />

Returns
FontFamily
A FontFamily object that specifies the preferred font family, or a primary preferred font family with one or more
fallback font families. For information about defaults, see the FontFamily class topic.
ContentPresenter.FontFamilyProperty ContentPresenter.
FontFamilyProperty ContentPresenter.FontFamily
Property
I n this Article
Edit
Identifies the FontFamily dependency property.
public : static DependencyProperty FontFamilyProperty { get; }
static DependencyProperty FontFamilyProperty();
public static DependencyProperty FontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the FontFamily dependency property.
ContentPresenter.FontSize ContentPresenter.FontSize
ContentPresenter.FontSize
I n this Article
Edit
Gets or sets the font size for the text content presented by the ContentPresenter.
public : double FontSize { get; set; }
double FontSize();

void FontSize(double fontsize);


public double FontSize { get; set; }

<ContentPresenter FontSize="double" .../>

Returns
double
A non-negative value that specifies the font size, measured in pixels.
ContentPresenter.FontSizeProperty ContentPresenter.
FontSizeProperty ContentPresenter.FontSizeProperty
I n this Article
Edit
Identifies the FontSize dependency property.
public : static DependencyProperty FontSizeProperty { get; }
static DependencyProperty FontSizeProperty();
public static DependencyProperty FontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the FontSize dependency property.
ContentPresenter.FontStretch ContentPresenter.Font
Stretch ContentPresenter.FontStretch
I n this Article
Edit
Gets or sets the font stretch for the text content presented by the ContentPresenter.
public : FontStretch FontStretch { get; set; }
FontStretch FontStretch();

void FontStretch(FontStretch fontstretch);


public FontStretch FontStretch { get; set; }

<ContentPresenter FontStretch="fontStretchMemberName"/>

Returns
FontStretch
The requested font stretch, as a FontStretch constant. The default is Normal.
ContentPresenter.FontStretchProperty ContentPresenter.
FontStretchProperty ContentPresenter.FontStretch
Property
I n this Article
Edit
Identifies the FontStretch dependency property.
public : static DependencyProperty FontStretchProperty { get; }
static DependencyProperty FontStretchProperty();
public static DependencyProperty FontStretchProperty { get; }

Returns
DependencyProperty
The identifier for the FontStretch dependency property.
ContentPresenter.FontStyle ContentPresenter.FontStyle
ContentPresenter.FontStyle
I n this Article
Edit
Gets or sets the font style for the presented content.
public : FontStyle FontStyle { get; set; }
FontStyle FontStyle();

void FontStyle(FontStyle fontstyle);


public FontStyle FontStyle { get; set; }

<ContentPresenter FontStyle="fontStyleMemberName"/>

Returns
FontStyle
The requested font style, which is a FontStyle constant name. The default is Normal.
ContentPresenter.FontStyleProperty ContentPresenter.
FontStyleProperty ContentPresenter.FontStyleProperty
I n this Article
Edit
Identifies the FontStyle dependency property.
public : static DependencyProperty FontStyleProperty { get; }
static DependencyProperty FontStyleProperty();
public static DependencyProperty FontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the FontStyle dependency property.
ContentPresenter.FontWeight ContentPresenter.Font
Weight ContentPresenter.FontWeight
I n this Article
Edit
Gets or sets the top-level font weight for the text content presented by the ContentPresenter.
public : FontWeight FontWeight { get; set; }
FontWeight FontWeight();

void FontWeight(FontWeight fontweight);


public FontWeight FontWeight { get; set; }

<ContentPresenter FontWeight="fontWeightsValue"/>

Returns
FontWeight
The requested font weight, which is a FontWeight that is obtained from one of the FontWeights property values. The
default is Normal.
ContentPresenter.FontWeightProperty ContentPresenter.
FontWeightProperty ContentPresenter.FontWeight
Property
I n this Article
Edit
Identifies the FontWeight dependency property.
public : static DependencyProperty FontWeightProperty { get; }
static DependencyProperty FontWeightProperty();
public static DependencyProperty FontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the FontWeight dependency property.
ContentPresenter.Foreground ContentPresenter.
Foreground ContentPresenter.Foreground
I n this Article
Edit
Gets or sets the Brush to apply to the text content handled by the ContentPresenter.
public : Brush Foreground { get; set; }
Brush Foreground();

void Foreground(Brush foreground);


public Brush Foreground { get; set; }

<ContentPresenter Foreground="{StaticResource resourceName}"/>

Returns
Brush
The brush used as the foreground brush for the text contents. The default is a null brush from a pure code perspective,
but system style defaults set this to Black (for Light theme) or White (for Dark theme).
See Use brushes
Also
ContentPresenter.ForegroundProperty ContentPresenter.
ForegroundProperty ContentPresenter.Foreground
Property
I n this Article
Edit
Identifies the Foreground dependency property.
public : static DependencyProperty ForegroundProperty { get; }
static DependencyProperty ForegroundProperty();
public static DependencyProperty ForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the Foreground dependency property.
ContentPresenter.HorizontalContentAlignment Content
Presenter.HorizontalContentAlignment ContentPresenter.
HorizontalContentAlignment
I n this Article
Edit
Gets or sets the horizontal alignment of the content.
public : HorizontalAlignment HorizontalContentAlignment { get; set; }
HorizontalAlignment HorizontalContentAlignment();

void HorizontalContentAlignment(HorizontalAlignment horizontalcontentalignment);


public HorizontalAlignment HorizontalContentAlignment { get; set; }

<ContentPresenter HorizontalContentAlignment="horizontalAlignmentMemberName"/>

Returns
HorizontalAlignment
One of the HorizontalAlignment values.
ContentPresenter.HorizontalContentAlignmentProperty
ContentPresenter.HorizontalContentAlignmentProperty
ContentPresenter.HorizontalContentAlignmentProperty
I n this Article
Edit
Identifies the HorizontalContentAlignment dependency property.
public : static DependencyProperty HorizontalContentAlignmentProperty { get; }
static DependencyProperty HorizontalContentAlignmentProperty();
public static DependencyProperty HorizontalContentAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalContentAlignment dependency property.
See Dependency properties overview
Also
ContentPresenter.IsTextScaleFactorEnabled Content
Presenter.IsTextScaleFactorEnabled ContentPresenter.Is
TextScaleFactorEnabled
I n this Article
Edit
Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.
public : Platform::Boolean IsTextScaleFactorEnabled { get; set; }
bool IsTextScaleFactorEnabled();

void IsTextScaleFactorEnabled(bool istextscalefactorenabled);


public bool IsTextScaleFactorEnabled { get; set; }

<ContentPresenter IsTextScaleFactorEnabled="bool"/>

Returns
bool
true if automatic text enlargement is enabled; otherwise, false.
See Accessible text requirements
Also
ContentPresenter.IsTextScaleFactorEnabledProperty
ContentPresenter.IsTextScaleFactorEnabledProperty
ContentPresenter.IsTextScaleFactorEnabledProperty
I n this Article
Edit
Identifies the IsTextScaleFactorEnabled dependency property.
public : static DependencyProperty IsTextScaleFactorEnabledProperty { get; }
static DependencyProperty IsTextScaleFactorEnabledProperty();
public static DependencyProperty IsTextScaleFactorEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextScaleFactorEnabled dependency property.
ContentPresenter.LineHeight ContentPresenter.Line
Height ContentPresenter.LineHeight
I n this Article
Edit
Gets or sets the height of each line of text content presented by the ContentPresenter.
public : double LineHeight { get; set; }
double LineHeight();

void LineHeight(double lineheight);


public double LineHeight { get; set; }

<ContentPresenter LineHeight="double"/>

Returns
double
The height in pixels of each line of text content. A value of 0 indicates that the line height is determined automatically
from the current font characteristics. The default is 0.
ContentPresenter.LineHeightProperty ContentPresenter.
LineHeightProperty ContentPresenter.LineHeight
Property
I n this Article
Edit
Identifies the LineHeight dependency property.
public : static DependencyProperty LineHeightProperty { get; }
static DependencyProperty LineHeightProperty();
public static DependencyProperty LineHeightProperty { get; }

Returns
DependencyProperty
The identifier for the LineHeight dependency property.
ContentPresenter.LineStackingStrategy ContentPresenter.
LineStackingStrategy ContentPresenter.LineStacking
Strategy
I n this Article
Edit
Gets or sets a value that indicates how a line box is determined for each line of text.
public : LineStackingStrategy LineStackingStrategy { get; set; }
LineStackingStrategy LineStackingStrategy();

void LineStackingStrategy(LineStackingStrategy linestackingstrategy);


public LineStackingStrategy LineStackingStrategy { get; set; }

Returns
LineStackingStrategy
A value that indicates how a line box is determined for each line of text. The default is MaxHeight.
ContentPresenter.LineStackingStrategyProperty Content
Presenter.LineStackingStrategyProperty Content
Presenter.LineStackingStrategyProperty
I n this Article
Edit
Identifies the LineStackingStrategy dependency property.
public : static DependencyProperty LineStackingStrategyProperty { get; }
static DependencyProperty LineStackingStrategyProperty();
public static DependencyProperty LineStackingStrategyProperty { get; }

Returns
DependencyProperty
The identifier for the LineStackingStrategy dependency property.
ContentPresenter.MaxLines ContentPresenter.MaxLines
ContentPresenter.MaxLines
I n this Article
Edit
Gets or sets the maximum lines of text shown.
public : int MaxLines { get; set; }
int32_t MaxLines();

void MaxLines(int32_t maxlines);


public int MaxLines { get; set; }

Returns
int
The maximum lines of text shown. The default is 0, which is a special value that represents "Auto" behavior. The value
cannot be negative.
ContentPresenter.MaxLinesProperty ContentPresenter.
MaxLinesProperty ContentPresenter.MaxLinesProperty
I n this Article
Edit
Identifies the MaxLines dependency property.
public : static DependencyProperty MaxLinesProperty { get; }
static DependencyProperty MaxLinesProperty();
public static DependencyProperty MaxLinesProperty { get; }

Returns
DependencyProperty
The identifier for the MaxLines dependency property.
ContentPresenter.OnContentTemplateChanged Content
Presenter.OnContentTemplateChanged ContentPresenter.
OnContentTemplateChanged
I n this Article
Edit
Invoked when the value of the ContentTemplate property changes.
protected : virtual void OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate
newContentTemplate)
virtual void OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate
newContentTemplate) const;
protected virtual void OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate
newContentTemplate)

Parameters
oldContentTemplate DataTemplate
The old value of the ContentTemplate property.
newContentTemplate DataTemplate
The new value of the ContentTemplate property.
ContentPresenter.OnContentTemplateSelectorChanged
ContentPresenter.OnContentTemplateSelectorChanged
ContentPresenter.OnContentTemplateSelectorChanged
I n this Article
Edit
Invoked when the value of the ContentTemplateSelector property changes.
protected : virtual void OnContentTemplateSelectorChanged(DataTemplateSelector
oldContentTemplateSelector, DataTemplateSelector newContentTemplateSelector)
virtual void OnContentTemplateSelectorChanged(DataTemplateSelector oldContentTemplateSelector,
DataTemplateSelector newContentTemplateSelector) const;
protected virtual void OnContentTemplateSelectorChanged(DataTemplateSelector
oldContentTemplateSelector, DataTemplateSelector newContentTemplateSelector)

Parameters
oldContentTemplateSelector DataTemplateSelector
The old value of the ContentTemplateSelector property.
newContentTemplateSelector DataTemplateSelector
The new value of the ContentTemplateSelector property.

Remarks
Classes that derive from ContentPresenter can override this method in order to perform any custom logic that should
apply, in cases where the selector logic that automatically chooses the DataTemplate based on context changes.
ContentPresenter.OpticalMarginAlignment Content
Presenter.OpticalMarginAlignment ContentPresenter.
OpticalMarginAlignment
I n this Article
Edit
Get or sets a value that indicates how the font is modified to align with fonts of different sizes.
public : OpticalMarginAlignment OpticalMarginAlignment { get; set; }
OpticalMarginAlignment OpticalMarginAlignment();

void OpticalMarginAlignment(OpticalMarginAlignment opticalmarginalignment);


public OpticalMarginAlignment OpticalMarginAlignment { get; set; }

<ContentPresenter OpticalMarginAlignment="None"/>
-or-
<ContentPresenter OpticalMarginAlignment="TrimSideBearings"/>

Returns
OpticalMarginAlignment
A value of the enumeration that indicates how the font is modified to align at different sizes. The default is None.
ContentPresenter.OpticalMarginAlignmentProperty
ContentPresenter.OpticalMarginAlignmentProperty
ContentPresenter.OpticalMarginAlignmentProperty
I n this Article
Edit
Identifies the OpticalMarginAlignment dependency property.
public : static DependencyProperty OpticalMarginAlignmentProperty { get; }
static DependencyProperty OpticalMarginAlignmentProperty();
public static DependencyProperty OpticalMarginAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the OpticalMarginAlignment dependency property.
ContentPresenter.Padding ContentPresenter.Padding
ContentPresenter.Padding
I n this Article
Edit
Gets or sets the distance between the border and its child object.
public : Thickness Padding { get; set; }
Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<ContentPresenter Padding="uniform"/>
- or -
<ContentPresenter Padding="left&right,top&bottom"/>
- or -
<ContentPresenter Padding="left,top,right,bottom"/>

Returns
Thickness
The dimensions of the space between the border and its child as a Thickness value. Thickness is a structure that stores
dimension values using pixel measures.

Remarks
A related property is Margin (a property of FrameworkElement ). For more info about the relationship between margin
and padding, see Alignment, margin, and padding or Define layouts with XAML.
ContentPresenter.PaddingProperty ContentPresenter.
PaddingProperty ContentPresenter.PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
See Dependency properties overview
Also
ContentPresenter.TextLineBounds ContentPresenter.Text
LineBounds ContentPresenter.TextLineBounds
I n this Article
Edit
Gets or sets a value that indicates how the line box height is determined for each line of text displayed in the
ContentPresenter.
public : TextLineBounds TextLineBounds { get; set; }
TextLineBounds TextLineBounds();

void TextLineBounds(TextLineBounds textlinebounds);


public TextLineBounds TextLineBounds { get; set; }

<ContentPresenter TextLineBounds="textLineBoundsValue"/>

Returns
TextLineBounds
A value that indicates how the line box height is determined for each line of text. The default is Full.
ContentPresenter.TextLineBoundsProperty Content
Presenter.TextLineBoundsProperty ContentPresenter.Text
LineBoundsProperty
I n this Article
Edit
Identifies the TextLineBounds dependency property.
public : static DependencyProperty TextLineBoundsProperty { get; }
static DependencyProperty TextLineBoundsProperty();
public static DependencyProperty TextLineBoundsProperty { get; }

Returns
DependencyProperty
The identifier for the TextLineBounds dependency property.
ContentPresenter.TextWrapping ContentPresenter.Text
Wrapping ContentPresenter.TextWrapping
I n this Article
Edit
Gets or sets how the element wraps text.
public : TextWrapping TextWrapping { get; set; }
TextWrapping TextWrapping();

void TextWrapping(TextWrapping textwrapping);


public TextWrapping TextWrapping { get; set; }

Returns
TextWrapping
A value that indicates how the element wraps text. The default is NoWrap.
ContentPresenter.TextWrappingProperty Content
Presenter.TextWrappingProperty ContentPresenter.Text
WrappingProperty
I n this Article
Edit
Identifies the TextWrapping dependency property.
public : static DependencyProperty TextWrappingProperty { get; }
static DependencyProperty TextWrappingProperty();
public static DependencyProperty TextWrappingProperty { get; }

Returns
DependencyProperty
The identifier for the TextWrapping dependency property.
ContentPresenter.VerticalContentAlignment Content
Presenter.VerticalContentAlignment ContentPresenter.
VerticalContentAlignment
I n this Article
Edit
Gets or sets the vertical alignment of the content.
public : VerticalAlignment VerticalContentAlignment { get; set; }
VerticalAlignment VerticalContentAlignment();

void VerticalContentAlignment(VerticalAlignment verticalcontentalignment);


public VerticalAlignment VerticalContentAlignment { get; set; }

<ContentPresenter VerticalContentAlignment="verticalAlignmentValue"/>

Returns
VerticalAlignment
One of the VerticalAlignment values.
ContentPresenter.VerticalContentAlignmentProperty
ContentPresenter.VerticalContentAlignmentProperty
ContentPresenter.VerticalContentAlignmentProperty
I n this Article
Edit
Identifies the VerticalContentAlignment dependency property.
public : static DependencyProperty VerticalContentAlignmentProperty { get; }
static DependencyProperty VerticalContentAlignmentProperty();
public static DependencyProperty VerticalContentAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalContentAlignment dependency property.
See Dependency properties overview
Also
ContextMenuEventArgs ContextMenuEventArgs Context
MenuEventArgs Class
Provides event data for the ContextMenuOpening event that exists on several text-related UI elements.

D eclaration
public : sealed class ContextMenuEventArgs : RoutedEventArgs, IContextMenuEventArgs
struct winrt::Windows::UI::Xaml::Controls::ContextMenuEventArgs : RoutedEventArgs,
IContextMenuEventArgs
public sealed class ContextMenuEventArgs : RoutedEventArgs, IContextMenuEventArgs

I nheritance H ierarchy
RoutedEventArgs

Properties
CursorLeft
CursorLeft
CursorLeft

Gets the pixel offset of the text cursor horizontal position.

CursorTop
CursorTop
CursorTop

Gets the pixel offset of the text cursor vertical position.

Handled
Handled
Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers
along the event route from handling the same event again.

See Also
RoutedEventArgs
ContextMenuEventArgs.CursorLeft ContextMenuEvent
Args.CursorLeft ContextMenuEventArgs.CursorLeft
I n this Article
Edit
Gets the pixel offset of the text cursor horizontal position.
public : double CursorLeft { get; }
double CursorLeft();
public double CursorLeft { get; }

Returns
double
A value in pixels.
ContextMenuEventArgs.CursorTop ContextMenuEvent
Args.CursorTop ContextMenuEventArgs.CursorTop
I n this Article
Edit
Gets the pixel offset of the text cursor vertical position.
public : double CursorTop { get; }
double CursorTop();
public double CursorTop { get; }

Returns
double
A value in pixels.
ContextMenuEventArgs.Handled ContextMenuEvent
Args.Handled ContextMenuEventArgs.Handled
I n this Article
Edit
Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along
the event route from handling the same event again.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
True to mark the routed event handled. False to leave the routed event unhandled, which permits the event to
potentially route further and be acted on by other handlers. The default is false.
ContextMenuOpeningEventHandler ContextMenu
OpeningEventHandler ContextMenuOpeningEvent
Handler Delegate
Represents the method that will handle the ContextMenuOpening event that exists on several text-related UI
elements.

D eclaration
public : delegate void ContextMenuOpeningEventHandler(Platform::Object sender,
ContextMenuEventArgs e)
struct ContextMenuOpeningEventHandler : winrt::Windows::Foundation::IUnknown
{
ContextMenuOpeningEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> ContextMenuOpeningEventHandler(L lambda);
template <typename F> ContextMenuOpeningEventHandler(F* function);
template <typename O, typename M> ContextMenuOpeningEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::ContextMenuEventArgs const& e) const;
};
public delegate void ContextMenuOpeningEventHandler(Object sender, ContextMenuEventArgs e)

I nheritance H ierarchy
None
Control Control Control Class
Represents the base class for UI elements that use a ControlTemplate to define their appearance. Parent class for
ContentControl, UserControl, ItemsControl and several practical controls.

D eclaration
public : class Control : FrameworkElement, IControl, IControl2, IControl3, IControl4, IControl5,
IControl7, IControlOverrides, IControlOverrides6, IControlProtected
struct winrt::Windows::UI::Xaml::Controls::Control : FrameworkElement, IControl, IControl2,
IControl3, IControl4, IControl5, IControl7, IControlOverrides, IControlOverrides6,
IControlProtected
public class Control : FrameworkElement, IControl, IControl2, IControl3, IControl4, IControl5,
IControl7, IControlOverrides, IControlOverrides6, IControlProtected

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
The Control class is the base class for many of the controls you add to an app and its UI. The Control class defines very
little behavior; you can add an actual Control element to XAML for UI but you typically add something that inherits
from Control directly or indirectly, such as a Button or ListBox. For a list of controls you can use, see Controls by
function.
The Template property, which uses the type ControlTemplate, specifies the visual appearance of a control. If you want
to change the appearance of a control but retain its functionality, you should consider creating a new ControlTemplate
instead of defining a new Control -based class. For more info, see Control templates.
Control is the parent of UserControl. UserControl is the intended base class for lightweight controls that don't need
visual states. Although the UserControl technically inherits the Template property, you cannot apply a template to a
UserControl.
I mplicit styles for controls
Each practical control that's defined for XAML has a default style that contains its default control template. Controls can
have an implicit style, meaning that the FrameworkElement.Style property isn't set explicitly. Once that implicit style is
available, almost all other properties of a control can be set with Setter elements in that Style. The Style can initialize
the control separately from the rest of the control logic, and can set values that aren't the code-based defaults for each
property.
The implicit style exists as a keyed resource that's part of the Windows Runtime, stored internally as a binary
representation of XAML. You can get a copy of either a particular control's style or of the full set of styles to look at
how the styles and control templates are defined.
The association between a particular control type and the key/name of the implicit style it uses by default is established
by the value of the DefaultStyleKey property. The DefaultStyleKey property is protected, so only someone that
subclasses a control class can change the value. If you're just creating a control instance, for example declaring controls
in a XAML UI, then the default style is the implicit style that's based on the control's type. For more info, see Remarks
in DefaultStyleKey. You don't need to change the DefaultStyleKey value to use a different style, you just need to define
your own XAML Style that has the same TargetType that matches the implicit style lookup and exists as a XAML
resource. For more info, see Control templates.
The visual state model
The visual state model is a technique where you modify just a few of the properties defined in a control's template. You
change property values in order to provide visual feedback to the user that indicates what the control is doing and
hints at further UI interactions that are possible. The controls are modified by applying zero-duration or short-duration
storyboarded animations to some of the properties in the template. You also can define short-duration animations that
apply for the transitions between states.
The visual states themselves are defined as part of the control template. Each visual state has a name, so that the
control logic can invoke the GoToState method that loads up each visual state when it's needed for a particular logic
state. Visual states are declared within visual state groups, so that visual states that are exclusive to each other can
ensure that only one such state is active at a time. As soon as another visual state from the same group is loaded, the
animations for the previous state stop being applied, but animations in another group might still be running and
applying their changes and visual behavior. For example, a control might have a visual indicator for keyboard focus and
a visual indicator for pointer-over. Because these are UI modes that can be adjusted independently of each other and
can happen at the same time, they're each defined in a different visual state group.
Because it's defined in XAML as part of the control template, you can change the visual state behavior for any XAML
control that you use in your UI. However, the logic is still based on the control expecting to find certain visual state
groups and named visual states within. So you have to be very careful that you're providing the correctly named and
structured visual states that are showing all aspects of a control's behavior to the user. For more info, see Storyboarded
animations for visual states. Visual states are also briefly introduced in Control templates.
Default visual states for controls sometimes use the library animations. You should try to preserve the library
animations when you replace control templates or visual states because these animations are an important part of the
control's look and feel in the UI. For more info, see Animations overview.
Controls and focus
The Control class defines several API that influence the keyboard focus behavior for a UI: the Focus method, the
FocusState property, and the IsEnabled and IsTabStop properties. Enabling keyboard focus is an important part of
assuring that a UI is accessible, because each focusable element becomes part of the tab order for the UI. Only UI
elements that are interactive are typically enabled to receive keyboard focus. For example, a TextBox is interactive
because the user can type text, whereas a TextBlock is not interactive because the text is read-only. Most of the classes
that derive from Control are legitimately interactive and so it makes sense that they can be focused and should be in
the tab order.
In order to be focusable, each of these must be true:
Visibility is Visible
IsEnabled is true
IsTabStop is true
The control must be instantiated with its template loaded (Loaded fired, control connected to app's root visual) If you
want a control to not be focusable, you can set IsTabStop to false. However, if the reason you don't want the control to
have focus is because it's not interactive in your UI, you might want to set IsEnabled to false to make the lack of
interaction obvious to everyone. Many controls have predefined visual states that are invoked for IsEnabled =false,
such as "graying out" text in labels.
Focus changes can fire GotFocus or LostFocus events. Although the "FocusedElement" value (exposed via
GetFocusedElement method) is updated immediately, the change notifications of GotFocus or LostFocus occur
asynchronously. This asynchronous focusing design is intended to avoid flickering on visual state transitions when
control logic reacts to focus change too quickly.
The Focus method enables bringing keyboard focus to a control programmatically. Be judicious when calling this
method, it can be intrusive to move the keyboard focus when the user doesn't expect it. The main scenarios for Focus
are either setting the very first keyboard focus point when an entire page of UI is loaded, or setting focus to a specific
part of a control once the parent control container has received top-level focus (like focusing the textbox in a
combobox). For more info, see Focus. FocusState tracks whether focus is programmatic or user-driven, which makes a
difference for visual states, notably the visual focus indicator for keyboard focus that all controls should have.
On * event handler overrides
Each On* method represents a prewired event handler for the corresponding UIElement event. Practical controls that
derive from Control can override the On* method and use this to provide control-specific handling and behavior for
that input event. The most common scenario is to use the event handler to mark the event as Handled in the event
data. The control code has first chance to handle this event, before any event handlers that are wired on a control
instance are invoked. When the event data is marked Handled, then other handlers like those on the control instance
won't be called. Also, the event won't bubble.
As it's implemented directly on Control, the On* method has an empty implementation. But each ancestor in a
control's hierarchy may have provided an implementation. You won't be able to see this implementation because it's
internal native code. In some cases a control will already have existing On* overrides that mark the event Handled.
Once you've provided an initial On* override for a control, then any controls that you further derive from your own
control class would also inherit the On* overrides you define. Any instances you use have that behavior too.
Note

App code can still handle events that may have been marked Handled by a control's On* method logic, but they need
to use the handledEventsToo parameter for the UIElement.AddHandler method. For more info, see
UIElement.AddHandler or Events and routed events overview.
The Control class defines several protected virtual methods that are each associated with a framework-level input
event. These methods are intended to provide a pre-wired event handler for input events such that a control can
enforce that certain input behaviors are used by that control and all instances of it. For example, there's a
PointerPressed event defined by UIElement. Control defines the OnPointerPressed method, with an empty definition.
Within the base Control constructor, event wiring for all the relevant input events includes the On* method as a
listener/handler, which initially does nothing. But all it takes now for you as the control author to change the behavior
for an input event is to give a new override definition for an On* method (also, make sure your constructor calls base).
That behavior gets inherited to all instances or subclasses, unless another subclasser overrides it again. Because the
On* events are first in sequence, before any UI definition XAML, they can adjust the event data and potentially change
the conditions that other listeners see about the event.
The existing On* definitions in a particular control class can affect you as the consumer of the control even if you
haven't overridden any On* methods yourself. This is because the existing On* definitions may have provided handling
for an event that sets a Handled property value to false in some event's event data. That will prevent your instance-
based event handling from even seeing the event, and will prevent your handler from being invoked. What's
happening here is that there's an intentional control design that is enforcing that certain events shouldn't matter to the
control, either because they're low -level events that clash with control logic or because the control has replacement
logic. A prominent example of this is the ButtonBase class. The ButtonBase class has two behaviors that it enforces
through a native override of OnPointerPressed and OnKeyDown. It's doing this because it's combining various input
modes at a low level and reporting them instead as the control-specific Click event. In the case of a PointerPressed
event handler, if you tried to handle this on a Button instance, your handler doesn't get invoked. That's because the
native OnPointerPressed set Handled to true and that prevented PointerPressed from propagating to your instance
and app code. For OnKeyDown, the logic was just looking for certain keys (Ctrl and Enter) so an instance handler can
still invoke as long as it isn't also looking for those keys.
Note

There's actually a way to get around native handling of On* methods for input, for some of the input events. To do this
you need to wire your handlers using the AddHandler method with handledEventsToo. For more info see AddHandler
or Events and routed events overview.
Text properties that inherit to text element parts
Control defines several properties that are relevant to presentation of text. These are:
Foreground
FontFamily
FontSize
FontStretch
FontStyle
FontWeight
Obviously, not every control is intended to display text within it. For example, setting FontFamily on an
AppBarSeparator is legal but has absolutely no effect. The reason that Control defines these properties at the base
class level is to make it easy for control templates to use {TemplateBinding} markup extension to apply top-level text
properties to one or more text element parts that exist within the template. For example, if you look at the control
template for a DatePicker, you'll see that the root is a container and more deeply within that container are several
ComboBox parts that actually take the text input. Each of these uses statements like
FontWeight="{TemplateBinding FontWeight}" to have the top-level FontWeight as set on a DatePicker be used by
various parts within.
Text properties on Control also inherit implicitly for a control that has a ContentPresenter within it that displays text.
For example, if you set FontSize on a Button, there's no explicit {TemplateBinding} markup extension in its template or
ContentPresenter part that controls what the template does with a top-level FontSize value. But the Control.FontSize
value is implicitly inherited by ContentPresenter.FontSize based on the context within the template's definition, so the
text within the Button will be presented using the Control.FontSize you set.
Control derived classes
Control is the parent class for these immediately derived control classes. Some of these are practical controls. Others
are intermediate base classes for various controls that share characteristics.
AppBarSeparator
ContentControl
DatePicker
Hub
HubSection
ItemsControl
MenuFlyoutItemBase
PasswordBox
ProgressRing
RangeBase
RichEditBox
SearchBox
SemanticZoom
TextBox
Thumb
TimePicker
ToggleSwitch
UserControl

Constructors
Control()
Control()
Control()

Provides base class initialization behavior for Control derived classes.


Properties
Background
Background
Background

Gets or sets a brush that provides the background of the control.

BackgroundProperty
BackgroundProperty
BackgroundProperty

Identifies the Background dependency property.

BackgroundSizing
BackgroundSizing
BackgroundSizing

Gets or sets a value that indicates how far the background extends in relation to this element's border.

BackgroundSizingProperty
BackgroundSizingProperty
BackgroundSizingProperty

Identifies the BackgroundSizing dependency property.

BorderBrush
BorderBrush
BorderBrush

Gets or sets a brush that describes the border fill of a control.

BorderBrushProperty
BorderBrushProperty
BorderBrushProperty

Identifies the BorderBrush dependency property.

BorderThickness
BorderThickness
BorderThickness

Gets or sets the border thickness of a control.

BorderThicknessProperty
BorderThicknessProperty
BorderThicknessProperty

Identifies the BorderThickness dependency property.

CharacterSpacing
CharacterSpacing
CharacterSpacing

Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.

CharacterSpacingProperty
CharacterSpacingProperty
CharacterSpacingProperty

Identifies the CharacterSpacing dependency property.

CornerRadius
CornerRadius
CornerRadius

Gets or sets the radius for the corners of the control's border.

CornerRadiusProperty
CornerRadiusProperty
CornerRadiusProperty

Identifies the CornerRadius dependency property.

DefaultStyleKey
DefaultStyleKey
DefaultStyleKey

Gets or sets the key that references the default style for the control. Authors of custom controls use this property
to change the default for the style that their control uses.

DefaultStyleKeyProperty
DefaultStyleKeyProperty
DefaultStyleKeyProperty

Identifies the DefaultStyleKey dependency property.

DefaultStyleResourceUri
DefaultStyleResourceUri
DefaultStyleResourceUri
Gets or sets the path to the resource file that contains the default style for the control.

DefaultStyleResourceUriProperty
DefaultStyleResourceUriProperty
DefaultStyleResourceUriProperty

Identifies the DefaultStyleResourceUri dependency property.

ElementSoundMode
ElementSoundMode
ElementSoundMode

Get or sets a value that specifies a control's preference for whether sounds are played.

ElementSoundModeProperty
ElementSoundModeProperty
ElementSoundModeProperty

Identifies the ElementSoundMode dependency property.

FocusState
FocusState
FocusState

Gets a value that specifies whether this control has focus, and the mode by which focus was obtained.

FocusStateProperty
FocusStateProperty
FocusStateProperty

Identifies the FocusState dependency property.

FontFamily
FontFamily
FontFamily

Gets or sets the font used to display text in the control.

FontFamilyProperty
FontFamilyProperty
FontFamilyProperty

Identifies the FontFamily dependency property.


FontSize
FontSize
FontSize

Gets or sets the size of the text in this control.

FontSizeProperty
FontSizeProperty
FontSizeProperty

Identifies the FontSize dependency property.

FontStretch
FontStretch
FontStretch

Gets or sets the degree to which a font is condensed or expanded on the screen.

FontStretchProperty
FontStretchProperty
FontStretchProperty

Identifies the FontStretch dependency property.

FontStyle
FontStyle
FontStyle

Gets or sets the style in which the text is rendered.

FontStyleProperty
FontStyleProperty
FontStyleProperty

Identifies the FontStyle dependency property.

FontWeight
FontWeight
FontWeight

Gets or sets the thickness of the specified font.

FontWeightProperty
FontWeightProperty
FontWeightProperty
Identifies the FontWeight dependency property.

Foreground
Foreground
Foreground

Gets or sets a brush that describes the foreground color.

ForegroundProperty
ForegroundProperty
ForegroundProperty

Identifies the Foreground dependency property.

HorizontalContentAlignment
HorizontalContentAlignment
HorizontalContentAlignment

Gets or sets the horizontal alignment of the control's content.

HorizontalContentAlignmentProperty
HorizontalContentAlignmentProperty
HorizontalContentAlignmentProperty

Identifies the HorizontalContentAlignment dependency property.

IsEnabled
IsEnabled
IsEnabled

Gets or sets a value indicating whether the user can interact with the control.

IsEnabledProperty
IsEnabledProperty
IsEnabledProperty

Identifies the IsEnabled dependency property.

IsFocusEngaged
IsFocusEngaged
IsFocusEngaged

Get or sets a value that indicates whether focus is constrained within the control boundaries (for game pad/remote
interaction).
IsFocusEngagedProperty
IsFocusEngagedProperty
IsFocusEngagedProperty

Identifies the IsFocusEngaged dependency property.

IsFocusEngagementEnabled
IsFocusEngagementEnabled
IsFocusEngagementEnabled

Get or sets a value that indicates whether focus can be constrained within the control boundaries (for game
pad/remote interaction).

IsFocusEngagementEnabledProperty
IsFocusEngagementEnabledProperty
IsFocusEngagementEnabledProperty

Identifies the IsFocusEngagementEnabled dependency property.

IsTabStop
IsTabStop
IsTabStop

Gets or sets a value that indicates whether a control is included in tab navigation.

IsTabStopProperty
IsTabStopProperty
IsTabStopProperty

Identifies the IsTabStop dependency property.

IsTemplateFocusTargetProperty
IsTemplateFocusTargetProperty
IsTemplateFocusTargetProperty

Identifies the Control.IsTemplateFocusTarget XAML attached property.

IsTemplateKeyTipTargetProperty
IsTemplateKeyTipTargetProperty
IsTemplateKeyTipTargetProperty

Identifies the Control.IsTemplateKeyTipTarget XAML attached property.

IsTextScaleFactorEnabled
IsTextScaleFactorEnabled
IsTextScaleFactorEnabled

Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.

IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty

Identifies the IsTextScaleFactorEnabled dependency property.

Padding
Padding
Padding

Gets or sets the padding inside a control.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.

RequiresPointer
RequiresPointer
RequiresPointer

Gets or sets whether a UI element supports mouse mode, which emulates pointer interaction experiences with
non-pointer input devices such as an Xbox gamepad or remote control.

RequiresPointerProperty
RequiresPointerProperty
RequiresPointerProperty

Identifies the RequiresPointer dependency property.

TabIndex
TabIndex
TabIndex

Gets or sets a value that determines the order in which elements receive focus when the user navigates through
controls by pressing the Tab key.

TabIndexProperty
TabIndexProperty
TabIndexProperty
Identifies the TabIndex dependency property.

TabNavigation
TabNavigation
TabNavigation

Gets or sets a value that modifies how tabbing and TabIndex work for this control.
Note

For Windows 10 Creators Update (build 10.0.15063) and newer, the TabFocusNavigation property is available on
the base class to include objects in the tab sequence that do not use a ControlTemplate.
UI Element

TabNavigationProperty
TabNavigationProperty
TabNavigationProperty

Identifies the TabNavigation dependency property.

Template
Template
Template

Gets or sets a control template. The control template defines the visual appearance of a control in UI, and is
defined in XAML markup.

TemplateProperty
TemplateProperty
TemplateProperty

Identifies the Template dependency property.

UseSystemFocusVisuals
UseSystemFocusVisuals
UseSystemFocusVisuals

Gets or sets a value that indicates whether the control uses focus visuals that are drawn by the system or those
defined in the control template.

UseSystemFocusVisualsProperty
UseSystemFocusVisualsProperty
UseSystemFocusVisualsProperty

Identifies the UseSystemFocusVisuals dependency property.

VerticalContentAlignment
VerticalContentAlignment
VerticalContentAlignment

Gets or sets the vertical alignment of the control's content.

VerticalContentAlignmentProperty
VerticalContentAlignmentProperty
VerticalContentAlignmentProperty

Identifies the VerticalContentAlignment dependency property.

XYFocusDown
XYFocusDown
XYFocusDown

Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) down.

XYFocusDownProperty
XYFocusDownProperty
XYFocusDownProperty

Identifies the XYFocusDown dependency property.

XYFocusLeft
XYFocusLeft
XYFocusLeft

Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) left.

XYFocusLeftProperty
XYFocusLeftProperty
XYFocusLeftProperty

Identifies the XYFocusLeft dependency property.

XYFocusRight
XYFocusRight
XYFocusRight

Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) right.

XYFocusRightProperty
XYFocusRightProperty
XYFocusRightProperty

Identifies the XYFocusRight dependency property.


XYFocusUp
XYFocusUp
XYFocusUp

Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) up.

XYFocusUpProperty
XYFocusUpProperty
XYFocusUpProperty

Identifies the XYFocusUp dependency property.

Methods
ApplyTemplate()
ApplyTemplate()
ApplyTemplate()

Loads the relevant control template so that its parts can be referenced.

Focus(FocusState)
Focus(FocusState)
Focus(FocusState)

Attempts to set the focus on the control.

GetIsTemplateFocusTarget(FrameworkElement)
GetIsTemplateFocusTarget(FrameworkElement)
GetIsTemplateFocusTarget(FrameworkElement)

Gets the value of the Control.IsTemplateFocusTarget XAML attached property for the target element.

GetIsTemplateKeyTipTarget(DependencyObject)
GetIsTemplateKeyTipTarget(DependencyObject)
GetIsTemplateKeyTipTarget(DependencyObject)

Gets the value of the Control.IsTemplateKeyTipTarget XAML attached property for the target element.

GetTemplateChild(String)
GetTemplateChild(String)
GetTemplateChild(String)

Retrieves the named element in the instantiated ControlTemplate visual tree.

OnCharacterReceived(CharacterReceivedRoutedEventArgs)
OnCharacterReceived(CharacterReceivedRoutedEventArgs)
OnCharacterReceived(CharacterReceivedRoutedEventArgs)

Called before the CharacterReceived event occurs.

OnDoubleTapped(DoubleTappedRoutedEventArgs)
OnDoubleTapped(DoubleTappedRoutedEventArgs)
OnDoubleTapped(DoubleTappedRoutedEventArgs)

Called before the DoubleTapped event occurs.

OnDragEnter(DragEventArgs)
OnDragEnter(DragEventArgs)
OnDragEnter(DragEventArgs)

Called before the DragEnter event occurs.

OnDragLeave(DragEventArgs)
OnDragLeave(DragEventArgs)
OnDragLeave(DragEventArgs)

Called before the DragLeave event occurs.

OnDragOver(DragEventArgs)
OnDragOver(DragEventArgs)
OnDragOver(DragEventArgs)

Called before the DragOver event occurs.

OnDrop(DragEventArgs)
OnDrop(DragEventArgs)
OnDrop(DragEventArgs)

Called before the Drop event occurs.

OnGotFocus(RoutedEventArgs)
OnGotFocus(RoutedEventArgs)
OnGotFocus(RoutedEventArgs)

Called before the GotFocus event occurs.

OnHolding(HoldingRoutedEventArgs)
OnHolding(HoldingRoutedEventArgs)
OnHolding(HoldingRoutedEventArgs)

Called before the Holding event occurs.


OnKeyDown(KeyRoutedEventArgs)
OnKeyDown(KeyRoutedEventArgs)
OnKeyDown(KeyRoutedEventArgs)

Called before the KeyDown event occurs.

OnKeyUp(KeyRoutedEventArgs)
OnKeyUp(KeyRoutedEventArgs)
OnKeyUp(KeyRoutedEventArgs)

Called before the KeyUp event occurs.

OnLostFocus(RoutedEventArgs)
OnLostFocus(RoutedEventArgs)
OnLostFocus(RoutedEventArgs)

Called before the LostFocus event occurs.

OnManipulationCompleted(ManipulationCompletedRoutedEventArgs)
OnManipulationCompleted(ManipulationCompletedRoutedEventArgs)
OnManipulationCompleted(ManipulationCompletedRoutedEventArgs)

Called before the ManipulationCompleted event occurs.

OnManipulationDelta(ManipulationDeltaRoutedEventArgs)
OnManipulationDelta(ManipulationDeltaRoutedEventArgs)
OnManipulationDelta(ManipulationDeltaRoutedEventArgs)

Called before the ManipulationDelta event occurs.

OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs)
OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs)
OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs)

Called before the ManipulationInertiaStarting event occurs.

OnManipulationStarted(ManipulationStartedRoutedEventArgs)
OnManipulationStarted(ManipulationStartedRoutedEventArgs)
OnManipulationStarted(ManipulationStartedRoutedEventArgs)

Called before the ManipulationStarted event occurs.

OnManipulationStarting(ManipulationStartingRoutedEventArgs)
OnManipulationStarting(ManipulationStartingRoutedEventArgs)
OnManipulationStarting(ManipulationStartingRoutedEventArgs)
Called before the ManipulationStarting event occurs.

OnPointerCanceled(PointerRoutedEventArgs)
OnPointerCanceled(PointerRoutedEventArgs)
OnPointerCanceled(PointerRoutedEventArgs)

Called before the PointerCanceled event occurs.

OnPointerCaptureLost(PointerRoutedEventArgs)
OnPointerCaptureLost(PointerRoutedEventArgs)
OnPointerCaptureLost(PointerRoutedEventArgs)

Called before the PointerCaptureLost event occurs.

OnPointerEntered(PointerRoutedEventArgs)
OnPointerEntered(PointerRoutedEventArgs)
OnPointerEntered(PointerRoutedEventArgs)

Called before the PointerEntered event occurs.

OnPointerExited(PointerRoutedEventArgs)
OnPointerExited(PointerRoutedEventArgs)
OnPointerExited(PointerRoutedEventArgs)

Called before the PointerExited event occurs.

OnPointerMoved(PointerRoutedEventArgs)
OnPointerMoved(PointerRoutedEventArgs)
OnPointerMoved(PointerRoutedEventArgs)

Called before the PointerMoved event occurs.

OnPointerPressed(PointerRoutedEventArgs)
OnPointerPressed(PointerRoutedEventArgs)
OnPointerPressed(PointerRoutedEventArgs)

Called before the PointerPressed event occurs.

OnPointerReleased(PointerRoutedEventArgs)
OnPointerReleased(PointerRoutedEventArgs)
OnPointerReleased(PointerRoutedEventArgs)

Called before the PointerReleased event occurs.


OnPointerWheelChanged(PointerRoutedEventArgs)
OnPointerWheelChanged(PointerRoutedEventArgs)
OnPointerWheelChanged(PointerRoutedEventArgs)

Called before the PointerWheelChanged event occurs.

OnPreviewKeyDown(KeyRoutedEventArgs)
OnPreviewKeyDown(KeyRoutedEventArgs)
OnPreviewKeyDown(KeyRoutedEventArgs)

Called before the PreviewKeyDown event occurs.

OnPreviewKeyUp(KeyRoutedEventArgs)
OnPreviewKeyUp(KeyRoutedEventArgs)
OnPreviewKeyUp(KeyRoutedEventArgs)

Called before the PreviewKeyUp event occurs.

OnRightTapped(RightTappedRoutedEventArgs)
OnRightTapped(RightTappedRoutedEventArgs)
OnRightTapped(RightTappedRoutedEventArgs)

Called before the RightTapped event occurs.

OnTapped(TappedRoutedEventArgs)
OnTapped(TappedRoutedEventArgs)
OnTapped(TappedRoutedEventArgs)

Called before the Tapped event occurs.

RemoveFocusEngagement()
RemoveFocusEngagement()
RemoveFocusEngagement()

Releases focus from the control boundaries for a control that has focus engagement (for game pad/remote
interaction).

SetIsTemplateFocusTarget(FrameworkElement, Boolean)
SetIsTemplateFocusTarget(FrameworkElement, Boolean)
SetIsTemplateFocusTarget(FrameworkElement, Boolean)

Sets the value of the Control.IsTemplateFocusTarget XAML attached property for a target element.

SetIsTemplateKeyTipTarget(DependencyObject, Boolean)
SetIsTemplateKeyTipTarget(DependencyObject, Boolean)
SetIsTemplateKeyTipTarget(DependencyObject, Boolean)

Sets the value of the Control.IsTemplateKeyTipTarget XAML attached property for a target element.

Events
FocusDisengaged
FocusDisengaged
FocusDisengaged

Occurs when focus is released from the control boundaries (for game pad/remote interaction).

FocusEngaged
FocusEngaged
FocusEngaged

Occurs when focus is constrained within the control boundaries (for game pad/remote interaction).

IsEnabledChanged
IsEnabledChanged
IsEnabledChanged

Occurs when the IsEnabled property changes.

See Also
FrameworkElement
FrameworkElement
FrameworkElement
FrameworkElement
FrameworkElement
FrameworkElement
FrameworkElement
Control.ApplyTemplate Control.ApplyTemplate Control.
ApplyTemplate
I n this Article
Edit
Loads the relevant control template so that its parts can be referenced.
public : Platform::Boolean ApplyTemplate()
bool ApplyTemplate() const;
public bool ApplyTemplate()

Returns
bool
A value that indicates whether the visual tree was rebuilt by this call. True if the tree was rebuilt; false if the previous
visual tree was retained.
Control.Background Control.Background Control.
Background
I n this Article
Edit
Gets or sets a brush that provides the background of the control.
public : Brush Background { get; set; }
Brush Background();

void Background(Brush background);


public Brush Background { get; set; }

<control Background="{StaticResource resourceName}"/>

Returns
Brush
The brush that provides the background of the control. The default is null, (a null brush) which is evaluated as
Transparent for rendering.

Remarks
Each control might apply this property differently based on its visual template. This property only affects a control
whose template uses the Background property as an input for the template's UI properties. On other controls, this
property has no effect. Typically, a control uses a {TemplateBinding} markup extension to bind its Background value to
the Background of a Panel that is the root element of the control template; for example, to Grid.Background . For more
info about visual templates and control templating, see Styling controls or the reference page for the Template
property.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background, Foreground, and BorderBrush. For more info, see the Light-weight
styling section of the Styling controls article.
See Use brushes
Also
Control.BackgroundProperty Control.Background
Property Control.BackgroundProperty
I n this Article
Edit
Identifies the Background dependency property.
public : static DependencyProperty BackgroundProperty { get; }
static DependencyProperty BackgroundProperty();
public static DependencyProperty BackgroundProperty { get; }

Returns
DependencyProperty
The identifier for the Background dependency property.
Control.BackgroundSizing Control.BackgroundSizing
Control.BackgroundSizing
I n this Article
Edit
Gets or sets a value that indicates how far the background extends in relation to this element's border.
public : BackgroundSizing BackgroundSizing { get; set; }
BackgroundSizing BackgroundSizing();

void BackgroundSizing(BackgroundSizing backgroundsizing);


public BackgroundSizing BackgroundSizing { get; set; }

Returns
BackgroundSizing
A value of the enumeration that indicates how far the background extends. The default is InnerBorderEdge.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
You can set this property to OuterBorderEdge to make the element's background extend under the border. If the
border is transparent, the background will show through it.
See BackgroundSizing
Also BackgroundSizing
Control.BackgroundSizingProperty Control.Background
SizingProperty Control.BackgroundSizingProperty
I n this Article
Edit
Identifies the BackgroundSizing dependency property.
public : static DependencyProperty BackgroundSizingProperty { get; }
static DependencyProperty BackgroundSizingProperty();
public static DependencyProperty BackgroundSizingProperty { get; }

Returns
DependencyProperty
The identifier for the BackgroundSizing dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


Control.BorderBrush Control.BorderBrush Control.Border
Brush
I n this Article
Edit
Gets or sets a brush that describes the border fill of a control.
public : Brush BorderBrush { get; set; }
Brush BorderBrush();

void BorderBrush(Brush borderbrush);


public Brush BorderBrush { get; set; }

<control Background="{StaticResource resourceName}"/>

Returns
Brush
The brush that is used to fill the control's border. The default is null, (a null brush) which is evaluated as Transparent for
rendering.

Remarks
Each control might apply this property differently based on its visual template. This property only affects a control
whose template uses the BorderBrush property as an input for the template's UI properties. On other controls, this
property has no effect. Typically, if it wants to display a border, a control uses a {TemplateBinding} markup extension to
bind its BorderBrush value to the BorderBrush of a Border that is the root element of the control template. For more
info about visual templates and control templating, see Styling controls or the reference page for the Template
property.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background, Foreground, and BorderBrush. For more info, see the Light-weight
styling section of the Styling controls article.
The BorderThickness value must be greater than 0 in order to see the BorderBrush value take effect.
See Use brushes
Also
Control.BorderBrushProperty Control.BorderBrush
Property Control.BorderBrushProperty
I n this Article
Edit
Identifies the BorderBrush dependency property.
public : static DependencyProperty BorderBrushProperty { get; }
static DependencyProperty BorderBrushProperty();
public static DependencyProperty BorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the BorderBrush dependency property.
Control.BorderThickness Control.BorderThickness
Control.BorderThickness
I n this Article
Edit
Gets or sets the border thickness of a control.
public : Thickness BorderThickness { get; set; }
Thickness BorderThickness();

void BorderThickness(Thickness borderthickness);


public Thickness BorderThickness { get; set; }

<control BorderThickness="uniform"/>
- or -
<control BorderThickness="left&right,top&bottom"/>
- or -
<control BorderThickness="left,top,right,bottom"/>

Returns
Thickness
The border thickness of a control, as a Thickness value.

Remarks
Each control might apply this property differently based on its visual template. This property only affects a control
whose template uses the BorderThickness property as a parameter. On other controls, this property has no effect. For
more info about visual templates, see the Template property.
See Thickness
Also
Control.BorderThicknessProperty Control.Border
ThicknessProperty Control.BorderThicknessProperty
I n this Article
Edit
Identifies the BorderThickness dependency property.
public : static DependencyProperty BorderThicknessProperty { get; }
static DependencyProperty BorderThicknessProperty();
public static DependencyProperty BorderThicknessProperty { get; }

Returns
DependencyProperty
The identifier for the BorderThickness dependency property.
Control.CharacterSpacing Control.CharacterSpacing
Control.CharacterSpacing
I n this Article
Edit
Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.
public : int CharacterSpacing { get; set; }
int32_t CharacterSpacing();

void CharacterSpacing(int32_t characterspacing);


public int CharacterSpacing { get; set; }

<control CharacterSpacing="int"/>

Returns
int
The uniform spacing between characters, in units of 1/1000 of an em. The default is 0. Positive values increase tracking
and loosen character spacing. Negative values decrease tracking and tighten the character spacing.
Control.CharacterSpacingProperty Control.Character
SpacingProperty Control.CharacterSpacingProperty
I n this Article
Edit
Identifies the CharacterSpacing dependency property.
public : static DependencyProperty CharacterSpacingProperty { get; }
static DependencyProperty CharacterSpacingProperty();
public static DependencyProperty CharacterSpacingProperty { get; }

Returns
DependencyProperty
The identifier for the CharacterSpacing dependency property.
Control Control Control
I n this Article
Edit
Provides base class initialization behavior for Control derived classes.

protected : Control()
Control() const;
protected Control()
Control.CornerRadius Control.CornerRadius Control.
CornerRadius
I n this Article
Edit
Gets or sets the radius for the corners of the control's border.
public : CornerRadius CornerRadius { get; set; }
CornerRadius CornerRadius();

void CornerRadius(CornerRadius cornerradius);


public CornerRadius CornerRadius { get; set; }

<control CornerRadius="uniformRadius"/>
- or -
<control CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>

Returns
CornerRadius
The degree to which the corners are rounded, expressed as values of the CornerRadius structure.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Examples
<Button Content="Button"
Background="Blue"
BorderThickness="1.0"
BorderBrush="Black"
CornerRadius="15" />

Remarks
Member components of a CornerRadius value cannot be negative.
CornerRadius property on Control behaves the same way Border.CornerRadius does. CornerRadius is a rendering
artifact and does not impact layout of the contents (clipping may occur).
The default CornerRadius value in all control templates is 0. Setting the CornerRadius property impacts those controls
that have a Border in their ControlTemplate (Example: Button, ComboBox).
Control.CornerRadiusProperty Control.CornerRadius
Property Control.CornerRadiusProperty
I n this Article
Edit
Identifies the CornerRadius dependency property.
public : static DependencyProperty CornerRadiusProperty { get; }
static DependencyProperty CornerRadiusProperty();
public static DependencyProperty CornerRadiusProperty { get; }

Returns
DependencyProperty
The identifier for the CornerRadius dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


Control.DefaultStyleKey Control.DefaultStyleKey Control.
DefaultStyleKey
I n this Article
Edit
Gets or sets the key that references the default style for the control. Authors of custom controls use this property to
change the default for the style that their control uses.
protected : Platform::Object DefaultStyleKey { get; set; }
winrt::Windows::Foundation::IInspectable DefaultStyleKey();

void DefaultStyleKey(winrt::Windows::Foundation::IInspectable defaultstylekey);


protected object DefaultStyleKey { get; set; }

Returns
object
The key that references the default style for the control. To work correctly as part of theme style lookup, this value is
expected to be a System.Type value.
Note

Visual C++ component extensions (C++/CX) uses a string that is the qualified name of the type. But this relies on
generated code that produces a TypeName once accessed by a XAML compiler; see Remarks.

Remarks
DefaultStyleKey is one of the very few protected properties in the Windows Runtime API. It's intended only for use by
control authors, who will be subclassing some existing control class and therefore have the necessary access to set this
property. For many custom control scenarios where you'll be setting DefaultStyleKey, you'll also be overriding
OnApplyTemplate.
The return type of DefaultStyleKey is loosely typed as Object in the syntax, but the XAML style system will expect the
value to provide a type reference:
For a control that has its logic written in C#, the value of DefaultStyleKey should be an instance of System.Type.
Typically you set this value in the default constructor:
public CustomControl1()
{
this.DefaultStyleKey = typeof(CustomControl1);
}

For a control that has its logic written in Microsoft Visual Basic, the value of DefaultStyleKey should be an instance of
System.Type. Typically you set this value in the default constructor:
Public Sub New()
Me.DefaultStyleKey = GetType(CustomControl1)
End Sub

CustomControl1::CustomControl1() // public: in the header.


{
DefaultStyleKey(winrt::box_value(L"App1.CustomControl1"));
}
For a control that has its logic written in Visual C++ component extensions (C++/CX), the value of DefaultStyleKey
should be a namespace-qualified string that is the name of the custom control class. Typically you set this value in the
default constructor:
Note

Ultimately the string alone isn't enough to support a Visual C++ component extensions (C++/CX) type reference. If
you use the Add / New Item / Templated Control options in Solution Explorer, the templates and support for
Visual C++ component extensions (C++/CX) and XAML generates classes that give IXamlMetadataProvider info. The
XAML compiler can access this code when the XAML is loaded, and uses it to validate and create types and members
and join the partial classes. As far as what you define in your own app code, the string is all you need. But if you're
curious you can have a look at the XamlTypeInfo.g.h and XamlTypeInfo.g.cpp files that are generated.
Control authors could choose to not provide a value for DefaultStyleKey, but that's uncommon. The result would be
that the default style is the one as defined by the base class. In some cases (like for ContentControl ) the value is null.
Even if you choose to not redefine the value, make sure that the original default style is useful for rendering your
control.
When a XAML control is loaded, the rendering process starts, and the system is looking for the correct template to
apply, what's being loaded is the XAML default style for the control, including its template. Included in the Windows
Runtime is an internal copy of all the default styles for all the XAML controls that the Windows Runtime defines. The
type reference in DefaultStyleKey tells the system which named XAML resource to load as this style. In XAML form, the
styles really are keyed by type even though there's no mechanism in Windows Runtime XAML that defines a type
reference explicitly. But for any TargetType value, which is the attribute that holds the key for lookup, it's implicitly
assumed to represent a type reference in the form of a string. For example, DefaultStyleKey from a Button is a
System.Type instance where the Name is "Button", FullName is "Windows.UI.Xaml.Controls.Button". The system uses
this info to know to load the Style from the internal resources that has TargetType="Button" .

Custom controls usually aren't in the default XAML namespace. Instead, they're in a XAML namespace that has a
using: statement to reference the app's code namespace. By default, projects create a prefix "local:" that maps this
namespace for you. You could also map other XAML namespaces to refer to additional code namespaces for controls
or other code that your app defines.
The "local:" prefix (or some other namespace that maps to your app's code and namespaces) should precede the name
of your custom control, when it's in XAML as the TargetType value. This is also already done for you by the starting
templates; when you add a new control, you'll see a generic.xaml file that contains just one style. That style will have
TargetType value that is a string starting with "local:" and completed by the name you chose for your custom control
class. To match previous examples that set DefaultStyleKey in a CustomControl1 definition, you'd see an element for
<Style TargetType="local:CustomControl1"> defined in the starting generic.xaml, and that style defines the control
template as well as setting other properties.
Note

The "local:" prefix is isolated to the XAML where it's defined and used. XAML namespaces and the prefixes only have
meaning within XAML and are self-contained to each XAML file. DefaultStyleKey values in code don't include the
prefixes.
See OnApplyTemplate
Also XAML namespaces and namespace mapping
ResourceDictionary and XAML resource references
Quickstart: Control templates
Control.DefaultStyleKeyProperty Control.DefaultStyleKey
Property Control.DefaultStyleKeyProperty
I n this Article
Edit
Identifies the DefaultStyleKey dependency property.
public : static DependencyProperty DefaultStyleKeyProperty { get; }
static DependencyProperty DefaultStyleKeyProperty();
public static DependencyProperty DefaultStyleKeyProperty { get; }

Returns
DependencyProperty
The identifier for the DefaultStyleKey dependency property.
Control.DefaultStyleResourceUri Control.DefaultStyle
ResourceUri Control.DefaultStyleResourceUri
I n this Article
Edit
Gets or sets the path to the resource file that contains the default style for the control.
public : Uri DefaultStyleResourceUri { get; set; }
Uri DefaultStyleResourceUri();

void DefaultStyleResourceUri(Uri defaultstyleresourceuri);


public Uri DefaultStyleResourceUri { get; set; }

Returns
Uri
The path to the resource file that contains the default style for the control.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


Control.DefaultStyleResourceUriProperty Control.Default
StyleResourceUriProperty Control.DefaultStyleResource
UriProperty
I n this Article
Edit
Identifies the DefaultStyleResourceUri dependency property.
public : static DependencyProperty DefaultStyleResourceUriProperty { get; }
static DependencyProperty DefaultStyleResourceUriProperty();
public static DependencyProperty DefaultStyleResourceUriProperty { get; }

Returns
DependencyProperty
The identifier for the DefaultStyleResourceUri dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


Control.ElementSoundMode Control.ElementSound
Mode Control.ElementSoundMode
I n this Article
Edit
Get or sets a value that specifies a control's preference for whether sounds are played.
public : ElementSoundMode ElementSoundMode { get; set; }
ElementSoundMode ElementSoundMode();

void ElementSoundMode(ElementSoundMode elementsoundmode);


public ElementSoundMode ElementSoundMode { get; set; }

<control ElementSoundMode="elementSoundModeMemberName"/>

Returns
ElementSoundMode
A value of the enumeration that specifies a control's preference for whether sounds are played. The default is Auto.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Set the ElementSoundMode property to override the global ElementSoundPlayer setting for a specific control.
For more info about using this property, see Sound in UWP apps.
Version compatibility
The ElementSoundMode property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Control", "ElementSoundMode"))
{
button1.ElementSoundMode = ElementSoundMode.Off;
}
}

See Sound in UWP apps


Also
Control.ElementSoundModeProperty Control.Element
SoundModeProperty Control.ElementSoundMode
Property
I n this Article
Edit
Identifies the ElementSoundMode dependency property.
public : static DependencyProperty ElementSoundModeProperty { get; }
static DependencyProperty ElementSoundModeProperty();
public static DependencyProperty ElementSoundModeProperty { get; }

Returns
DependencyProperty
The identifier for the ElementSoundMode dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


Control.Focus Control.Focus Control.Focus
I n this Article
Edit
Attempts to set the focus on the control.

public : Platform::Boolean Focus(FocusState value)


bool Focus(FocusState value) const;
public bool Focus(FocusState value)

Parameters
value FocusState
Specifies how focus was set, as a value of the enumeration.
Returns
bool
true if focus was set to the control, or focus was already on the control. false if the control is not focusable.

Examples
In this example, clicking an "Edit" button causes focus to be set on a TextBox, so the Programmatic focus state is passed
to the Focus method.
<StackPanel>
<Button Content="Edit" Click="Button_Click"/>
<TextBox x:Name="EditorTextBox" IsReadOnly="True"/>
</StackPanel>

private void Button_Click(object sender, RoutedEventArgs e)


{
EditorTextBox.IsReadOnly = false;
EditorTextBox.Focus(FocusState.Programmatic);
}

Remarks
You can't remove focus from a control by calling this method with Unfocused as the parameter. This value is not
allowed and causes an exception. To remove focus from a control, set focus to a different control.
You typically pass FocusState.Programmatic as the parameter to indicate the control obtained focus through a
deliberate call to the Focus method. For example, if clicking an "Edit" button causes focus to be set on a TextBox, use the
Programmatic focus state.
Pass FocusState.Pointer if you’re setting focus as the direct result of a pointer interaction. Pass FocusState.Keyboard as
the parameter if you’re setting focus as a result of a keyboard interaction, like a tab sequence or key press. For example,
if you’re implementing an ItemsControl and handle key presses to let the user move focus between items in the
control, use the Keyboard focus state when you call Focus in your key press handler.
Note

In Windows 8, when FocusState is Programmatic, the keyboard focus visual is shown even if the prior method of input
was pointer. In Windows 8.1, when you call Focus (FocusState.Programmatic), the prior FocusState, either Pointer or
Keyboard, is retained so that the correct focus visual is shown. This means that if you check the value of the FocusState
property after you call Focus (FocusState.Programmatic), the FocusState property will have a value of either Pointer or
Keyboard.
In an app that’s compiled for Windows 8, but run in Windows 8.1, the Windows 8 behavior is retained. The FocusState
property value is Programmatic and the keyboard focus visual is shown.
See GotFocus
Also LostFocus
Keyboard interactions
Keyboard accessibility
Touch keyboard sample
Control.FocusDisengaged Control.FocusDisengaged
Control.FocusDisengaged
I n this Article
Edit
Occurs when focus is released from the control boundaries (for game pad/remote interaction).
public : event TypedEventHandler<Control, FocusDisengagedEventArgs> FocusDisengaged
// Register
event_token FocusDisengaged(TypedEventHandler<Control, FocusDisengagedEventArgs> const& handler)
const;

// Revoke with event_token


void FocusDisengaged(event_token const& cookie) const;

// Revoke with event_revoker


FocusDisengaged_revoker FocusDisengaged(auto_revoke_t, TypedEventHandler<Control,
FocusDisengagedEventArgs> const& handler) const;
public event TypedEventHandler<Control, FocusDisengagedEventArgs> FocusDisengaged

<control FocusDisengaged="eventhandler"/>

Remarks
For event data, see FocusDisengagedEventArgs.
Focus engagement makes it easier to use a game pad or remote control to interact with an app. Setting focus
engagement does not affect keyboard or other input devices.
When the IsFocusEngagementEnabled property is set to true, it marks the control as requiring focus engagement. This
means that the user must press the A/Select button to "engage" the control and interact with it. When they are finished,
they can press the B/Back button to disengage the control and navigate away from it.
For more info, see the Focus engagement section of the Designing for Xbox and TV article.
Version compatibility
The FocusDisengaged event is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not connect this event without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
event before you use it.
<Slider x:Name="slider1" Loaded="Slider_Loaded"/>

private void Slider_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsEventPresent("Windows.UI.Xaml.Controls.Control", "FocusDisengaged"))
{
slider1.FocusDisengaged += Slider1_FocusDisengaged;
}
}
Control.FocusEngaged Control.FocusEngaged Control.
FocusEngaged
I n this Article
Edit
Occurs when focus is constrained within the control boundaries (for game pad/remote interaction).
public : event TypedEventHandler<Control, FocusEngagedEventArgs> FocusEngaged
// Register
event_token FocusEngaged(TypedEventHandler<Control, FocusEngagedEventArgs> const& handler) const;

// Revoke with event_token


void FocusEngaged(event_token const& cookie) const;

// Revoke with event_revoker


FocusEngaged_revoker FocusEngaged(auto_revoke_t, TypedEventHandler<Control, FocusEngagedEventArgs>
const& handler) const;
public event TypedEventHandler<Control, FocusEngagedEventArgs> FocusEngaged

<control FocusEngaged="eventhandler"/>

Remarks
For event data, see FocusEngagedEventArgs.
Focus engagement makes it easier to use a game pad or remote control to interact with an app. Setting focus
engagement does not affect keyboard or other input devices.
When the IsFocusEngagementEnabled property is set to true, it marks the control as requiring focus engagement. This
means that the user must press the A/Select button to "engage" the control and interact with it. When they are finished,
they can press the B/Back button to disengage the control and navigate away from it.
For more info about this property, see the Focus engagement section of the Designing for Xbox and TV article.
Version compatibility
The FocusEngaged event is not available prior to Windows 10, version 1607. If your app’s 'minimum platform version'
setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in this
page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not connect this event without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
event before you use it.
<Slider x:Name="slider1" Loaded="Slider_Loaded"/>

private void Slider_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsEventPresent("Windows.UI.Xaml.Controls.Control", "FocusEngaged"))
{
slider1.FocusEngaged += Slider1_FocusEngaged;
}
}
Control.FocusState Control.FocusState Control.Focus
State
I n this Article
Edit
Gets a value that specifies whether this control has focus, and the mode by which focus was obtained.
public : FocusState FocusState { get; }
FocusState FocusState();
public FocusState FocusState { get; }

Returns
FocusState
A value of the enumeration. A value of Unfocused indicates that the control does not have focus.

Remarks
This property supports controls that use different visual styles depending on whether the control was focused by the
keyboard or by other means. Some controls use visual states that show a visible focus indicator if the control was
focused by a keyboard action, but do not show the indicator if the control was focused by a pointer action. The internal
logic of such a control implements OnGotFocus and then gets the value of FocusState from the sender. If FocusState is
Keyboard, then a different named visual state that includes a focus rectangle is loaded, by calling GoToState. Typically,
focus-related visual states are grouped together in the default control template XAML. Custom controls that want to
use different focus visuals depending on the means of focus can implement this same logic themselves. See
OnGotFocus.
Another way to use this property is to use FocusManager to determine which element in the overall UI has focus, and
then call FocusState on that element to get information on how that control received focus.
Note

In Windows 8, when FocusState is Programmatic, the keyboard focus visual is shown even if the prior method of input
was pointer. In Windows 8.1, when you call Focus (FocusState.Programmatic), the prior FocusState, either Pointer or
Keyboard, is retained so that the correct focus visual is shown. This means that if you check the value of the FocusState
property after you call Focus (FocusState.Programmatic), the FocusState property will have a value of either Pointer or
Keyboard.
In an app that’s compiled for Windows 8, but run in Windows 8.1, the Windows 8 behavior is retained. The FocusState
property value is Programmatic and the keyboard focus visual is shown.
Note

Classes that inherit from ItemsControl, such as ListBox and AutoSuggestBox, do not propagate the FocusState
property. They will always return Unfocused. Access the correct value through RoutedEventArgs.OriginalSource.
Control.FocusStateProperty Control.FocusStateProperty
Control.FocusStateProperty
I n this Article
Edit
Identifies the FocusState dependency property.
public : static DependencyProperty FocusStateProperty { get; }
static DependencyProperty FocusStateProperty();
public static DependencyProperty FocusStateProperty { get; }

Returns
DependencyProperty
The identifier for the FocusState dependency property.
Control.FontFamily Control.FontFamily Control.Font
Family
I n this Article
Edit
Gets or sets the font used to display text in the control.
public : FontFamily FontFamily { get; set; }
FontFamily FontFamily();

void FontFamily(FontFamily fontfamily);


public FontFamily FontFamily { get; set; }

<control FontFamily="fontFamilyValue"/>

Returns
FontFamily
The font used to display text in the control.
Control.FontFamilyProperty Control.FontFamilyProperty
Control.FontFamilyProperty
I n this Article
Edit
Identifies the FontFamily dependency property.
public : static DependencyProperty FontFamilyProperty { get; }
static DependencyProperty FontFamilyProperty();
public static DependencyProperty FontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the FontFamily dependency property.
Control.FontSize Control.FontSize Control.FontSize
I n this Article
Edit
Gets or sets the size of the text in this control.

public : double FontSize { get; set; }


double FontSize();

void FontSize(double fontsize);


public double FontSize { get; set; }

<control FontSize="double"/>

Returns
double
The size of the text in the Control, in pixels.

Remarks
The unit measure for FontSize is pixels, measuring the line height of the characters in the font. The apparent size of text
in the UI can vary based on the current scaling. If you want to use different FontSize values for different scalings, you
can do this using the resources system.
The default value of FontSize is 11.
See UX guidelines for layout and scaling
Also Quickstart: Displaying text
Control.FontSizeProperty Control.FontSizeProperty
Control.FontSizeProperty
I n this Article
Edit
Identifies the FontSize dependency property.
public : static DependencyProperty FontSizeProperty { get; }
static DependencyProperty FontSizeProperty();
public static DependencyProperty FontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the FontSize dependency property.
Control.FontStretch Control.FontStretch Control.Font
Stretch
I n this Article
Edit
Gets or sets the degree to which a font is condensed or expanded on the screen.
public : FontStretch FontStretch { get; set; }
FontStretch FontStretch();

void FontStretch(FontStretch fontstretch);


public FontStretch FontStretch { get; set; }

<control FontStretch="fontStretchMemberName"/>

Returns
FontStretch
One of the values that specifies the degree to which a font is condensed or expanded on the screen. The default is
Normal.
Control.FontStretchProperty Control.FontStretchProperty
Control.FontStretchProperty
I n this Article
Edit
Identifies the FontStretch dependency property.
public : static DependencyProperty FontStretchProperty { get; }
static DependencyProperty FontStretchProperty();
public static DependencyProperty FontStretchProperty { get; }

Returns
DependencyProperty
The identifier for the FontStretch dependency property.
Control.FontStyle Control.FontStyle Control.FontStyle
I n this Article
Edit
Gets or sets the style in which the text is rendered.

public : FontStyle FontStyle { get; set; }


FontStyle FontStyle();

void FontStyle(FontStyle fontstyle);


public FontStyle FontStyle { get; set; }

<control FontStyle="fontStyleMemberName" />

Returns
FontStyle
One of the values that specifies the style in which the text is rendered. The default is Normal.
Control.FontStyleProperty Control.FontStyleProperty
Control.FontStyleProperty
I n this Article
Edit
Identifies the FontStyle dependency property.
public : static DependencyProperty FontStyleProperty { get; }
static DependencyProperty FontStyleProperty();
public static DependencyProperty FontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the FontStyle dependency property.
Control.FontWeight Control.FontWeight Control.Font
Weight
I n this Article
Edit
Gets or sets the thickness of the specified font.
public : FontWeight FontWeight { get; set; }
FontWeight FontWeight();

void FontWeight(FontWeight fontweight);


public FontWeight FontWeight { get; set; }

<control FontWeight="fontWeightMemberName"/>

Returns
FontWeight
One of the values that specifies the thickness of the specified font. The default is Normal.
Control.FontWeightProperty Control.FontWeight
Property Control.FontWeightProperty
I n this Article
Edit
Identifies the FontWeight dependency property.
public : static DependencyProperty FontWeightProperty { get; }
static DependencyProperty FontWeightProperty();
public static DependencyProperty FontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the FontWeight dependency property.
Control.Foreground Control.Foreground Control.
Foreground
I n this Article
Edit
Gets or sets a brush that describes the foreground color.
public : Brush Foreground { get; set; }
Brush Foreground();

void Foreground(Brush foreground);


public Brush Foreground { get; set; }

<control Foreground="{StaticResource resourceName}"/>

Returns
Brush
The brush that paints the foreground of the control. The default value is a SolidColorBrush with color of Black.

Remarks
Each control might apply this property differently based on its visual template. This property only affects a control
whose template uses the Foreground property as a parameter. On other controls, this property has no effect. Typically,
a ContentControl derived control uses a {TemplateBinding} markup extension to bind its Foreground value to the
Foreground of a ContentPresenter within the control template. The same color/brush might also be used for values of
other decorative elements in the template (glyphs, icons, control surfaces) or to composite part properties such as the
individual ComboBox elements of the TimePicker control. For more info about visual templates and control templating,
see Styling controls or the reference page for the Template property.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background, Foreground, and BorderBrush. For more info, see the Light-weight
styling section of the Styling controls article.
See Use brushes
Also
Control.ForegroundProperty Control.Foreground
Property Control.ForegroundProperty
I n this Article
Edit
Identifies the Foreground dependency property.
public : static DependencyProperty ForegroundProperty { get; }
static DependencyProperty ForegroundProperty();
public static DependencyProperty ForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the Foreground dependency property.
Control.GetIsTemplateFocusTarget Control.GetIsTemplate
FocusTarget Control.GetIsTemplateFocusTarget
I n this Article
Edit
Gets the value of the Control.IsTemplateFocusTarget XAML attached property for the target element.
public : static Platform::Boolean GetIsTemplateFocusTarget(FrameworkElement element)
static bool GetIsTemplateFocusTarget(FrameworkElement element) const;
public static bool GetIsTemplateFocusTarget(FrameworkElement element)

Parameters
element FrameworkElement
The object from which the property value is read.
Returns
bool
The Control.IsTemplateFocusTarget XAML attached property value of the specified object.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Control.IsTemplateFocusTarget XAML attached property in XAML and won't need this method. For more info, see the
Control.IsTemplateFocusTarget attached property.
See Control.IsTemplateFocusTarget
Also
Control.GetIsTemplateKeyTipTarget Control.GetIs
TemplateKeyTipTarget Control.GetIsTemplateKeyTip
Target
I n this Article
Edit
Gets the value of the Control.IsTemplateKeyTipTarget XAML attached property for the target element.
public : static Platform::Boolean GetIsTemplateKeyTipTarget(DependencyObject element)
static bool GetIsTemplateKeyTipTarget(DependencyObject element) const;
public static bool GetIsTemplateKeyTipTarget(DependencyObject element)

Parameters
element DependencyObject
The object from which the property value is read.
Returns
bool
The Control.IsTemplateKeyTipTarget XAML attached property value of the specified object.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Control.IsTemplateKeytipTarget XAML attached property in XAML and won't need this method. For more info, see
the Control.IsTemplateKeyTipTarget attached property.
Control.GetTemplateChild Control.GetTemplateChild
Control.GetTemplateChild
I n this Article
Edit
Retrieves the named element in the instantiated ControlTemplate visual tree.
protected : DependencyObject GetTemplateChild(Platform::String childName)
DependencyObject GetTemplateChild(winrt::hstring childName) const;
protected DependencyObject GetTemplateChild(String childName)

Parameters
childName String
The name of the element to find.
Returns
DependencyObject
The named element from the template, if the element is found. Can return null if no element with name childName
was found in the template.

Remarks
You call GetTemplateChild to get references to objects in a controls Template after it's instantiated. The
ControlTemplate is instantiated in the OnApplyTemplate method. You can use the GetTemplateChild method inside
your OnApplyTemplate override and keep a reference to the objects you need.
See OnApplyTemplate
Also
Control.HorizontalContentAlignment Control.Horizontal
ContentAlignment Control.HorizontalContentAlignment
I n this Article
Edit
Gets or sets the horizontal alignment of the control's content.
public : HorizontalAlignment HorizontalContentAlignment { get; set; }
HorizontalAlignment HorizontalContentAlignment();

void HorizontalContentAlignment(HorizontalAlignment horizontalcontentalignment);


public HorizontalAlignment HorizontalContentAlignment { get; set; }

<control HorizontalContentAlignment="horizontalAlignmentMemberName"/>

Returns
HorizontalAlignment
One of the HorizontalAlignment values. The default is Left.

Remarks
Each control might apply this property differently based on the Style setters for the control's implicit style, and its visual
template. Also, the apparent "default value" of each individual control used in UI can be different. For example, a Button
control starts with the value Center.
A value for the HorizontalContentAlignment property only affects layout behavior for a control when its template uses
the HorizontalContentAlignment property as the source of a HorizontalAlignment value for presenters or content
areas within. On other controls, setting HorizontalContentAlignment has no effect. For more info about visual
templates for controls, see the reference for Control.Template.
See HorizontalAlignment
Also Alignment, margin, and padding
Control.HorizontalContentAlignmentProperty Control.
HorizontalContentAlignmentProperty Control.Horizontal
ContentAlignmentProperty
I n this Article
Edit
Identifies the HorizontalContentAlignment dependency property.
public : static DependencyProperty HorizontalContentAlignmentProperty { get; }
static DependencyProperty HorizontalContentAlignmentProperty();
public static DependencyProperty HorizontalContentAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalContentAlignment dependency property.
Control.IsEnabled Control.IsEnabled Control.IsEnabled
I n this Article
Edit
Gets or sets a value indicating whether the user can interact with the control.

public : Platform::Boolean IsEnabled { get; set; }


bool IsEnabled();

void IsEnabled(bool isenabled);


public bool IsEnabled { get; set; }

<control IsEnabled="bool"/>

Returns
bool
true if the user can interact with the control; otherwise, false.

Remarks
Many controls have predefined visual states that are invoked for IsEnabled =false, such as "graying out" text in labels.
Whenever IsEnabled changes, that fires the IsEnabledChanged event. Controls might handle this event in order to
change the visual states. The event has DependencyPropertyChangedEventArgs data, so you can determine the old
and new values without having to use your own flags.
A control inherits the IsEnabled property from its parent control. For example, if a control that contains a button has
IsEnabled set to false, the button's IsEnabled property is also false. When the parent's property changes, that fires
IsEnabledChanged for each control where the value changes because of the value inheriting.
How the control logic behaves when disabled is potentially different for each control. However, these behaviors will
result in all controls when IsEnabled =false:
The control can't receive keyboard focus or be focused programmatically.
The control does not appear in a tab sequence (any value for TabIndex is ignored).
A disabled control is still visible to hit testing. It can't handle any input events on itself. However, a disabled control can
still source the input events, and input routed events can bubble to a parent where they can be handled.
See IsEnabledChangedIsEnabledChangedIsEnabledChanged
Also Visibility
Control.IsEnabledChanged Control.IsEnabledChanged
Control.IsEnabledChanged
I n this Article
Edit
Occurs when the IsEnabled property changes.
public : event DependencyPropertyChangedEventHandler IsEnabledChanged
// Register
event_token IsEnabledChanged(DependencyPropertyChangedEventHandler const& handler) const;

// Revoke with event_token


void IsEnabledChanged(event_token const& cookie) const;

// Revoke with event_revoker


IsEnabledChanged_revoker IsEnabledChanged(auto_revoke_t, DependencyPropertyChangedEventHandler
const& handler) const;
public event DependencyPropertyChangedEventHandler IsEnabledChanged

<control IsEnabledChanged="eventhandler"/>

Remarks
Whenever IsEnabled changes, that fires the IsEnabledChanged event. Controls might handle this event in order to
change the visual states. The event has DependencyPropertyChangedEventArgs data, so you can determine the old
and new values without having to use your own flags.
A control inherits the IsEnabled property from its parent control. For example, if a control that contains a button has
IsEnabled set to false, the button's IsEnabled property is also false. When the parent's property changes, that fires
IsEnabledChanged for each control where the value changes because of the value inheriting.
Control.IsEnabledProperty Control.IsEnabledProperty
Control.IsEnabledProperty
I n this Article
Edit
Identifies the IsEnabled dependency property.
public : static DependencyProperty IsEnabledProperty { get; }
static DependencyProperty IsEnabledProperty();
public static DependencyProperty IsEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsEnabled dependency property.
Control.IsFocusEngaged Control.IsFocusEngaged
Control.IsFocusEngaged
I n this Article
Edit
Get or sets a value that indicates whether focus is constrained within the control boundaries (for game pad/remote
interaction).
public : Platform::Boolean IsFocusEngaged { get; set; }
bool IsFocusEngaged();

void IsFocusEngaged(bool isfocusengaged);


public bool IsFocusEngaged { get; set; }

<control IsFocusEngaged="bool"/>

Returns
bool
true if focus is constrained within the control boundaries; otherwise, false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
IsFocusEngagementEnabled must be true and the control must have focus before you set the IsFocusEngaged
property to true. Otherwise, a runtime exception will occur.
Focus engagement makes it easier to use a game pad or remote control to interact with an app. Setting focus
engagement does not affect keyboard or other input devices.
When the IsFocusEngagementEnabled property is set to true, it marks the control as requiring focus engagement. This
means that the user must press the A/Select button to "engage" the control and interact with it. When they are finished,
they can press the B/Back button to disengage the control and navigate away from it.
For more info about this property, see the Focus engagement section of the Designing for Xbox and TV article.
Version compatibility
The IsFocusEngaged property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Control", "IsFocusEngaged"))
{
slider1.IsFocusEngaged = true;
}
Control.IsFocusEngagedProperty Control.IsFocus
EngagedProperty Control.IsFocusEngagedProperty
I n this Article
Edit
Identifies the IsFocusEngaged dependency property.
public : static DependencyProperty IsFocusEngagedProperty { get; }
static DependencyProperty IsFocusEngagedProperty();
public static DependencyProperty IsFocusEngagedProperty { get; }

Returns
DependencyProperty
The identifier for the IsFocusEngaged dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


Control.IsFocusEngagementEnabled Control.IsFocus
EngagementEnabled Control.IsFocusEngagementEnabled
I n this Article
Edit
Get or sets a value that indicates whether focus can be constrained within the control boundaries (for game
pad/remote interaction).
public : Platform::Boolean IsFocusEngagementEnabled { get; set; }
bool IsFocusEngagementEnabled();

void IsFocusEngagementEnabled(bool isfocusengagementenabled);


public bool IsFocusEngagementEnabled { get; set; }

<control IsFocusEngagementEnabled="bool"/>

Returns
bool
true if focus can be constrained within the control boundaries; otherwise, false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Focus engagement makes it easier to use a game pad or remote control to interact with an app. Setting focus
engagement does not affect keyboard or other input devices.
When the IsFocusEngagementEnabled property is set to true, it marks the control as requiring focus engagement. This
means that the user must press the A/Select button to "engage" the control and interact with it. When they are finished,
they can press the B/Back button to disengage the control and navigate away from it.
For more info about this property, see the Focus engagement section of the Designing for Xbox and TV article.
Version compatibility
The IsFocusEngagementEnabled property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Control",
"IsFocusEngagementEnabled"))
{
slider1.IsFocusEngagementEnabled = true;
}
Control.IsFocusEngagementEnabledProperty Control.Is
FocusEngagementEnabledProperty Control.IsFocus
EngagementEnabledProperty
I n this Article
Edit
Identifies the IsFocusEngagementEnabled dependency property.
public : static DependencyProperty IsFocusEngagementEnabledProperty { get; }
static DependencyProperty IsFocusEngagementEnabledProperty();
public static DependencyProperty IsFocusEngagementEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsFocusEngagementEnabled dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


Control.IsTabStop Control.IsTabStop Control.IsTabStop
I n this Article
Edit
Gets or sets a value that indicates whether a control is included in tab navigation.

public : Platform::Boolean IsTabStop { get; set; }


bool IsTabStop();

void IsTabStop(bool istabstop);


public bool IsTabStop { get; set; }

<control IsTabStop="bool"/>

Returns
bool
true if the control is included in tab navigation; otherwise, false. The default is true.

Remarks
Controlling the tab sequence with a combination of IsTabStop and TabIndex rather than using the default tab sequence
is sometimes necessary in order to tune the keyboard accessibility of your UI. For more info, see Keyboard accessibility.
If IsTabStop is false, the control is excluded from tab navigation. In addition, if IsTabStop is false, the control cannot
receive input focus. (If you try to set focus programmatically, by calling the Focus method, Focus returns false).
If the reason you don't want the control to be a tab stop is because it's not interactive in your UI, you might want to set
IsEnabled to false to make the lack of interaction more obvious. Many controls have predefined visual states that are
invoked for IsEnabled =false, such as "graying out" text in labels.
See Keyboard accessibility
Also
Control.IsTabStopProperty Control.IsTabStopProperty
Control.IsTabStopProperty
I n this Article
Edit
Identifies the IsTabStop dependency property.
public : static DependencyProperty IsTabStopProperty { get; }
static DependencyProperty IsTabStopProperty();
public static DependencyProperty IsTabStopProperty { get; }

Returns
DependencyProperty
The identifier for the IsTabStop dependency property.
Control.IsTemplateFocusTargetProperty Control.Is
TemplateFocusTargetProperty Control.IsTemplateFocus
TargetProperty
I n this Article
Edit
Identifies the Control.IsTemplateFocusTarget XAML attached property.
public : static DependencyProperty IsTemplateFocusTargetProperty { get; }
static DependencyProperty IsTemplateFocusTargetProperty();
public static DependencyProperty IsTemplateFocusTargetProperty { get; }

Returns
DependencyProperty
The identifier for the Control.IsTemplateFocusTarget XAML attached property.
See Control.IsTemplateFocusTarget
Also Attached properties overview
Control.IsTemplateKeyTipTargetProperty Control.Is
TemplateKeyTipTargetProperty Control.IsTemplateKeyTip
TargetProperty
I n this Article
Edit
Identifies the Control.IsTemplateKeyTipTarget XAML attached property.
public : static DependencyProperty IsTemplateKeyTipTargetProperty { get; }
static DependencyProperty IsTemplateKeyTipTargetProperty();
public static DependencyProperty IsTemplateKeyTipTargetProperty { get; }

Returns
DependencyProperty
The identifier for the Control.IsTemplateKeyTipTarget XAML attached property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


Control.IsTextScaleFactorEnabled Control.IsTextScale
FactorEnabled Control.IsTextScaleFactorEnabled
I n this Article
Edit
Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.
public : Platform::Boolean IsTextScaleFactorEnabled { get; set; }
bool IsTextScaleFactorEnabled();

void IsTextScaleFactorEnabled(bool istextscalefactorenabled);


public bool IsTextScaleFactorEnabled { get; set; }

<control IsTextScaleFactorEnabled="bool"/>

Returns
bool
true if automatic text enlargement is enabled; otherwise, false.
See Accessible text requirements
Also
Control.IsTextScaleFactorEnabledProperty Control.IsText
ScaleFactorEnabledProperty Control.IsTextScaleFactor
EnabledProperty
I n this Article
Edit
Identifies the IsTextScaleFactorEnabled dependency property.
public : static DependencyProperty IsTextScaleFactorEnabledProperty { get; }
static DependencyProperty IsTextScaleFactorEnabledProperty();
public static DependencyProperty IsTextScaleFactorEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextScaleFactorEnabled dependency property.
Control.OnCharacterReceived Control.OnCharacter
Received Control.OnCharacterReceived
I n this Article
Edit
Called before the CharacterReceived event occurs.
protected : virtual void OnCharacterReceived(CharacterReceivedRoutedEventArgs e)
virtual void OnCharacterReceived(CharacterReceivedRoutedEventArgs e) const;
protected virtual void OnCharacterReceived(CharacterReceivedRoutedEventArgs e)

Parameters
e CharacterReceivedRoutedEventArgs
Event data for the event.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

See CharacterReceived
Also Events and routed events overview
Control.OnDoubleTapped Control.OnDoubleTapped
Control.OnDoubleTapped
I n this Article
Edit
Called before the DoubleTapped event occurs.
protected : virtual void OnDoubleTapped(DoubleTappedRoutedEventArgs e)
virtual void OnDoubleTapped(DoubleTappedRoutedEventArgs e) const;
protected virtual void OnDoubleTapped(DoubleTappedRoutedEventArgs e)

Parameters
e DoubleTappedRoutedEventArgs
Event data for the event.
See DoubleTapped
Also DoubleTappedRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnDragEnter Control.OnDragEnter Control.On
DragEnter
I n this Article
Edit
Called before the DragEnter event occurs.
protected : virtual void OnDragEnter(DragEventArgs e)
virtual void OnDragEnter(DragEventArgs e) const;
protected virtual void OnDragEnter(DragEventArgs e)

Parameters
e DragEventArgs
Event data for the event.
See DragEnter
Also DragEventArgs
Events and routed events overview
Control.OnDragLeave Control.OnDragLeave Control.On
DragLeave
I n this Article
Edit
Called before the DragLeave event occurs.
protected : virtual void OnDragLeave(DragEventArgs e)
virtual void OnDragLeave(DragEventArgs e) const;
protected virtual void OnDragLeave(DragEventArgs e)

Parameters
e DragEventArgs
Event data for the event.
See DragLeave
Also DragEventArgs
Events and routed events overview
Control.OnDragOver Control.OnDragOver Control.On
DragOver
I n this Article
Edit
Called before the DragOver event occurs.
protected : virtual void OnDragOver(DragEventArgs e)
virtual void OnDragOver(DragEventArgs e) const;
protected virtual void OnDragOver(DragEventArgs e)

Parameters
e DragEventArgs
Event data for the event.
See DragOver
Also DragEventArgs
Events and routed events overview
Control.OnDrop Control.OnDrop Control.OnDrop
I n this Article
Edit
Called before the Drop event occurs.

protected : virtual void OnDrop(DragEventArgs e)


virtual void OnDrop(DragEventArgs e) const;
protected virtual void OnDrop(DragEventArgs e)

Parameters
e DragEventArgs
Event data for the event.
See Drop
Also DragEventArgs
Events and routed events overview
Control.OnGotFocus Control.OnGotFocus Control.OnGot
Focus
I n this Article
Edit
Called before the GotFocus event occurs.
protected : virtual void OnGotFocus(RoutedEventArgs e)
virtual void OnGotFocus(RoutedEventArgs e) const;
protected virtual void OnGotFocus(RoutedEventArgs e)

Parameters
e RoutedEventArgs
The data for the event.
See GotFocus
Also RoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnHolding Control.OnHolding Control.On
Holding
I n this Article
Edit
Called before the Holding event occurs.
protected : virtual void OnHolding(HoldingRoutedEventArgs e)
virtual void OnHolding(HoldingRoutedEventArgs e) const;
protected virtual void OnHolding(HoldingRoutedEventArgs e)

Parameters
e HoldingRoutedEventArgs
Event data for the event.
See Holding
Also HoldingRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnKeyDown Control.OnKeyDown Control.OnKey
Down
I n this Article
Edit
Called before the KeyDown event occurs.
protected : virtual void OnKeyDown(KeyRoutedEventArgs e)
virtual void OnKeyDown(KeyRoutedEventArgs e) const;
protected virtual void OnKeyDown(KeyRoutedEventArgs e)

Parameters
e KeyRoutedEventArgs
The data for the event.

Remarks
As it's implemented directly on Control, OnKeyDown has an empty implementation. But each ancestor in a control's
hierarchy may have provided an implementation. You won't be able to see this implementation because it's internal
native code. In some cases a control will already have existing On* overrides that mark the event Handled. For key
events, controls are usually only handling for certain keys, by checking values in KeyRoutedEventArgs. For example,
ButtonBase detects the Space key as a way to fire Click. Control code or your code probably shouldn't be suppressing
all key events, because it's a common pattern to let key events bubble to the root visual so that they can be shortcuts or
accelerators for app interaction. For more info see Keyboard interactions.
See KeyDown
Also KeyRoutedEventArgs
Keyboard interactions
Events and routed events overview
Control.OnKeyUp Control.OnKeyUp Control.OnKeyUp
I n this Article
Edit
Called before the KeyUp event occurs.

protected : virtual void OnKeyUp(KeyRoutedEventArgs e)


virtual void OnKeyUp(KeyRoutedEventArgs e) const;
protected virtual void OnKeyUp(KeyRoutedEventArgs e)

Parameters
e KeyRoutedEventArgs
The data for the event.

Remarks
As it's implemented directly on Control, OnKeyUp has an empty implementation. But each ancestor in a control's
hierarchy may have provided an implementation. You won't be able to see this implementation because it's internal
native code. In some cases a control will already have existing On* overrides that mark the event Handled. For key
events, controls are usually only handling for certain keys, by checking values in KeyRoutedEventArgs. For example,
ButtonBase detects the Space key as a way to fire Click. Control code or your code probably shouldn't be suppressing
all key events, because it's a common pattern to let key events bubble to the root visual so that they can be shortcuts or
accelerators for app interaction. For more info see Keyboard interactions.
See KeyUp
Also KeyRoutedEventArgs
Keyboard interactions
Events and routed events overview
Control.OnLostFocus Control.OnLostFocus Control.On
LostFocus
I n this Article
Edit
Called before the LostFocus event occurs.
protected : virtual void OnLostFocus(RoutedEventArgs e)
virtual void OnLostFocus(RoutedEventArgs e) const;
protected virtual void OnLostFocus(RoutedEventArgs e)

Parameters
e RoutedEventArgs
The data for the event.
See LostFocus
Also RoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnManipulationCompleted Control.On
ManipulationCompleted Control.OnManipulation
Completed
I n this Article
Edit
Called before the ManipulationCompleted event occurs.
protected : virtual void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)
virtual void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e) const;
protected virtual void OnManipulationCompleted(ManipulationCompletedRoutedEventArgs e)

Parameters
e ManipulationCompletedRoutedEventArgs
Event data for the event.

Remarks
Windows 8 behavior
Windows 8 doesn't fire ManipulationCompleted in cases where the inertial phase has started (and
ManipulationInertiaStarting has fired) but the user has tapped on the item before it's finished scrolling, which cancels
the inertial phase visually. The issue is fixed starting with Windows 8.1; ManipulationCompleted is fired as soon as the
tap action cancels the inertial phase.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
See ManipulationCompleted
Also ManipulationCompletedRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnManipulationDelta Control.OnManipulation
Delta Control.OnManipulationDelta
I n this Article
Edit
Called before the ManipulationDelta event occurs.
protected : virtual void OnManipulationDelta(ManipulationDeltaRoutedEventArgs e)
virtual void OnManipulationDelta(ManipulationDeltaRoutedEventArgs e) const;
protected virtual void OnManipulationDelta(ManipulationDeltaRoutedEventArgs e)

Parameters
e ManipulationDeltaRoutedEventArgs
Event data for the event.
See ManipulationDelta
Also ManipulationDeltaRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnManipulationInertiaStarting Control.On
ManipulationInertiaStarting Control.OnManipulation
InertiaStarting
I n this Article
Edit
Called before the ManipulationInertiaStarting event occurs.
protected : virtual void OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs e)
virtual void OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs e) const;
protected virtual void OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs e)

Parameters
e ManipulationInertiaStartingRoutedEventArgs
Event data for the event.

Remarks
Windows 8 behavior
Windows 8 doesn't fire ManipulationCompleted in cases where the inertial phase has started (and
ManipulationInertiaStarting has fired) but the user has tapped on the item before it's finished scrolling, which cancels
the inertial phase visually. The issue is fixed starting with Windows 8.1; ManipulationCompleted is fired as soon as the
tap action cancels the inertial phase.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
See ManipulationInertiaStarting
Also ManipulationInertiaStartingRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnManipulationStarted Control.OnManipulation
Started Control.OnManipulationStarted
I n this Article
Edit
Called before the ManipulationStarted event occurs.
protected : virtual void OnManipulationStarted(ManipulationStartedRoutedEventArgs e)
virtual void OnManipulationStarted(ManipulationStartedRoutedEventArgs e) const;
protected virtual void OnManipulationStarted(ManipulationStartedRoutedEventArgs e)

Parameters
e ManipulationStartedRoutedEventArgs
Event data for the event.
See ManipulationStarted
Also ManipulationStartedRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnManipulationStarting Control.On
ManipulationStarting Control.OnManipulationStarting
I n this Article
Edit
Called before the ManipulationStarting event occurs.
protected : virtual void OnManipulationStarting(ManipulationStartingRoutedEventArgs e)
virtual void OnManipulationStarting(ManipulationStartingRoutedEventArgs e) const;
protected virtual void OnManipulationStarting(ManipulationStartingRoutedEventArgs e)

Parameters
e ManipulationStartingRoutedEventArgs
Event data for the event.

Remarks
Windows 8 behavior
Windows 8 had an issue with firing this event if multiple gestures happened in a short period of time. For example,
Windows 8 might only fire ManipulationStarting for the first gesture and not the second. The issue is fixed starting
with Windows 8.1; multiple starting gestures processed by the input system each fire a distinct ManipulationStarting
event.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
See ManipulationStarting
Also ManipulationStartingRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnPointerCanceled Control.OnPointerCanceled
Control.OnPointerCanceled
I n this Article
Edit
Called before the PointerCanceled event occurs.
protected : virtual void OnPointerCanceled(PointerRoutedEventArgs e)
virtual void OnPointerCanceled(PointerRoutedEventArgs e) const;
protected virtual void OnPointerCanceled(PointerRoutedEventArgs e)

Parameters
e PointerRoutedEventArgs
Event data for the event.
See PointerCanceled
Also PointerRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnPointerCaptureLost Control.OnPointerCapture
Lost Control.OnPointerCaptureLost
I n this Article
Edit
Called before the PointerCaptureLost event occurs.
protected : virtual void OnPointerCaptureLost(PointerRoutedEventArgs e)
virtual void OnPointerCaptureLost(PointerRoutedEventArgs e) const;
protected virtual void OnPointerCaptureLost(PointerRoutedEventArgs e)

Parameters
e PointerRoutedEventArgs
Event data for the event.
See PointerCaptureLost
Also PointerRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnPointerEntered Control.OnPointerEntered
Control.OnPointerEntered
I n this Article
Edit
Called before the PointerEntered event occurs.
protected : virtual void OnPointerEntered(PointerRoutedEventArgs e)
virtual void OnPointerEntered(PointerRoutedEventArgs e) const;
protected virtual void OnPointerEntered(PointerRoutedEventArgs e)

Parameters
e PointerRoutedEventArgs
Event data for the event.

Remarks
Windows 8 behavior
For Windows 8, generally the PointerEntered event won't fire if the onscreen cursor (or stylus or touchpoint) did not
actually move. For example, PointerEntered doesn't fire if the mouse and its onscreen cursor remains stationary, and an
object with a PointerEntered handler has its position translated or otherwise adjusted to move underneath the
onscreen cursor. Or, PointerEntered doesn't fire if an element like a popup or flyout disappears and the pointer is now
over a new element (but pointer hasn't moved yet). Related to this is the PointerExited behavior. For example, if a
popup is dismissed programmatically, it won't fire PointerExited if the pointer didn't move as the cause of dismissing it.
You would still get a PointerEntered event if the pointer moves while over the newly revealed element, but that's up to
the user whether that will happen, and it happens at the time of movement, not the moment of dismissal. In short,
trying to use the last element that fired PointerEntered for pointer state determination in the app UI isn't
comprehensive in Windows 8, and there are many scenarios where PointerEntered and PointerExited won't pair up.
This impacts the visual states for controls that use PointerEntered and PointerExited as triggers also.
Starting with Windows 8.1, PointerExited is fired for any case where the pointer had at one time fired a PointerEntered
event, but some UI state change happens where the pointer is no longer within that element. This includes cases where
the whole element disappears. And if the pointer is now over a different element because a previous element
disappeared, that element fires PointerEntered, even if the pointer never moves. Elements that set their Visibility to
Collapsed programmatically is one way that elements might disappear from UI, and the Windows 8.1 behavior
accounts for this and will fire PointerExited for the **Collapsed ** element and PointerEntered for the newly revealed
element.
If you migrate your app code from Windows 8 to Windows 8.1 you may want to account for this behavior change,
because it results in PointerExited and PointerEntered being fired in cases where they wouldn't have fired before.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
See PointerEntered
Also PointerRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnPointerExited Control.OnPointerExited
Control.OnPointerExited
I n this Article
Edit
Called before the PointerExited event occurs.
protected : virtual void OnPointerExited(PointerRoutedEventArgs e)
virtual void OnPointerExited(PointerRoutedEventArgs e) const;
protected virtual void OnPointerExited(PointerRoutedEventArgs e)

Parameters
e PointerRoutedEventArgs
Event data for the event.

Remarks
Windows 8 behavior
For Windows 8, generally the PointerEntered event won't fire if the onscreen cursor (or stylus or touchpoint) did not
actually move. For example, PointerEntered doesn't fire if the mouse and its onscreen cursor remains stationary, and an
object with a PointerEntered handler has its position translated or otherwise adjusted to move underneath the
onscreen cursor. Or, PointerEntered doesn't fire if an element like a popup or flyout disappears and the pointer is now
over a new element (but pointer hasn't moved yet). Related to this is the PointerExited behavior. For example, if a
popup is dismissed programmatically, it won't fire PointerExited if the pointer didn't move as the cause of dismissing it.
You would still get a PointerEntered event if the pointer moves while over the newly revealed element, but that's up to
the user whether that will happen, and it happens at the time of movement, not the moment of dismissal. In short,
trying to use the last element that fired PointerEntered for pointer state determination in the app UI isn't
comprehensive in Windows 8, and there are many scenarios where PointerEntered and PointerExited won't pair up.
This impacts the visual states for controls that use PointerEntered and PointerExited as triggers also.
Starting with Windows 8.1, PointerExited is fired for any case where the pointer had at one time fired a PointerEntered
event, but some UI state change happens where the pointer is no longer within that element. This includes cases where
the whole element disappears. And if the pointer is now over a different element because a previous element
disappeared, that element fires PointerEntered, even if the pointer never moves. Elements that set their Visibility to
Collapsed programmatically is one way that elements might disappear from UI, and the Windows 8.1 behavior
accounts for this and will fire PointerExited for the **Collapsed ** element and PointerEntered for the newly revealed
element.
If you migrate your app code from Windows 8 to Windows 8.1 you may want to account for this behavior change,
because it results in PointerExited and PointerEntered being fired in cases where they wouldn't have fired before.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
See PointerExited
Also PointerRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnPointerMoved Control.OnPointerMoved
Control.OnPointerMoved
I n this Article
Edit
Called before the PointerMoved event occurs.
protected : virtual void OnPointerMoved(PointerRoutedEventArgs e)
virtual void OnPointerMoved(PointerRoutedEventArgs e) const;
protected virtual void OnPointerMoved(PointerRoutedEventArgs e)

Parameters
e PointerRoutedEventArgs
Event data for the event.
See PointerMoved
Also PointerRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnPointerPressed Control.OnPointerPressed
Control.OnPointerPressed
I n this Article
Edit
Called before the PointerPressed event occurs.
protected : virtual void OnPointerPressed(PointerRoutedEventArgs e)
virtual void OnPointerPressed(PointerRoutedEventArgs e) const;
protected virtual void OnPointerPressed(PointerRoutedEventArgs e)

Parameters
e PointerRoutedEventArgs
Event data for the event.

Remarks
As it's implemented directly on Control, OnPointerPressed has an empty implementation. But each ancestor in a
control's hierarchy may have provided an implementation. You won't be able to see this implementation because it's
internal native code. In some cases a control will already have existing On* overrides that mark the event Handled.
OnPointerPressed happens to be an On* event that several Windows Runtime XAML controls have provided
overrides for. For example, ButtonBase has overridden OnPointerPressed to mark the event Handled. What all buttons
do instead is to then raise the Click event that represents a higher-level event behavior for that control. That means you
won't easily be able to handle UIElement.PointerPressed on a button, but you probably shouldn't be handling it
anyways for most scenarios. Just use Click instead.
See PointerPressed
Also PointerRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnPointerReleased Control.OnPointerReleased
Control.OnPointerReleased
I n this Article
Edit
Called before the PointerReleased event occurs.
protected : virtual void OnPointerReleased(PointerRoutedEventArgs e)
virtual void OnPointerReleased(PointerRoutedEventArgs e) const;
protected virtual void OnPointerReleased(PointerRoutedEventArgs e)

Parameters
e PointerRoutedEventArgs
Event data for the event.
See PointerReleased
Also PointerRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnPointerWheelChanged Control.OnPointer
WheelChanged Control.OnPointerWheelChanged
I n this Article
Edit
Called before the PointerWheelChanged event occurs.
protected : virtual void OnPointerWheelChanged(PointerRoutedEventArgs e)
virtual void OnPointerWheelChanged(PointerRoutedEventArgs e) const;
protected virtual void OnPointerWheelChanged(PointerRoutedEventArgs e)

Parameters
e PointerRoutedEventArgs
Event data for the event.

Remarks
Windows 8 behavior
For Windows 8, track pad device gestures that were input-handled by a ScrollViewer control part were interpreted as
mouse wheel input, and thus would fire a PointerWheelChanged event. Starting with Windows 8.1, ScrollViewer uses
an underlying manipulation logic that interprets track pad gestures as actions that the ScrollViewer responds to, and
thus the gesture is considered handled by the control and the PointerWheelChanged event is not fired anymore.
If you migrate your app code from Windows 8 to Windows 8.1 you may want to account for this behavior change,
because it results in PointerWheelChanged being fired in fewer cases. Also, the behavior that's now built-in to
ScrollViewer may be duplicating what your handler would have done.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
See PointerRoutedEventArgs
Also Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnPreviewKeyDown Control.OnPreviewKeyDown
Control.OnPreviewKeyDown
I n this Article
Edit
Called before the PreviewKeyDown event occurs.
protected : virtual void OnPreviewKeyDown(KeyRoutedEventArgs e)
virtual void OnPreviewKeyDown(KeyRoutedEventArgs e) const;
protected virtual void OnPreviewKeyDown(KeyRoutedEventArgs e)

Parameters
e KeyRoutedEventArgs
The data for the event.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


Control.OnPreviewKeyUp Control.OnPreviewKeyUp
Control.OnPreviewKeyUp
I n this Article
Edit
Called before the PreviewKeyUp event occurs.
protected : virtual void OnPreviewKeyUp(KeyRoutedEventArgs e)
virtual void OnPreviewKeyUp(KeyRoutedEventArgs e) const;
protected virtual void OnPreviewKeyUp(KeyRoutedEventArgs e)

Parameters
e KeyRoutedEventArgs
The data for the event.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


Control.OnRightTapped Control.OnRightTapped Control.
OnRightTapped
I n this Article
Edit
Called before the RightTapped event occurs.
protected : virtual void OnRightTapped(RightTappedRoutedEventArgs e)
virtual void OnRightTapped(RightTappedRoutedEventArgs e) const;
protected virtual void OnRightTapped(RightTappedRoutedEventArgs e)

Parameters
e RightTappedRoutedEventArgs
Event data for the event.

Remarks
This event is not implemented in a MapControl.
Windows 8 behavior
Windows 8 had an issue with the data for the RightTapped event, where the X and Y values for the point you'd get
from RightTappedRoutedEventArgs.GetPosition were reversed (X was really Y; Y was really X). This issue has been
fixed starting with Windows 8.1. But if you're retargeting a Windows 8 app for Windows 8.1, you might have had code
that worked around this issue by swapping the X and Y back. If so, remove that code when you retarget because the
issue is now fixed.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
Also, Windows 8 didn't include default key handling for Shift+F10 that would fire this event and then display context
menus. Shift+F10 is typically a secondary key combination for the VK_APP virtual key value (the Properties key), and
thus Shift+F10 might be expected to fire RightTapped too. This issue has been fixed starting with Windows 8.1;
Shift+F10 now fires RightTapped. You can see this change as default event handling on some controls that have default
context menus for text, such as TextBox, or when invoking custom menus and flyouts.
Apps that were compiled for Windows 8 but running on Windows 8.1 do not use this Windows 8 behavior, they use
the corrected Windows 8.1 behavior.
See RightTapped
Also RightTappedRoutedEventArgs
Events and routed events overview
Custom user interactions
Handle pointer input
Control.OnTapped Control.OnTapped Control.OnTapped
I n this Article
Edit
Called before the Tapped event occurs.

protected : virtual void OnTapped(TappedRoutedEventArgs e)


virtual void OnTapped(TappedRoutedEventArgs e) const;
protected virtual void OnTapped(TappedRoutedEventArgs e)

Parameters
e TappedRoutedEventArgs
Event data for the event.

Remarks
This event is not implemented in a MapControl.
See TappedRoutedEventArgs
Also Events and routed events overview
Custom user interactions
Handle pointer input
Control.Padding Control.Padding Control.Padding
I n this Article
Edit
Gets or sets the padding inside a control.

public : Thickness Padding { get; set; }


Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<control Padding="uniform"/>
- or -
<control Padding="left&right,top&bottom"/>
- or -
<control Padding="left,top,right,bottom"/>

Returns
Thickness
The amount of space between the content of a Control and its Margin or Border. The default is a Thickness with values
of 0 on all four sides.

Remarks
Each control might apply this property differently based on its visual template. This property only affects a control
whose template uses the Padding property as a parameter. On other controls, this property has no effect. For more info
about control templates, see the Template property.
A related property is Margin (a property of FrameworkElement ). For many controls, margin and padding would
typically blend together with the division between them not being apparent in the rendering. For such controls it's
typical to specify a Margin or a Padding, but not both. For more info about the relationship between margin and
padding, see Alignment, margin, and padding or Define layouts with XAML.
See Thickness
Also Alignment, margin, and padding
Control.PaddingProperty Control.PaddingProperty
Control.PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
Control.RemoveFocusEngagement Control.RemoveFocus
Engagement Control.RemoveFocusEngagement
I n this Article
Edit
Releases focus from the control boundaries for a control that has focus engagement (for game pad/remote interaction).
public : void RemoveFocusEngagement()
void RemoveFocusEngagement() const;
public void RemoveFocusEngagement()

Additional features and requirements


Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Focus engagement makes it easier to use a game pad or remote control to interact with an app. Setting focus
engagement does not affect keyboard or other input devices.
When the IsFocusEngagementEnabled property is set to true, it marks the control as requiring focus engagement. This
means that the user must press the A/Select button to "engage" the control and interact with it. When they are finished,
they can press the B/Back button to disengage the control and navigate away from it. You can call
RemoveFocusEngagement to programmatically disengage a control.
For more info, see the Focus engagement section of the Designing for Xbox and TV article.
Version compatibility
The RemoveFocusEngagement method is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not call this method without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
method before you use it.
if (ApiInformation.IsMethodPresent("Windows.UI.Xaml.Controls.Control", "RemoveFocusEngagement"))
{
control1.RemoveFocusEngagement();
}
Control.RequiresPointer Control.RequiresPointer Control.
RequiresPointer
I n this Article
Edit
Gets or sets whether a UI element supports mouse mode, which emulates pointer interaction experiences with non-
pointer input devices such as an Xbox gamepad or remote control.
public : RequiresPointer RequiresPointer { get; set; }
RequiresPointer RequiresPointer();

void RequiresPointer(RequiresPointer requirespointer);


public RequiresPointer RequiresPointer { get; set; }

<control RequiresPointer="requiresPointerMemberName"/>

Returns
RequiresPointer
The pointer emulation mode. The default is Never.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
For non-pointer input devices, focus is moved between controls through a variety of methods, such as the Tab and
arrow keys on a keyboard, the directional pad (D -pad) on a remote, or thumb sticks on an Xbox controller. For some
user experiences, such as maps and drawing surfaces, it is not possible or practical to use XY focus navigation.
RequiresPointer enables an app to provide a more pointer-like interaction experience through a cursor that can be
moved freely using the Xbox input devices.
RequiresPointer is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.
RequiresPointerMode sets mouse mode at the application level.
For more info, see the Mouse mode section of Designing for Xbox and TV.
Version compatibility
The RequiresPointer property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Control", "RequiresPointer"))
{
mapControl1.RequiresPointer = RequiresPointer.WhenEngaged;
}
Control.RequiresPointerProperty Control.RequiresPointer
Property Control.RequiresPointerProperty
I n this Article
Edit
Identifies the RequiresPointer dependency property.
public : static DependencyProperty RequiresPointerProperty { get; }
static DependencyProperty RequiresPointerProperty();
public static DependencyProperty RequiresPointerProperty { get; }

Returns
DependencyProperty
The identifier for the RequiresPointer dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


Control.SetIsTemplateFocusTarget Control.SetIsTemplate
FocusTarget Control.SetIsTemplateFocusTarget
I n this Article
Edit
Sets the value of the Control.IsTemplateFocusTarget XAML attached property for a target element.
public : static void SetIsTemplateFocusTarget(FrameworkElement element, bool value)
static void SetIsTemplateFocusTarget(FrameworkElement element, bool value) const;
public static void SetIsTemplateFocusTarget(FrameworkElement element, Boolean value)

Parameters
element FrameworkElement
The object to which the property value is written.
value Boolean
The value to set.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Control.IsTemplateFocusTarget XAML attached property in XAML and won't need this method. For more info, see the
Control.IsTemplateFocusTarget attached property.
Control.SetIsTemplateKeyTipTarget Control.SetIsTemplate
KeyTipTarget Control.SetIsTemplateKeyTipTarget
I n this Article
Edit
Sets the value of the Control.IsTemplateKeyTipTarget XAML attached property for a target element.
public : static void SetIsTemplateKeyTipTarget(DependencyObject element, bool value)
static void SetIsTemplateKeyTipTarget(DependencyObject element, bool value) const;
public static void SetIsTemplateKeyTipTarget(DependencyObject element, Boolean value)

Parameters
element DependencyObject
The object to which the property value is written.
value Boolean
The value to set.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Control.IsTemplateFocusTarget XAML attached property in XAML and won't need this method. For more info, see
the Control.IsTemplateKeyTipTarget attached property.
Control.TabIndex Control.TabIndex Control.TabIndex
I n this Article
Edit
Gets or sets a value that determines the order in which elements receive focus when the user navigates through
controls by pressing the Tab key.
public : int TabIndex { get; set; }
int32_t TabIndex();

void TabIndex(int32_t tabindex);


public int TabIndex { get; set; }

<control TabIndex="int/>

Returns
int
A value that determines the order of logical navigation for a device. The default value is MaxValue.
See Keyboard interactions
Also Keyboard accessibility
Control.TabIndexProperty Control.TabIndexProperty
Control.TabIndexProperty
I n this Article
Edit
Identifies the TabIndex dependency property.
public : static DependencyProperty TabIndexProperty { get; }
static DependencyProperty TabIndexProperty();
public static DependencyProperty TabIndexProperty { get; }

Returns
DependencyProperty
The identifier for the TabIndex dependency property.
Control.TabNavigation Control.TabNavigation Control.
TabNavigation
I n this Article
Edit
Gets or sets a value that modifies how tabbing and TabIndex work for this control.
Note

For Windows 10 Creators Update (build 10.0.15063) and newer, the TabFocusNavigation property is available on the
UI Element

base class to include objects in the tab sequence that do not use a ControlTemplate.
public : KeyboardNavigationMode TabNavigation { get; set; }
KeyboardNavigationMode TabNavigation();

void TabNavigation(KeyboardNavigationMode tabnavigation);


public KeyboardNavigationMode TabNavigation { get; set; }

<control TabNavigation="keyboardNavigationModeMemberName"/>

Returns
KeyboardNavigationMode
A value of the enumeration. The default is Local.
See Keyboard interactions
Also Keyboard accessibility
Control.TabNavigationProperty Control.TabNavigation
Property Control.TabNavigationProperty
I n this Article
Edit
Identifies the TabNavigation dependency property.
public : static DependencyProperty TabNavigationProperty { get; }
static DependencyProperty TabNavigationProperty();
public static DependencyProperty TabNavigationProperty { get; }

Returns
DependencyProperty
The identifier for the TabNavigation dependency property.
Control.Template Control.Template Control.Template
I n this Article
Edit
Gets or sets a control template. The control template defines the visual appearance of a control in UI, and is defined in
XAML markup.
public : ControlTemplate Template { get; set; }
ControlTemplate Template();

void Template(ControlTemplate template);


public ControlTemplate Template { get; set; }

<control Template="{StaticResource templateResourceKey}"/>

Returns
ControlTemplate
The template that defines the appearance of the Control. The ControlTemplate must have exactly one root element as
its content.

Examples
This example shows a more complete control template defined as a Style and Setter with Setter.Property value of
"Template". This is a named style for a RadioButton control. It includes the template elements that are normally part of
a functional control template, such as a VisualStateManager.VisualStateGroups attached property element attached to
the root element of the template, and x:Name attribute values assigned to each of the prominent control parts.

<Style x:Key="TextRadioButtonStyle" TargetType="RadioButton">


<Setter Property="MinWidth" Value="0"/>
<Setter Property="MinHeight" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<Grid Background="Transparent">
<TextBlock
x:Name="Text"
Text="{TemplateBinding Content}"
Margin="3,-7,3,10"
TextWrapping="NoWrap"
Style="{StaticResource SubheaderTextStyle}"/>
<Rectangle
x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="1.5"/>
<Rectangle
x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{StaticResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="0.5"/>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="
{StaticResource ApplicationPointerOverForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">

<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="
{StaticResource ApplicationPressedForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="
{StaticResource ButtonDisabledForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation Duration="0" To="1"
Storyboard.TargetName="FocusVisualWhite" Storyboard.TargetProperty="Opacity"/>
<DoubleAnimation Duration="0" To="1"
Storyboard.TargetName="FocusVisualBlack" Storyboard.TargetProperty="Opacity"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused"/>
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked"/>
<VisualState x:Name="Unchecked">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Text"
Storyboard.TargetProperty="Foreground">
<DiscreteObjectKeyFrame KeyTime="0" Value="
{StaticResource ApplicationSecondaryForegroundThemeBrush}"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Remarks
The second XAML syntax shown above is a Setter syntax as part of a Style. This is how a Template value for a Control
is defined in almost all cases.
TargetType is a required attribute on all ControlTemplate elements used as a Template value. The value should match
the TargetType property for the Style that contains the Setter for Template, if you are using a style-setter syntax.
The ControlTemplate specifies the appearance of a Control; if a Control does not have a ControlTemplate, the Control
will have no visible presence in your app. The control author defines the default control template, and the app author
can re-template the ControlTemplate XAML to redefine the visual tree of the control.
Control templates are typically set in Extensible Application Markup Language (XAML ) as part of a control-specific
implicit style. In this case, a Property value in the Setter is set as the string "Template", and the Setter.Value value is set
as a property element, which contains a ControlTemplate object element. For example, this is the Style that defines a
Template value for a ScrollViewer. This is an example of an implicit style, where the Style can be in a
ResourceDictionary but doesn't need an x:Key attribute.

<ResourceDictionary>
<Style TargetType="ScrollViewer">
...
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ScrollViewer">
<!--visual root of template for a ScrollViewer-->
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
...
</ResourceDictionary>

Styles and templates


You can use a Setter in a Style to apply values to any dependency property. But it's the Setter for the Template property
of a Control -derived class that constitutes the majority of the XAML markup in a typical Style. When a Style is used to
define a control template, the TargetType of the Style element and the TargetType of the ControlTemplate element for
its Control.Template setter should always use the same value. The Template setter defines the basic templated UI
definition for a control where that template is applied. It also contains the visual states for a control, and other state-
based UI definitions such as default theme transitions. For a complex control such as ListBox, the default template Style
and the ControlTemplate within can have hundreds of lines of XAML. For more info on the role of Template in control
templating scenarios, see Quickstart: Control templates.
I mplicit styles
You can define styles such that a Style is used implicitly by all objects of the same TargetType, without requiring each
instance of such an object to specifically reference the Style as a FrameworkElement.Style value. When a <Style>
resource is declared in a ResourceDictionary without an x:Key attribute, the x:Key value uses the value of the
TargetType property. If you set the style implicitly, the style is applied only to the types that match the TargetType
exactly and not to elements derived from the TargetType value. For example, if you create a style implicitly for all the
ToggleButton controls in your application, and your application has ToggleButton and CheckBox controls (CheckBox
derives from ToggleButton ), the "ToggleButton" implicit style is applied only to the ToggleButton controls.
See Quickstart: Control templates
Also OnApplyTemplate
ControlTemplate
Control.TemplateProperty Control.TemplateProperty
Control.TemplateProperty
I n this Article
Edit
Identifies the Template dependency property.
public : static DependencyProperty TemplateProperty { get; }
static DependencyProperty TemplateProperty();
public static DependencyProperty TemplateProperty { get; }

Returns
DependencyProperty
The identifier for the Template dependency property.
Control.UseSystemFocusVisuals Control.UseSystemFocus
Visuals Control.UseSystemFocusVisuals
I n this Article
Edit
Gets or sets a value that indicates whether the control uses focus visuals that are drawn by the system or those defined
in the control template.
public : Platform::Boolean UseSystemFocusVisuals { get; set; }
bool UseSystemFocusVisuals();

void UseSystemFocusVisuals(bool usesystemfocusvisuals);


public bool UseSystemFocusVisuals { get; set; }

Returns
bool
true if the control uses focus visuals drawn by the system; false if the control uses focus visuals defined in the
ControlTemplate. The default is false; see Remarks.

Examples
This example shows a ControlTemplate that defines custom focus visuals for a Button.
Some elements of the control template aren't shown to make the relevant parts more clear. To see the full control
template for Button, see Button styles and templates.
<Style TargetType="Button">

<!-- Set UseSystemFocusVisuals to false. -->


<Setter Property="UseSystemFocusVisuals" Value="False"/>
...

<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOver">
...

</VisualState>
</VisualStateGroup>

<!-- Add VisualStateGroup for FocusStates. -->


<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused">
<Storyboard>
<DoubleAnimation Storyboard.TargetName="FocusVisualWhite"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
<DoubleAnimation Storyboard.TargetName="FocusVisualBlack"
Storyboard.TargetProperty="Opacity"
To="1"
Duration="0"/>
</Storyboard>
</VisualState>
<VisualState x:Name="Unfocused"/>
<VisualState x:Name="PointerFocused"/>
</VisualStateGroup>

</VisualStateManager.VisualStateGroups>
<Border x:Name="Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Margin="3">
<ContentPresenter x:Name="ContentPresenter"
Content="{TemplateBinding Content}"
ContentTransitions="{TemplateBinding ContentTransitions}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding
HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding
VerticalContentAlignment}"
AutomationProperties.AccessibilityView="Raw"/>
</Border>

<!-- Add elements for focus visuals. -->


<Rectangle x:Name="FocusVisualWhite"
IsHitTestVisible="False"
Stroke="{ThemeResource FocusVisualWhiteStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="1.5"/>
<Rectangle x:Name="FocusVisualBlack"
IsHitTestVisible="False"
Stroke="{ThemeResource FocusVisualBlackStrokeThemeBrush}"
StrokeEndLineCap="Square"
StrokeDashArray="1,1"
Opacity="0"
StrokeDashOffset="0.5"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

Remarks
This property is false by default so that a custom ControlTemplate that defines its own focus visuals works as expected.
However, all XAML framework controls set this property to true in their ControlTemplate and use system drawn focus
visuals.
To define custom focus visuals for a control, you need to provide a custom ControlTemplate. In the ControlTemplate, do
the following:
If you're modifying a default ControlTemplate, be sure to set the UseSystemFocusVisuals property to false to turn off
the system focus visuals. When set to false, the focus states in the VisualStateManager are called.
Define a VisualStateGroup for FocusStates .
In the FocusStates group, define VisualState s for Focused , Unfocused , and PointerFocused .
Define the focus visuals.
See Control.IsTemplateFocusTarget
Also
Button styles and templates
Control.UseSystemFocusVisualsProperty Control.Use
SystemFocusVisualsProperty Control.UseSystemFocus
VisualsProperty
I n this Article
Edit
Identifies the UseSystemFocusVisuals dependency property.
public : static DependencyProperty UseSystemFocusVisualsProperty { get; }
static DependencyProperty UseSystemFocusVisualsProperty();
public static DependencyProperty UseSystemFocusVisualsProperty { get; }

Returns
DependencyProperty
The identifier for the UseSystemFocusVisuals dependency property.
See Dependency properties overview
Also
Control.VerticalContentAlignment Control.Vertical
ContentAlignment Control.VerticalContentAlignment
I n this Article
Edit
Gets or sets the vertical alignment of the control's content.
public : VerticalAlignment VerticalContentAlignment { get; set; }
VerticalAlignment VerticalContentAlignment();

void VerticalContentAlignment(VerticalAlignment verticalcontentalignment);


public VerticalAlignment VerticalContentAlignment { get; set; }

<control VerticalContentAlignment="verticalAlignmentValue"/>

Returns
VerticalAlignment
One of the VerticalAlignment values. The default is Top.

Remarks
Each control might apply this property differently based on the Style setters for the control's implicit style, and its visual
template. Also, the apparent "default value" of each individual control used in UI can be different. For example, a Button
control starts with the value Center.
A value for the VerticalContentAlignment property only affects layout behavior for a control when its template uses the
VerticalContentAlignment property as the source of a VerticalAlignment value for presenters or content areas within.
On other controls, setting VerticalContentAlignment has no effect. For more info about visual templates for controls,
see the reference for Control.Template.
See VerticalAlignment
Also Alignment, margin, and padding
Control.VerticalContentAlignmentProperty Control.
VerticalContentAlignmentProperty Control.Vertical
ContentAlignmentProperty
I n this Article
Edit
Identifies the VerticalContentAlignment dependency property.
public : static DependencyProperty VerticalContentAlignmentProperty { get; }
static DependencyProperty VerticalContentAlignmentProperty();
public static DependencyProperty VerticalContentAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalContentAlignment dependency property.
Control.XYFocusDown Control.XYFocusDown Control.XY
FocusDown
I n this Article
Edit
Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) down.
public : DependencyObject XYFocusDown { get; set; }
DependencyObject XYFocusDown();

void XYFocusDown(DependencyObject xyfocusdown);


public DependencyObject XYFocusDown { get; set; }

<control XYFocusDown="{x:Bind dependencyObjectValue}"/>

Returns
DependencyObject
The object that gets focus when a user presses the Directional Pad (D -pad) down.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
XYFocusDown is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.
For more info about this property, see the XY focus navigation and interaction section of the Designing for Xbox and
TV article.
XYFocusDown="{x:Bind commandBar2}"
Version compatibility
The XYFocusDown property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Control", "XYFocusDown"))
{
button1.XYFocusDown = button2;
}
Control.XYFocusDownProperty Control.XYFocusDown
Property Control.XYFocusDownProperty
I n this Article
Edit
Identifies the XYFocusDown dependency property.
public : static DependencyProperty XYFocusDownProperty { get; }
static DependencyProperty XYFocusDownProperty();
public static DependencyProperty XYFocusDownProperty { get; }

Returns
DependencyProperty
The identifier for the XYFocusDown dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


Control.XYFocusLeft Control.XYFocusLeft Control.XY
FocusLeft
I n this Article
Edit
Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) left.
public : DependencyObject XYFocusLeft { get; set; }
DependencyObject XYFocusLeft();

void XYFocusLeft(DependencyObject xyfocusleft);


public DependencyObject XYFocusLeft { get; set; }

<control XYFocusLeft="{x:Bind dependencyObjectValue}"/>

Returns
DependencyObject
The object that gets focus when a user presses the Directional Pad (D -pad) left.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
XYFocusLeft is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.
For more info about this property, see the XY focus navigation and interaction section of the Designing for Xbox and
TV article.
Version compatibility
The XYFocusLeft property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Control", "XYFocusLeft"))
{
button1.XYFocusLeft = button2;
}
Control.XYFocusLeftProperty Control.XYFocusLeft
Property Control.XYFocusLeftProperty
I n this Article
Edit
Identifies the XYFocusLeft dependency property.
public : static DependencyProperty XYFocusLeftProperty { get; }
static DependencyProperty XYFocusLeftProperty();
public static DependencyProperty XYFocusLeftProperty { get; }

Returns
DependencyProperty
The identifier for the XYFocusLeft dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


Control.XYFocusRight Control.XYFocusRight Control.XY
FocusRight
I n this Article
Edit
Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) right.
public : DependencyObject XYFocusRight { get; set; }
DependencyObject XYFocusRight();

void XYFocusRight(DependencyObject xyfocusright);


public DependencyObject XYFocusRight { get; set; }

<control XYFocusRight="{x:Bind dependencyObjectValue}"/>

Returns
DependencyObject
The object that gets focus when a user presses the Directional Pad (D -pad) right.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
XYFocusRight is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.
For more info about this property, see the XY focus navigation and interaction section of the Designing for Xbox and
TV article.
Version compatibility
The XYFocusRight property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Control", "XYFocusRight"))
{
button1.XYFocusRight = button2;
}
Control.XYFocusRightProperty Control.XYFocusRight
Property Control.XYFocusRightProperty
I n this Article
Edit
Identifies the XYFocusRight dependency property.
public : static DependencyProperty XYFocusRightProperty { get; }
static DependencyProperty XYFocusRightProperty();
public static DependencyProperty XYFocusRightProperty { get; }

Returns
DependencyProperty
The identifier for the XYFocusRight dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


Control.XYFocusUp Control.XYFocusUp Control.XYFocus
Up
I n this Article
Edit
Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) up.
public : DependencyObject XYFocusUp { get; set; }
DependencyObject XYFocusUp();

void XYFocusUp(DependencyObject xyfocusup);


public DependencyObject XYFocusUp { get; set; }

<control XYFocusUp="{x:Bind dependencyObjectValue}"/>

Returns
DependencyObject
The object that gets focus when a user presses the Directional Pad (D -pad) up.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
XYFocusUp is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.
For more info about this property, see the XY focus navigation and interaction section of the Designing for Xbox and
TV article.
Version compatibility
The XYFocusUp property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform version'
setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in this
page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Control", "XYFocusUp"))
{
button1.XYFocusUp = button2;
}
Control.XYFocusUpProperty Control.XYFocusUpProperty
Control.XYFocusUpProperty
I n this Article
Edit
Identifies the XYFocusUp dependency property.
public : static DependencyProperty XYFocusUpProperty { get; }
static DependencyProperty XYFocusUpProperty();
public static DependencyProperty XYFocusUpProperty { get; }

Returns
DependencyProperty
The identifier for the XYFocusUp dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


ControlTemplate ControlTemplate ControlTemplate Class
Defines the element tree that is used as the control template for a control.

D eclaration
public : sealed class ControlTemplate : FrameworkTemplate, IControlTemplate
struct winrt::Windows::UI::Xaml::Controls::ControlTemplate : FrameworkTemplate, IControlTemplate
public sealed class ControlTemplate : FrameworkTemplate, IControlTemplate

I nheritance H ierarchy
DependencyObject
FrameworkTemplate

Remarks
For more info and examples, see XAML control templates.
ControlTemplate is used as the value of the Control.Template property, which defines the visuals of a control by
applying the template. You almost always define a ControlTemplate as a XAML resource, using an implicit key
TargetType that is the same as a Style that sets Control.Template with a Setter. You rarely if ever assign a value for
Control.Template directly on a control instance.
There are really only two properties you use when defining a ControlTemplate: the TargetType, and the implicit XAML
content. ControlTemplate inherits the implicit XAML content behavior from its FrameworkTemplate parent. Basically
the element contained within a ControlTemplate as defined in XAML is assigning a root element for a further structure
of XAML elements that define the template. This is setting a "Template" property that can't subsequently be examined
by code and only has meaning for how the XAML parser assigns content for controls based on applying that template.
To have its content be set from a ControlTemplate, a control element must be a true Control subclass, so that it has the
Control.Template property. There are other cases where templates apply content but this usually involves one of the
other FrameworkTemplate derived template classes (DataTemplate or ItemsPanelTemplate ).
Control templates provide the visuals and parts that make up an instance of a control as it appears in an app's UI. At
run time, the template has already been applied, and so all the parts that were created out of the template are now truly
parts of the control, and can be accessed by techniques such as examining the XAML namescopes from within control
content or using the VisualTreeHelper class. Events such as the input events sometimes expose the parts of a control
that came from the applied control template.
There are ways to access template-defined content either before or after the template is applied to a specific control
instance; see OnApplyTemplate or GetTemplateChild.
The actual point in time that a ControlTemplate is applied to a control instance can be detected because this invokes the
OnApplyTemplate protected virtual method. So long as the control isn't sealed, you can subclass a control so that you
have the opportunity to override OnApplyTemplate. This override can be written to perform actions that wouldn't be
possible prior to the template being applied. For example, you can wire event handlers to control parts, or set control
properties to reference object parts that were created out of the template but didn't start with a {TemplateBinding}
markup extension value.

Constructors
ControlTemplate()
ControlTemplate()
ControlTemplate()

Initializes a new instance of the ControlTemplate class.

Properties
TargetType
TargetType
TargetType

Gets or sets the type to which the ControlTemplate is applied.

See Also
FrameworkTemplate
FrameworkTemplate
FrameworkTemplate
ControlTemplate ControlTemplate ControlTemplate
I n this Article
Edit
Initializes a new instance of the ControlTemplate class.

public : ControlTemplate()
ControlTemplate() const;
public ControlTemplate()
ControlTemplate.TargetType ControlTemplate.TargetType
ControlTemplate.TargetType
I n this Article
Edit
Gets or sets the type to which the ControlTemplate is applied.
public : TypeName TargetType { get; set; }
TypeName TargetType();

void TargetType(TypeName targettype);


public Type TargetType { get; set; }

<ControlTemplate TargetType="typeName"/>

Returns
Type
The type to which the ControlTemplate is applied. This value is usually set in XAML, not code. See Remarks.

Remarks
The typical way to specify a TargetType value is through a XAML attribute on the ControlTemplate. When set in XAML,
the meaning of TargetType and the values you provide take on some aspects of how types are represented in XAML. In
particular, any prefixes that would be necessary to refer to a given type as a XAML element should also be included as
the value of the TargetType value string. For example, if a template is intended to target a custom type that must be
preceded by the already-mapped prefix "local" in a particular markup scope, then the TargetType value should include
that same prefix. This behavior is enabled by built-in conversion behavior in the Windows Runtime XAML parser.
In most cases, you will be setting the TargetType for a ControlTemplate where that ControlTemplate is within a Setter
for the Template property. This in turn is within the implicit Style you are defining for a control. The
ControlTemplate.TargetType value and the Style.TargetType value of the containing Style should always be the same
type reference, referring to the same implicitly named control. Otherwise the control template might not work.
For more info on how to write a control template, see Quickstart: Control templates.
Note

If you have previously programmed XAML for Windows Presentation Foundation (WPF ), then you might have used
an x:Type markup extension to fill in any XAML values that take a System.Type. The Windows Runtime XAML parser
does not support x:Type. Instead, you should refer to the type by name without using any markup extension, and any
necessary XAML -to-backing type conversion is already handled by the built-in conversion behavior described in the
previous paragraph.
Using TargetType in code
Setting TargetType in code is uncommon. The XAML style/template system is intended to be used by loading XAML as
a resource and having all aspects of a control template be ready beforehand. There should be very few scenarios where
you would not know info about controls and templates until runtime, where there is a need to set a TargetType on a
ControlTemplate created or referenced in code.
Getting a TargetType in code is also uncommon, but you might do this to double-check that a ControlTemplate that
you've loaded from XAML is compatible with a given control target that you got from the runtime tree.
 Tip

If you are programming using a Microsoft .NET language (C# or Microsoft Visual Basic), the TypeName type projects
as System.Type. When programming using C#, you usually use the typeof operator to get references to the
System.Type of a type based on a type name as a string. In Microsoft Visual Basic, use GetType.
See Quickstart: Control templates
Also ResourceDictionary and XAML resource references
DataTemplateSelector DataTemplateSelector Data
TemplateSelector Class
Enables custom template selection logic at the application level.

D eclaration
public : class DataTemplateSelector : IDataTemplateSelector, IDataTemplateSelector2,
IDataTemplateSelectorOverrides, IDataTemplateSelectorOverrides2, IElementFactory
struct winrt::Windows::UI::Xaml::Controls::DataTemplateSelector : IDataTemplateSelector,
IDataTemplateSelector2, IDataTemplateSelectorOverrides, IDataTemplateSelectorOverrides2,
IElementFactory
public class DataTemplateSelector : IDataTemplateSelector, IDataTemplateSelector2,
IDataTemplateSelectorOverrides, IDataTemplateSelectorOverrides2, IElementFactory

I nheritance H ierarchy
None

Remarks
For more info about data templates, see the DataTemplate class and Item containers and templates.
The base DataTemplateSelector class is not used as an object element in XAML. However, it is a common scenario to
derive a custom DataTemplateSelector, map a xmlns prefix for the custom class and its namespace/assembly, and then
refer to an instance of the custom class as defined in a Resources block in XAML. This makes it possible to refer to the
custom template selector class by x:Key, and use that reference to set the value of properties such as
ItemTemplateSelector in XAML templates and visual states.
The callable methods of DataTemplateSelector are the two SelectTemplate overloads. The overridable methods of
DataTemplateSelector are the two SelectTemplateCore overloads. To define an effective DataTemplateSelector
subclass, provide implementations for SelectTemplateCore(Object) and SelectTemplateCore(Object,
DependencyObject). All these methods return a DataTemplate instance that's typically a specific choice that's
appropriate for the inputs of the method that was called to obtain it.
App code typically doesn't call SelectTemplate methods; the methods exists so that the infrastructure can call it while
choosing the correct templates based on using a DataTemplateSelector instance from a property value such as
ItemsControl.ItemsTemplateSelector.
For example XAML that references a custom DataTemplateSelector as the HeaderTemplateSelector value, and example
code that shows the overrides for HeaderTemplateSelector methods, see How to group items in a list or grid.

Constructors
DataTemplateSelector()
DataTemplateSelector()
DataTemplateSelector()

Initializes a new instance of the DataTemplateSelector class.

Methods
GetElement(ElementFactoryGetArgs)
GetElement(ElementFactoryGetArgs)
GetElement(ElementFactoryGetArgs)

Creates or retrieves an existing instance of the UIElement object declared in the DataTemplate returned by
SelectTemplate.

RecycleElement(ElementFactoryRecycleArgs)
RecycleElement(ElementFactoryRecycleArgs)
RecycleElement(ElementFactoryRecycleArgs)

Recycles a UIElement object that was created using GetElement.

SelectTemplate(Object)
SelectTemplate(Object)
SelectTemplate(Object)

Returns a specific DataTemplate for a given item.

SelectTemplate(Object, DependencyObject)
SelectTemplate(Object, DependencyObject)
SelectTemplate(Object, DependencyObject)

Returns a specific DataTemplate for a given item and container.

SelectTemplateCore(Object)
SelectTemplateCore(Object)
SelectTemplateCore(Object)

When implemented by a derived class, returns a specific DataTemplate for a given item or container.

SelectTemplateCore(Object, DependencyObject)
SelectTemplateCore(Object, DependencyObject)
SelectTemplateCore(Object, DependencyObject)

When implemented by a derived class, returns a specific DataTemplate for a given item or container.

See Also
DataTemplate
DataTemplate
DataTemplate
DataTemplateSelector DataTemplateSelector Data
TemplateSelector
I n this Article
Edit
Initializes a new instance of the DataTemplateSelector class.
public : DataTemplateSelector()
DataTemplateSelector() const;
public DataTemplateSelector()
DataTemplateSelector.GetElement DataTemplateSelector.
GetElement DataTemplateSelector.GetElement
I n this Article
Edit
Creates or retrieves an existing instance of the UIElement object declared in the DataTemplate returned by
SelectTemplate.
public : UIElement GetElement(ElementFactoryGetArgs args)
UIElement GetElement(ElementFactoryGetArgs args) const;
public UIElement GetElement(ElementFactoryGetArgs args)

Parameters
args ElementFactoryGetArgs
An instance of ElementFactoryGetArgs.
Returns
UIElement
An instance of the root UIElement declared in the selected DataTemplate or, null if the root of the selected
DataTemplate is not a UIElement.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
For more info, see the remarks for the DataTemplate.GetElement method.
DataTemplateSelector.RecycleElement DataTemplate
Selector.RecycleElement DataTemplateSelector.Recycle
Element
I n this Article
Edit
Recycles a UIElement object that was created using GetElement.
public : void RecycleElement(ElementFactoryRecycleArgs args)
void RecycleElement(ElementFactoryRecycleArgs args) const;
public void RecycleElement(ElementFactoryRecycleArgs args)

Parameters
args ElementFactoryRecycleArgs
An instance of ElementFactoryRecycleArgs.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
For more info, see the remarks for the DataTemplate.RecycleElement method.
DataTemplateSelector.SelectTemplate DataTemplate
Selector.SelectTemplate DataTemplateSelector.Select
Template
I n this Article

Overloads
SelectTemplate(Object) SelectTemplate(Object) SelectTemplate(
Object) Returns a specific DataTemplate for a given item.

SelectTemplate(Object, DependencyObject) SelectTemplate(


Object, DependencyObject) SelectTemplate(Object, Returns a specific DataTemplate for a given item and container.
DependencyObject)

SelectTemplate(Object) SelectTemplate(Object)
SelectTemplate(Object)
Edit
Returns a specific DataTemplate for a given item.
public : DataTemplate SelectTemplate(Platform::Object item)
DataTemplate SelectTemplate(winrt::Windows::Foundation::IInspectable item) const;
public DataTemplate SelectTemplate(Object item)

Parameters
item Object
The item to return a template for.
Returns
DataTemplate
The template to use for the given item and/or container.
Attributes OverloadAttribute
See
Also
SelectTemplate(Object, DependencyObject)SelectTemplate(Object, DependencyObject)SelectTemplate(Object,
DependencyObject)
Adding ListView and GridView controls

SelectTemplate(Object, DependencyObject) SelectTemplate(Object,


DependencyObject) SelectTemplate(Object, DependencyObject)
Edit
Returns a specific DataTemplate for a given item and container.
public : DataTemplate SelectTemplate(Platform::Object item, DependencyObject container)
DataTemplate SelectTemplate(winrt::Windows::Foundation::IInspectable item, DependencyObject
container) const;
public DataTemplate SelectTemplate(Object item, DependencyObject container)

Parameters
item Object
The item to return a template for.
container DependencyObject
The parent container for the templated item.
Returns
DataTemplate
The template to use for the given item and/or container.
See SelectTemplate(Object)SelectTemplate(Object)SelectTemplate(Object)
Also Adding ListView and GridView controls
DataTemplateSelector.SelectTemplateCore DataTemplate
Selector.SelectTemplateCore DataTemplateSelector.Select
TemplateCore
I n this Article

Overloads
SelectTemplateCore(Object) SelectTemplateCore(Object) Select
TemplateCore(Object) When implemented by a derived class, returns a specific
DataTemplate for a given item or container.

SelectTemplateCore(Object, DependencyObject) Select


TemplateCore(Object, DependencyObject) SelectTemplateCore( When implemented by a derived class, returns a specific
Object, DependencyObject) DataTemplate for a given item or container.

SelectTemplateCore(Object) SelectTemplateCore(Object)
SelectTemplateCore(Object)
Edit
When implemented by a derived class, returns a specific DataTemplate for a given item or container.
protected : virtual DataTemplate SelectTemplateCore(Platform::Object item)
virtual DataTemplate SelectTemplateCore(winrt::Windows::Foundation::IInspectable item) const;
protected virtual DataTemplate SelectTemplateCore(Object item)

Parameters
item Object
The item to return a template for.
Returns
DataTemplate
The template to use for the given item and/or container.
Attributes OverloadAttribute
Remarks
If your ItemsControl.ItemsPanel is an ItemsStackPanel or ItemsWrapGrid, provide an override for the
SelectTemplateCore(Object) method. If the ItemsPanel is a different panel, such as VirtualizingStackPanel or WrapGrid,
provide an override for the SelectTemplateCore(Object, DependencyObject) method.
Note

In Windows 8.1, ItemsStackPanel is the default ItemsPanel for ListView, and ItemsWrapGrid is the default ItemsPanel
for GridView.
See
Also
DataTemplate
SelectTemplateCore(Object, DependencyObject)SelectTemplateCore(Object,
DependencyObject)SelectTemplateCore(Object, DependencyObject)
Adding ListView and GridView controls

SelectTemplateCore(Object, DependencyObject)
SelectTemplateCore(Object, DependencyObject)
SelectTemplateCore(Object, DependencyObject)
Edit
When implemented by a derived class, returns a specific DataTemplate for a given item or container.
protected : virtual DataTemplate SelectTemplateCore(Platform::Object item, DependencyObject
container)
virtual DataTemplate SelectTemplateCore(winrt::Windows::Foundation::IInspectable item,
DependencyObject container) const;
protected virtual DataTemplate SelectTemplateCore(Object item, DependencyObject container)

Parameters
item Object
The item to return a template for.
container DependencyObject
The parent container for the templated item.
Returns
DataTemplate
The template to use for the given item and/or container.
Remarks
Most implementations will choose to implement the selection logic based on the value of either item or container, not
both. Implementations should still pass the unused parameter as-is to base.
See DataTemplate
Also SelectTemplateCore(Object)SelectTemplateCore(Object)SelectTemplateCore(Object)
Adding ListView and GridView controls
DatePickedEventArgs DatePickedEventArgs DatePicked
EventArgs Class
Provides data for the DatePicked event.

D eclaration
public : sealed class DatePickedEventArgs : DependencyObject, IDatePickedEventArgs
struct winrt::Windows::UI::Xaml::Controls::DatePickedEventArgs : DependencyObject,
IDatePickedEventArgs
public sealed class DatePickedEventArgs : DependencyObject, IDatePickedEventArgs

I nheritance H ierarchy
DependencyObject

Constructors
DatePickedEventArgs()
DatePickedEventArgs()
DatePickedEventArgs()

Initializes a new instance of the DatePickedEventArgs class.

Properties
NewDate
NewDate
NewDate

Gets the date that was selected by the user.

OldDate
OldDate
OldDate

Gets the previous date.

See Also
DependencyObject
DatePickedEventArgs DatePickedEventArgs DatePicked
EventArgs
I n this Article
Edit
Initializes a new instance of the DatePickedEventArgs class.
public : DatePickedEventArgs()
DatePickedEventArgs() const;
public DatePickedEventArgs()
DatePickedEventArgs.NewDate DatePickedEventArgs.
NewDate DatePickedEventArgs.NewDate
I n this Article
Edit
Gets the date that was selected by the user.
public : DateTime NewDate { get; }
DateTime NewDate();
public DateTimeOffset NewDate { get; }

Returns
DateTimeOffset
The date that was selected by the user.
DatePickedEventArgs.OldDate DatePickedEventArgs.Old
Date DatePickedEventArgs.OldDate
I n this Article
Edit
Gets the previous date.
public : DateTime OldDate { get; }
DateTime OldDate();
public DateTimeOffset OldDate { get; }

Returns
DateTimeOffset
The previous date.
DatePicker DatePicker DatePicker Class
Represents a control that allows a user to pick a date value.

D eclaration
public : class DatePicker : Control, IDatePicker, IDatePicker2, IDatePicker3
struct winrt::Windows::UI::Xaml::Controls::DatePicker : Control, IDatePicker, IDatePicker2,
IDatePicker3
public class DatePicker : Control, IDatePicker, IDatePicker2, IDatePicker3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
Use a DatePicker to let a user enter a date value. The user picks the date using ComboBox selection for month, day, and
year values. You can customize the DatePicker in various ways to suit your app.

You can use a DateTimeFormatter object to format the contents of each ComboBox selector. For more info, see Date
picker.
Note

Some date formats should be avoided if the date picker might be displayed in a small area, such as adding the full
string value of the day of week. These strings can be long and might be clipped if the DatePicker's width is forced to be
small.
D ateTime and Calendar values
The date objects used in a DatePicker have a different representation depending on your programming language. C#
and Visual Basic use the System.DateTimeOffset structure that is part of .NET. Visual C++ component extensions
(C++/CX) uses the Windows::Foundation::DateTime structure. A related concept is the Calendar class, which
influences how dates are interpreted in context. All Windows Runtime apps can use the
Windows.Globalization.Calendar class. C# and Visual Basic apps can alternatively use the
System.Globalization.Calendar class, which has very similar functionality. (Windows Runtime app can use the base
.NET Calendar class but not the specific implementations for example GregorianCalendar.)
.NET also supports a type named DateTime, which is implicitly convertible to a DateTimeOffset. So you might see a
"DateTime" type being used in .NET code that's used to set values that are really DateTimeOffset. For more info on the
difference between DateTime and DateTimeOffset, see Remarks in DateTimeOffset.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the DatePicker control.

R ES O U R CE K EY D ES CR IPTIO N

DatePickerSpacerFill Spacer color

DatePickerSpacerFillDisabled Spacer color when disabled

DatePickerHeaderForeground Header text color

DatePickerHeaderForegroundDisabled Header text color when disabled

DatePickerButtonForeground Button text color

DatePickerButtonForegroundPointerOver Button text color on hover

DatePickerButtonForegroundPressed Button text color when pressed

DatePickerButtonForegroundDisabled Button text color when disabled

DatePickerButtonForegroundFocused Button text color when focused

DatePickerButtonBackground Button background color at rest

DatePickerButtonBackgroundPointerOver Button background color on hover

DatePickerButtonBackgroundPressed Button background color when pressed

DatePickerButtonBackgroundDisabled Button background color when disabled

DatePickerButtonBackgroundFocused Button background color when focused

DatePickerButtonBorderBrush Button border color at rest

DatePickerButtonBorderBrushPointerOver Button border color on hover

DatePickerButtonBorderBrushPressed Button border color when pressed

DatePickerButtonBorderBrushDisabled Button border color when disabled

DateTimePickerFlyoutButtonForegroundPointerOver Flyout button foreground color on hover

DateTimePickerFlyoutButtonForegroundPressed Flyout button foreground color when pressed

DateTimePickerFlyoutButtonBackground Flyout button background color at rest


DateTimePickerFlyoutButtonBackgroundPointerOver Flyout button background color on hover

DateTimePickerFlyoutButtonBackgroundPressed Flyout button background color when pressed

DateTimePickerFlyoutButtonBorderBrush Flyout button border color at rest

DateTimePickerFlyoutButtonBorderBrushPointerOver Flyout button border color on hover

DateTimePickerFlyoutButtonBorderBrushPressed Flyout button border color when pressed

Constructors
DatePicker()
DatePicker()
DatePicker()

Initializes a new instance of the DatePicker class.

Properties
CalendarIdentifier
CalendarIdentifier
CalendarIdentifier

Gets or sets the calendar system to use.

CalendarIdentifierProperty
CalendarIdentifierProperty
CalendarIdentifierProperty

Gets the identifier for the CalendarIdentifier dependency property.

Date
Date
Date

Gets or sets the date currently set in the date picker.

DateProperty
DateProperty
DateProperty

Gets the identifier for the Date dependency property.

DayFormat
DayFormat
DayFormat
Gets or sets the display format for the day value.

DayFormatProperty
DayFormatProperty
DayFormatProperty

Gets the identifier for the DayFormat dependency property.

DayVisible
DayVisible
DayVisible

Gets or sets a value that indicates whether the day selector is shown.

DayVisibleProperty
DayVisibleProperty
DayVisibleProperty

Gets the identifier for the DayVisible dependency property.

Header
Header
Header

Gets or sets the content for the control's header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the control's header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.


LightDismissOverlayMode
LightDismissOverlayMode
LightDismissOverlayMode

Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.

LightDismissOverlayModeProperty
LightDismissOverlayModeProperty
LightDismissOverlayModeProperty

Identifies the LightDismissOverlayMode dependency property.

MaxYear
MaxYear
MaxYear

Gets or sets the maximum Gregorian year available for picking.

MaxYearProperty
MaxYearProperty
MaxYearProperty

Gets the identifier for the MaxYear dependency property.

MinYear
MinYear
MinYear

Gets or sets the minimum Gregorian year available for picking.

MinYearProperty
MinYearProperty
MinYearProperty

Gets the identifier for the MinYear dependency property.

MonthFormat
MonthFormat
MonthFormat

Gets or sets the display format for the month value.

MonthFormatProperty
MonthFormatProperty
MonthFormatProperty
Gets the identifier for the MonthFormat dependency property.

MonthVisible
MonthVisible
MonthVisible

Gets or sets a value that indicates whether the month selector is shown.

MonthVisibleProperty
MonthVisibleProperty
MonthVisibleProperty

Gets the identifier for the MonthVisible dependency property.

Orientation
Orientation
Orientation

Gets or sets a value that indicates whether the day, month, and year selectors are stacked horizontally or vertically.

OrientationProperty
OrientationProperty
OrientationProperty

Gets the identifier for the Orientation dependency property.

SelectedDate
SelectedDate
SelectedDate

Gets or sets the date currently selected in the date picker, or null if no date is selected.

SelectedDateProperty
SelectedDateProperty
SelectedDateProperty

Identifies the SelectedDate dependency property.

YearFormat
YearFormat
YearFormat

Gets or sets the display format for the year value.


YearFormatProperty
YearFormatProperty
YearFormatProperty

Gets the identifier for the YearFormat dependency property.

YearVisible
YearVisible
YearVisible

Gets or sets a value that indicates whether the year selector is shown.

YearVisibleProperty
YearVisibleProperty
YearVisibleProperty

Gets the identifier for the YearVisible dependency property.

Events
DateChanged
DateChanged
DateChanged

Occurs when the date value is changed.

SelectedDateChanged
SelectedDateChanged
SelectedDateChanged

Occurs when the date value is changed.

See Also
Control
Control
Control
Control
Control
Control
DatePicker.CalendarIdentifier DatePicker.Calendar
Identifier DatePicker.CalendarIdentifier
I n this Article
Edit
Gets or sets the calendar system to use.
public : Platform::String CalendarIdentifier { get; set; }
winrt::hstring CalendarIdentifier();

void CalendarIdentifier(winrt::hstring calendaridentifier);


public string CalendarIdentifier { get; set; }

<DatePicker CalendarIdentifier="calendarSystem"/>

Returns
string
The calendar system to use.

Examples
To set the CalendarIdentifier in XAML, use the identifier string, as shown here.
<DatePicker x:Name="julianDatePicker" CalendarIdentifier="JulianCalendar"/>

To set the CalendarIdentifier on code, use the value returned by the corresponding CalendarIdentifiers property, as
shown here.

DatePicker julianDatePicker = new DatePicker();


julianDatePicker.CalendarIdentifier = Windows.Globalization.CalendarIdentifiers.Julian;

Remarks
Set the CalendarIdentifier property to specify the calendar system used by the DatePicker. The DatePicker supports all
calendar systems in the CalendarIdentifiers class. To set the CalendarIdentifier in XAML, use the identifier string. To set
it in code, use the corresponding CalendarIdentifiers property. See the Examples section.
This table lists the supported calendar systems. See the CalendarIdentifiers documentation for more information about
each calendar system.

CALEND AR S YS TEM ID ENTIFIER S TR ING LO CALIZED ?

@Windows.Globalization.CalendarIdenti "GregorianCalendar" Yes.


fiers.Gregorian?text=Gregorian

@Windows.Globalization.CalendarIdenti "HebrewCalendar" No. Strings always in Hebrew.


fiers.Hebrew?text=Hebrew

@Windows.Globalization.CalendarIdenti "HijriCalendar" No. Strings always in Arabic.


fiers.Hijri?text=Hijri
@Windows.Globalization.CalendarIdenti "JapaneseCalendar" No. Strings always in Japanese.
fiers.Japanese?text=Japanese

@Windows.Globalization.CalendarIdenti "JulianCalendar" Yes.


fiers.Julian?text=Julian

@Windows.Globalization.CalendarIdenti "KoreanCalendar" Yes.


fiers.Korean?text=Korean

@Windows.Globalization.CalendarIdenti "TaiwanCalendar" Yes.


fiers.Taiwan?text=Taiwan

@Windows.Globalization.CalendarIdenti "ThaiCalendar" Yes.


fiers.Thai?text=Thai

@Windows.Globalization.CalendarIdenti "UmAlQuraCalendar" No. Strings always in Arabic.


fiers.UmAlQura?text=UmAlQura

The string content of each ComboBox in the DatePicker is created by a DateTimeFormatter. The DateTimeFormatter
uses the CalendarIdentifier set on the DatePicker to determine which calendar to use to format the content. If the
CalendarIdentifier is not set, the DateTimeFormatter uses the default calendar for the app’s preferred language (see
ApplicationLanguages ).
If the specified calendar system is localized, it will display in the app’s preferred language. For example, if you specify a
Korean calendar and the app language is "en-us", the DatePicker will display in English because there are translations
for the Korean calendar. However, if you specify a Japanese calendar and the app preferred language is "en-us", the
DatePicker will still display in Japanese because there are no translations for the Japanese calendar.
See Quickstart: Adding a DatePicker
Also
DatePicker.CalendarIdentifierProperty DatePicker.
CalendarIdentifierProperty DatePicker.CalendarIdentifier
Property
I n this Article
Edit
Gets the identifier for the CalendarIdentifier dependency property.
public : static DependencyProperty CalendarIdentifierProperty { get; }
static DependencyProperty CalendarIdentifierProperty();
public static DependencyProperty CalendarIdentifierProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarIdentifier dependency property.
DatePicker.Date DatePicker.Date DatePicker.Date
I n this Article
Edit
Gets or sets the date currently set in the date picker.

public : DateTime Date { get; set; }


DateTime Date();

void Date(DateTime date);


public DateTimeOffset Date { get; set; }

Returns
DateTimeOffset
The date currently set in the picker.

Remarks
The Date property can't be set as a XAML attribute string, because the Windows Runtime XAML parser doesn't have a
conversion logic for converting strings to dates as DateTime / DateTimeOffset objects. Here are some suggested ways
these objects can be defined in code and set to a date other than the current date.
DateTime: Instantiate a Windows.Globalization.Calendar object (it is initialized to the current date). Set properties such
as Day or Year, or call methods such as AddMonths, to adjust the date. Then, call Calendar.GetDateTime and use the
returned DateTime to set Date.
DateTimeOffset: Call the constructor. For the inner System.DateTime, use the constructor signature. Or, construct a
default DateTimeOffset (it is initialized to the current date) and call methods such as AddMonths.
Another possible technique is to define a date that's available as a data object or in the data context, then set Date as a
XAML attribute that references a {Binding} markup extension that can access the date as data.
See DateChangedDateChangedDateChanged
Also Quickstart: Adding a DatePicker
XAML DatePicker and TimePicker controls sample
DatePicker.DateChanged DatePicker.DateChanged Date
Picker.DateChanged
I n this Article
Edit
Occurs when the date value is changed.
public : event EventHandler<DatePickerValueChangedEventArgs> DateChanged
// Register
event_token DateChanged(EventHandler<DatePickerValueChangedEventArgs> const& handler) const;

// Revoke with event_token


void DateChanged(event_token const& cookie) const;

// Revoke with event_revoker


DateChanged_revoker DateChanged(auto_revoke_t, EventHandler<DatePickerValueChangedEventArgs> const&
handler) const;
public event EventHandler<DatePickerValueChangedEventArgs> DateChanged

<DatePicker DateChanged="eventhandler" />

Remarks
When you handle this event, use the OldDate and NewDate properties of the DatePickerValueChangedEventArgs
event data for your logic. These properties use different data types depending on your programming language (C# and
Visual Basic use System.DateTimeOffset; Visual C++ component extensions (C++/CX) uses
Windows::Foundation::DateTime).
See XAML DatePicker and TimePicker controls sample
Also Quickstart: Adding a DatePicker
DatePicker DatePicker DatePicker
I n this Article
Edit
Initializes a new instance of the DatePicker class.

public : DatePicker()
DatePicker() const;
public DatePicker()
DatePicker.DateProperty DatePicker.DateProperty Date
Picker.DateProperty
I n this Article
Edit
Gets the identifier for the Date dependency property.
public : static DependencyProperty DateProperty { get; }
static DependencyProperty DateProperty();
public static DependencyProperty DateProperty { get; }

Returns
DependencyProperty
The identifier for the Date dependency property.
DatePicker.DayFormat DatePicker.DayFormat DatePicker.
DayFormat
I n this Article
Edit
Gets or sets the display format for the day value.
public : Platform::String DayFormat { get; set; }
winrt::hstring DayFormat();

void DayFormat(winrt::hstring dayformat);


public string DayFormat { get; set; }

<DatePicker DayFormat="formatString"/>

Returns
string
The display format for the day value.

Examples
Here's a DatePicker formatted using format templates, and a DatePicker formatted using format strings. Both
DatePicker controls look the same when the app is run because the formatting is equivalent.
<!-- DatePicker formatted using format templates. -->
<DatePicker DayFormat="day" MonthFormat="month.numeric" YearFormat="year.abbreviated"/>

<!-- DatePicker formatted using format patterns. -->


<DatePicker DayFormat="{}{day.integer}" MonthFormat="{}{month.integer}" YearFormat="{}
{year.abbreviated}"/>

Here's a DatePicker that combines 2 format patterns to display both the numeric date and the day of the week in the
day picker. There is no equivalent format template for this format.
<DatePicker DayFormat="{}{day.integer} {dayofweek.abbreviated}"/>

Remarks
Change the format of the day picker by setting the DayFormat property.
The string content of each ComboBox in the DatePicker is created by a DateTimeFormatter. You inform the
DateTimeFormatter how to format the day value by providing a string that is either a format template or a format
pattern. Common templates and patterns for day values are listed in the following table.

FO R MAT PAT TER N FO R MAT TEMPL ATE

`{day.integer} | {day.integer(n)}` `day`

`{dayofweek.full} | {dayofweek.abbreviated} | `dayofweek | dayofweek.full | dayofweek.abbreviated`


{dayofweek.abbreviated(n)}`

In some cases, using a format pattern gives you more precise control over the formatting. For example, you can use a
format pattern to specify that the day picker always shows 2 digits, including a leading 0 when needed. You can also
combine multiple format patterns. For example, you can combine the {day} and {dayofweek.abbreviated} formats
to make the day picker show both the numeric date and the day of the week, like this: 14 Thu. See the Examples
section for more info.
For the complete list of format templates and format patterns, see the Remarks section of the DateTimeFormatter class
documentation.
Note

Some date formats should be avoided if the date picker might be displayed in a small area, such as adding the full
string value of the day of week. These strings can be long and might be clipped if the DatePicker's width is forced to be
small.
See Quickstart: Adding a DatePicker
Also How to use patterns to format dates and times
DatePicker.DayFormatProperty DatePicker.DayFormat
Property DatePicker.DayFormatProperty
I n this Article
Edit
Gets the identifier for the DayFormat dependency property.
public : static DependencyProperty DayFormatProperty { get; }
static DependencyProperty DayFormatProperty();
public static DependencyProperty DayFormatProperty { get; }

Returns
DependencyProperty
The identifier for the DayFormat dependency property.
DatePicker.DayVisible DatePicker.DayVisible DatePicker.
DayVisible
I n this Article
Edit
Gets or sets a value that indicates whether the day selector is shown.
public : Platform::Boolean DayVisible { get; set; }
bool DayVisible();

void DayVisible(bool dayvisible);


public bool DayVisible { get; set; }

<DatePicker DayVisible="bool"/>

Returns
bool
true if the day selector is shown; otherwise, false. The default is true.

Remarks
By default, the DatePicker shows ComboBox elements to select the month, day, and year. Set DayVisible to false to
hide the ComboBox that displays or changes the day component of a date.
See Quickstart: Adding a DatePicker
Also
DatePicker.DayVisibleProperty DatePicker.DayVisible
Property DatePicker.DayVisibleProperty
I n this Article
Edit
Gets the identifier for the DayVisible dependency property.
public : static DependencyProperty DayVisibleProperty { get; }
static DependencyProperty DayVisibleProperty();
public static DependencyProperty DayVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the DayVisible dependency property.
DatePicker.Header DatePicker.Header DatePicker.Header
I n this Article
Edit
Gets or sets the content for the control's header.

public : Platform::Object Header { get; set; }


winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<DatePicker Header="headerString"/>

Returns
object
The content of the control's header. The default is null.

Remarks
You can set a data template for the Header value by using the HeaderTemplate property.
See Quickstart: Adding a DatePicker
Also
DatePicker.HeaderProperty DatePicker.HeaderProperty
DatePicker.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
DatePicker.HeaderTemplate DatePicker.HeaderTemplate
DatePicker.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the control's header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<DatePicker HeaderTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
DatePicker.HeaderTemplateProperty DatePicker.Header
TemplateProperty DatePicker.HeaderTemplateProperty
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
DatePicker.LightDismissOverlayMode DatePicker.Light
DismissOverlayMode DatePicker.LightDismissOverlay
Mode
I n this Article
Edit
Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.
public : LightDismissOverlayMode LightDismissOverlayMode { get; set; }
LightDismissOverlayMode LightDismissOverlayMode();

void LightDismissOverlayMode(LightDismissOverlayMode lightdismissoverlaymode);


public LightDismissOverlayMode LightDismissOverlayMode { get; set; }

Returns
LightDismissOverlayMode
A value of the enumeration that specifies whether the area outside of a light-dismiss UI is darkened. The default is
Auto.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Transient UI, such as the open DatePickerFlyout of a DatePicker, closes when you click or tap outside of it. This is called
light-dismiss. "Overlay" refers to the area outside of a light-dismiss UI.
By default, the "overlay" is darkened on the Xbox, and not darkened on other devices families. You can set
LightDismissOverlayMode to On to make your app darken the "overlay" area on all device families, or set it to Off to
not darken the "overlay" area on all device families.
Version compatibility
The LightDismissOverlayMode property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.DatePicker",
"LightDismissOverlayMode"))
{
datePicker1.LightDismissOverlayMode = LightDismissOverlayMode.On;
}
}
DatePicker.LightDismissOverlayModeProperty Date
Picker.LightDismissOverlayModeProperty DatePicker.
LightDismissOverlayModeProperty
I n this Article
Edit
Identifies the LightDismissOverlayMode dependency property.
public : static DependencyProperty LightDismissOverlayModeProperty { get; }
static DependencyProperty LightDismissOverlayModeProperty();
public static DependencyProperty LightDismissOverlayModeProperty { get; }

Returns
DependencyProperty
The identifier for the LightDismissOverlayMode dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


DatePicker.MaxYear DatePicker.MaxYear DatePicker.Max
Year
I n this Article
Edit
Gets or sets the maximum Gregorian year available for picking.
public : DateTime MaxYear { get; set; }
DateTime MaxYear();

void MaxYear(DateTime maxyear);


public DateTimeOffset MaxYear { get; set; }

Returns
DateTimeOffset
The maximum Gregorian year available for picking.

Remarks
The MaxYear property can't be set as a XAML attribute string, because the Windows Runtime XAML parser doesn't
have a conversion logic for converting strings to dates as DateTime / DateTimeOffset objects. Here are some
suggested ways these objects can be defined in code and set to a date other than the current date.
DateTime: Instantiate a Windows.Globalization.Calendar object (it is initialized to the current date). Set Year, or call
AddYears, to adjust the date. Then, call Calendar.GetDateTime and use the returned DateTime to set MaxYear.
DateTimeOffset: Call the constructor. For the inner System.DateTime, use the constructor signature. Or, construct a
default DateTimeOffset (it is initialized to the current date) and call AddYears.
Another possible technique is to define a date that's available as a data object or in the data context, then set MaxYear
as a XAML attribute that references a {Binding} markup extension that can access the date as data.
See Quickstart: Adding a DatePicker
Also
DatePicker.MaxYearProperty DatePicker.MaxYearProperty
DatePicker.MaxYearProperty
I n this Article
Edit
Gets the identifier for the MaxYear dependency property.
public : static DependencyProperty MaxYearProperty { get; }
static DependencyProperty MaxYearProperty();
public static DependencyProperty MaxYearProperty { get; }

Returns
DependencyProperty
The identifier for the MaxYear dependency property.
DatePicker.MinYear DatePicker.MinYear DatePicker.Min
Year
I n this Article
Edit
Gets or sets the minimum Gregorian year available for picking.
public : DateTime MinYear { get; set; }
DateTime MinYear();

void MinYear(DateTime minyear);


public DateTimeOffset MinYear { get; set; }

Returns
DateTimeOffset
The minimum Gregorian year available for picking.

Remarks
The MinYear property can't be set as a XAML attribute string, because the Windows Runtime XAML parser doesn't
have a conversion logic for converting strings to dates as DateTime / DateTimeOffset objects. Here are some
suggested ways these objects can be defined in code and set to a date other than the current date.
DateTime: Instantiate a Windows.Globalization.Calendar object (it is initialized to the current date). Set Year, or call
AddYears, to adjust the date. Then, call Calendar.GetDateTime and use the returned DateTime to set MinYear.
DateTimeOffset: Call the constructor. For the inner System.DateTime, use the constructor signature. Or, construct a
default DateTimeOffset (it is initialized to the current date) and call AddYears.
Another possible technique is to define a date that's available as a data object or in the data context, then set MinYear
as a XAML attribute that references a {Binding} markup extension that can access the date as data.
See Quickstart: Adding a DatePicker
Also
DatePicker.MinYearProperty DatePicker.MinYearProperty
DatePicker.MinYearProperty
I n this Article
Edit
Gets the identifier for the MinYear dependency property.
public : static DependencyProperty MinYearProperty { get; }
static DependencyProperty MinYearProperty();
public static DependencyProperty MinYearProperty { get; }

Returns
DependencyProperty
The identifier for the MinYear dependency property.
DatePicker.MonthFormat DatePicker.MonthFormat Date
Picker.MonthFormat
I n this Article
Edit
Gets or sets the display format for the month value.
public : Platform::String MonthFormat { get; set; }
winrt::hstring MonthFormat();

void MonthFormat(winrt::hstring monthformat);


public string MonthFormat { get; set; }

<DatePicker MonthFormat="formatString"/>

Returns
string
The display format for the month value.

Examples
Here's a DatePicker formatted using format templates, and a DatePicker formatted using format strings. Both
DatePicker controls look the same when the app is run because the formatting is equivalent.
<!-- DatePicker formatted using format templates. -->
<DatePicker DayFormat="day" MonthFormat="month.numeric" YearFormat="year.abbreviated"/>

<!-- DatePicker formatted using format patterns. -->


<DatePicker DayFormat="{}{day.integer}" MonthFormat="{}{month.integer}" YearFormat="{}
{year.abbreviated}"/>

Here's a DatePicker that combines 2 format patterns to display both the month number and name in the month picker.
There is no equivalent format template for this format.
<DatePicker MonthFormat="{}{month.integer} {month.abbreviated}"/>

Remarks
Change the format of the month picker by setting the MonthFormat property.
The string content of each ComboBox in the DatePicker is created by a DateTimeFormatter. You instruct the
DateTimeFormatter how to format the month value by providing a string that is either a format template or a format
pattern. Common templates and patterns for month values are listed in the following table.

FO R MAT PAT TER N FO R MAT TEMPL ATE

`{month.integer} | {month.integer(n)} ` `month.numeric`

`{month.full} | {month.abbreviated} | {month.abbreviated(n)}` `month | month.full | month.abbreviated`

In some cases, using a format pattern gives you more precise control over the formatting. For example, you can use a
format pattern to specify that the month picker always shows 2 digits, including a leading 0 when needed. You can also
combine multiple format patterns. For example, you can combine the {month.integer} and {month.abbreviated}
formats to make the month picker show the month number and name, like this: 12 Dec. See the Examples section for
more info.
For the complete list of format templates and format patterns, see the Remarks section of the DateTimeFormatter class
documentation.
Note

Some date formats should be avoided if the date picker might be displayed in a small area, such as adding the full
string value of the day of week. These strings can be long and might be clipped if the DatePicker's width is forced to be
small.
See Quickstart: Adding a DatePicker
Also How to use patterns to format dates and times
DatePicker.MonthFormatProperty DatePicker.Month
FormatProperty DatePicker.MonthFormatProperty
I n this Article
Edit
Gets the identifier for the MonthFormat dependency property.
public : static DependencyProperty MonthFormatProperty { get; }
static DependencyProperty MonthFormatProperty();
public static DependencyProperty MonthFormatProperty { get; }

Returns
DependencyProperty
The identifier for the MonthFormat dependency property.
DatePicker.MonthVisible DatePicker.MonthVisible Date
Picker.MonthVisible
I n this Article
Edit
Gets or sets a value that indicates whether the month selector is shown.
public : Platform::Boolean MonthVisible { get; set; }
bool MonthVisible();

void MonthVisible(bool monthvisible);


public bool MonthVisible { get; set; }

<DatePicker MonthVisible="bool"/>

Returns
bool
true if the month selector is shown; otherwise, false. The default is true.

Remarks
By default, the DatePicker shows ComboBox elements to select the month, day, and year. Set MonthVisible to false to
hide the ComboBox that displays or changes the month component of a date.
See Quickstart: Adding a DatePicker
Also
DatePicker.MonthVisibleProperty DatePicker.Month
VisibleProperty DatePicker.MonthVisibleProperty
I n this Article
Edit
Gets the identifier for the MonthVisible dependency property.
public : static DependencyProperty MonthVisibleProperty { get; }
static DependencyProperty MonthVisibleProperty();
public static DependencyProperty MonthVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the MonthVisible dependency property.
DatePicker.Orientation DatePicker.Orientation Date
Picker.Orientation
I n this Article
Edit
Gets or sets a value that indicates whether the day, month, and year selectors are stacked horizontally or vertically.
public : Orientation Orientation { get; set; }
Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

<DatePicker Orientation="Horizontal"/>
-or-
<DatePicker Orientation="Vertical"/>

Returns
Orientation
A named constant of the enumeration that indicates whether the day, month, and year selectors are stacked
horizontally or vertically. The default is Horizontal.

Remarks
By default, the DatePicker shows the month, day, and year pickers in a horizontal row. You can change them to a
vertical stack by setting the Orientation property to Vertical.
DatePicker.OrientationProperty DatePicker.Orientation
Property DatePicker.OrientationProperty
I n this Article
Edit
Gets the identifier for the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
DatePicker.SelectedDate DatePicker.SelectedDate Date
Picker.SelectedDate
I n this Article
Edit
Gets or sets the date currently selected in the date picker, or null if no date is selected.
public : IReference<DateTime> SelectedDate { get; set; }
IReference<DateTime> SelectedDate();

void SelectedDate(IReference<DateTime> selecteddate);


public Nullable<DateTimeOffset> SelectedDate { get; set; }

Returns
Nullable<DateTimeOffset>
The date currently selected in the picker, or null if no date is selected.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


DatePicker.SelectedDateChanged DatePicker.Selected
DateChanged DatePicker.SelectedDateChanged
I n this Article
Edit
Occurs when the date value is changed.
public : event TypedEventHandler<DatePicker, DatePickerSelectedValueChangedEventArgs>
SelectedDateChanged
// Register
event_token SelectedDateChanged(TypedEventHandler<DatePicker,
DatePickerSelectedValueChangedEventArgs> const& handler) const;

// Revoke with event_token


void SelectedDateChanged(event_token const& cookie) const;

// Revoke with event_revoker


SelectedDateChanged_revoker SelectedDateChanged(auto_revoke_t, TypedEventHandler<DatePicker,
DatePickerSelectedValueChangedEventArgs> const& handler) const;
public event TypedEventHandler<DatePicker, DatePickerSelectedValueChangedEventArgs>
SelectedDateChanged

<DatePicker SelectedDateChanged="eventhandler" />

Remarks
When you handle this event, use the OldDate and NewDate properties of the
DatePickerSelectedValueChangedEventArgs event data for your logic. These properties use different data types
depending on your programming language (C# and Visual Basic use System.DateTimeOffset; Visual C++ component
extensions (C++/CX) uses Windows::Foundation::DateTime).
DatePicker.SelectedDateProperty DatePicker.Selected
DateProperty DatePicker.SelectedDateProperty
I n this Article
Edit
Identifies the SelectedDate dependency property.
public : static DependencyProperty SelectedDateProperty { get; }
static DependencyProperty SelectedDateProperty();
public static DependencyProperty SelectedDateProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedDate dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


DatePicker.YearFormat DatePicker.YearFormat Date
Picker.YearFormat
I n this Article
Edit
Gets or sets the display format for the year value.
public : Platform::String YearFormat { get; set; }
winrt::hstring YearFormat();

void YearFormat(winrt::hstring yearformat);


public string YearFormat { get; set; }

<DatePicker YearFormat="formatString"/>

Returns
string
The display format for the year value.

Examples
Here's a DatePicker formatted using format templates, and a DatePicker formatted using format strings. Both
DatePicker s look the same when the app is run because the formatting is equivalent.
<!-- DatePicker formatted using format templates. -->
<DatePicker DayFormat="day" MonthFormat="month.numeric" YearFormat="year.abbreviated"/>

<!-- DatePicker formatted using format patterns. -->


<DatePicker DayFormat="{}{day.integer}" MonthFormat="{}{month.integer}" YearFormat="{}
{year.abbreviated}"/>

Remarks
Change the format of the year picker by setting the YearFormat property.
The string content of each ComboBox in the DatePicker is created by a DateTimeFormatter. You inform the
DateTimeFormatter how to format the year value by providing a string that is either a format template or a format
pattern. Common templates and patterns for year values are listed in the following table.

FO R MAT PAT TER N FO R MAT TEMPL ATE

`{year.full} | {year.abbreviated} | {year.abbreviated(n)}` `year | year.full | year.abbreviated`

`{era.full} | {era.abbreviated} | {era.abbreviated(n)}` n/a


Note

"Era" only applies when the CalendarIdentifier is set to the Japanese calendar. For the Japanese calendar, era is shown
in the year picker.
For the complete list of format templates and format patterns, see the Remarks section of the DateTimeFormatter class
documentation.
Note

Some date formats should be avoided if the date picker might be displayed in a small area, such as adding the full
string value of the day of week. These strings can be long and might be clipped if the DatePicker's width is forced to be
small.
See Quickstart: Adding a DatePicker
Also How to use patterns to format dates and times
DatePicker.YearFormatProperty DatePicker.YearFormat
Property DatePicker.YearFormatProperty
I n this Article
Edit
Gets the identifier for the YearFormat dependency property.
public : static DependencyProperty YearFormatProperty { get; }
static DependencyProperty YearFormatProperty();
public static DependencyProperty YearFormatProperty { get; }

Returns
DependencyProperty
The identifier for the YearFormat dependency property.
DatePicker.YearVisible DatePicker.YearVisible DatePicker.
YearVisible
I n this Article
Edit
Gets or sets a value that indicates whether the year selector is shown.
public : Platform::Boolean YearVisible { get; set; }
bool YearVisible();

void YearVisible(bool yearvisible);


public bool YearVisible { get; set; }

<DatePicker YearVisible="bool"/>

Returns
bool
true if the year selector is shown; otherwise, false. The default is true.

Remarks
By default, the DatePicker shows ComboBox elements to select the month, day, and year. Set MonthVisible to false to
hide the ComboBox that displays or changes the year component of a date.
See Quickstart: Adding a DatePicker
Also
DatePicker.YearVisibleProperty DatePicker.YearVisible
Property DatePicker.YearVisibleProperty
I n this Article
Edit
Gets the identifier for the YearVisible dependency property.
public : static DependencyProperty YearVisibleProperty { get; }
static DependencyProperty YearVisibleProperty();
public static DependencyProperty YearVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the YearVisible dependency property.
DatePickerFlyout DatePickerFlyout DatePickerFlyout
Class
Represents a control that allows a user to pick a date.

D eclaration
public : sealed class DatePickerFlyout : PickerFlyoutBase, IDatePickerFlyout, IDatePickerFlyout2
struct winrt::Windows::UI::Xaml::Controls::DatePickerFlyout : PickerFlyoutBase,
IDatePickerFlyout, IDatePickerFlyout2
public sealed class DatePickerFlyout : PickerFlyoutBase, IDatePickerFlyout, IDatePickerFlyout2

I nheritance H ierarchy
DependencyObject
FlyoutBase
PickerFlyoutBase

Constructors
DatePickerFlyout()
DatePickerFlyout()
DatePickerFlyout()

Initializes a new instance of the DatePickerFlyout class.

Properties
CalendarIdentifier
CalendarIdentifier
CalendarIdentifier

Gets or sets the calendar system to use.

CalendarIdentifierProperty
CalendarIdentifierProperty
CalendarIdentifierProperty

Gets the identifier for the CalendarIdentifier dependency property.

Date
Date
Date

Gets or sets the date currently set in the date picker.

DateProperty
DateProperty
DateProperty

Gets the identifier for the Date dependency property.

DayFormat
DayFormat
DayFormat

Gets or sets the display format for the day value.

DayFormatProperty
DayFormatProperty
DayFormatProperty

Identifies the DayFormat dependency property.

DayVisible
DayVisible
DayVisible

Gets or sets a value that indicates whether the day selector is shown.

DayVisibleProperty
DayVisibleProperty
DayVisibleProperty

Gets the identifier for the DayVisible dependency property.

MaxYear
MaxYear
MaxYear

Gets or sets the maximum Gregorian year available for picking.

MaxYearProperty
MaxYearProperty
MaxYearProperty

Gets the identifier for the MaxYear dependency property.

MinYear
MinYear
MinYear

Gets or sets the minimum Gregorian year available for picking.


MinYearProperty
MinYearProperty
MinYearProperty

Gets the identifier for the MinYear dependency property.

MonthFormat
MonthFormat
MonthFormat

Gets or sets the display format for the month value.

MonthFormatProperty
MonthFormatProperty
MonthFormatProperty

Identifies the MonthFormat dependency property.

MonthVisible
MonthVisible
MonthVisible

Gets or sets a value that indicates whether the month selector is shown.

MonthVisibleProperty
MonthVisibleProperty
MonthVisibleProperty

Gets the identifier for the MonthVisible dependency property.

YearFormat
YearFormat
YearFormat

Gets or sets the display format for the year value.

YearFormatProperty
YearFormatProperty
YearFormatProperty

Identifies the YearFormat dependency property.

YearVisible
YearVisible
YearVisible
Gets or sets a value that indicates whether the year selector is shown.

YearVisibleProperty
YearVisibleProperty
YearVisibleProperty

Gets the identifier for the YearVisible dependency property.

Methods
ShowAtAsync(FrameworkElement)
ShowAtAsync(FrameworkElement)
ShowAtAsync(FrameworkElement)

Begins an asynchronous operation to show the date picker placed in relation to the specified element.

Events
DatePicked
DatePicked
DatePicked

Occurs when a date has been picked by the user.

See Also
PickerFlyoutBase
DatePickerFlyout.CalendarIdentifier DatePickerFlyout.
CalendarIdentifier DatePickerFlyout.CalendarIdentifier
I n this Article
Edit
Gets or sets the calendar system to use.
public : Platform::String CalendarIdentifier { get; set; }
winrt::hstring CalendarIdentifier();

void CalendarIdentifier(winrt::hstring calendaridentifier);


public string CalendarIdentifier { get; set; }

Returns
string
The name of the calendar system to use. For a list of supported calendar systems, see CalendarIdentifiers.
DatePickerFlyout.CalendarIdentifierProperty DatePicker
Flyout.CalendarIdentifierProperty DatePickerFlyout.
CalendarIdentifierProperty
I n this Article
Edit
Gets the identifier for the CalendarIdentifier dependency property.
public : static DependencyProperty CalendarIdentifierProperty { get; }
static DependencyProperty CalendarIdentifierProperty();
public static DependencyProperty CalendarIdentifierProperty { get; }

Returns
DependencyProperty
The identifier for the CalendarIdentifier dependency property.
DatePickerFlyout.Date DatePickerFlyout.Date DatePicker
Flyout.Date
I n this Article
Edit
Gets or sets the date currently set in the date picker.
public : DateTime Date { get; set; }
DateTime Date();

void Date(DateTime date);


public DateTimeOffset Date { get; set; }

Returns
DateTimeOffset
The date currently set in the picker.
DatePickerFlyout.DatePicked DatePickerFlyout.Date
Picked DatePickerFlyout.DatePicked
I n this Article
Edit
Occurs when a date has been picked by the user.
public : event TypedEventHandler<DatePickerFlyout, DatePickedEventArgs> DatePicked
// Register
event_token DatePicked(TypedEventHandler<DatePickerFlyout, DatePickedEventArgs> const& handler)
const;

// Revoke with event_token


void DatePicked(event_token const& cookie) const;

// Revoke with event_revoker


DatePicked_revoker DatePicked(auto_revoke_t, TypedEventHandler<DatePickerFlyout,
DatePickedEventArgs> const& handler) const;
public event TypedEventHandler<DatePickerFlyout, DatePickedEventArgs> DatePicked
DatePickerFlyout DatePickerFlyout DatePickerFlyout
I n this Article
Edit
Initializes a new instance of the DatePickerFlyout class.

public : DatePickerFlyout()
DatePickerFlyout() const;
public DatePickerFlyout()
DatePickerFlyout.DateProperty DatePickerFlyout.Date
Property DatePickerFlyout.DateProperty
I n this Article
Edit
Gets the identifier for the Date dependency property.
public : static DependencyProperty DateProperty { get; }
static DependencyProperty DateProperty();
public static DependencyProperty DateProperty { get; }

Returns
DependencyProperty
The identifier for the Date dependency property.
DatePickerFlyout.DayFormat DatePickerFlyout.Day
Format DatePickerFlyout.DayFormat
I n this Article
Edit
Gets or sets the display format for the day value.
public : Platform::String DayFormat { get; set; }
winrt::hstring DayFormat();

void DayFormat(winrt::hstring dayformat);


public string DayFormat { get; set; }

<DatePickerFlyout DayFormat="formatString"/>

Returns
string
The display format for the day value.

Remarks
Change the format of the day value by setting the DayFormat property.
The string content of the day value is created by a DateTimeFormatter. You inform the DateTimeFormatter how to
format the day value by providing a string that is either a format template or a format pattern. Common templates and
patterns for day values are listed in the following table.

FO R MAT PAT TER N FO R MAT TEMPL ATE

`{day.integer} | {day.integer(n)}` `day`

`{dayofweek.full} | {dayofweek.abbreviated} | `dayofweek | dayofweek.full | dayofweek.abbreviated`


{dayofweek.abbreviated(n)}`

In some cases, using a format pattern gives you more precise control over the formatting. For example, you can use a
format pattern to specify that the day picker always shows 2 digits, including a leading 0 when needed. You can also
combine multiple format patterns. For example, you can combine the {day} and {dayofweek.abbreviated} formats
to make the day picker show both the numeric date and the day of the week, like this: 14 Thu. See the Examples
section for more info.
For the complete list of format templates and format patterns, see the Remarks section of the DateTimeFormatter class
documentation.
Note

Some date formats should be avoided if the date picker might be displayed in a small area, such as adding the full
string value of the day of week. These strings can be long and might be clipped if the DatePicker's width is forced to be
small.
See How to use patterns to format dates and times
Also
DatePickerFlyout.DayFormatProperty DatePickerFlyout.
DayFormatProperty DatePickerFlyout.DayFormat
Property
I n this Article
Edit
Identifies the DayFormat dependency property.
public : static DependencyProperty DayFormatProperty { get; }
static DependencyProperty DayFormatProperty();
public static DependencyProperty DayFormatProperty { get; }

Returns
DependencyProperty
The identifier for the DayFormat dependency property.
See Dependency properties overview
Also
DatePickerFlyout.DayVisible DatePickerFlyout.DayVisible
DatePickerFlyout.DayVisible
I n this Article
Edit
Gets or sets a value that indicates whether the day selector is shown.
public : Platform::Boolean DayVisible { get; set; }
bool DayVisible();

void DayVisible(bool dayvisible);


public bool DayVisible { get; set; }

Returns
bool
True if the day selector is shown; otherwise, false. The default is true.
DatePickerFlyout.DayVisibleProperty DatePickerFlyout.
DayVisibleProperty DatePickerFlyout.DayVisibleProperty
I n this Article
Edit
Gets the identifier for the DayVisible dependency property.
public : static DependencyProperty DayVisibleProperty { get; }
static DependencyProperty DayVisibleProperty();
public static DependencyProperty DayVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the DayVisible dependency property.
DatePickerFlyout.MaxYear DatePickerFlyout.MaxYear
DatePickerFlyout.MaxYear
I n this Article
Edit
Gets or sets the maximum Gregorian year available for picking.
public : DateTime MaxYear { get; set; }
DateTime MaxYear();

void MaxYear(DateTime maxyear);


public DateTimeOffset MaxYear { get; set; }

Returns
DateTimeOffset
The maximum Gregorian year available for picking.S
DatePickerFlyout.MaxYearProperty DatePickerFlyout.Max
YearProperty DatePickerFlyout.MaxYearProperty
I n this Article
Edit
Gets the identifier for the MaxYear dependency property.
public : static DependencyProperty MaxYearProperty { get; }
static DependencyProperty MaxYearProperty();
public static DependencyProperty MaxYearProperty { get; }

Returns
DependencyProperty
The identifier for the MaxYear dependency property.
DatePickerFlyout.MinYear DatePickerFlyout.MinYear
DatePickerFlyout.MinYear
I n this Article
Edit
Gets or sets the minimum Gregorian year available for picking.
public : DateTime MinYear { get; set; }
DateTime MinYear();

void MinYear(DateTime minyear);


public DateTimeOffset MinYear { get; set; }

Returns
DateTimeOffset
The minimum Gregorian year available for picking.
DatePickerFlyout.MinYearProperty DatePickerFlyout.Min
YearProperty DatePickerFlyout.MinYearProperty
I n this Article
Edit
Gets the identifier for the MinYear dependency property.
public : static DependencyProperty MinYearProperty { get; }
static DependencyProperty MinYearProperty();
public static DependencyProperty MinYearProperty { get; }

Returns
DependencyProperty
The identifier for the MinYear dependency property.
DatePickerFlyout.MonthFormat DatePickerFlyout.Month
Format DatePickerFlyout.MonthFormat
I n this Article
Edit
Gets or sets the display format for the month value.
public : Platform::String MonthFormat { get; set; }
winrt::hstring MonthFormat();

void MonthFormat(winrt::hstring monthformat);


public string MonthFormat { get; set; }

<DatePickerFlyout MonthFormat="formatString"/>

Returns
string
The display format for the month value.

Remarks
Change the format of the month value by setting the MonthFormat property.
The string content of the month value is created by a DateTimeFormatter. You inform the DateTimeFormatter how to
format the day value by providing a string that is either a format template or a format pattern. Common templates and
patterns for day values are listed in the following table.

FO R MAT PAT TER N FO R MAT TEMPL ATE

`{month.integer} | {month.integer(n)} ` `month.numeric`

`{month.full} | {month.abbreviated} | {month.abbreviated(n)}` `month | month.full | month.abbreviated`

In some cases, using a format pattern gives you more precise control over the formatting. For example, you can use a
format pattern to specify that the month picker always shows 2 digits, including a leading 0 when needed. You can also
combine multiple format patterns. For example, you can combine the {month.integer} and {month.abbreviated}
formats to make the month picker show the month number and name, like this: 12 Dec. See the Examples section for
more info.
For the complete list of format templates and format patterns, see the Remarks section of the DateTimeFormatter class
documentation.
Note

Some date formats should be avoided if the date picker might be displayed in a small area, such as adding the full
string value of the day of week. These strings can be long and might be clipped if the DatePicker's width is forced to be
small.
See How to use patterns to format dates and times
Also
DatePickerFlyout.MonthFormatProperty DatePicker
Flyout.MonthFormatProperty DatePickerFlyout.Month
FormatProperty
I n this Article
Edit
Identifies the MonthFormat dependency property.
public : static DependencyProperty MonthFormatProperty { get; }
static DependencyProperty MonthFormatProperty();
public static DependencyProperty MonthFormatProperty { get; }

Returns
DependencyProperty
The identifier for the MonthFormat dependency property.
See Dependency properties overview
Also
DatePickerFlyout.MonthVisible DatePickerFlyout.Month
Visible DatePickerFlyout.MonthVisible
I n this Article
Edit
Gets or sets a value that indicates whether the month selector is shown.
public : Platform::Boolean MonthVisible { get; set; }
bool MonthVisible();

void MonthVisible(bool monthvisible);


public bool MonthVisible { get; set; }

Returns
bool
True if the month selector is shown; otherwise, false. The default is true.
DatePickerFlyout.MonthVisibleProperty DatePicker
Flyout.MonthVisibleProperty DatePickerFlyout.Month
VisibleProperty
I n this Article
Edit
Gets the identifier for the MonthVisible dependency property.
public : static DependencyProperty MonthVisibleProperty { get; }
static DependencyProperty MonthVisibleProperty();
public static DependencyProperty MonthVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the MonthVisible dependency property.
DatePickerFlyout.ShowAtAsync DatePickerFlyout.ShowAt
Async DatePickerFlyout.ShowAtAsync
I n this Article
Edit
Begins an asynchronous operation to show the date picker placed in relation to the specified element.
public : IAsyncOperation<IReference<DateTime>> ShowAtAsync(FrameworkElement target)
IAsyncOperation<IReference<DateTime>> ShowAtAsync(FrameworkElement target) const;
public IAsyncOperation<Nullable<DateTimeOffset>> ShowAtAsync(FrameworkElement target)

Parameters
target FrameworkElement
The element to use as the flyout's placement target.
Returns
IAsyncOperation<Nullable<DateTimeOffset>>
An asynchronous operation
Attributes RemoteAsyncAttribute
DatePickerFlyout.YearFormat DatePickerFlyout.Year
Format DatePickerFlyout.YearFormat
I n this Article
Edit
Gets or sets the display format for the year value.
public : Platform::String YearFormat { get; set; }
winrt::hstring YearFormat();

void YearFormat(winrt::hstring yearformat);


public string YearFormat { get; set; }

<DatePickerFlyout YearFormat="formatString"/>

Returns
string
The display format for the year value.

Remarks
Change the format of the year value by setting the YearFormat property.
The string content of the year value is created by a DateTimeFormatter. You inform the DateTimeFormatter how to
format the year value by providing a string that is either a format template or a format pattern. Common templates
and patterns for year values are listed in the following table.

FO R MAT PAT TER N FO R MAT TEMPL ATE

`{year.full} | {year.abbreviated} | {year.abbreviated(n)}` `year | year.full | year.abbreviated`

`{era.full} | {era.abbreviated} | {era.abbreviated(n)}` n/a


Note

"Era" only applies when the CalendarIdentifier is set to the Japanese calendar. For the Japanese calendar, era is shown
in the year picker.
For the complete list of format templates and format patterns, see the Remarks section of the DateTimeFormatter class
documentation.
Note

Some date formats should be avoided if the date picker might be displayed in a small area, such as adding the full
string value of the day of week. These strings can be long and might be clipped if the DatePicker's width is forced to be
small.
See How to use patterns to format dates and times
Also
DatePickerFlyout.YearFormatProperty DatePickerFlyout.
YearFormatProperty DatePickerFlyout.YearFormat
Property
I n this Article
Edit
Identifies the YearFormat dependency property.
public : static DependencyProperty YearFormatProperty { get; }
static DependencyProperty YearFormatProperty();
public static DependencyProperty YearFormatProperty { get; }

Returns
DependencyProperty
The identifier for the YearFormat dependency property.
See Dependency properties overview
Also
DatePickerFlyout.YearVisible DatePickerFlyout.YearVisible
DatePickerFlyout.YearVisible
I n this Article
Edit
Gets or sets a value that indicates whether the year selector is shown.
public : Platform::Boolean YearVisible { get; set; }
bool YearVisible();

void YearVisible(bool yearvisible);


public bool YearVisible { get; set; }

Returns
bool
True if the year selector is shown; otherwise, false. The default is true.
DatePickerFlyout.YearVisibleProperty DatePickerFlyout.
YearVisibleProperty DatePickerFlyout.YearVisibleProperty
I n this Article
Edit
Gets the identifier for the YearVisible dependency property.
public : static DependencyProperty YearVisibleProperty { get; }
static DependencyProperty YearVisibleProperty();
public static DependencyProperty YearVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the YearVisible dependency property.
DatePickerFlyoutItem DatePickerFlyoutItem DatePicker
FlyoutItem Class
Represents the container for an item in the DatePickerFlyout control.

D eclaration
public : sealed class DatePickerFlyoutItem : DependencyObject, IDatePickerFlyoutItem,
ICustomPropertyProvider
struct winrt::Windows::UI::Xaml::Controls::DatePickerFlyoutItem : DependencyObject,
IDatePickerFlyoutItem, ICustomPropertyProvider
public sealed class DatePickerFlyoutItem : DependencyObject, IDatePickerFlyoutItem,
ICustomPropertyProvider

I nheritance H ierarchy
DependencyObject

Properties
PrimaryText
PrimaryText
PrimaryText

Gets or sets the primary text of the item.

PrimaryTextProperty
PrimaryTextProperty
PrimaryTextProperty

Identifies the PrimaryText dependency property.

SecondaryText
SecondaryText
SecondaryText

Gets or sets the secondary text of the item.

SecondaryTextProperty
SecondaryTextProperty
SecondaryTextProperty

Identifies the SecondaryText dependency property.

Type
Type
Type

Gets the type of the item.


Methods
GetCustomProperty(String)
GetCustomProperty(String)
GetCustomProperty(String)

Retrieves an ICustomProperty object by specifying a property name.

GetIndexedProperty(String, TypeName)
GetIndexedProperty(String, TypeName)
GetIndexedProperty(String, TypeName)

Retrieves a custom property's ICustomProperty support object by specifying a property name and the type of the
indexed collection.

GetStringRepresentation()
GetStringRepresentation()
GetStringRepresentation()

Provides support for "GetStringFromObject" and/or "ToString" logic on the assumption that the implementation
supports System.Object. This logic might be accessed by features or services such as generating UI Automation
values based on data content.

See Also
DependencyObject
DatePickerFlyoutItem.GetCustomProperty DatePicker
FlyoutItem.GetCustomProperty DatePickerFlyoutItem.Get
CustomProperty
I n this Article
Edit
Retrieves an ICustomProperty object by specifying a property name.
public : ICustomProperty GetCustomProperty(Platform::String name)
ICustomProperty GetCustomProperty(winrt::hstring name) const;
public ICustomProperty GetCustomProperty(String name)

Parameters
name String
The name of the property.
Returns
ICustomProperty
The custom property support object.
DatePickerFlyoutItem.GetIndexedProperty DatePicker
FlyoutItem.GetIndexedProperty DatePickerFlyoutItem.
GetIndexedProperty
I n this Article
Edit
Retrieves a custom property's ICustomProperty support object by specifying a property name and the type of the
indexed collection.
public : ICustomProperty GetIndexedProperty(Platform::String name, TypeName type)
ICustomProperty GetIndexedProperty(winrt::hstring name, TypeName type) const;
public ICustomProperty GetIndexedProperty(String name, Type type)

Parameters
name String
The name of the custom property.
type Type
The type of the indexed collection, specified as a TypeName (for Visual C++ component extensions (C++/CX)) or
System.Type (for C#/VB ).
Returns
ICustomProperty
The returned support object for the custom property, or null.
DatePickerFlyoutItem.GetStringRepresentation Date
PickerFlyoutItem.GetStringRepresentation DatePicker
FlyoutItem.GetStringRepresentation
I n this Article
Edit
Provides support for "GetStringFromObject" and/or "ToString" logic on the assumption that the implementation
supports System.Object. This logic might be accessed by features or services such as generating UI Automation values
based on data content.
public : Platform::String GetStringRepresentation()
winrt::hstring GetStringRepresentation() const;
public string GetStringRepresentation()

Returns
string
The provided string.
DatePickerFlyoutItem.PrimaryText DatePickerFlyoutItem.
PrimaryText DatePickerFlyoutItem.PrimaryText
I n this Article
Edit
Gets or sets the primary text of the item.
public : Platform::String PrimaryText { get; set; }
winrt::hstring PrimaryText();

void PrimaryText(winrt::hstring primarytext);


public string PrimaryText { get; set; }

Returns
string
The primary text of the item.
DatePickerFlyoutItem.PrimaryTextProperty DatePicker
FlyoutItem.PrimaryTextProperty DatePickerFlyoutItem.
PrimaryTextProperty
I n this Article
Edit
Identifies the PrimaryText dependency property.
public : static DependencyProperty PrimaryTextProperty { get; }
static DependencyProperty PrimaryTextProperty();
public static DependencyProperty PrimaryTextProperty { get; }

Returns
DependencyProperty
The identifier for the PrimaryText dependency property.
DatePickerFlyoutItem.SecondaryText DatePickerFlyout
Item.SecondaryText DatePickerFlyoutItem.SecondaryText
I n this Article
Edit
Gets or sets the secondary text of the item.
public : Platform::String SecondaryText { get; set; }
winrt::hstring SecondaryText();

void SecondaryText(winrt::hstring secondarytext);


public string SecondaryText { get; set; }

Returns
string
The secondary text of the item.
DatePickerFlyoutItem.SecondaryTextProperty DatePicker
FlyoutItem.SecondaryTextProperty DatePickerFlyoutItem.
SecondaryTextProperty
I n this Article
Edit
Identifies the SecondaryText dependency property.
public : static DependencyProperty SecondaryTextProperty { get; }
static DependencyProperty SecondaryTextProperty();
public static DependencyProperty SecondaryTextProperty { get; }

Returns
DependencyProperty
The identifier for the SecondaryText dependency property.
DatePickerFlyoutItem.Type DatePickerFlyoutItem.Type
DatePickerFlyoutItem.Type
I n this Article
Edit
Gets the type of the item.
public : TypeName Type { get; }
TypeName Type();
public Type Type { get; }

Returns
Type
The type of the item, specified as a TypeName wrapper.
DatePickerFlyoutPresenter DatePickerFlyoutPresenter
DatePickerFlyoutPresenter Class
Represents a control to allow a user to pick a date.

D eclaration
public : sealed class DatePickerFlyoutPresenter : Control, IDatePickerFlyoutPresenter
struct winrt::Windows::UI::Xaml::Controls::DatePickerFlyoutPresenter : Control,
IDatePickerFlyoutPresenter
public sealed class DatePickerFlyoutPresenter : Control, IDatePickerFlyoutPresenter

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the DatePickerFlyoutPresenter control.

R ES O U R CE K EY D ES CR IPTIO N

DatePickerFlyoutPresenterSpacerFill Spacer color

DatePickerFlyoutPresenterBackground Background color

DatePickerFlyoutPresenterBorderBrush Border color

DatePickerFlyoutPresenterHighlightFill Highlight color

See Also
Control
DatePickerSelectedValueChangedEventArgs DatePicker
SelectedValueChangedEventArgs DatePickerSelected
ValueChangedEventArgs Class
Provides event data for the DatePicker.SelectedDateChanged event.

D eclaration
public : sealed class DatePickerSelectedValueChangedEventArgs :
IDatePickerSelectedValueChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::DatePickerSelectedValueChangedEventArgs :
IDatePickerSelectedValueChangedEventArgs
public sealed class DatePickerSelectedValueChangedEventArgs :
IDatePickerSelectedValueChangedEventArgs

I nheritance H ierarchy
None

Properties
NewDate
NewDate
NewDate

Gets the new date selected in the picker.

OldDate
OldDate
OldDate

Gets the date previously selected in the picker.


DatePickerSelectedValueChangedEventArgs.NewDate
DatePickerSelectedValueChangedEventArgs.NewDate
DatePickerSelectedValueChangedEventArgs.NewDate
I n this Article
Edit
Gets the new date selected in the picker.
public : IReference<DateTime> NewDate { get; }
IReference<DateTime> NewDate();
public Nullable<DateTimeOffset> NewDate { get; }

Returns
Nullable<DateTimeOffset>
The new date selected in the picker.
DatePickerSelectedValueChangedEventArgs.OldDate
DatePickerSelectedValueChangedEventArgs.OldDate
DatePickerSelectedValueChangedEventArgs.OldDate
I n this Article
Edit
Gets the date previously selected in the picker.
public : IReference<DateTime> OldDate { get; }
IReference<DateTime> OldDate();
public Nullable<DateTimeOffset> OldDate { get; }

Returns
Nullable<DateTimeOffset>
The date previously selected in the picker.
DatePickerValueChangedEventArgs DatePickerValue
ChangedEventArgs DatePickerValueChangedEventArgs
Class
Provides event data for the DatePicker.DateChanged event.

D eclaration
public : sealed class DatePickerValueChangedEventArgs : IDatePickerValueChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::DatePickerValueChangedEventArgs :
IDatePickerValueChangedEventArgs
public sealed class DatePickerValueChangedEventArgs : IDatePickerValueChangedEventArgs

I nheritance H ierarchy
None

Properties
NewDate
NewDate
NewDate

Gets the new date selected in the picker.

OldDate
OldDate
OldDate

Gets the date previously selected in the picker.


DatePickerValueChangedEventArgs.NewDate DatePicker
ValueChangedEventArgs.NewDate DatePickerValue
ChangedEventArgs.NewDate
I n this Article
Edit
Gets the new date selected in the picker.
public : DateTime NewDate { get; }
DateTime NewDate();
public DateTimeOffset NewDate { get; }

Returns
DateTimeOffset
The new date selected in the picker.
DatePickerValueChangedEventArgs.OldDate DatePicker
ValueChangedEventArgs.OldDate DatePickerValue
ChangedEventArgs.OldDate
I n this Article
Edit
Gets the date previously selected in the picker.
public : DateTime OldDate { get; }
DateTime OldDate();
public DateTimeOffset OldDate { get; }

Returns
DateTimeOffset
The date previously selected in the picker.
DisabledFormattingAccelerators DisabledFormatting
Accelerators DisabledFormattingAccelerators Enum
Defines constants that specify which keyboard shortcuts for formatting are disabled in a RichEditBox.

D eclaration
public : enum class DisabledFormattingAccelerators
enum class winrt::Windows::UI::Xaml::Controls::DisabledFormattingAccelerators : uint32_t
public enum DisabledFormattingAccelerators

I nheritance H ierarchy
None

Fields
All All All All keyboard shortcuts are disabled.

Bold Bold Bold The keyboard shortcut for bold (Ctrl+B) is disabled.

Italic Italic Italic The keyboard shortcut for italic (Ctrl+I) is disabled.

None None None No keyboard shortcuts are disabled.

Underline Underline Underline The keyboard shortcut for underline (Ctrl+U) is disabled.
DragItemsCompletedEventArgs DragItemsCompleted
EventArgs DragItemsCompletedEventArgs Class
Provides event data for the DragItemsCompleted event.

D eclaration
public : sealed class DragItemsCompletedEventArgs : IDragItemsCompletedEventArgs
struct winrt::Windows::UI::Xaml::Controls::DragItemsCompletedEventArgs :
IDragItemsCompletedEventArgs
public sealed class DragItemsCompletedEventArgs : IDragItemsCompletedEventArgs

I nheritance H ierarchy
None

Properties
DropResult
DropResult
DropResult

Gets a value that indicates what operation was performed on the dragged data, and whether it was successful.

Items
Items
Items

Gets the loosely typed collection of objects that are selected for the item drag action.
DragItemsCompletedEventArgs.DropResult DragItems
CompletedEventArgs.DropResult DragItemsCompleted
EventArgs.DropResult
I n this Article
Edit
Gets a value that indicates what operation was performed on the dragged data, and whether it was successful.
public : DataPackageOperation DropResult { get; }
DataPackageOperation DropResult();
public DataPackageOperation DropResult { get; }

Returns
DataPackageOperation
A value of the enumeration that indicates what operation was performed on the dragged data.
DragItemsCompletedEventArgs.Items DragItems
CompletedEventArgs.Items DragItemsCompletedEvent
Args.Items
I n this Article
Edit
Gets the loosely typed collection of objects that are selected for the item drag action.
public : IVectorView<Platform::Object> Items { get; }
IVectorView<winrt::Windows::Foundation::IInspectable> Items();
public IReadOnlyList<object> Items { get; }

Returns
IReadOnlyList<object>
A loosely typed collection of objects.
DragItemsStartingEventArgs DragItemsStartingEvent
Args DragItemsStartingEventArgs Class
Provides event data for the DragItemsStarting event.

D eclaration
public : sealed class DragItemsStartingEventArgs : IDragItemsStartingEventArgs
struct winrt::Windows::UI::Xaml::Controls::DragItemsStartingEventArgs :
IDragItemsStartingEventArgs
public sealed class DragItemsStartingEventArgs : IDragItemsStartingEventArgs

I nheritance H ierarchy
None

Constructors
DragItemsStartingEventArgs()
DragItemsStartingEventArgs()
DragItemsStartingEventArgs()

Initializes a new instance of the DragItemsStartingEventArgs class.

Properties
Cancel
Cancel
Cancel

Gets or sets a value that indicates whether the item drag action should be canceled.

Data
Data
Data

Gets the data payload associated with an items drag action.

Items
Items
Items

Gets the loosely typed collection of objects that are selected for the item drag action.

See Also
DragItemsStartingEventArgs.Cancel DragItemsStarting
EventArgs.Cancel DragItemsStartingEventArgs.Cancel
I n this Article
Edit
Gets or sets a value that indicates whether the item drag action should be canceled.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
True to cancel the item drag action; otherwise, false.

Remarks
Set this property to true in a handler in order to cancel an items drag action.
DragItemsStartingEventArgs.Data DragItemsStarting
EventArgs.Data DragItemsStartingEventArgs.Data
I n this Article
Edit
Gets the data payload associated with an items drag action.
public : DataPackage Data { get; }
DataPackage Data();
public DataPackage Data { get; }

Returns
DataPackage
The data payload.

Remarks
By default the data is empty. When you perform custom actions as the result of a drag-and-drop operation, you
typically provide custom data that can later be inspected and used to perform the custom action.
DragItemsStartingEventArgs DragItemsStartingEvent
Args DragItemsStartingEventArgs
I n this Article
Edit
Initializes a new instance of the DragItemsStartingEventArgs class.
public : DragItemsStartingEventArgs()
DragItemsStartingEventArgs() const;
public DragItemsStartingEventArgs()
DragItemsStartingEventArgs.Items DragItemsStarting
EventArgs.Items DragItemsStartingEventArgs.Items
I n this Article
Edit
Gets the loosely typed collection of objects that are selected for the item drag action.
public : IVector<Platform::Object> Items { get; }
IVector<winrt::Windows::Foundation::IInspectable> Items();
public IList<object> Items { get; }

Returns
IList<object>
A loosely typed collection of objects.
DragItemsStartingEventHandler DragItemsStartingEvent
Handler DragItemsStartingEventHandler Delegate
Represents the method that will handle the DragItemsStarting event.

D eclaration
public : delegate void DragItemsStartingEventHandler(Platform::Object sender,
DragItemsStartingEventArgs e)
struct DragItemsStartingEventHandler : winrt::Windows::Foundation::IUnknown
{
DragItemsStartingEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> DragItemsStartingEventHandler(L lambda);
template <typename F> DragItemsStartingEventHandler(F* function);
template <typename O, typename M> DragItemsStartingEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::DragItemsStartingEventArgs const& e) const;
};
public delegate void DragItemsStartingEventHandler(Object sender, DragItemsStartingEventArgs e)

I nheritance H ierarchy
None
DropDownButton DropDownButton DropDownButton
Class
Represents a button with a chevron intended to open a menu.

D eclaration
public : class DropDownButton : Button, IDropDownButton
struct winrt::Windows::UI::Xaml::Controls::DropDownButton : Button, IDropDownButton
public class DropDownButton : Button, IDropDownButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
Button

Remarks
A DropDownButton is a button that shows a chevron as a visual indicator that it has an attached flyout that contains
more options. It has the same behavior as a standard Button with a flyout; only the appearance is different.
For more info and examples, see Buttons.

Constructors
DropDownButton()
DropDownButton()
DropDownButton()

Initializes a new instance of the DropDownButton class.

See Also
DropDownButton DropDownButton DropDownButton
I n this Article
Edit
Initializes a new instance of the DropDownButton class.

public : DropDownButton()
DropDownButton() const;
public DropDownButton()
DropDownButtonAutomationPeer DropDownButton
AutomationPeer DropDownButtonAutomationPeer Class
Exposes DropDownButton types to Microsoft UI Automation.

D eclaration
public : class DropDownButtonAutomationPeer : ButtonAutomationPeer, IExpandCollapseProvider,
IDropDownButtonAutomationPeer
struct winrt::Windows::UI::Xaml::Controls::DropDownButtonAutomationPeer : ButtonAutomationPeer,
IExpandCollapseProvider, IDropDownButtonAutomationPeer
public class DropDownButtonAutomationPeer : ButtonAutomationPeer, IExpandCollapseProvider,
IDropDownButtonAutomationPeer

I nheritance H ierarchy
DependencyObject
AutomationPeer
FrameworkElementAutomationPeer
ButtonBaseAutomationPeer
ButtonAutomationPeer

Constructors
DropDownButtonAutomationPeer(DropDownButton)
DropDownButtonAutomationPeer(DropDownButton)
DropDownButtonAutomationPeer(DropDownButton)

Initializes a new instance of the DropDownButtonAutomationPeer class.

Properties
ExpandCollapseState
ExpandCollapseState
ExpandCollapseState

Gets the state, expanded or collapsed, of the control.

Methods
Collapse()
Collapse()
Collapse()

Hides the control's drop down menu.

Expand()
Expand()
Expand()
Displays the control's drop down menu.
DropDownButtonAutomationPeer.Collapse DropDown
ButtonAutomationPeer.Collapse DropDownButton
AutomationPeer.Collapse
I n this Article
Edit
Hides the control's drop down menu.
public : void Collapse()
void Collapse() const;
public void Collapse()
DropDownButtonAutomationPeer DropDownButton
AutomationPeer DropDownButtonAutomationPeer
I n this Article
Edit
Initializes a new instance of the DropDownButtonAutomationPeer class.
public : DropDownButtonAutomationPeer(DropDownButton owner)
DropDownButtonAutomationPeer(DropDownButton owner) const;
public DropDownButtonAutomationPeer(DropDownButton owner)

Parameters
owner DropDownButton
The DropDownButton control instance to create the peer for.
DropDownButtonAutomationPeer.Expand DropDown
ButtonAutomationPeer.Expand DropDownButton
AutomationPeer.Expand
I n this Article
Edit
Displays the control's drop down menu.
public : void Expand()
void Expand() const;
public void Expand()
DropDownButtonAutomationPeer.ExpandCollapseState
DropDownButtonAutomationPeer.ExpandCollapseState
DropDownButtonAutomationPeer.ExpandCollapseState
I n this Article
Edit
Gets the state, expanded or collapsed, of the control.
public : ExpandCollapseState ExpandCollapseState { get; }
ExpandCollapseState ExpandCollapseState();
public ExpandCollapseState ExpandCollapseState { get; }

Returns
ExpandCollapseState
A value of the enumeration.
DynamicOverflowItemsChangingEventArgs Dynamic
OverflowItemsChangingEventArgs DynamicOverflow
ItemsChangingEventArgs Class
Provides data for the CommandBar.DynamicOverflowItemsChanging event.

D eclaration
public : sealed class DynamicOverflowItemsChangingEventArgs :
IDynamicOverflowItemsChangingEventArgs
struct winrt::Windows::UI::Xaml::Controls::DynamicOverflowItemsChangingEventArgs :
IDynamicOverflowItemsChangingEventArgs
public sealed class DynamicOverflowItemsChangingEventArgs :
IDynamicOverflowItemsChangingEventArgs

I nheritance H ierarchy
None

Constructors
DynamicOverflowItemsChangingEventArgs()
DynamicOverflowItemsChangingEventArgs()
DynamicOverflowItemsChangingEventArgs()

Initializes a new instance of the DynamicOverflowItemsChangingEventArgs class.

Properties
Action
Action
Action

Gets a value that indicates whether items were added to or removed from the CommandBar overflow menu.
DynamicOverflowItemsChangingEventArgs.Action
DynamicOverflowItemsChangingEventArgs.Action
DynamicOverflowItemsChangingEventArgs.Action
I n this Article
Edit
Gets a value that indicates whether items were added to or removed from the CommandBar overflow menu.
public : CommandBarDynamicOverflowAction Action { get; }
CommandBarDynamicOverflowAction Action();
public CommandBarDynamicOverflowAction Action { get; }

Returns
CommandBarDynamicOverflowAction
A value that indicates whether items were added to or removed from the CommandBar overflow menu.
DynamicOverflowItemsChangingEventArgs Dynamic
OverflowItemsChangingEventArgs DynamicOverflow
ItemsChangingEventArgs
I n this Article
Edit
Initializes a new instance of the DynamicOverflowItemsChangingEventArgs class.
public : DynamicOverflowItemsChangingEventArgs()
DynamicOverflowItemsChangingEventArgs() const;
public DynamicOverflowItemsChangingEventArgs()
FlipView FlipView FlipView Class
Represents an items control that displays one item at a time, and enables "flip" behavior for traversing its collection of
items.

D eclaration
public : class FlipView : Selector, IFlipView, IFlipView2
struct winrt::Windows::UI::Xaml::Controls::FlipView : Selector, IFlipView, IFlipView2
public class FlipView : Selector, IFlipView, IFlipView2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Selector

Remarks
 Tip

For more info, design guidance, and code examples, see Flip view.
Use a FlipView to present a collection of items that the user views sequentially, one at a time. It's useful for displaying a
gallery of images or the pages of a magazine.
FlipView is an ItemsControl, so it can contain a collection of items of any type. To populate the view, add items to the
Items collection, or set the ItemsSource property to a data source.
By default, a data item is displayed in the FlipView as the string representation of the data object it's bound to. To
specify exactly how items in the FlipView are displayed, you create a DataTemplate to define the layout of controls used
to display an individual item. The controls in the layout can be bound to properties of a data object, or have content
defined inline. You assign the DataTemplate to the ItemTemplate property of the FlipView.
For more info, see these topics:
Quickstart: Adding FlipView controls
How to add a flip view
Note

When a user flips through FlipView content using touch interaction, a SelectionChanged event occurs only when touch
manipulations are complete. This means that when a user flips through content quickly, individual SelectionChanged
events are not always generated for every item because the manipulation is still occurring.
For more examples, see XAML FlipView sample.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the FlipView control.

R ES O U R CE K EY D ES CR IPTIO N

FlipViewBackground Control background color

FlipViewNextPreviousArrowForeground Button arrow color

FlipViewNextPreviousArrowForegroundPointerOver Button arrow color on hover

FlipViewNextPreviousArrowForegroundPressed Button arrow color when pressed

FlipViewNextPreviousButtonBackground Button background color at rest

FlipViewNextPreviousButtonBackgroundPointerOver Button background color on hover

FlipViewNextPreviousButtonBackgroundPressed Button background color when pressed

FlipViewNextPreviousButtonBorderBrush Button border color at rest

FlipViewNextPreviousButtonBorderBrushPointerOver Button border color on hover

FlipViewNextPreviousButtonBorderBrushPressed Button border color when pressed

Constructors
FlipView()
FlipView()
FlipView()

Initializes a new instance of the FlipView class.

Properties
UseTouchAnimationsForAllNavigation
UseTouchAnimationsForAllNavigation
UseTouchAnimationsForAllNavigation

Gets or sets a value that indicates whether transition animations are always used whether the navigation is touch-
based, button-based or programmatic.

UseTouchAnimationsForAllNavigationProperty
UseTouchAnimationsForAllNavigationProperty
UseTouchAnimationsForAllNavigationProperty

Identifies the UseTouchAnimationsForAllNavigation dependency property.

See Also
Selector
Selector
Selector
Selector
FlipView FlipView FlipView
I n this Article
Edit
Initializes a new instance of the FlipView class.

public : FlipView()
FlipView() const;
public FlipView()
FlipView.UseTouchAnimationsForAllNavigation FlipView.
UseTouchAnimationsForAllNavigation FlipView.UseTouch
AnimationsForAllNavigation
I n this Article
Edit
Gets or sets a value that indicates whether transition animations are always used whether the navigation is touch-
based, button-based or programmatic.
public : Platform::Boolean UseTouchAnimationsForAllNavigation { get; set; }
bool UseTouchAnimationsForAllNavigation();

void UseTouchAnimationsForAllNavigation(bool usetouchanimationsforallnavigation);


public bool UseTouchAnimationsForAllNavigation { get; set; }

<FlipView UseTouchAnimationsForAllNavigation="bool" />

Returns
bool
true if transition animations are always used; false if transition animations are used only for touch navigation. The
default is true.

Remarks
The XAML FlipView control supports three modes of navigation; touch-based, button-based and programmatic. When
a user navigates by touch, the FlipView items scroll smoothly into view. When you set this property to true, the same
navigation animation occurs whether the navigation is touch-based, button-based and programmatic. If
UseTouchAnimationsForAllNavigation is false and the user navigates by mouse, keyboard, or programmatically, the
animation doesn't occur and items just pop into view.

Windows 8 In Windows 8, the FlipView navigation animation occurs only when the user navigates by touch. If you
recompile an app built for Windows 8 for Windows 8.1 and need to keep the Windows 8 behavior, set this property
to false. For example, if you check the HorizontalOffset property value of FlipView 's internal ScrollViewer while
the selection is changing, the value is not fixed until the animation is complete. If your app has a dependency on
this value, you can set this property to false.
FlipView.UseTouchAnimationsForAllNavigationProperty
FlipView.UseTouchAnimationsForAllNavigationProperty
FlipView.UseTouchAnimationsForAllNavigationProperty
I n this Article
Edit
Identifies the UseTouchAnimationsForAllNavigation dependency property.
public : static DependencyProperty UseTouchAnimationsForAllNavigationProperty { get; }
static DependencyProperty UseTouchAnimationsForAllNavigationProperty();
public static DependencyProperty UseTouchAnimationsForAllNavigationProperty { get; }

Returns
DependencyProperty
The identifier for the UseTouchAnimationsForAllNavigation dependency property.
FlipViewItem FlipViewItem FlipViewItem Class
Represents the container for an item in a FlipView control.

D eclaration
public : class FlipViewItem : SelectorItem, IFlipViewItem
struct winrt::Windows::UI::Xaml::Controls::FlipViewItem : SelectorItem, IFlipViewItem
public class FlipViewItem : SelectorItem, IFlipViewItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem

Remarks
The FlipViewItem class provides the container for items displayed in a FlipView control. You populate the FlipView by
adding objects directly to its Items collection or by binding its ItemsSource property to a data source. When items are
added to the FlipView, a FlipViewItem container is created automatically for each item in the collection.
You can specify the look of the FlipViewItem by setting the FlipView 's ItemContainerStyle property to a Style with a
TargetType of FlipViewItem.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the FlipViewItem control.

R ES O U R CE K EY D ES CR IPTIO N

FlipViewItemBackground Item background color


Note

In an app compiled for Windows 8.1, FlipViewItem handles pointer focus differently than in an app compiled for
Windows 8. + In an app compiled for Windows 8, the event order is PointerPressed > GotFocus > PointerReleased.
FlipViewItem does not mark the PointerReleased event as Handled.
In an app compiled for Windows 8.1, the event order is PointerPressed > GotFocus. FlipViewItem marks the
PointerReleased event as Handled.

Constructors
FlipViewItem()
FlipViewItem()
FlipViewItem()

Initializes a new instance of the FlipViewItem class.

See Also
SelectorItem
FlipViewItem FlipViewItem FlipViewItem
I n this Article
Edit
Initializes a new instance of the FlipViewItem class.

public : FlipViewItem()
FlipViewItem() const;
public FlipViewItem()
Flyout Flyout Flyout Class
Represents a control that displays lightweight UI that is either information, or requires user interaction. Unlike a dialog,
a Flyout can be light dismissed by clicking or tapping outside of it, pressing the device’s back button, or pressing the
‘Esc’ key.

D eclaration
public : class Flyout : FlyoutBase, IFlyout
struct winrt::Windows::UI::Xaml::Controls::Flyout : FlyoutBase, IFlyout
public class Flyout : FlyoutBase, IFlyout

I nheritance H ierarchy
DependencyObject
FlyoutBase

Remarks
A Flyout displays a message that requires user interaction.

Use a Flyout control for collecting information, for displaying more info, or for warnings and confirmations. Unlike a
dialog, a Flyout does not create a separate window, and does not block other user interaction. To show a menu of items,
use a MenuFlyout instead. For more info, including XAML and code examples, see Quickstart: Adding a Flyout.
A Flyout control (or MenuFlyout ) is used as the value of the Button.Flyout property. This is usually set in XAML as part
of a UI definition of the page. Button is the only control that has a dedicated Flyout property. To associate a Flyout with
other controls, use the FlyoutBase.AttachedFlyout attached property. When set as Button.Flyout, the Flyout displays
when the button is tapped or otherwise invoked. When a Flyout is assigned to other UI elements using
FlyoutBase.AttachedFlyout, you must call either the ShowAt method or the static ShowAttachedFlyout method to
display the flyout.
In addition to the members listed in this reference topic, there are other members of the base class FlyoutBase that are
often used in typical Flyout scenarios:
FlyoutBase.AttachedFlyout: an attached property that associates a Flyout with a particular UI element (this can be any
FrameworkElement derived class).
ShowAttachedFlyout: a static method that can determine whether a flyout is already associated with a UI element
through a FlyoutBase.AttachedFlyout assignment. If so, the method calls ShowAt internally, using the
FrameworkElement that you specified.
Accessibility
If you use a Flyout with no focusable content-for example, with only text, as shown here-you should take some
additional steps to ensure that your content is accessible. Specifically, you need to ensure that Windows Narrator or
other screen readers can read the flyout’s content.
By default, there are properties set on the FlyoutPresenter that prevent it from receiving focus. This is the desired
behavior when content inside the Flyout can receive focus. However, if the content inside the Flyout can’t receive focus,
you should update to the FlyoutPresenterStyle to let the FlyoutPresenter receive focus instead. To do this, set IsTabStop
to true and TabNavigation to Cycle on the flyout presenter style.
This example shows how to let the FlyoutPresenter receive focus so that the content is accessible.
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Button VerticalAlignment="Center" HorizontalAlignment="Center"
Content="Open flyout">
<Button.Flyout>
<Flyout>
<Flyout.FlyoutPresenterStyle>
<Style TargetType="FlyoutPresenter">
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility"
Value="Disabled"/>
<Setter Property="IsTabStop" Value="True"/>
<Setter Property="TabNavigation" Value="Cycle"/>
</Style>
</Flyout.FlyoutPresenterStyle>
<TextBlock TextWrapping="Wrap" Text="This is some text in a flyout."/>
</Flyout>
</Button.Flyout>
</Button>
</Grid>

Constructors
Flyout()
Flyout()
Flyout()

Initializes a new instance of the Flyout class.

Properties
Content
Content
Content
Gets or sets the content of the Flyout.

ContentProperty
ContentProperty
ContentProperty

Gets the identifier for the Content dependency property.

FlyoutPresenterStyle
FlyoutPresenterStyle
FlyoutPresenterStyle

Gets or sets the Style applied to the Flyout content.

FlyoutPresenterStyleProperty
FlyoutPresenterStyleProperty
FlyoutPresenterStyleProperty

Gets the identifier for the FlyoutPresenterStyle dependency property.

See Also
FlyoutBase
FlyoutBase
FlyoutBase
FlyoutBase
FlyoutBase
Flyout.Content Flyout.Content Flyout.Content
I n this Article
Edit
Gets or sets the content of the Flyout.

public : UIElement Content { get; set; }


UIElement Content();

void Content(UIElement content);


public UIElement Content { get; set; }

<Flyout>
singleUIElement
</Flyout>

Returns
UIElement
The content of the Flyout.
Flyout.ContentProperty Flyout.ContentProperty Flyout.
ContentProperty
I n this Article
Edit
Gets the identifier for the Content dependency property.
public : static DependencyProperty ContentProperty { get; }
static DependencyProperty ContentProperty();
public static DependencyProperty ContentProperty { get; }

Returns
DependencyProperty
The identifier for the Content dependency property.
Flyout Flyout Flyout
I n this Article
Edit
Initializes a new instance of the Flyout class.

public : Flyout()
Flyout() const;
public Flyout()
Flyout.FlyoutPresenterStyle Flyout.FlyoutPresenterStyle
Flyout.FlyoutPresenterStyle
I n this Article
Edit
Gets or sets the Style applied to the Flyout content.
public : Style FlyoutPresenterStyle { get; set; }
Style FlyoutPresenterStyle();

void FlyoutPresenterStyle(Style flyoutpresenterstyle);


public Style FlyoutPresenterStyle { get; set; }

<Flyout FlyoutPresenterStyle={StaticResource styleResourceKey}/>

Returns
Style
The applied Style for the Flyout content, if present; otherwise, null. The default is null.

Remarks
The Style element you use for a FlyoutPresenterStyle value must specify TargetType="FlyoutPresenter" .
A Flyout itself isn't a control or even a UIElement, and thus doesn't have any properties to apply a Style to. Instead, you
can style the properties of the internal FlyoutPresenter that is presenting the Content of a Flyout. The properties that
can be styled are the dependency properties of the base ContentControl class or Control class, such as FontSize or
Padding, or base element properties such as FrameworkElement.Margin that the FlyoutPresenter class inherits. You
also can use the properties that are available on whichever element you're setting as Flyout.Content, and set values of
those properties directly rather than styling the FlyoutPresenter.
See Styling controls
Also
Flyout.FlyoutPresenterStyleProperty Flyout.Flyout
PresenterStyleProperty Flyout.FlyoutPresenterStyle
Property
I n this Article
Edit
Gets the identifier for the FlyoutPresenterStyle dependency property.
public : static DependencyProperty FlyoutPresenterStyleProperty { get; }
static DependencyProperty FlyoutPresenterStyleProperty();
public static DependencyProperty FlyoutPresenterStyleProperty { get; }

Returns
DependencyProperty
The identifier for the FlyoutPresenterStyle dependency property.
FlyoutPresenter FlyoutPresenter FlyoutPresenter Class
Displays the content of a Flyout.

D eclaration
public : class FlyoutPresenter : ContentControl, IFlyoutPresenter
struct winrt::Windows::UI::Xaml::Controls::FlyoutPresenter : ContentControl, IFlyoutPresenter
public class FlyoutPresenter : ContentControl, IFlyoutPresenter

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
You don't typically declare object elements for FlyoutPresenter in XAML. There are no properties that a
FlyoutPresenter can set in XAML syntax and there's no reason to declare a FlyoutPresenter as a resource.
The main purpose of the FlyoutPresenter class is to be the default internal presenter for the Content value of a Flyout.
The Content property can be any UIElement. The FlyoutPresenter can apply presentation that can modify presentation
info declared on the element used as Content. You extend presentation behavior of the FlyoutPresenter by setting a
value for the FlyoutPresenterStyle property of the Flyout. The Style you declare that fills the FlyoutPresenterStyle
property must specify TargetType="FlyoutPresenter" . The properties that can be styled are the dependency
properties of the base ContentControl class or Control class, such as FontSize or Padding, or base element properties
such as FrameworkElement.Margin that the FlyoutPresenter class inherits.
FlyoutPresenter exists as a class and has a default constructor basically to satisfy XAML infrastructure support, when
it's specified as the TargetType of the Style used for a FlyoutPresenterStyle value.

Constructors
FlyoutPresenter()
FlyoutPresenter()
FlyoutPresenter()

Initializes a new instance of the FlyoutPresenter class.

See Also
ContentControl
ContentControl
FlyoutPresenter FlyoutPresenter FlyoutPresenter
I n this Article
Edit
Initializes a new instance of the FlyoutPresenter class.

public : FlyoutPresenter()
FlyoutPresenter() const;
public FlyoutPresenter()
FocusDisengagedEventArgs FocusDisengagedEventArgs
FocusDisengagedEventArgs Class
Provides data for the FocusDisengaged event.

D eclaration
public : sealed class FocusDisengagedEventArgs : RoutedEventArgs, IFocusDisengagedEventArgs
struct winrt::Windows::UI::Xaml::Controls::FocusDisengagedEventArgs : RoutedEventArgs,
IFocusDisengagedEventArgs
public sealed class FocusDisengagedEventArgs : RoutedEventArgs, IFocusDisengagedEventArgs

I nheritance H ierarchy
RoutedEventArgs

See Also
RoutedEventArgs
FocusEngagedEventArgs FocusEngagedEventArgs Focus
EngagedEventArgs Class
Provides data for the FocusEngaged event.

D eclaration
public : sealed class FocusEngagedEventArgs : RoutedEventArgs, IFocusEngagedEventArgs,
IFocusEngagedEventArgs2
struct winrt::Windows::UI::Xaml::Controls::FocusEngagedEventArgs : RoutedEventArgs,
IFocusEngagedEventArgs, IFocusEngagedEventArgs2
public sealed class FocusEngagedEventArgs : RoutedEventArgs, IFocusEngagedEventArgs,
IFocusEngagedEventArgs2

I nheritance H ierarchy
RoutedEventArgs

Properties
Handled
Handled
Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers
along the event route from handling the same event again.

See Also
RoutedEventArgs
FocusEngagedEventArgs.Handled FocusEngagedEvent
Args.Handled FocusEngagedEventArgs.Handled
I n this Article
Edit
Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along
the event route from handling the same event again.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
true to mark the routed event handled. false to leave the routed event unhandled, which permits the event to
potentially route further and be acted on by other handlers. The default is false.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


FontIcon FontIcon FontIcon Class
Represents an icon that uses a glyph from the specified font.

D eclaration
public : class FontIcon : IconElement, IFontIcon, IFontIcon2, IFontIcon3
struct winrt::Windows::UI::Xaml::Controls::FontIcon : IconElement, IFontIcon, IFontIcon2,
IFontIcon3
public class FontIcon : IconElement, IFontIcon, IFontIcon2, IFontIcon3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
IconElement

Remarks
Use FontIcon to specify an icon using a Glyph value from a FontFamily. You must have the font available for the glyphs
to show. Glyph values are assigned by font developers to private Unicode values that don’t map to existing code points.
Windows 10 uses the Segoe MDL2 Assets FontFamily, and the glyphs are included in the Symbol enumeration.
You can set the MirroredWhenRightToLeft property to have the glyph appear mirrored when the FlowDirection is
RightToLeft. You typically use this property when a FontIcon is used to display an icon as part of a control template and
the icon needs to be mirrored along with the rest of the control.
Note

You can set the Foreground property on the AppBarButton or on the FontIcon. If you set the Foreground on the
AppBarButton, it's applied only to the default visual state. It's not applied to the other visual states defined in the
AppBarButton template, like MouseOver . If you set the Foreground on the FontIcon, the color is applied to all visual
states.

Constructors
FontIcon()
FontIcon()
FontIcon()

Initializes a new instance of the FontIcon class.

Properties
FontFamily
FontFamily
FontFamily

Gets or sets the font used to display the icon glyph.

FontFamilyProperty
FontFamilyProperty
FontFamilyProperty

Gets the identifier for the FontFamily dependency property.

FontSize
FontSize
FontSize

Gets or sets the size of the icon glyph.

FontSizeProperty
FontSizeProperty
FontSizeProperty

Gets the identifier for the FontSize dependency property.

FontStyle
FontStyle
FontStyle

Gets or sets the font style for the icon glyph.

FontStyleProperty
FontStyleProperty
FontStyleProperty

Gets the identifier for the FontStyle dependency property.

FontWeight
FontWeight
FontWeight

Gets or sets the thickness of the icon glyph.

FontWeightProperty
FontWeightProperty
FontWeightProperty

Gets the identifier for the FontWeight dependency property.

Glyph
Glyph
Glyph

Gets or sets the character code that identifies the icon glyph.
GlyphProperty
GlyphProperty
GlyphProperty

Gets the identifier for the Glyph dependency property.

IsTextScaleFactorEnabled
IsTextScaleFactorEnabled
IsTextScaleFactorEnabled

Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.

IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty

Identifies the IsTextScaleFactorEnabled dependency property.

MirroredWhenRightToLeft
MirroredWhenRightToLeft
MirroredWhenRightToLeft

Gets or sets a value that indicates whether the icon is mirrored when the FlowDirection is RightToLeft.

MirroredWhenRightToLeftProperty
MirroredWhenRightToLeftProperty
MirroredWhenRightToLeftProperty

Identifies the MirroredWhenRightToLeft dependency property.

See Also
IconElement
IconElement
FontIcon.FontFamily FontIcon.FontFamily FontIcon.Font
Family
I n this Article
Edit
Gets or sets the font used to display the icon glyph.
public : FontFamily FontFamily { get; set; }
FontFamily FontFamily();

void FontFamily(FontFamily fontfamily);


public FontFamily FontFamily { get; set; }

<FontIcon FontFamily="fontFamilyValue"/>

Returns
FontFamily
The font used to display the icon glyph.
FontIcon.FontFamilyProperty FontIcon.FontFamily
Property FontIcon.FontFamilyProperty
I n this Article
Edit
Gets the identifier for the FontFamily dependency property.
public : static DependencyProperty FontFamilyProperty { get; }
static DependencyProperty FontFamilyProperty();
public static DependencyProperty FontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the FontFamily dependency property.
FontIcon FontIcon FontIcon
I n this Article
Edit
Initializes a new instance of the FontIcon class.

public : FontIcon()
FontIcon() const;
public FontIcon()
FontIcon.FontSize FontIcon.FontSize FontIcon.FontSize
I n this Article
Edit
Gets or sets the size of the icon glyph.

public : double FontSize { get; set; }


double FontSize();

void FontSize(double fontsize);


public double FontSize { get; set; }

<FontIcon FontSize="double" .../>

Returns
double
A non-negative value that specifies the font size, measured in pixels.

Remarks
The unit measure for FontSize is pixels, measuring the line height of the characters in the font. The apparent size of text
in the UI can vary based on the current scaling. If you want to use different FontSize values for different scalings, you
can do this using the resources system.
FontIcon.FontSizeProperty FontIcon.FontSizeProperty
FontIcon.FontSizeProperty
I n this Article
Edit
Gets the identifier for the FontSize dependency property.
public : static DependencyProperty FontSizeProperty { get; }
static DependencyProperty FontSizeProperty();
public static DependencyProperty FontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the FontSize dependency property.
FontIcon.FontStyle FontIcon.FontStyle FontIcon.Font
Style
I n this Article
Edit
Gets or sets the font style for the icon glyph.
public : FontStyle FontStyle { get; set; }
FontStyle FontStyle();

void FontStyle(FontStyle fontstyle);


public FontStyle FontStyle { get; set; }

<FontIcon FontStyle="fontStyleMemberName"/>

Returns
FontStyle
A named constant of the enumeration that specifies the style in which the icon glyph is rendered. The default is
Normal.
FontIcon.FontStyleProperty FontIcon.FontStyleProperty
FontIcon.FontStyleProperty
I n this Article
Edit
Gets the identifier for the FontStyle dependency property.
public : static DependencyProperty FontStyleProperty { get; }
static DependencyProperty FontStyleProperty();
public static DependencyProperty FontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the FontStyle dependency property.
FontIcon.FontWeight FontIcon.FontWeight FontIcon.Font
Weight
I n this Article
Edit
Gets or sets the thickness of the icon glyph.
public : FontWeight FontWeight { get; set; }
FontWeight FontWeight();

void FontWeight(FontWeight fontweight);


public FontWeight FontWeight { get; set; }

<FontIcon FontWeight="fontWeightsValue"/>

Returns
FontWeight
A value that specifies the thickness of the icon glyph. The default is Normal.
FontIcon.FontWeightProperty FontIcon.FontWeight
Property FontIcon.FontWeightProperty
I n this Article
Edit
Gets the identifier for the FontWeight dependency property.
public : static DependencyProperty FontWeightProperty { get; }
static DependencyProperty FontWeightProperty();
public static DependencyProperty FontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the FontWeight dependency property.
FontIcon.Glyph FontIcon.Glyph FontIcon.Glyph
I n this Article
Edit
Gets or sets the character code that identifies the icon glyph.

public : Platform::String Glyph { get; set; }


winrt::hstring Glyph();

void Glyph(winrt::hstring glyph);


public string Glyph { get; set; }

<FontIcon Glyph="characterCode"/>

Returns
string
The hexadecimal character code for the icon glyph.
FontIcon.GlyphProperty FontIcon.GlyphProperty Font
Icon.GlyphProperty
I n this Article
Edit
Gets the identifier for the Glyph dependency property.
public : static DependencyProperty GlyphProperty { get; }
static DependencyProperty GlyphProperty();
public static DependencyProperty GlyphProperty { get; }

Returns
DependencyProperty
The identifier for the Glyph dependency property.
FontIcon.IsTextScaleFactorEnabled FontIcon.IsTextScale
FactorEnabled FontIcon.IsTextScaleFactorEnabled
I n this Article
Edit
Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.
public : Platform::Boolean IsTextScaleFactorEnabled { get; set; }
bool IsTextScaleFactorEnabled();

void IsTextScaleFactorEnabled(bool istextscalefactorenabled);


public bool IsTextScaleFactorEnabled { get; set; }

<FontIcon IsTextScaleFactorEnabled="bool"/>

Returns
bool
true if automatic text enlargement is enabled; otherwise, false.
See Accessible text requirements
Also
FontIcon.IsTextScaleFactorEnabledProperty FontIcon.Is
TextScaleFactorEnabledProperty FontIcon.IsTextScale
FactorEnabledProperty
I n this Article
Edit
Identifies the IsTextScaleFactorEnabled dependency property.
public : static DependencyProperty IsTextScaleFactorEnabledProperty { get; }
static DependencyProperty IsTextScaleFactorEnabledProperty();
public static DependencyProperty IsTextScaleFactorEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextScaleFactorEnabled dependency property.
FontIcon.MirroredWhenRightToLeft FontIcon.Mirrored
WhenRightToLeft FontIcon.MirroredWhenRightToLeft
I n this Article
Edit
Gets or sets a value that indicates whether the icon is mirrored when the FlowDirection is RightToLeft.
public : Platform::Boolean MirroredWhenRightToLeft { get; set; }
bool MirroredWhenRightToLeft();

void MirroredWhenRightToLeft(bool mirroredwhenrighttoleft);


public bool MirroredWhenRightToLeft { get; set; }

Returns
bool
true if the icon is mirrored when the FlowDirection is FlowDirection.RightToLeft; otherwise, false. The default is false.

Remarks
You can set the MirroredWhenRightToLeft property to have the glyph appear mirrored when the FlowDirection is
RightToLeft. You typically use this property when a FontIcon is used to display an icon as part of a control template and
the icon needs to be mirrored along with the rest of the control.
See FlowDirection
Also How to support bidirectional UI
How to adjust layout and fonts for various languages, and support RTL layouts
FontIcon.MirroredWhenRightToLeftProperty FontIcon.
MirroredWhenRightToLeftProperty FontIcon.Mirrored
WhenRightToLeftProperty
I n this Article
Edit
Identifies the MirroredWhenRightToLeft dependency property.
public : static DependencyProperty MirroredWhenRightToLeftProperty { get; }
static DependencyProperty MirroredWhenRightToLeftProperty();
public static DependencyProperty MirroredWhenRightToLeftProperty { get; }

Returns
DependencyProperty
The identifier for the MirroredWhenRightToLeft dependency property.
See Dependency properties overview
Also
FontIconSource FontIconSource FontIconSource Class
Represents an icon source that uses a glyph from the specified font.

D eclaration
public : class FontIconSource : IconSource, IFontIconSource
struct winrt::Windows::UI::Xaml::Controls::FontIconSource : IconSource, IFontIconSource
public class FontIconSource : IconSource, IFontIconSource

I nheritance H ierarchy
DependencyObject
IconSource

Constructors
FontIconSource()
FontIconSource()
FontIconSource()

Initializes a new instance of the FontIconSource class.

Properties
FontFamily
FontFamily
FontFamily

Gets or sets the font used to display the icon glyph.

FontFamilyProperty
FontFamilyProperty
FontFamilyProperty

Gets the identifier for the FontFamily dependency property.

FontSize
FontSize
FontSize

Gets or sets the size of the icon glyph.

FontSizeProperty
FontSizeProperty
FontSizeProperty

Gets the identifier for the FontSize dependency property.


FontStyle
FontStyle
FontStyle

Gets or sets the font style for the icon glyph.

FontStyleProperty
FontStyleProperty
FontStyleProperty

Gets the identifier for the FontStyle dependency property.

FontWeight
FontWeight
FontWeight

Gets or sets the thickness of the icon glyph.

FontWeightProperty
FontWeightProperty
FontWeightProperty

Gets the identifier for the FontWeight dependency property.

Glyph
Glyph
Glyph

Gets or sets the character code that identifies the icon glyph.

GlyphProperty
GlyphProperty
GlyphProperty

Gets the identifier for the Glyph dependency property.

IsTextScaleFactorEnabled
IsTextScaleFactorEnabled
IsTextScaleFactorEnabled

Gets or sets a value that indicates whether automatic text enlargement, to reflect the system text size setting, is
enabled.

IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty

Gets the identifier for the IsTextScaleFactorEnabled dependency property.

MirroredWhenRightToLeft
MirroredWhenRightToLeft
MirroredWhenRightToLeft

Gets or sets a value that indicates whether the icon is mirrored when its containing element's FlowDirection is
RightToLeft.

MirroredWhenRightToLeftProperty
MirroredWhenRightToLeftProperty
MirroredWhenRightToLeftProperty

Gets the identifier for the MirroredWhenRightToLeft dependency property.


FontIconSource.FontFamily FontIconSource.FontFamily
FontIconSource.FontFamily
I n this Article
Edit
Gets or sets the font used to display the icon glyph.
public : FontFamily FontFamily { get; set; }
FontFamily FontFamily();

void FontFamily(FontFamily fontfamily);


public FontFamily FontFamily { get; set; }

<FontIconSource FontFamily="fontFamilyValue"/>

Returns
FontFamily
The font used to display the icon glyph.
FontIconSource.FontFamilyProperty FontIconSource.Font
FamilyProperty FontIconSource.FontFamilyProperty
I n this Article
Edit
Gets the identifier for the FontFamily dependency property.
public : static DependencyProperty FontFamilyProperty { get; }
static DependencyProperty FontFamilyProperty();
public static DependencyProperty FontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the FontFamily dependency property.
FontIconSource FontIconSource FontIconSource
I n this Article
Edit
Initializes a new instance of the FontIconSource class.

public : FontIconSource()
FontIconSource() const;
public FontIconSource()
FontIconSource.FontSize FontIconSource.FontSize Font
IconSource.FontSize
I n this Article
Edit
Gets or sets the size of the icon glyph.
public : double FontSize { get; set; }
double FontSize();

void FontSize(double fontsize);


public double FontSize { get; set; }

<FontIconSource FontSize="double" .../>

Returns
double
A non-negative value that specifies the font size, measured in pixels.

Remarks
The unit measure for FontSize is pixels, measuring the line height of the characters in the font. The apparent size of text
in the UI can vary based on the current scaling. If you want to use different FontSize values for different scalings, you
can do this using the resources system.
FontIconSource.FontSizeProperty FontIconSource.Font
SizeProperty FontIconSource.FontSizeProperty
I n this Article
Edit
Gets the identifier for the FontSize dependency property.
public : static DependencyProperty FontSizeProperty { get; }
static DependencyProperty FontSizeProperty();
public static DependencyProperty FontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the FontSize dependency property.
FontIconSource.FontStyle FontIconSource.FontStyle Font
IconSource.FontStyle
I n this Article
Edit
Gets or sets the font style for the icon glyph.
public : FontStyle FontStyle { get; set; }
FontStyle FontStyle();

void FontStyle(FontStyle fontstyle);


public FontStyle FontStyle { get; set; }

<FontIconSource FontStyle="fontStyleMemberName"/>

Returns
FontStyle
A named constant of the enumeration that specifies the style in which the icon glyph is rendered. The default is
Normal.
FontIconSource.FontStyleProperty FontIconSource.Font
StyleProperty FontIconSource.FontStyleProperty
I n this Article
Edit
Gets the identifier for the FontStyle dependency property.
public : static DependencyProperty FontStyleProperty { get; }
static DependencyProperty FontStyleProperty();
public static DependencyProperty FontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the FontStyle dependency property.
FontIconSource.FontWeight FontIconSource.FontWeight
FontIconSource.FontWeight
I n this Article
Edit
Gets or sets the thickness of the icon glyph.
public : FontWeight FontWeight { get; set; }
FontWeight FontWeight();

void FontWeight(FontWeight fontweight);


public FontWeight FontWeight { get; set; }

<FontIconSource FontWeight="fontWeightsValue"/>

Returns
FontWeight
A value that specifies the thickness of the icon glyph. The default is Normal.
FontIconSource.FontWeightProperty FontIconSource.
FontWeightProperty FontIconSource.FontWeight
Property
I n this Article
Edit
Gets the identifier for the FontWeight dependency property.
public : static DependencyProperty FontWeightProperty { get; }
static DependencyProperty FontWeightProperty();
public static DependencyProperty FontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the FontWeight dependency property.
FontIconSource.Glyph FontIconSource.Glyph FontIcon
Source.Glyph
I n this Article
Edit
Gets or sets the character code that identifies the icon glyph.
public : Platform::String Glyph { get; set; }
winrt::hstring Glyph();

void Glyph(winrt::hstring glyph);


public string Glyph { get; set; }

<FontIconSource Glyph="characterCode"/>

Returns
string
The hexadecimal character code for the icon glyph.
FontIconSource.GlyphProperty FontIconSource.Glyph
Property FontIconSource.GlyphProperty
I n this Article
Edit
Gets the identifier for the Glyph dependency property.
public : static DependencyProperty GlyphProperty { get; }
static DependencyProperty GlyphProperty();
public static DependencyProperty GlyphProperty { get; }

Returns
DependencyProperty
The identifier for the Glyph dependency property.
FontIconSource.IsTextScaleFactorEnabled FontIcon
Source.IsTextScaleFactorEnabled FontIconSource.IsText
ScaleFactorEnabled
I n this Article
Edit
Gets or sets a value that indicates whether automatic text enlargement, to reflect the system text size setting, is enabled.
public : Platform::Boolean IsTextScaleFactorEnabled { get; set; }
bool IsTextScaleFactorEnabled();

void IsTextScaleFactorEnabled(bool istextscalefactorenabled);


public bool IsTextScaleFactorEnabled { get; set; }

<FontIconSource IsTextScaleFactorEnabled="bool"/>

Returns
bool
true if automatic text enlargement is enabled; otherwise, false.
FontIconSource.IsTextScaleFactorEnabledProperty Font
IconSource.IsTextScaleFactorEnabledProperty FontIcon
Source.IsTextScaleFactorEnabledProperty
I n this Article
Edit
Gets the identifier for the IsTextScaleFactorEnabled dependency property.
public : static DependencyProperty IsTextScaleFactorEnabledProperty { get; }
static DependencyProperty IsTextScaleFactorEnabledProperty();
public static DependencyProperty IsTextScaleFactorEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextScaleFactorEnabled dependency property.
FontIconSource.MirroredWhenRightToLeft FontIcon
Source.MirroredWhenRightToLeft FontIconSource.
MirroredWhenRightToLeft
I n this Article
Edit
Gets or sets a value that indicates whether the icon is mirrored when its containing element's FlowDirection is
RightToLeft.
public : Platform::Boolean MirroredWhenRightToLeft { get; set; }
bool MirroredWhenRightToLeft();

void MirroredWhenRightToLeft(bool mirroredwhenrighttoleft);


public bool MirroredWhenRightToLeft { get; set; }

<FontIconSource MirroredWhenRightToLeft="bool"/>

Returns
bool
true if the icon is mirrored when the FlowDirection is FlowDirection.RightToLeft; otherwise, false. The default is false.

Remarks
You can set the MirroredWhenRightToLeft property to have the glyph appear mirrored when its containing element's
FlowDirection is RightToLeft. You typically use this property when a FontIcon is used to display an icon as part of a
control template and the icon needs to be mirrored along with the rest of the control.
FontIconSource.MirroredWhenRightToLeftProperty Font
IconSource.MirroredWhenRightToLeftProperty FontIcon
Source.MirroredWhenRightToLeftProperty
I n this Article
Edit
Gets the identifier for the MirroredWhenRightToLeft dependency property.
public : static DependencyProperty MirroredWhenRightToLeftProperty { get; }
static DependencyProperty MirroredWhenRightToLeftProperty();
public static DependencyProperty MirroredWhenRightToLeftProperty { get; }

Returns
DependencyProperty
The identifier for the MirroredWhenRightToLeft dependency property.
Frame Frame Frame Class
Displays Page instances, supports navigation to new pages, and maintains a navigation history to support forward and
backward navigation.

D eclaration
public : class Frame : ContentControl, IFrame, IFrame2, IFrame3, IFrame4, IFrame5, INavigate
struct winrt::Windows::UI::Xaml::Controls::Frame : ContentControl, IFrame, IFrame2, IFrame3,
IFrame4, IFrame5, INavigate
public class Frame : ContentControl, IFrame, IFrame2, IFrame3, IFrame4, IFrame5, INavigate

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
You use the Frame control to support navigation to Page instances. You create as many different page types as needed
to present the content in your app, and then navigate to those pages by calling the Navigate method and passing in the
type of the page to navigate to. You can also pass in a parameter object to initialize the page to a particular state.
The frame maintains a history of pages it has navigated to. You can get the type of the current page through the
CurrentSourcePageType property, and navigate forward or backward with the GoBack and GoForward methods. The
CanGoBack and CanGoForward properties indicate whether a page is available in the desired direction. One common
practice is to bind the IsEnabled properties of navigation buttons to CanGoBack and CanGoForward so that users can't
navigate to a page that doesn't exist.
You can handle the Navigating, Navigated, NavigationStopped, and NavigationFailed events to perform high-level
tasks such as starting and stopping a "navigation in progress" animation or displaying an error message. For page-
level tasks, override the page OnNavigatedTo, OnNavigatingFrom, and OnNavigatedFrom methods. This is useful to
perform tasks such as initializing and saving the page state.
By default, each navigation creates a new instance of the specific Page subclass requested, and disposes the previous
page instance. This happens even when navigating back to a previously visited page or when the new page type is the
same as the previous page type. Apps that involve frequent navigation to the same pages can cache and reuse the page
instances to make navigation more efficient. To do this, set the CacheSize property to specify how many pages to
cache. For each page type that you want to cache, you must also set the Page.NavigationCacheMode property to either
Enabled or Required. Pages with a Required cache mode are cached regardless of the CacheSize value, and do not
count against the CacheSize total.
I Navigate
The INavigate interface is mainly infrastructure. It's not expected that typical app will implement this interface.

Constructors
Frame()
Frame()
Frame()
Initializes a new instance of the Frame class.

Properties
BackStack
BackStack
BackStack

Gets a collection of PageStackEntry instances representing the backward navigation history of the Frame.

BackStackDepth
BackStackDepth
BackStackDepth

Gets the number of entries in the navigation back stack.

BackStackDepthProperty
BackStackDepthProperty
BackStackDepthProperty

Identifies the BackStackDepth dependency property.

BackStackProperty
BackStackProperty
BackStackProperty

Identifies the BackStack dependency property.

CacheSize
CacheSize
CacheSize

Gets or sets the number of pages in the navigation history that can be cached for the frame.

CacheSizeProperty
CacheSizeProperty
CacheSizeProperty

Identifies the CacheSize dependency property.

CanGoBack
CanGoBack
CanGoBack

Gets a value that indicates whether there is at least one entry in back navigation history.
CanGoBackProperty
CanGoBackProperty
CanGoBackProperty

Identifies the CanGoBack dependency property.

CanGoForward
CanGoForward
CanGoForward

Gets a value that indicates whether there is at least one entry in forward navigation history.

CanGoForwardProperty
CanGoForwardProperty
CanGoForwardProperty

Identifies the CanGoForward dependency property.

CurrentSourcePageType
CurrentSourcePageType
CurrentSourcePageType

Gets a type reference for the content that is currently displayed.

CurrentSourcePageTypeProperty
CurrentSourcePageTypeProperty
CurrentSourcePageTypeProperty

Identifies the CurrentSourcePageType dependency property.

ForwardStack
ForwardStack
ForwardStack

Gets a collection of PageStackEntry instances representing the forward navigation history of the Frame.

ForwardStackProperty
ForwardStackProperty
ForwardStackProperty

Identifies the ForwardStack dependency property.

IsNavigationStackEnabled
IsNavigationStackEnabled
IsNavigationStackEnabled
Gets or sets a value that indicates whether navigation is recorded in the Frame's ForwardStack or BackStack.

IsNavigationStackEnabledProperty
IsNavigationStackEnabledProperty
IsNavigationStackEnabledProperty

Identifies the IsNavigationStackEnabled dependency property.

SourcePageType
SourcePageType
SourcePageType

Gets or sets a type reference of the current content, or the content that should be navigated to.

SourcePageTypeProperty
SourcePageTypeProperty
SourcePageTypeProperty

Identifies the SourcePageType dependency property.

Methods
GetNavigationState()
GetNavigationState()
GetNavigationState()

Serializes the Frame navigation history into a string.

GoBack()
GoBack()
GoBack()

Navigates to the most recent item in back navigation history, if a Frame manages its own navigation history.

GoBack(NavigationTransitionInfo)
GoBack(NavigationTransitionInfo)
GoBack(NavigationTransitionInfo)

Navigates to the most recent item in back navigation history, if a Frame manages its own navigation history, and
specifies the animated transition to use.

GoForward()
GoForward()
GoForward()

Navigates to the most recent item in forward navigation history, if a Frame manages its own navigation history.
Navigate(TypeName)
Navigate(TypeName)
Navigate(TypeName)

Causes the Frame to load content represented by the specified Page.

Navigate(TypeName, Object)
Navigate(TypeName, Object)
Navigate(TypeName, Object)

Causes the Frame to load content represented by the specified Page, also passing a parameter to be interpreted by
the target of the navigation.

Navigate(TypeName, Object, NavigationTransitionInfo)


Navigate(TypeName, Object, NavigationTransitionInfo)
Navigate(TypeName, Object, NavigationTransitionInfo)

Causes the Frame to load content represented by the specified Page -derived data type, also passing a parameter
to be interpreted by the target of the navigation, and a value indicating the animated transition to use.

NavigateToType(TypeName, Object, FrameNavigationOptions)


NavigateToType(TypeName, Object, FrameNavigationOptions)
NavigateToType(TypeName, Object, FrameNavigationOptions)

Causes the Frame to load content represented by the specified Page, also passing a parameter to be interpreted by
the target of the navigation.

SetNavigationState(String)
SetNavigationState(String)
SetNavigationState(String)

Reads and restores the navigation history of a Frame from a provided serialization string.

SetNavigationState(String, Boolean)
SetNavigationState(String, Boolean)
SetNavigationState(String, Boolean)

Reads and restores the navigation history of a Frame from a provided serialization string.

Events
Navigated
Navigated
Navigated

Occurs when the content that is being navigated to has been found and is available from the Content property,
although it may not have completed loading.
Navigating
Navigating
Navigating

Occurs when a new navigation is requested.

NavigationFailed
NavigationFailed
NavigationFailed

Occurs when an error is raised while navigating to the requested content.

NavigationStopped
NavigationStopped
NavigationStopped

Occurs when
a new navigation is requested while a current navigation is in progress.

See Also
ContentControl
ContentControl
ContentControl
Frame.BackStack Frame.BackStack Frame.BackStack
I n this Article
Edit
Gets a collection of PageStackEntry instances representing the backward navigation history of the Frame.

public : IVector<PageStackEntry> BackStack { get; }


IVector<PageStackEntry> BackStack();
public IList<PageStackEntry> BackStack { get; }

Returns
IList<PageStackEntry>
The backward navigation stack.
Frame.BackStackDepth Frame.BackStackDepth Frame.
BackStackDepth
I n this Article
Edit
Gets the number of entries in the navigation back stack.
public : int BackStackDepth { get; }
int32_t BackStackDepth();
public int BackStackDepth { get; }

Returns
int
The number of entries in the navigation back stack.
Frame.BackStackDepthProperty Frame.BackStackDepth
Property Frame.BackStackDepthProperty
I n this Article
Edit
Identifies the BackStackDepth dependency property.
public : static DependencyProperty BackStackDepthProperty { get; }
static DependencyProperty BackStackDepthProperty();
public static DependencyProperty BackStackDepthProperty { get; }

Returns
DependencyProperty
The identifier for the BackStackDepth dependency property.
Frame.BackStackProperty Frame.BackStackProperty
Frame.BackStackProperty
I n this Article
Edit
Identifies the BackStack dependency property.
public : static DependencyProperty BackStackProperty { get; }
static DependencyProperty BackStackProperty();
public static DependencyProperty BackStackProperty { get; }

Returns
DependencyProperty
The identifier for the BackStack dependency property.
Frame.CacheSize Frame.CacheSize Frame.CacheSize
I n this Article
Edit
Gets or sets the number of pages in the navigation history that can be cached for the frame.

public : int CacheSize { get; set; }


int32_t CacheSize();

void CacheSize(int32_t cachesize);


public int CacheSize { get; set; }

<Frame CacheSize="int" />

Returns
int
The number of pages that can be in the navigation history.
Frame.CacheSizeProperty Frame.CacheSizeProperty
Frame.CacheSizeProperty
I n this Article
Edit
Identifies the CacheSize dependency property.
public : static DependencyProperty CacheSizeProperty { get; }
static DependencyProperty CacheSizeProperty();
public static DependencyProperty CacheSizeProperty { get; }

Returns
DependencyProperty
The identifier for the CacheSize dependency property.
Frame.CanGoBack Frame.CanGoBack Frame.CanGoBack
I n this Article
Edit
Gets a value that indicates whether there is at least one entry in back navigation history.

public : Platform::Boolean CanGoBack { get; }


bool CanGoBack();
public bool CanGoBack { get; }

Returns
bool
true if there is at least one entry in back navigation history; false if there are no entries in back navigation history or
the Frame does not own its own navigation history.
Frame.CanGoBackProperty Frame.CanGoBackProperty
Frame.CanGoBackProperty
I n this Article
Edit
Identifies the CanGoBack dependency property.
public : static DependencyProperty CanGoBackProperty { get; }
static DependencyProperty CanGoBackProperty();
public static DependencyProperty CanGoBackProperty { get; }

Returns
DependencyProperty
The identifier for the CanGoBack dependency property.
Frame.CanGoForward Frame.CanGoForward Frame.Can
GoForward
I n this Article
Edit
Gets a value that indicates whether there is at least one entry in forward navigation history.
public : Platform::Boolean CanGoForward { get; }
bool CanGoForward();
public bool CanGoForward { get; }

Returns
bool
true if there is at least one entry in forward navigation history; false if there are no entries in forward navigation
history or the Frame does not own its own navigation history.
Frame.CanGoForwardProperty Frame.CanGoForward
Property Frame.CanGoForwardProperty
I n this Article
Edit
Identifies the CanGoForward dependency property.
public : static DependencyProperty CanGoForwardProperty { get; }
static DependencyProperty CanGoForwardProperty();
public static DependencyProperty CanGoForwardProperty { get; }

Returns
DependencyProperty
The identifier for the CanGoForward dependency property.
Frame.CurrentSourcePageType Frame.CurrentSource
PageType Frame.CurrentSourcePageType
I n this Article
Edit
Gets a type reference for the content that is currently displayed.
public : TypeName CurrentSourcePageType { get; }
TypeName CurrentSourcePageType();
public Type CurrentSourcePageType { get; }

Returns
Type
A type reference for the content that is currently displayed.

Remarks
CurrentSourcePageType and SourcePageType are normally the same value. However, if the frame calls Navigate and
the navigation is still in progress, the CurrentSourcePageType is the value before the navigation and the
SourcePageType is the value being navigated to.
 Tip

If you are programming using a Microsoft .NET language (C# or Microsoft Visual Basic), the TypeName type projects
as System.Type. When programming using C#, it is common to use the typeof operator to get references to the
System.Type of a type. In Microsoft Visual Basic, use GetType.
See NavigatingNavigatingNavigating
Also XAML Navigation sample
Frame.CurrentSourcePageTypeProperty Frame.Current
SourcePageTypeProperty Frame.CurrentSourcePageType
Property
I n this Article
Edit
Identifies the CurrentSourcePageType dependency property.
public : static DependencyProperty CurrentSourcePageTypeProperty { get; }
static DependencyProperty CurrentSourcePageTypeProperty();
public static DependencyProperty CurrentSourcePageTypeProperty { get; }

Returns
DependencyProperty
The identifier for the CurrentSourcePageType dependency property.
Frame.ForwardStack Frame.ForwardStack Frame.
ForwardStack
I n this Article
Edit
Gets a collection of PageStackEntry instances representing the forward navigation history of the Frame.
public : IVector<PageStackEntry> ForwardStack { get; }
IVector<PageStackEntry> ForwardStack();
public IList<PageStackEntry> ForwardStack { get; }

Returns
IList<PageStackEntry>
The forward navigation stack.
Frame.ForwardStackProperty Frame.ForwardStack
Property Frame.ForwardStackProperty
I n this Article
Edit
Identifies the ForwardStack dependency property.
public : static DependencyProperty ForwardStackProperty { get; }
static DependencyProperty ForwardStackProperty();
public static DependencyProperty ForwardStackProperty { get; }

Returns
DependencyProperty
The identifier for the ForwardStack dependency property.
Frame Frame Frame
I n this Article
Edit
Initializes a new instance of the Frame class.

public : Frame()
Frame() const;
public Frame()
Frame.GetNavigationState Frame.GetNavigationState
Frame.GetNavigationState
I n this Article
Edit
Serializes the Frame navigation history into a string.
public : Platform::String GetNavigationState()
winrt::hstring GetNavigationState() const;
public string GetNavigationState()

Returns
string
The string-form serialized navigation history. See Remarks.

Remarks
This method is useful to restore the navigation state of your app after it has been suspended and resumed. When your
app is suspended, call GetNavigationState and save the return value. When your app is resumed, call
SetNavigationState and pass it the saved value.
Calling this method will call Page.OnNavigatedFrom for the current page using NavigationMode.Forward.
GetNavigationState is usually called when the application is being suspended, so the current page is navigated away
from.
Note

The serialization format used by these methods is for internal use only. Your app should not form any dependencies on
it. Additionally, this format supports serialization only for basic types like string, char, numeric and GUID types.
See SetNavigationState
Also
Frame.GoBack Frame.GoBack Frame.GoBack
I n this Article

Overloads
GoBack() GoBack() GoBack()
Navigates to the most recent item in back navigation history,
if a Frame manages its own navigation history.

GoBack(NavigationTransitionInfo) GoBack(NavigationTransition
Info) GoBack(NavigationTransitionInfo) Navigates to the most recent item in back navigation history,
if a Frame manages its own navigation history, and specifies
the animated transition to use.

GoBack() GoBack() GoBack()


Edit
Navigates to the most recent item in back navigation history, if a Frame manages its own navigation history.

public : void GoBack()


void GoBack() const;
public void GoBack()

See GoBack(NavigationTransitionInfo)GoBack(NavigationTransitionInfo)GoBack(NavigationTransitionInfo)
Also

GoBack(NavigationTransitionInfo)
GoBack(NavigationTransitionInfo)
GoBack(NavigationTransitionInfo)
Edit
Navigates to the most recent item in back navigation history, if a Frame manages its own navigation history, and
specifies the animated transition to use.
public : void GoBack(NavigationTransitionInfo transitionInfoOverride)
void GoBack(NavigationTransitionInfo transitionInfoOverride) const;
public void GoBack(NavigationTransitionInfo transitionInfoOverride)

Parameters
transitionInfoOverride NavigationTransitionInfo
Info about the animated transition to use.
See GoBack()GoBack()GoBack()
Also
Frame.GoForward Frame.GoForward Frame.GoForward
I n this Article
Edit
Navigates to the most recent item in forward navigation history, if a Frame manages its own navigation history.

public : void GoForward()


void GoForward() const;
public void GoForward()
Frame.IsNavigationStackEnabled Frame.IsNavigation
StackEnabled Frame.IsNavigationStackEnabled
I n this Article
Edit
Gets or sets a value that indicates whether navigation is recorded in the Frame's ForwardStack or BackStack.
public : Platform::Boolean IsNavigationStackEnabled { get; set; }
bool IsNavigationStackEnabled();

void IsNavigationStackEnabled(bool isnavigationstackenabled);


public bool IsNavigationStackEnabled { get; set; }

Returns
bool
true if navigation is recorded in the Frame's ForwardStack or BackStack; otherwise, false. The default is true.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


Frame.IsNavigationStackEnabledProperty Frame.Is
NavigationStackEnabledProperty Frame.IsNavigation
StackEnabledProperty
I n this Article
Edit
Identifies the IsNavigationStackEnabled dependency property.
public : static DependencyProperty IsNavigationStackEnabledProperty { get; }
static DependencyProperty IsNavigationStackEnabledProperty();
public static DependencyProperty IsNavigationStackEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsNavigationStackEnabled dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


Frame.Navigate Frame.Navigate Frame.Navigate
I n this Article

Overloads
Navigate(TypeName) Navigate(TypeName) Navigate(Type
Name) Causes the Frame to load content represented by the specified
Page.

Navigate(TypeName, Object) Navigate(TypeName, Object)


Navigate(TypeName, Object) Causes the Frame to load content represented by the specified
Page, also passing a parameter to be interpreted by the target
of the navigation.

Navigate(TypeName, Object, NavigationTransitionInfo)


Navigate(TypeName, Object, NavigationTransitionInfo) Causes the Frame to load content represented by the specified
Navigate(TypeName, Object, NavigationTransitionInfo) Page -derived data type, also passing a parameter to be
interpreted by the target of the navigation, and a value
indicating the animated transition to use.

Navigate(TypeName) Navigate(TypeName) Navigate(TypeName)


Edit
Causes the Frame to load content represented by the specified Page.
public : Platform::Boolean Navigate(TypeName sourcePageType)
bool Navigate(TypeName sourcePageType) const;
public bool Navigate(Type sourcePageType)

Parameters
sourcePageType Type
The page to navigate to, specified as a type reference to its partial class type. (A type reference is given as System.Type
for Microsoft .NET, or a TypeName helper struct for Visual C++ component extensions (C++/CX)).
Returns
bool
false if a NavigationFailed event handler has set Handled to true; otherwise, true. See Remarks for more info.
Remarks
You handle the NavigationFailed event to respond to navigation failure. You can handle the failure directly in the event
handler, or you can set the NavigationFailedEventArgs.Handled property to true and use the Navigate method return
value to respond to the failure.
Apps typically use GetNavigationState to serialize the frame’s state when the app suspends. You can do this directly in
your app code or indirectly by using the SuspensionManager class generated by the Visual Studio templates. To enable
frame state serialization using GetNavigationState, you must use only basic types for the navigation parameter, such as
string, char, numeric, and GUID types. Otherwise GetNavigationState will throw an exception when the app suspends.
The parameter can have other types if you do not use GetNavigationState.
The parameter value can have a complex type if you do not use GetNavigationState. However, you should still use only
basic types in order to avoid excess memory usage caused by the frame’s navigation stack holding a reference to the
parameter. A preferred approach is to not pass the actual object, but instead pass an identifier that you can use to look
up the object in the target landing page. For example, instead of passing a Customer object, pass a reference to the
CustomerID , then look up the Customer after the navigation is complete.
 Tip

If you are programming using a Microsoft .NET language (C# or Microsoft Visual Basic), the TypeName type projects
as System.Type. When programming using C#, it is common to use the typeof operator to get references to the
System.Type of a type. In Microsoft Visual Basic, use GetType. If you're using Visual C++ component extensions
(C++/CX), where you'll need to create a TypeName helper struct, you can use the typeid component extension.

See Navigate(TypeName, Object)Navigate(TypeName, Object)Navigate(TypeName, Object)


Also NavigationFailedNavigationFailedNavigationFailed
Navigation
XAML Navigation sample

Navigate(TypeName, Object) Navigate(TypeName, Object)


Navigate(TypeName, Object)
Edit
Causes the Frame to load content represented by the specified Page, also passing a parameter to be interpreted by the
target of the navigation.
public : Platform::Boolean Navigate(TypeName sourcePageType, Platform::Object parameter)
bool Navigate(TypeName sourcePageType, winrt::Windows::Foundation::IInspectable parameter) const;
public bool Navigate(Type sourcePageType, Object parameter)

Parameters
sourcePageType Type
The page to navigate to, specified as a type reference to its partial class type. (A type reference is given as System.Type
for Microsoft .NET, or a TypeName helper struct for Visual C++ component extensions (C++/CX)).
parameter Object
The navigation parameter to pass to the target page; must have a basic type (string, char, numeric, or GUID ) to support
parameter serialization using GetNavigationState.
Returns
bool
false if a NavigationFailed event handler has set Handled to true; otherwise, true. See Remarks for more info.
See Navigate(TypeName)Navigate(TypeName)Navigate(TypeName)
Also Navigation
XAML Navigation sample

Navigate(TypeName, Object, NavigationTransitionInfo)


Navigate(TypeName, Object, NavigationTransitionInfo)
Navigate(TypeName, Object, NavigationTransitionInfo)
Edit
Causes the Frame to load content represented by the specified Page -derived data type, also passing a parameter to be
interpreted by the target of the navigation, and a value indicating the animated transition to use.
public : Platform::Boolean Navigate(TypeName sourcePageType, Platform::Object parameter,
NavigationTransitionInfo infoOverride)
bool Navigate(TypeName sourcePageType, winrt::Windows::Foundation::IInspectable parameter,
NavigationTransitionInfo infoOverride) const;
public bool Navigate(Type sourcePageType, Object parameter, NavigationTransitionInfo infoOverride)

Parameters
sourcePageType Type
The page to navigate to, specified as a type reference to its partial class type. (A type reference is given as System.Type
for Microsoft .NET, or a TypeName helper struct for Visual C++ component extensions (C++/CX)).
parameter Object
The navigation parameter to pass to the target page; must have a basic type (string, char, numeric, or GUID ) to support
parameter serialization using GetNavigationState.
infoOverride NavigationTransitionInfo
Info about the animated transition.
Returns
bool
false if a NavigationFailed event handler has set Handled to true; otherwise, true. See Remarks for more info.
Examples
<Frame x:Name="myFrame">
<Frame.ContentTransitions>
<TransitionCollection>
<NavigationThemeTransition />
</TransitionCollection>
</Frame.ContentTransitions>
</Frame>

// Play the default animation


myFrame.Navigate(typeof(Page2), null);

// Explicitly play the page refresh animation


myFrame.Navigate(typeof(Page2), null, new EntranceNavigationTransitionInfo());

// Play the drill in animation


myFrame.Navigate(typeof(Page2), null, new DrillInNavigationTransitionInfo());

// Suppress the default animation


myFrame.Navigate(typeof(Page2), null, new SuppressNavigationTransitionInfo());

See Navigate(TypeName, Object)Navigate(TypeName, Object)Navigate(TypeName, Object)


Also Navigate(TypeName)Navigate(TypeName)Navigate(TypeName)
Navigation
XAML Navigation sample
Frame.Navigated Frame.Navigated Frame.Navigated
I n this Article
Edit
Occurs when the content that is being navigated to has been found and is available from the Content property,
although it may not have completed loading.
public : event NavigatedEventHandler Navigated
// Register
event_token Navigated(NavigatedEventHandler const& handler) const;

// Revoke with event_token


void Navigated(event_token const& cookie) const;

// Revoke with event_revoker


Navigated_revoker Navigated(auto_revoke_t, NavigatedEventHandler const& handler) const;
public event NavigatedEventHandler Navigated

<Frame Navigated="eventhandler" />


Frame.NavigateToType Frame.NavigateToType Frame.
NavigateToType
I n this Article
Edit
Causes the Frame to load content represented by the specified Page, also passing a parameter to be interpreted by the
target of the navigation.
public : Platform::Boolean NavigateToType(TypeName sourcePageType, Platform::Object parameter,
FrameNavigationOptions navigationOptions)
bool NavigateToType(TypeName sourcePageType, winrt::Windows::Foundation::IInspectable parameter,
FrameNavigationOptions navigationOptions) const;
public bool NavigateToType(Type sourcePageType, Object parameter, FrameNavigationOptions
navigationOptions)

Parameters
sourcePageType Type
The page to navigate to, specified as a type reference to its partial class type. (A type reference is given as System.Type
for Microsoft .NET, or a TypeName helper struct for Visual C++ component extensions (C++/CX)).
parameter Object
The navigation parameter to pass to the target page; must have a basic type (string, char, numeric, or GUID ) to support
parameter serialization using GetNavigationState.
navigationOptions FrameNavigationOptions
Options for the navigation, including whether it is recorded in the navigation stack and what transition animation is
used.
Returns
bool
false if a NavigationFailed event handler has set Handled to true; otherwise, true.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


Frame.Navigating Frame.Navigating Frame.Navigating
I n this Article
Edit
Occurs when a new navigation is requested.

public : event NavigatingCancelEventHandler Navigating


// Register
event_token Navigating(NavigatingCancelEventHandler const& handler) const;

// Revoke with event_token


void Navigating(event_token const& cookie) const;

// Revoke with event_revoker


Navigating_revoker Navigating(auto_revoke_t, NavigatingCancelEventHandler const& handler) const;
public event NavigatingCancelEventHandler Navigating

<Frame Navigating="eventhandler" />


Frame.NavigationFailed Frame.NavigationFailed Frame.
NavigationFailed
I n this Article
Edit
Occurs when an error is raised while navigating to the requested content.
public : event NavigationFailedEventHandler NavigationFailed
// Register
event_token NavigationFailed(NavigationFailedEventHandler const& handler) const;

// Revoke with event_token


void NavigationFailed(event_token const& cookie) const;

// Revoke with event_revoker


NavigationFailed_revoker NavigationFailed(auto_revoke_t, NavigationFailedEventHandler const&
handler) const;
public event NavigationFailedEventHandler NavigationFailed

<Frame NavigationFailed="eventhandler" />

Remarks
Currently, you must handle NavigationFailed to respond when the Navigate method fails. You can handle the failure
directly in the event handler, or you can set the NavigationFailedEventArgs.Handled property to true and use the
Navigate method return value to respond to the failure.
Frame.NavigationStopped Frame.NavigationStopped
Frame.NavigationStopped
I n this Article
Edit
Occurs when
a new navigation is requested while a current navigation is in progress.
public : event NavigationStoppedEventHandler NavigationStopped
// Register
event_token NavigationStopped(NavigationStoppedEventHandler const& handler) const;

// Revoke with event_token


void NavigationStopped(event_token const& cookie) const;

// Revoke with event_revoker


NavigationStopped_revoker NavigationStopped(auto_revoke_t, NavigationStoppedEventHandler const&
handler) const;
public event NavigationStoppedEventHandler NavigationStopped

<Frame NavigationStopped="eventhandler" />


Frame.SetNavigationState Frame.SetNavigationState
Frame.SetNavigationState
I n this Article

Overloads
SetNavigationState(String) SetNavigationState(String) Set
NavigationState(String) Reads and restores the navigation history of a Frame from a
provided serialization string.

SetNavigationState(String, Boolean) SetNavigationState(String,


Boolean) SetNavigationState(String, Boolean) Reads and restores the navigation history of a Frame from a
provided serialization string.

SetNavigationState(String) SetNavigationState(String)
SetNavigationState(String)
Edit
Reads and restores the navigation history of a Frame from a provided serialization string.
public : void SetNavigationState(Platform::String navigationState)
void SetNavigationState(winrt::hstring navigationState) const;
public void SetNavigationState(String navigationState)

Parameters
navigationState String
The serialization string that supplies the restore point for navigation history.
Attributes OverloadAttribute
Remarks
This method is useful to restore the navigation state of your app after it has been suspended and resumed. When your
app is suspended, call GetNavigationState and save the return value. When your app is resumed, call
SetNavigationState and pass it the saved value.
Calling SetNavigationState will call Page.OnNavigatedTo for the current page, with NavigationMode.Back.
SetNavigationState is usually called when the application is being resumed, so the current page is navigated to.

SetNavigationState(String, Boolean) SetNavigationState(String,


Boolean) SetNavigationState(String, Boolean)
Edit
Reads and restores the navigation history of a Frame from a provided serialization string.
public : void SetNavigationState(Platform::String navigationState, bool suppressNavigate)
void SetNavigationState(winrt::hstring navigationState, bool suppressNavigate) const;
public void SetNavigationState(String navigationState, Boolean suppressNavigate)
Parameters
navigationState String
The serialization string that supplies the restore point for navigation history.
suppressNavigate Boolean
true to restore navigation history without navigating to the current page; otherwise, false.
Attributes OverloadAttribute
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Remarks
If you call SetNavigationState with the suppressNavigate parameter set to true, Page.OnNavigatedTo is not called
for the current page. The current page is also put into the BackStack. When suppressing the transition, also be sure to
use GoBack or GoForward to navigate to the correct page in the navigation history. NavigateTo is also supported,
however the forward stack will be cleared when it is used.
Frame.SourcePageType Frame.SourcePageType Frame.
SourcePageType
I n this Article
Edit
Gets or sets a type reference of the current content, or the content that should be navigated to.
public : TypeName SourcePageType { get; set; }
TypeName SourcePageType();

void SourcePageType(TypeName sourcepagetype);


public Type SourcePageType { get; set; }

Returns
Type
A type reference for the current content, or the content to navigate to.

Remarks
CurrentSourcePageType and SourcePageType are normally the same value. However, if the frame calls Navigate and
the navigation is still in progress, the CurrentSourcePageType is the value before the navigation and the
SourcePageType is the value being navigated to.
 Tip

If you are programming using a Microsoft .NET language (C# or Visual Basic), the TypeName type projects as
System.Type. When programming using C#, it is common to use the typeof operator to get references to the
System.Type of a type. In Visual Basic, use GetType.
SourcePageType can be set in XAML, using string-to-type conversion that's interpreted using XAML namespace
mappings, but that's rarely done. It's a better practice to have code at the app level that tracks activation and whether a
suspended app is resuming, which then uses Frame.Navigate to set the current page. The Microsoft Visual Studio
templates often produce such code for you. For this same reason, it's also rare to set SourcePageType as an alternative
to calling Frame.Navigate, which also specifies a Page by type reference. If you do set a value for SourcePageType in
XAML, you typically need to use a prefix such as "local:" that's defined in the same XAML construct. You need the prefix
to map a XAML namespace that references the code namespace where your page partial class is defined. For more
info, see XAML namespaces and namespace mapping.
A more typical scenario for SourcePageType in code is to only read its value, and not set it. For example you might
compare SourcePageType for the current page in the Frame with items in the navigation stacks (BackStack,
ForwardStack ) to see if there are existing entries for that same Page.
See XAML Navigation sample
Also
Frame.SourcePageTypeProperty Frame.SourcePageType
Property Frame.SourcePageTypeProperty
I n this Article
Edit
Identifies the SourcePageType dependency property.
public : static DependencyProperty SourcePageTypeProperty { get; }
static DependencyProperty SourcePageTypeProperty();
public static DependencyProperty SourcePageTypeProperty { get; }

Returns
DependencyProperty
The identifier for the SourcePageType dependency property.
Grid Grid Grid Class
Defines a flexible grid area that consists of columns and rows. Child elements of the Grid are measured and arranged
according to their row/column assignments (set by using Grid.Row and Grid.Column attached properties) and other
logic.

D eclaration
public : class Grid : Panel, IGrid, IGrid2, IGrid3, IGrid4
struct winrt::Windows::UI::Xaml::Controls::Grid : Panel, IGrid, IGrid2, IGrid3, IGrid4
public class Grid : Panel, IGrid, IGrid2, IGrid3, IGrid4

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel

Remarks
 Tip

For more info, design guidance, and code examples, see Layout panels.
Grid is a layout panel that supports arranging child elements in rows and columns.

 Tip

Starting in Windows 10, Grid defines new border properties that let you draw a border around the Grid without using
an additional Border element. The new properties are Grid.BorderBrush, Grid.BorderThickness, Grid.CornerRadius,
and Grid.Padding.
<Grid BorderBrush="Red" BorderThickness="2" CornerRadius="10" Padding="12">
<TextBlock Text="Hello World!"/>
</Grid>

You typically define layout behavior for a Grid in XAML by providing one or more RowDefinition elements as the value
of Grid.RowDefinitions, and one or more ColumnDefinition elements as the value of Grid.ColumnDefinitions. Then,
you apply the Grid.Row and Grid.Column attached properties to each of the element children of the Grid, to indicate
which row/column combination is used to position that element within the parent Grid.
To set the height of rows and the width of columns, you set RowDefinition.Height for each RowDefinition and
ColumnDefinition.Width for each ColumnDefinition. By default, each row or column divides layout space equally. You
can change this behavior either by providing absolute pixel values, or a Star sizing that divides available space using a
weighted factor. For more info on how to use Star sizing in a Grid, see Define layouts with XAML or GridLength. You
also can use an Auto sizing that sizes to content.
To indicate that an element child should span multiple rows or multiple columns in the Grid, you can apply the
Grid.RowSpan or Grid.ColumnSpan attached properties to child elements of a Grid.
By default, a Grid contains one row and one column.
Setting the Margin property on the child elements in a Grid sets the distance between the element and its grid cell
boundaries. The HorizontalAlignment and VerticalAlignment properties describe how the child element should be
positioned within the grid cell. You can precisely position child elements of a Grid by using a combination of the
Margin property and alignment properties. If you need even more control over the layout of individual child elements,
consider using VariableSizedWrapGrid.
WrapGrid is another similar layout panel that has the benefit of better handling for content that's too wide, which
might be clipped by a regular Grid depending on values of other layout properties.
G rid X A ML attached properties
Grid is the host service class for several XAML attached properties. These attached properties enable child elements to
report how they should be positioned in their Grid parent.
Grid provides these attached properties for XAML usage:
Grid.Column
Grid.ColumnSpan
Grid.Row
Grid.RowSpan
In order to support XAML processor access to the attached properties, and also to expose equivalent get and set
operations to code, each XAML attached property has a pair of Get and Set accessor methods. For example, the
GetColumnSpan and SetColumnSpan methods support and provide the equivalent code-only support for
Grid.ColumnSpan. Alternatively, you can use the dependency property system to get or set the value of the attached
property. Call GetValue or SetValue, passing the arguments of the dependency property identifier to set, and a
reference to the target object on which to get or set the value.
An element in the first column that spans multiple rows can affect the height of each spanned row even if the first row
has enough height to accommodate the element, and subsequent spanned rows would otherwise have a height of 0.
For example, the second row in this Grid has its height set to 0, so the blue rectangle would not typically be visible. In
this case, you might expect that the red ellipse would not affect the second row because the first row is tall enough to
contain the ellipse. However, the Grid calculates the MinHeight of each row to be enough to accommodate the red
ellipse, and then spans the element across the rows. As a result, the second row is given a MinHeight of 50, the red
ellipse is centered in the 150px span, and half of the blue rectangle is visible in the second row.
Note

(This example uses an element that spans columns, but also applies to an element in the first column that spans
multiple rows.)
<Grid Background="Yellow" Width="300">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="0"/>
</Grid.RowDefinitions>
<Ellipse Grid.Row="0" Grid.Column="0" Height="50" Fill="Red" Grid.RowSpan="2"/>
<Rectangle Grid.Row="0" Grid.Column="1" Fill="Green" Height="100"/>
<Rectangle Grid.Row="1" Grid.Column="1" Fill="Blue" Height="100"/>
</Grid>
G rid derived classes
Grid is the parent class for SwapChainPanel and SwapChainBackgroundPanel.

Constructors
Grid()
Grid()
Grid()

Initializes a new instance of the Grid class.

Properties
BackgroundSizing
BackgroundSizing
BackgroundSizing

Gets or sets a value that indicates how far the background extends in relation to this element's border.

BackgroundSizingProperty
BackgroundSizingProperty
BackgroundSizingProperty

Identifies the BackgroundSizing dependency property.

BorderBrush
BorderBrush
BorderBrush

Gets or sets a brush that describes the border fill of the panel.

BorderBrushProperty
BorderBrushProperty
BorderBrushProperty

Identifies the BorderBrush dependency property.

BorderThickness
BorderThickness
BorderThickness

Gets or sets the border thickness of the panel.

BorderThicknessProperty
BorderThicknessProperty
BorderThicknessProperty
Identifies the BorderThickness dependency property.

ColumnDefinitions
ColumnDefinitions
ColumnDefinitions

Gets a list of ColumnDefinition objects defined on this instance of Grid.

ColumnProperty
ColumnProperty
ColumnProperty

Identifies the Grid.Column XAML attached property.

ColumnSpacing
ColumnSpacing
ColumnSpacing

Gets or sets the uniform distance (in pixels) between grid columns.

ColumnSpacingProperty
ColumnSpacingProperty
ColumnSpacingProperty

Identifies the ColumnSpacing dependency property.

ColumnSpanProperty
ColumnSpanProperty
ColumnSpanProperty

Identifies the Grid.ColumnSpan XAML attached property.

CornerRadius
CornerRadius
CornerRadius

Gets or sets the radius for the corners of the panel's border.

CornerRadiusProperty
CornerRadiusProperty
CornerRadiusProperty

Identifies the CornerRadius dependency property.


Padding
Padding
Padding

Gets or sets the distance between the border and its child object.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.

RowDefinitions
RowDefinitions
RowDefinitions

Gets a list of RowDefinition objects defined on this instance of Grid.

RowProperty
RowProperty
RowProperty

Identifies the Grid.Row XAML attached property.

RowSpacing
RowSpacing
RowSpacing

Gets or sets the uniform distance (in pixels) between grid rows.

RowSpacingProperty
RowSpacingProperty
RowSpacingProperty

Identifies the RowSpacing dependency property.

RowSpanProperty
RowSpanProperty
RowSpanProperty

Identifies the Grid.RowSpan XAML attached property.

Methods
GetColumn(FrameworkElement)
GetColumn(FrameworkElement)
GetColumn(FrameworkElement)

Gets the value of the Grid.Column XAML attached property from the specified FrameworkElement.

GetColumnSpan(FrameworkElement)
GetColumnSpan(FrameworkElement)
GetColumnSpan(FrameworkElement)

Gets the value of the Grid.ColumnSpan XAML attached property from the specified FrameworkElement.

GetRow(FrameworkElement)
GetRow(FrameworkElement)
GetRow(FrameworkElement)

Gets the value of the Grid.Row XAML attached property from the specified FrameworkElement.

GetRowSpan(FrameworkElement)
GetRowSpan(FrameworkElement)
GetRowSpan(FrameworkElement)

Gets the value of the Grid.RowSpan XAML attached property from the specified FrameworkElement.

SetColumn(FrameworkElement, Int32)
SetColumn(FrameworkElement, Int32)
SetColumn(FrameworkElement, Int32)

Sets the value of the Grid.Column XAML attached property on the specified FrameworkElement.

SetColumnSpan(FrameworkElement, Int32)
SetColumnSpan(FrameworkElement, Int32)
SetColumnSpan(FrameworkElement, Int32)

Sets the value of the Grid.ColumnSpan XAML attached property on the specified FrameworkElement.

SetRow(FrameworkElement, Int32)
SetRow(FrameworkElement, Int32)
SetRow(FrameworkElement, Int32)

Sets the value of the Grid.Row XAML attached property on the specified FrameworkElement.

SetRowSpan(FrameworkElement, Int32)
SetRowSpan(FrameworkElement, Int32)
SetRowSpan(FrameworkElement, Int32)

Sets the value of the Grid.RowSpan XAML attached property on the specified FrameworkElement.
See Also
Panel
Panel
Panel
Panel
Panel
Panel
Panel
Panel
Grid.BackgroundSizing Grid.BackgroundSizing Grid.
BackgroundSizing
I n this Article
Edit
Gets or sets a value that indicates how far the background extends in relation to this element's border.
public : BackgroundSizing BackgroundSizing { get; set; }
BackgroundSizing BackgroundSizing();

void BackgroundSizing(BackgroundSizing backgroundsizing);


public BackgroundSizing BackgroundSizing { get; set; }

Returns
BackgroundSizing
A value of the enumeration that indicates how far the background extends. The default is InnerBorderEdge.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
You can set this property to OuterBorderEdge to make the element's background extend under the border. If the
border is transparent, the background will show through it.
See BackgroundSizing
Also BackgroundSizing
Grid.BackgroundSizingProperty Grid.BackgroundSizing
Property Grid.BackgroundSizingProperty
I n this Article
Edit
Identifies the BackgroundSizing dependency property.
public : static DependencyProperty BackgroundSizingProperty { get; }
static DependencyProperty BackgroundSizingProperty();
public static DependencyProperty BackgroundSizingProperty { get; }

Returns
DependencyProperty
The identifier for the BackgroundSizing dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


Grid.BorderBrush Grid.BorderBrush Grid.BorderBrush
I n this Article
Edit
Gets or sets a brush that describes the border fill of the panel.

public : Brush BorderBrush { get; set; }


Brush BorderBrush();

void BorderBrush(Brush borderbrush);


public Brush BorderBrush { get; set; }

<Grid BorderBrush="{StaticResource resourceName}"/>

Returns
Brush
The brush that is used to fill the panel's border. The default is null, (a null brush) which is evaluated as Transparent for
rendering.

Remarks
The BorderThickness value must be greater than 0 in order to see the BorderBrush value take effect.
Grid.BorderBrushProperty Grid.BorderBrushProperty
Grid.BorderBrushProperty
I n this Article
Edit
Identifies the BorderBrush dependency property.
public : static DependencyProperty BorderBrushProperty { get; }
static DependencyProperty BorderBrushProperty();
public static DependencyProperty BorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the BorderBrush dependency property.
See Dependency properties overview
Also
Grid.BorderThickness Grid.BorderThickness Grid.Border
Thickness
I n this Article
Edit
Gets or sets the border thickness of the panel.
public : Thickness BorderThickness { get; set; }
Thickness BorderThickness();

void BorderThickness(Thickness borderthickness);


public Thickness BorderThickness { get; set; }

<Grid BorderThickness="uniform"/>
- or -
<Grid BorderThickness="left&right,top&bottom"/>
- or -
<Grid BorderThickness="left,top,right,bottom"/>

Returns
Thickness
The border thickness of the panel, as a Thickness value.
Grid.BorderThicknessProperty Grid.BorderThickness
Property Grid.BorderThicknessProperty
I n this Article
Edit
Identifies the BorderThickness dependency property.
public : static DependencyProperty BorderThicknessProperty { get; }
static DependencyProperty BorderThicknessProperty();
public static DependencyProperty BorderThicknessProperty { get; }

Returns
DependencyProperty
The identifier for the BorderThickness dependency property.
See Dependency properties overview
Also
Grid.ColumnDefinitions Grid.ColumnDefinitions Grid.
ColumnDefinitions
I n this Article
Edit
Gets a list of ColumnDefinition objects defined on this instance of Grid.
public : ColumnDefinitionCollection ColumnDefinitions { get; }
ColumnDefinitionCollection ColumnDefinitions();
public ColumnDefinitionCollection ColumnDefinitions { get; }

<Grid>
<Grid.ColumnDefinitions>
oneOrMoreColumnDefinitions
</Grid.ColumnDefinitions>
</Grid>

Returns
ColumnDefinitionCollection
A list of ColumnDefinition objects defined on this instance of Grid.

Examples
The following example creates a Grid with two columns by using ColumnDefinition s.
<Grid.ColumnDefinitions>
<ColumnDefinition Width="250" />
<ColumnDefinition Width="150" />
</Grid.ColumnDefinitions>

See Define layouts with XAML


Also
Grid.ColumnProperty Grid.ColumnProperty Grid.Column
Property
I n this Article
Edit
Identifies the Grid.Column XAML attached property.
public : static DependencyProperty ColumnProperty { get; }
static DependencyProperty ColumnProperty();
public static DependencyProperty ColumnProperty { get; }

Returns
DependencyProperty
The identifier for the Grid.Column XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the Grid.Column XAML attached property in XAML and won't need this identifier.
Grid.ColumnSpacing Grid.ColumnSpacing Grid.Column
Spacing
I n this Article
Edit
Gets or sets the uniform distance (in pixels) between grid columns.
public : double ColumnSpacing { get; set; }
double ColumnSpacing();

void ColumnSpacing(double columnspacing);


public double ColumnSpacing { get; set; }

<Grid ColumnSpacing="double" .../>

Returns
double
The uniform distance (in pixels) between grid columns.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


Grid.ColumnSpacingProperty Grid.ColumnSpacing
Property Grid.ColumnSpacingProperty
I n this Article
Edit
Identifies the ColumnSpacing dependency property.
public : static DependencyProperty ColumnSpacingProperty { get; }
static DependencyProperty ColumnSpacingProperty();
public static DependencyProperty ColumnSpacingProperty { get; }

Returns
DependencyProperty
The identifier for the ColumnSpacing dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


Grid.ColumnSpanProperty Grid.ColumnSpanProperty
Grid.ColumnSpanProperty
I n this Article
Edit
Identifies the Grid.ColumnSpan XAML attached property.
public : static DependencyProperty ColumnSpanProperty { get; }
static DependencyProperty ColumnSpanProperty();
public static DependencyProperty ColumnSpanProperty { get; }

Returns
DependencyProperty
The identifier for the Grid.ColumnSpan XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the Grid.ColumnSpan XAML attached property in XAML and won't need this identifier.
Grid.CornerRadius Grid.CornerRadius Grid.CornerRadius
I n this Article
Edit
Gets or sets the radius for the corners of the panel's border.

public : CornerRadius CornerRadius { get; set; }


CornerRadius CornerRadius();

void CornerRadius(CornerRadius cornerradius);


public CornerRadius CornerRadius { get; set; }

<Grid CornerRadius="uniformRadius"/>
- or -
<Grid CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>

Returns
CornerRadius
The degree to which the corners are rounded, expressed as values of the CornerRadius structure.

Remarks
Member components of a CornerRadius value cannot be negative.
Grid.CornerRadiusProperty Grid.CornerRadiusProperty
Grid.CornerRadiusProperty
I n this Article
Edit
Identifies the CornerRadius dependency property.
public : static DependencyProperty CornerRadiusProperty { get; }
static DependencyProperty CornerRadiusProperty();
public static DependencyProperty CornerRadiusProperty { get; }

Returns
DependencyProperty
The identifier for the CornerRadius dependency property.
See Dependency properties overview
Also
Grid.GetColumn Grid.GetColumn Grid.GetColumn
I n this Article
Edit
Gets the value of the Grid.Column XAML attached property from the specified FrameworkElement.

public : static int GetColumn(FrameworkElement element)


static int32_t GetColumn(FrameworkElement element) const;
public static int GetColumn(FrameworkElement element)

Parameters
element FrameworkElement
The element from which to read the property value.
Returns
int
The value of the Grid.Column XAML attached property on the target element. This is a zero-based index.

Examples
The following example shows how to get the row and column of the element that raised an event.
<Grid x:Name="LayoutRoot">
<Grid.Resources>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="Black"/>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>

<Rectangle Fill="White" Height="100" Width="100" Grid.Row="0" Grid.Column="0"


PointerEntered="r1_PointerEntered"/>
<Rectangle Fill="Yellow" Height="100" Width="100" Grid.Row="0" Grid.Column="1"
PointerEntered="r1_PointerEntered" />
<Rectangle Fill="Blue" Height="100" Width="100" Grid.Row="1" Grid.Column="0"
PointerEntered="r1_PointerEntered" />
<Rectangle Fill="Green" Height="100" Width="100" Grid.Row="1" Grid.Column="1"
PointerEntered="r1_PointerEntered"/>
<StackPanel >
<StackPanel Orientation="Horizontal" >
<TextBlock Text="Row = " />
<TextBlock x:Name="txtRow" />
</StackPanel>
<StackPanel Orientation="Horizontal" >
<TextBlock Text="Column = " />
<TextBlock x:Name="txtCol" />
</StackPanel>
</StackPanel>
</Grid>
private void r1_PointerEntered(object sender, PointerRoutedEventArgs e)
{
Rectangle r = (Rectangle)sender;
int row = Grid.GetRow(r);
int col = Grid.GetColumn(r);

txtRow.Text = row.ToString();
txtCol.Text = col.ToString();

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Grid.Column XAML attached property in XAML and won't need this method. For more info, see the Grid.Column
XAML attached property.
See Grid.Column
Also
Grid.GetColumnSpan Grid.GetColumnSpan Grid.Get
ColumnSpan
I n this Article
Edit
Gets the value of the Grid.ColumnSpan XAML attached property from the specified FrameworkElement.
public : static int GetColumnSpan(FrameworkElement element)
static int32_t GetColumnSpan(FrameworkElement element) const;
public static int GetColumnSpan(FrameworkElement element)

Parameters
element FrameworkElement
The element from which to read the property value.
Returns
int
The value of the Grid.ColumnSpan XAML attached property on the target element.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Grid.ColumnSpan XAML attached property in XAML and won't need this method. For more info, see the
Grid.ColumnSpan attached property.
See Grid.ColumnSpan
Also
Grid.GetRow Grid.GetRow Grid.GetRow
I n this Article
Edit
Gets the value of the Grid.Row XAML attached property from the specified FrameworkElement.

public : static int GetRow(FrameworkElement element)


static int32_t GetRow(FrameworkElement element) const;
public static int GetRow(FrameworkElement element)

Parameters
element FrameworkElement
The element from which to read the property value.
Returns
int
The value of the Grid.Row XAML attached property on the target element.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Grid.Row XAML attached property in XAML and won't need this method. For more info, see the Grid.Row attached
property.
See Grid.Row
Also
Grid.GetRowSpan Grid.GetRowSpan Grid.GetRowSpan
I n this Article
Edit
Gets the value of the Grid.RowSpan XAML attached property from the specified FrameworkElement.

public : static int GetRowSpan(FrameworkElement element)


static int32_t GetRowSpan(FrameworkElement element) const;
public static int GetRowSpan(FrameworkElement element)

Parameters
element FrameworkElement
The element from which to read the property value.
Returns
int
The value of the Grid.RowSpan XAML attached property on the target element.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Grid.RowSpan XAML attached property in XAML and won't need this method. For more info, see the Grid.RowSpan
attached property.
See Grid.RowSpan
Also
Grid Grid Grid
I n this Article
Edit
Initializes a new instance of the Grid class.

public : Grid()
Grid() const;
public Grid()
Grid.Padding Grid.Padding Grid.Padding
I n this Article
Edit
Gets or sets the distance between the border and its child object.

public : Thickness Padding { get; set; }


Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<Grid Padding="uniform"/>
- or -
<Grid Padding="left&right,top&bottom"/>
- or -
<Grid Padding="left,top,right,bottom"/>

Returns
Thickness
The dimensions of the space between the border and its child as a Thickness value. Thickness is a structure that stores
dimension values using pixel measures.

Remarks
A related property is Margin (a property of FrameworkElement ). For more info about the relationship between margin
and padding, see Alignment, margin, and padding or Define layouts with XAML.
Grid.PaddingProperty Grid.PaddingProperty Grid.
PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
See Dependency properties overview
Also
Grid.RowDefinitions Grid.RowDefinitions Grid.Row
Definitions
I n this Article
Edit
Gets a list of RowDefinition objects defined on this instance of Grid.
public : RowDefinitionCollection RowDefinitions { get; }
RowDefinitionCollection RowDefinitions();
public RowDefinitionCollection RowDefinitions { get; }

<Grid>
<Grid.RowDefinitions>
oneOrMoreRowDefinitions
</Grid.RowDefinitions>
</Grid>

Returns
RowDefinitionCollection
A list of RowDefinition objects defined on this instance of Grid.

Examples
The following example creates a Grid with three rows. The Height of the first row is set to the value Auto, which
distributes height evenly based on the size of the content that is within that row. The height of the second row and third
row are set to 2* and * respectively. The second row gets 2/3 of the remaining space and the third row gets 1/3.
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="2*" />
<RowDefinition Height="*"/>
</Grid.RowDefinitions>

See Define layouts with XAML


Also
Grid.RowProperty Grid.RowProperty Grid.RowProperty
I n this Article
Edit
Identifies the Grid.Row XAML attached property.

public : static DependencyProperty RowProperty { get; }


static DependencyProperty RowProperty();
public static DependencyProperty RowProperty { get; }

Returns
DependencyProperty
The identifier for the Grid.Row XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the Grid.Row XAML attached property in XAML and won't need this identifier.
Grid.RowSpacing Grid.RowSpacing Grid.RowSpacing
I n this Article
Edit
Gets or sets the uniform distance (in pixels) between grid rows.

public : double RowSpacing { get; set; }


double RowSpacing();

void RowSpacing(double rowspacing);


public double RowSpacing { get; set; }

<Grid RowSpacing="double" .../>

Returns
double
The uniform distance (in pixels) between grid rows.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


Grid.RowSpacingProperty Grid.RowSpacingProperty
Grid.RowSpacingProperty
I n this Article
Edit
Identifies the RowSpacing dependency property.
public : static DependencyProperty RowSpacingProperty { get; }
static DependencyProperty RowSpacingProperty();
public static DependencyProperty RowSpacingProperty { get; }

Returns
DependencyProperty
The identifier for the RowSpacing dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


Grid.RowSpanProperty Grid.RowSpanProperty Grid.Row
SpanProperty
I n this Article
Edit
Identifies the Grid.RowSpan XAML attached property.
public : static DependencyProperty RowSpanProperty { get; }
static DependencyProperty RowSpanProperty();
public static DependencyProperty RowSpanProperty { get; }

Returns
DependencyProperty
The identifier for the Grid.RowSpan XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the Grid.RowSpan XAML attached property in XAML and won't need this identifier.
Grid.SetColumn Grid.SetColumn Grid.SetColumn
I n this Article
Edit
Sets the value of the Grid.Column XAML attached property on the specified FrameworkElement.

public : static void SetColumn(FrameworkElement element, int value)


static void SetColumn(FrameworkElement element, int32_t value) const;
public static void SetColumn(FrameworkElement element, Int32 value)

Parameters
element FrameworkElement
The target element on which to set the Grid.Column XAML attached property.
value Int32
The property value to set.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Grid.Column XAML attached property in XAML and won't need this method. For more info, see the Grid.Column
XAML attached property.
See Grid.Column
Also
Grid.SetColumnSpan Grid.SetColumnSpan Grid.Set
ColumnSpan
I n this Article
Edit
Sets the value of the Grid.ColumnSpan XAML attached property on the specified FrameworkElement.
public : static void SetColumnSpan(FrameworkElement element, int value)
static void SetColumnSpan(FrameworkElement element, int32_t value) const;
public static void SetColumnSpan(FrameworkElement element, Int32 value)

Parameters
element FrameworkElement
The element on which to set the Grid.ColumnSpan XAML attached property.
value Int32
The property value to set.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Grid.ColumnSpan XAML attached property in XAML and won't need this method. For more info, see the
Grid.ColumnSpan attached property.
See Grid.ColumnSpan
Also
Grid.SetRow Grid.SetRow Grid.SetRow
I n this Article
Edit
Sets the value of the Grid.Row XAML attached property on the specified FrameworkElement.

public : static void SetRow(FrameworkElement element, int value)


static void SetRow(FrameworkElement element, int32_t value) const;
public static void SetRow(FrameworkElement element, Int32 value)

Parameters
element FrameworkElement
The target element on which to set the Grid.Row XAML attached property.
value Int32
The property value to set.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Grid.Row XAML attached property in XAML and won't need this method. For more info, see the Grid.Row attached
property.
See Grid.Row
Also
Grid.SetRowSpan Grid.SetRowSpan Grid.SetRowSpan
I n this Article
Edit
Sets the value of the Grid.RowSpan XAML attached property on the specified FrameworkElement.

public : static void SetRowSpan(FrameworkElement element, int value)


static void SetRowSpan(FrameworkElement element, int32_t value) const;
public static void SetRowSpan(FrameworkElement element, Int32 value)

Parameters
element FrameworkElement
The target element on which to set the Grid.RowSpan XAML attached property.
value Int32
The property value to set.

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
Grid.RowSpan XAML attached property in XAML and won't need this method. For more info, see the Grid.RowSpan
attached property.
See Grid.RowSpan
Also
GridView GridView GridView Class
Represents a control that displays data items in rows and columns.

D eclaration
public : class GridView : ListViewBase, IGridView
struct winrt::Windows::UI::Xaml::Controls::GridView : ListViewBase, IGridView
public class GridView : ListViewBase, IGridView

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Selector
ListViewBase

Remarks
 Tip

For more info, design guidance, and code examples, see List view and grid view.
Use a GridView to display a collection of items in rows and columns that can scroll vertically. Data is stacked
horizontally until it fills the columns, then continues with the next row. It's often used when you need to show a rich
visualization of each item that takes more space, such as a photo gallery.

GridView is an ItemsControl, so it can contain a collection of items of any type. To populate the view, add items to the
Items collection, or set the ItemsSource property to a data source.
By default, a data item is displayed in the GridView as the string representation of the data object it's bound to. To
specify exactly how items in the GridView are displayed, you create a DataTemplate to define the layout of controls
used to display an individual item. The controls in the layout can be bound to properties of a data object, or have
content defined inline. You assign the DataTemplate to the ItemTemplate property of the GridView. For common
templates you can use in your app, see Item templates for GridView.
Note

If you populate the GridView by setting the ItemsSource property, the ItemTemplate is applied to every item. If you
populate the Items collection directly, the ItemTemplate is applied only if the item is not a GridViewItem. See Examples
for more info.
If you use the GridView to display large sets of data, see Optimize ListView and GridView for tips to maintain a smooth
and responsive user experience.

Fall Creators Update (Windows 10) - Behavior change


By default, instead of performing selection, an active pen now scrolls/pans a list in UWP apps (like touch, touchpad,
and passive pen). If your app depends on the previous behavior, you can override pen scrolling and revert to the
previous behavior. See the @Windows.UI.Xaml.Controls.ScrollViewer?text=ScrollViewer class reference for details.

By default, a user can select a single item in a GridView. You can set the SelectionMode property to a
ListViewSelectionMode enumeration value to allow multi-selection or to disable selection. You can also change the
GridView interaction mode to make items respond to a user click like a button instead of being selected.
This table shows the ways a user can interact with a GridView, and how you can respond to the interaction.

TO ENAB LE THIS U S E THES E S E T TING S : HAND LE THIS EV ENT: U S E THIS PR O PER T Y TO


INTER ACTIO N: G E T THE S ELECTED ITEM:

No interaction @Windows.UI.Xaml.Controls. N/A N/A


ListViewBase.SelectionMode?
text=SelectionMode =
@Windows.UI.Xaml.Controls.
ListViewSelectionMode?
text=None,
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **False**

Single selection @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls.


ListViewBase.SelectionMode? Primitives.Selector.SelectionC Primitives.Selector.SelectedIt
text=SelectionMode = hanged? em?text=SelectedItem,
@Windows.UI.Xaml.Controls. text=SelectionChanged @Windows.UI.Xaml.Controls.
ListViewSelectionMode? Primitives.Selector.SelectedIn
text=Single, dex?text=SelectedIndex
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **False**

Contiguous multi-selection @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls.


ListViewBase.SelectionMode? Primitives.Selector.SelectionC ListViewBase.SelectedItems?
text=SelectionMode = hanged? text=SelectedItems
@Windows.UI.Xaml.Controls. text=SelectionChanged
ListViewSelectionMode?
text=Multiple,
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **False**

Non-contiguous multi- @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls.


selection ListViewBase.SelectionMode? Primitives.Selector.SelectionC ListViewBase.SelectedItems?
text=SelectionMode = hanged? text=SelectedItems
@Windows.UI.Xaml.Controls. text=SelectionChanged
ListViewSelectionMode?
text=Extended,
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **False**
Click @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls. N/A
ListViewBase.SelectionMode? ListViewBase.ItemClick?
text=SelectionMode = text=ItemClick
@Windows.UI.Xaml.Controls.
ListViewSelectionMode?
text=None,
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **True**
Note

The PointerWheelChanged event does not bubble up from a GridView. This means that a control that has a GridView
inside of it does not receive mouse wheel change messages if the pointer is over the GridView. For example, if you put
a GridView inside of a ScrollViewer, you can't scroll the ScrollViewer with the mouse wheel when the pointer is over
the GridView.
Note

When you set the Padding property on a GridView control, the value for right padding is ignored; only the values for
left, top, and bottom padding are applied.
GridView supports data virtualization to improve performance with large data sets. Random access virtualization is
supported when the data source implements the appropriate interfaces, which vary depending on the programming
language:
Visual C++ component extensions (C++/CX) apps should implement IObservableVector.
C# or Visual Basic apps should implement INotifyCollectionChanged and System.Collections.IList (not IList.
Virtualization requires both of these interfaces. Incremental loading virtualization is supported when the data source
implements the ISupportIncrementalLoading interface. When incremental loading is supported, you can use these
members to control data loading: DataFetchSize, IncrementalLoadingThreshold, IncrementalLoadingTrigger,
LoadMoreItemsAsync.

Windows 8 In Windows 8, when the data item in a selected GridViewItem is replaced, the SelectedIndex value is
not cleared. In Windows 8.1, the SelectedIndex value is cleared.

GridView implements the ISemanticZoomInformation interface, so it can be used as a view in a SemanticZoom


control. When it's used in a SemanticZoom control, always set the ScrollViewer.IsHorizontalScrollChainingEnabled
attached property to false on the ScrollViewer that's in the GridView 's control template, like this:
<GridView ScrollViewer.IsHorizontalScrollChainingEnabled="False"> . These members have an effect only when
the GridView is hosted in a SemanticZoom control: IsActiveView, IsZoomedInView, SemanticZoomOwner,
CompleteViewChange, CompleteViewChangeFrom, CompleteViewChangeTo, InitializeViewChange, MakeVisible,
StartViewChangeFrom, StartViewChangeTo.
The default template for GridView includes existing transition animations. Specifically, the default
ItemContainerTransitions value already contains values for AddDeleteThemeTransition, ContentThemeTransition,
ReorderThemeTransition and EntranceThemeTransition (with IsStaggeringEnabled="False" ). If you are setting a new
value for ItemContainerTransitions on GridView, consider reproducing these same theme animations as a starting
point. If you are setting the property yourself, those defaults get overwritten unless you include them again in your
definition.
Selection behavior and CollectionV iewSource
List controls that derive from Selector have a default selection behavior that depends on what the items source is (the
type that's used for ItemsSource ). If the items source is a CollectionViewSource instance, then the behavior in the
selection control is that the selection will default to the current item. When the list is first displayed, the selection
defaults to the first item as current item. If you don't want the first item to be selected in this case, set
IsSynchronizedWithCurrentItem to false in the GridView.

Constructors
GridView()
GridView()
GridView()

Initializes a new instance of the GridView class.

See Also
ListViewBase
GridView GridView GridView
I n this Article
Edit
Initializes a new instance of the GridView class.

public : GridView()
GridView() const;
public GridView()
GridViewHeaderItem GridViewHeaderItem GridView
HeaderItem Class
Represents items in the header for grouped data inside a GridView.

D eclaration
public : class GridViewHeaderItem : ListViewBaseHeaderItem, IGridViewHeaderItem
struct winrt::Windows::UI::Xaml::Controls::GridViewHeaderItem : ListViewBaseHeaderItem,
IGridViewHeaderItem
public class GridViewHeaderItem : ListViewBaseHeaderItem, IGridViewHeaderItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ListViewBaseHeaderItem

Remarks
GridViewHeaderItem is a control that's created by the system and added to the visual tree when the data templates for
a grouped ListView are realized. Specifically, it's created when realizing the GroupStyle.HeaderTemplate. You don't
typically define elements for GridViewHeaderItem in XAML. There's a default template for GridViewHeaderItem as
part of the built-in templates. The main app scenario for the GridViewHeaderItem class is to copy and replace the
default style and template with a style of your own, which also implicitly targets GridViewHeaderItem.
There's a dedicated automation peer class for GridViewHeaderItem, GridViewHeaderItemAutomationPeer. This is
because after the GridView is realized, all the created item parts need automation representation, so that Microsoft UI
Automation can report them in the tree it provides for assistive technology and other Microsoft UI Automation clients.
If you use the GroupStyle.HeaderContainerStyle property, the Style it contains must have a TargetType value of either
ListViewHeaderItem or GridViewHeaderItem.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the GridViewHeaderItem control.
R ES O U R CE K EY D ES CR IPTIO N

GridViewHeaderItemBackground Item background color

GridViewHeaderItemDividerStroke Divider line color

Constructors
GridViewHeaderItem()
GridViewHeaderItem()
GridViewHeaderItem()

Initializes a new instance of the GridViewHeaderItem class.

See Also
ListViewBaseHeaderItem
ListViewBaseHeaderItem
GridViewHeaderItem GridViewHeaderItem GridView
HeaderItem
I n this Article
Edit
Initializes a new instance of the GridViewHeaderItem class.
public : GridViewHeaderItem()
GridViewHeaderItem() const;
public GridViewHeaderItem()
GridViewItem GridViewItem GridViewItem Class
Represents the container for an item in a GridView control.

D eclaration
public : class GridViewItem : SelectorItem, IGridViewItem
struct winrt::Windows::UI::Xaml::Controls::GridViewItem : SelectorItem, IGridViewItem
public class GridViewItem : SelectorItem, IGridViewItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem

Remarks
The GridViewItem class provides the container for items displayed in a GridView control. You populate the GridView
by adding objects directly to its Items collection or by binding its ItemsSource property to a data source. When items
are added to the GridView, a GridViewItem container is created automatically for each item in the collection.
You can specify the look of the GridViewItem by setting the GridView 's ItemContainerStyle property to a Style with a
TargetType of GridViewItem.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the GridViewItem control.

R ES O U R CE K EY D ES CR IPTIO N

GridViewItemForeground Text color at rest

GridViewItemForegroundPointerOver Text color on hover

GridViewItemForegroundPressed Text color when pressed


GridViewItemBackground Background color at rest

GridViewItemBackgroundPointerOver Background color on hover

GridViewItemBackgroundPressed Background color when pressed

GridViewItemBackgroundSelected Background color when selected

GridViewItemBackgroundSelectedPointerOver Background color on hover and selected

GridViewItemBackgroundSelectedPressed Background color when pressed and selected

GridViewItemFocusVisualPrimaryBrush Focus indicator color when focused

GridViewItemFocusVisualSecondaryBrush Secondary focus indicator color when focused

GridViewItemFocusBorderBrush Border color when focused

GridViewItemFocusSecondaryBorderBrush Secondary border color when focused

GridViewItemCheckBrush Check mark color on selected item

GridViewItemCheckBoxBrush Checkmark box color on selected item

GridViewItemDragBackground Item background color when being dragged

GridViewItemDragForeground Item foreground color when being dragged

GridViewItemPlaceholderBackground Background color of item placeholder

GridViewItemSelectionCheckMarkVisualEnabled Boolean that specifies whether checkmark visual is shown

GridViewItemCheckMode Specifies how checkmark is shown ("Overlay" or "Inline")

Windows 8.1 To assign a custom value based on the data item to the AutomationProperties.Name attached
property, you must bind to the item container's Content property. For example, assume you have a Customer data
item that has a Name property and you want to use the Customer.Name property as the
AutomationProperties.Name value.

In Windows 8, the data item is set as the DataContext of the item container, so you can use a binding like this:
AutomationProperties.Name="{Binding Name}" .

In Windows 8.1, the item container's DataContext is not set. To bind the AutomationProperties.Name value to the data
item's Name property, use a binding like this:
AutomationProperties.Name="{Binding Path=Content.Name,RelativeSource={RelativeSource Mode=Self}}" .

Constructors
GridViewItem()
GridViewItem()
GridViewItem()
Initializes a new instance of the GridViewItem class.

Properties
TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a GridViewItem.

See Also
SelectorItem
SelectorItem
SelectorItem
GridViewItem GridViewItem GridViewItem
I n this Article
Edit
Initializes a new instance of the GridViewItem class.

public : GridViewItem()
GridViewItem() const;
public GridViewItem()
GridViewItem.TemplateSettings GridViewItem.Template
Settings GridViewItem.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a GridViewItem.
public : GridViewItemTemplateSettings TemplateSettings { get; }
GridViewItemTemplateSettings TemplateSettings();
public GridViewItemTemplateSettings TemplateSettings { get; }

Returns
GridViewItemTemplateSettings
An object that provides calculated values for templates.
GroupItem GroupItem GroupItem Class
Represents the root element for a subtree that is created for a group.

D eclaration
public : class GroupItem : ContentControl, IGroupItem
struct winrt::Windows::UI::Xaml::Controls::GroupItem : ContentControl, IGroupItem
public class GroupItem : ContentControl, IGroupItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
GroupItem can technically be used as an object element in XAML. However, the more common XAML usage that
involves GroupItem indirectly is when declaring a ContainerStyle. In this case, the "GroupItem" type is specified as the
TargetType for the style/template.

Constructors
GroupItem()
GroupItem()
GroupItem()

Initializes a new instance of the GroupItem class.

See Also
ContentControl
ContentControl
GroupItem GroupItem GroupItem
I n this Article
Edit
Initializes a new instance of the GroupItem class.

public : GroupItem()
GroupItem() const;
public GroupItem()
GroupStyle GroupStyle GroupStyle Class
Describes how to display the grouped items in a collection, such as the collection from GroupItems.

D eclaration
public : class GroupStyle : IGroupStyle, IGroupStyle2, INotifyPropertyChanged
struct winrt::Windows::UI::Xaml::Controls::GroupStyle : IGroupStyle, IGroupStyle2,
INotifyPropertyChanged
public class GroupStyle : IGroupStyle, IGroupStyle2, INotifyPropertyChanged

I nheritance H ierarchy
None

Remarks
A GroupStyle is typically defined in Extensible Application Markup Language (XAML ) and then set as the value of the
ItemsControl.GroupStyle property to define the visual look of the groups.

Constructors
GroupStyle()
GroupStyle()
GroupStyle()

Initializes a new instance of the GroupStyle class.

Properties
ContainerStyle
ContainerStyle
ContainerStyle
Note

ContainerStyle may be altered or unavailable for releases after Windows 8.1 and is not supported for
ItemsControl.GroupStyle.
Gets or sets the style that is applied to the GroupItem generated for each item.

ContainerStyleSelector
ContainerStyleSelector
ContainerStyleSelector
Note

ContainerStyleSelector may be altered or unavailable for releases after Windows 8.1 and is not supported for
ItemsControl.GroupStyle.
Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector referenced by this property returns
a style to apply to each generated GroupItem.

HeaderContainerStyle
HeaderContainerStyle
HeaderContainerStyle

Gets or sets the style that is applied to the header for each item.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the template that is used to display the group header.

HeaderTemplateSelector
HeaderTemplateSelector
HeaderTemplateSelector

Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector returns different
DataTemplate values to use for the header area of group item content.

HidesIfEmpty
HidesIfEmpty
HidesIfEmpty

Gets or sets a value that indicates whether items corresponding to empty groups should be displayed.

Panel
Panel
Panel

Gets or sets a template that creates the panel used to lay out the items.

Events
PropertyChanged
PropertyChanged
PropertyChanged

Occurs when a property value changes.

PropertyChanged
PropertyChanged
PropertyChanged

Occurs when a property value changes.

See Also
GroupStyle.ContainerStyle GroupStyle.ContainerStyle
GroupStyle.ContainerStyle
I n this Article
Edit
Note

ContainerStyle may be altered or unavailable for releases after Windows 8.1 and is not supported for
ItemsControl.GroupStyle.
Gets or sets the style that is applied to the GroupItem generated for each item.
public : Style ContainerStyle { get; set; }
Style ContainerStyle();

void ContainerStyle(Style containerstyle);


public Style ContainerStyle { get; set; }

<GroupStyle ContainerStyle="styleReference" />

Returns
Style
The style that is applied to the GroupItem generated for each item. The default is null.
See How to group items in a list or grid
Also
GroupStyle.ContainerStyleSelector GroupStyle.Container
StyleSelector GroupStyle.ContainerStyleSelector
I n this Article
Edit
Note

ContainerStyleSelector may be altered or unavailable for releases after Windows 8.1 and is not supported for
ItemsControl.GroupStyle.
Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector referenced by this property returns a
style to apply to each generated GroupItem.
public : StyleSelector ContainerStyleSelector { get; set; }
StyleSelector ContainerStyleSelector();

void ContainerStyleSelector(StyleSelector containerstyleselector);


public StyleSelector ContainerStyleSelector { get; set; }

<GroupStyle ContainerStyleSelector="styleSelectorReference" />

Returns
StyleSelector
An object that derives from StyleSelector. The default is null.
GroupStyle GroupStyle GroupStyle
I n this Article
Edit
Initializes a new instance of the GroupStyle class.

public : GroupStyle()
GroupStyle() const;
public GroupStyle()
GroupStyle.HeaderContainerStyle GroupStyle.Header
ContainerStyle GroupStyle.HeaderContainerStyle
I n this Article
Edit
Gets or sets the style that is applied to the header for each item.
public : Style HeaderContainerStyle { get; set; }
Style HeaderContainerStyle();

void HeaderContainerStyle(Style headercontainerstyle);


public Style HeaderContainerStyle { get; set; }

<GroupStyle ...>
<GroupStyle.HeaderContainerStyle>
<Style TargetType="headerItemType">
oneOrMoreSetters
</Style>
</GroupStyle.HeaderContainerStyle>
</GroupStyle>

Returns
Style
The style that is applied to the header for each item. The default is null.
GroupStyle.HeaderTemplate GroupStyle.HeaderTemplate
GroupStyle.HeaderTemplate
I n this Article
Edit
Gets or sets the template that is used to display the group header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<GroupStyle HeaderTemplate="dataTemplateReference" />

Returns
DataTemplate
A DataTemplate object that is used to display the group header. The default is null.
See How to group items in a list or grid
Also
GroupStyle.HeaderTemplateSelector GroupStyle.Header
TemplateSelector GroupStyle.HeaderTemplateSelector
I n this Article
Edit
Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector returns different
DataTemplate values to use for the header area of group item content.
public : DataTemplateSelector HeaderTemplateSelector { get; set; }
DataTemplateSelector HeaderTemplateSelector();

void HeaderTemplateSelector(DataTemplateSelector headertemplateselector);


public DataTemplateSelector HeaderTemplateSelector { get; set; }

<GroupStyle HeaderTemplateSelector="dataTemplateSelectorReference" />

Returns
DataTemplateSelector
An object that derives from DataTemplateSelector. The default is null.

Remarks
For example XAML that references a custom DataTemplateSelector as the HeaderTemplateSelector value, and example
code that shows the overrides for HeaderTemplateSelector methods, see How to group items in a list or grid.
GroupStyle.HidesIfEmpty GroupStyle.HidesIfEmpty
GroupStyle.HidesIfEmpty
I n this Article
Edit
Gets or sets a value that indicates whether items corresponding to empty groups should be displayed.
public : Platform::Boolean HidesIfEmpty { get; set; }
bool HidesIfEmpty();

void HidesIfEmpty(bool hidesifempty);


public bool HidesIfEmpty { get; set; }

<GroupStyle HidesIfEmpty="bool" .../>

Returns
bool
True to not display empty groups; otherwise, false. The default is false.
See How to group items in a list or grid
Also
GroupStyle.Panel GroupStyle.Panel GroupStyle.Panel
I n this Article
Edit
Gets or sets a template that creates the panel used to lay out the items.

public : ItemsPanelTemplate Panel { get; set; }


ItemsPanelTemplate Panel();

void Panel(ItemsPanelTemplate panel);


public ItemsPanelTemplate Panel { get; set; }

<GroupStyle Panel="itemsPanelTemplateReference" />

Returns
ItemsPanelTemplate
An ItemsPanelTemplate object that creates the panel used to layout the items.

Remarks
An ItemsPanelTemplate object element should contain exactly one FrameworkElement -derived class that serves as the
root element for items. In most cases this is a Panel -derived class. The expanded template serves as the parent for the
realized items and there generally is more than one item. Therefore the XAML content property of the intended root
element of an ItemsPanelTemplate should support a collection, as Panel.Children does.
Im p o rt a nt

The root element of the template declared for the ItemsPanelTemplate in the GroupStyle.Panel property cannot be a
virtualizing panel. Virtualizing panels are defined as any type that derives from VirtualizingPanel, for example the
VirtualizingStackPanel class.
See How to group items in a list or grid
Also
GroupStyle.PropertyChanged GroupStyle.Property
Changed GroupStyle.PropertyChanged
I n this Article
Edit
Occurs when a property value changes.
public : event PropertyChangedEventHandler PropertyChanged
// Register
event_token PropertyChanged(PropertyChangedEventHandler const& handler) const;

// Revoke with event_token


void PropertyChanged(event_token const& cookie) const;

// Revoke with event_revoker


PropertyChanged_revoker PropertyChanged(auto_revoke_t, PropertyChangedEventHandler const& handler)
const;
// This member is not implemented in C#

<GroupStyle PropertyChanged="eventhandler"/>
GroupStyle.PropertyChanged GroupStyle.Property
Changed GroupStyle.PropertyChanged
I n this Article
Edit
Occurs when a property value changes.
public : event PropertyChangedEventHandler PropertyChanged
// Register
event_token PropertyChanged(PropertyChangedEventHandler const& handler) const;

// Revoke with event_token


void PropertyChanged(event_token const& cookie) const;

// Revoke with event_revoker


PropertyChanged_revoker PropertyChanged(auto_revoke_t, PropertyChangedEventHandler const& handler)
const;
// This member is not implemented in C#

<GroupStyle PropertyChanged="eventhandler"/>
GroupStyleSelector GroupStyleSelector GroupStyle
Selector Class
Enables custom group style selection logic as a function of the parent group and its level.

D eclaration
public : class GroupStyleSelector : IGroupStyleSelector, IGroupStyleSelectorOverrides
struct winrt::Windows::UI::Xaml::Controls::GroupStyleSelector : IGroupStyleSelector,
IGroupStyleSelectorOverrides
public class GroupStyleSelector : IGroupStyleSelector, IGroupStyleSelectorOverrides

I nheritance H ierarchy
None

Constructors
GroupStyleSelector()
GroupStyleSelector()
GroupStyleSelector()

Initializes a new instance of the GroupStyleSelector class.

Methods
SelectGroupStyle(Object, UInt32)
SelectGroupStyle(Object, UInt32)
SelectGroupStyle(Object, UInt32)

Returns a specific GroupStyle for a given group and level.

SelectGroupStyleCore(Object, UInt32)
SelectGroupStyleCore(Object, UInt32)
SelectGroupStyleCore(Object, UInt32)

When implemented by a derived class, returns a specific GroupStyle for a given group and level.

See Also
GroupStyleSelector GroupStyleSelector GroupStyle
Selector
I n this Article
Edit
Initializes a new instance of the GroupStyleSelector class.
public : GroupStyleSelector()
GroupStyleSelector() const;
public GroupStyleSelector()
GroupStyleSelector.SelectGroupStyle GroupStyleSelector.
SelectGroupStyle GroupStyleSelector.SelectGroupStyle
I n this Article
Edit
Returns a specific GroupStyle for a given group and level.
public : GroupStyle SelectGroupStyle(Platform::Object group, unsigned int level)
GroupStyle SelectGroupStyle(winrt::Windows::Foundation::IInspectable group, uint32_t level) const;
public GroupStyle SelectGroupStyle(Object group, UInt32 level)

Parameters
group Object
The group to return a GroupStyle for.
level UInt32
The level of nesting for the specified group.
Returns
GroupStyle
TheGroupStyle to use when this GroupStyleSelector is invoked in an application.

Remarks
To provide a specific group style in a derived class, override the SelectGroupStyleCore method.

Windows 8 In Windows 8, you can pass null as the group parameter value. In Windows 8.1, passing null causes
an error.
GroupStyleSelector.SelectGroupStyleCore GroupStyle
Selector.SelectGroupStyleCore GroupStyleSelector.Select
GroupStyleCore
I n this Article
Edit
When implemented by a derived class, returns a specific GroupStyle for a given group and level.
protected : virtual GroupStyle SelectGroupStyleCore(Platform::Object group, unsigned int level)
virtual GroupStyle SelectGroupStyleCore(winrt::Windows::Foundation::IInspectable group, uint32_t
level) const;
protected virtual GroupStyle SelectGroupStyleCore(Object group, UInt32 level)

Parameters
group Object
The group to return a GroupStyle for.
level UInt32
The level of nesting for the specified group.
Returns
GroupStyle
The GroupStyle to use for the specified group and level.

Remarks
Windows 8 In Windows 8, you can pass null as the group parameter value. In Windows 8.1, passing null causes
an error.

See How to group items in a list or grid


Also
HandwritingPanelClosedEventArgs HandwritingPanel
ClosedEventArgs HandwritingPanelClosedEventArgs
Class
Provides event data for the HandwritingView.Closed event.

D eclaration
public : sealed class HandwritingPanelClosedEventArgs : IHandwritingPanelClosedEventArgs
struct winrt::Windows::UI::Xaml::Controls::HandwritingPanelClosedEventArgs :
IHandwritingPanelClosedEventArgs
public sealed class HandwritingPanelClosedEventArgs : IHandwritingPanelClosedEventArgs

I nheritance H ierarchy
None

See Also
HandwritingPanelOpenedEventArgs HandwritingPanel
OpenedEventArgs HandwritingPanelOpenedEventArgs
Class
Provides event data for the HandwritingView.Opened event.

D eclaration
public : sealed class HandwritingPanelOpenedEventArgs : IHandwritingPanelOpenedEventArgs
struct winrt::Windows::UI::Xaml::Controls::HandwritingPanelOpenedEventArgs :
IHandwritingPanelOpenedEventArgs
public sealed class HandwritingPanelOpenedEventArgs : IHandwritingPanelOpenedEventArgs

I nheritance H ierarchy
None

See Also
HandwritingPanelPlacementAlignment HandwritingPanel
PlacementAlignment HandwritingPanelPlacement
Alignment Enum
Defines constants that specify where the handwriting view panel is anchored to the control.

D eclaration
public : enum class HandwritingPanelPlacementAlignment
enum class winrt::Windows::UI::Xaml::Controls::HandwritingPanelPlacementAlignment : int32_t
public enum HandwritingPanelPlacementAlignment

I nheritance H ierarchy
None

Fields
Auto Auto Auto The system determines the best place to anchor the handwriting view panel.

BottomLeft BottomLeft BottomLeft The handwriting view panel is anchored to the bottom left corner of the
control.

BottomRight BottomRight The handwriting view panel is anchored to the bottom right corner of the
BottomRight control.

TopLeft TopLeft TopLeft The handwriting view panel is anchored to the top left corner of the control.

TopRight TopRight TopRight The handwriting view panel is anchored to the top right corner of the control.

See Also
HandwritingView HandwritingView HandwritingView
Class
Represents a Windows Ink input surface for text input controls.

D eclaration
public : class HandwritingView : Control, IHandwritingView
struct winrt::Windows::UI::Xaml::Controls::HandwritingView : Control, IHandwritingView
public class HandwritingView : Control, IHandwritingView

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Text input with the handwriting view.
Supported by text input controls such as TextBox, RichEditBox, and composite text controls such as AutoSuggestBox.
When a user taps into a text input box using a Windows pen, the text box transforms to let the user write directly into it
with a pen, rather than opening a separate input panel.

Constructors
HandwritingView()
HandwritingView()
HandwritingView()

Initializes a new instance of the HandwritingView class.

Properties
AreCandidatesEnabled
AreCandidatesEnabled
AreCandidatesEnabled

Gets or sets a value that specifies whether auto-completion candidates are shown as the use writes.
AreCandidatesEnabledProperty
AreCandidatesEnabledProperty
AreCandidatesEnabledProperty

Identifies the AreCandidatesEnabled dependency property.

IsOpen
IsOpen
IsOpen

Gets a value that indicates whether the handwriting view panel is open.

IsOpenProperty
IsOpenProperty
IsOpenProperty

Identifies the IsOpen dependency property.

PlacementAlignment
PlacementAlignment
PlacementAlignment

Gets or sets a value that specifies the anchor point used to place the handwriting view over the control.

PlacementAlignmentProperty
PlacementAlignmentProperty
PlacementAlignmentProperty

Identifies the PlacementAlignment dependency property.

PlacementTarget
PlacementTarget
PlacementTarget

Gets or sets the visual element or control that the handwriting view should be positioned in relation to when
opened.

PlacementTargetProperty
PlacementTargetProperty
PlacementTargetProperty

Identifies the PlacementTarget dependency property.

Methods
TryClose()
TryClose()
TryClose()

Attempts to close the handwriting view panel.

TryOpen()
TryOpen()
TryOpen()

Attempts to open the handwriting view panel.

Events
Closed
Closed
Closed

Occurs when the handwriting view panel is closed.

Opened
Opened
Opened

Occurs when the handwriting view panel is opened.

See Also
HandwritingView.AreCandidatesEnabled Handwriting
View.AreCandidatesEnabled HandwritingView.Are
CandidatesEnabled
I n this Article
Edit
Gets or sets a value that specifies whether auto-completion candidates are shown as the use writes.
public : Platform::Boolean AreCandidatesEnabled { get; set; }
bool AreCandidatesEnabled();

void AreCandidatesEnabled(bool arecandidatesenabled);


public bool AreCandidatesEnabled { get; set; }

Returns
bool
true if auto-completion candidates are shown as the use writes; otherwise, false. The default is true.
See Text input with the handwriting view
Also
HandwritingView.AreCandidatesEnabledProperty
HandwritingView.AreCandidatesEnabledProperty
HandwritingView.AreCandidatesEnabledProperty
I n this Article
Edit
Identifies the AreCandidatesEnabled dependency property.
public : static DependencyProperty AreCandidatesEnabledProperty { get; }
static DependencyProperty AreCandidatesEnabledProperty();
public static DependencyProperty AreCandidatesEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the AreCandidatesEnabled dependency property.
See Text input with the handwriting view
Also
HandwritingView.Closed HandwritingView.Closed
HandwritingView.Closed
I n this Article
Edit
Occurs when the handwriting view panel is closed.
public : event TypedEventHandler<HandwritingView, HandwritingPanelClosedEventArgs> Closed
// Register
event_token Closed(TypedEventHandler<HandwritingView, HandwritingPanelClosedEventArgs> const&
handler) const;

// Revoke with event_token


void Closed(event_token const& cookie) const;

// Revoke with event_revoker


Closed_revoker Closed(auto_revoke_t, TypedEventHandler<HandwritingView,
HandwritingPanelClosedEventArgs> const& handler) const;
public event TypedEventHandler<HandwritingView, HandwritingPanelClosedEventArgs> Closed

See Text input with the handwriting view


Also
HandwritingView HandwritingView HandwritingView
I n this Article
Edit
Initializes a new instance of the HandwritingView class.

public : HandwritingView()
HandwritingView() const;
public HandwritingView()

See Text input with the handwriting view


Also
HandwritingView.IsOpen HandwritingView.IsOpen
HandwritingView.IsOpen
I n this Article
Edit
Gets a value that indicates whether the handwriting view panel is open.
public : Platform::Boolean IsOpen { get; }
bool IsOpen();
public bool IsOpen { get; }

Returns
bool
true if the handwriting view panel is open; otherwise, false.

Remarks
The value of this property is set after the Opened or Closed event occurs.
See Text input with the handwriting view
Also
HandwritingView.IsOpenProperty HandwritingView.Is
OpenProperty HandwritingView.IsOpenProperty
I n this Article
Edit
Identifies the IsOpen dependency property.
public : static DependencyProperty IsOpenProperty { get; }
static DependencyProperty IsOpenProperty();
public static DependencyProperty IsOpenProperty { get; }

Returns
DependencyProperty
The identifier for the IsOpen dependency property.
See Text input with the handwriting view
Also
HandwritingView.Opened HandwritingView.Opened
HandwritingView.Opened
I n this Article
Edit
Occurs when the handwriting view panel is opened.
public : event TypedEventHandler<HandwritingView, HandwritingPanelOpenedEventArgs> Opened
// Register
event_token Opened(TypedEventHandler<HandwritingView, HandwritingPanelOpenedEventArgs> const&
handler) const;

// Revoke with event_token


void Opened(event_token const& cookie) const;

// Revoke with event_revoker


Opened_revoker Opened(auto_revoke_t, TypedEventHandler<HandwritingView,
HandwritingPanelOpenedEventArgs> const& handler) const;
public event TypedEventHandler<HandwritingView, HandwritingPanelOpenedEventArgs> Opened

See Text input with the handwriting view


Also
HandwritingView.PlacementAlignment HandwritingView.
PlacementAlignment HandwritingView.Placement
Alignment
I n this Article
Edit
Gets or sets a value that specifies the anchor point used to place the handwriting view over the control.
public : HandwritingPanelPlacementAlignment PlacementAlignment { get; set; }
HandwritingPanelPlacementAlignment PlacementAlignment();

void PlacementAlignment(HandwritingPanelPlacementAlignment placementalignment);


public HandwritingPanelPlacementAlignment PlacementAlignment { get; set; }

Returns
HandwritingPanelPlacementAlignment
An enunmeration value that specifies the anchor point used to place the handwriting view. The default is Auto.

Examples
Here, we show how to use the PlacementAlignment property of a TextBox HandwritingView to specify which anchor
on the underlying text control is used to align the handwriting view.
<TextBox Name="SampleTextBox"
Height="50" Width="500"
FontSize="36" FontFamily="Segoe UI"
PlaceholderText="Try taping with your pen">
<TextBox.HandwritingView>
<HandwritingView PlacementAlignment="TopLeft"/>
</TextBox.HandwritingView>
</TextBox>

Remarks
The enumeration has these values: Auto, TopLeft, TopRight, BottomLeft, and BottomRight.
See Text input with the handwriting view
Also
HandwritingView.PlacementAlignmentProperty
HandwritingView.PlacementAlignmentProperty
HandwritingView.PlacementAlignmentProperty
I n this Article
Edit
Identifies the PlacementAlignment dependency property.
public : static DependencyProperty PlacementAlignmentProperty { get; }
static DependencyProperty PlacementAlignmentProperty();
public static DependencyProperty PlacementAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the PlacementAlignment dependency property.
See Text input with the handwriting view
Also
HandwritingView.PlacementTarget HandwritingView.
PlacementTarget HandwritingView.PlacementTarget
I n this Article
Edit
Gets or sets the visual element or control that the handwriting view should be positioned in relation to when opened.
public : UIElement PlacementTarget { get; set; }
UIElement PlacementTarget();

void PlacementTarget(UIElement placementtarget);


public UIElement PlacementTarget { get; set; }

Returns
UIElement
The visual element or control that the handwriting view should be positioned in relation to when opened. The default is
null.

Remarks
If there is no explicit PlacementTarget set, the placement target is the parent text control.
See Text input with the handwriting view
Also
HandwritingView.PlacementTargetProperty Handwriting
View.PlacementTargetProperty HandwritingView.
PlacementTargetProperty
I n this Article
Edit
Identifies the PlacementTarget dependency property.
public : static DependencyProperty PlacementTargetProperty { get; }
static DependencyProperty PlacementTargetProperty();
public static DependencyProperty PlacementTargetProperty { get; }

Returns
DependencyProperty
The identifier for the PlacementTarget dependency property.
See Text input with the handwriting view
Also
HandwritingView.TryClose HandwritingView.TryClose
HandwritingView.TryClose
I n this Article
Edit
Attempts to close the handwriting view panel.
public : Platform::Boolean TryClose()
bool TryClose() const;
public bool TryClose()

Returns
bool
true if the handwriting view panel closed; otherwise, false.

Remarks
The Closed event is raised if the handwriting view opens successfully.
See Text input with the handwriting view
Also
HandwritingView.TryOpen HandwritingView.TryOpen
HandwritingView.TryOpen
I n this Article
Edit
Attempts to open the handwriting view panel.
public : Platform::Boolean TryOpen()
bool TryOpen() const;
public bool TryOpen()

Returns
bool
true if the handwriting view panel opened; otherwise, false.

Remarks
There are cases where the handwriting view does not open, such as when the current language is not supported.
The Opened event is raised if the handwriting view opens successfully.
See Text input with the handwriting view
Also
Hub Hub Hub Class
For Windows 10 and later: We recommend against using this control; use one of the other navigation
controls instead. For a list, see the Navigation basics article. Represents a control that displays groups of content
in a panning view.

D eclaration
public : class Hub : Control, IHub, ISemanticZoomInformation
struct winrt::Windows::UI::Xaml::Controls::Hub : Control, IHub, ISemanticZoomInformation
public class Hub : Control, IHub, ISemanticZoomInformation

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
Use a Hub to show different collections of data, either from the same source or from different sources.
H ub content
Add content to the Hub by adding HubSection objects to the Sections collection. These sections use a DataTemplate to
define the content for the section, and a Header property, which can be any content. If the Header object is a complex
data type as opposed to just a string, you can define the look of the header using the HeaderTemplate property.
The Hub uses virtualization to load sections as the user pans. You can handle the SectionsInViewChanged event to
respond to changes.
I nteractive section headers
You can set the HubSectionHeader.IsHeaderInteractive property is true to let a user navigate to the corresponding app
section page. When its IsHeaderInteractive property is true, the default header includes the text, See more. When a
user taps the See more text, the SectionHeaderClick event is raised. If you use a custom HeaderTemplate, you should
provide similar visual cues to indicate that the header is interactive.
You can handle the SectionHeaderClick event to respond to a tapped header. You get the section that was clicked from
the SectionHeaderClickEventArgs.Section property of the event data.
H ub and SemanticZoom
If you declare a Hub as the ZoomedInView of a SemanticZoom, the section headers change to HyperlinkButton s that
invoke the ZoomedOutView of the SemanticZoom when they're clicked.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the Hub control.

R ES O U R CE K EY D ES CR IPTIO N

HubForeground Control foreground color

Constructors
Hub()
Hub()
Hub()

Initializes a new instance of the Hub class.

Properties
DefaultSectionIndex
DefaultSectionIndex
DefaultSectionIndex

Gets or sets the index of the hub section to show first when the Hub is initialized.

DefaultSectionIndexProperty
DefaultSectionIndexProperty
DefaultSectionIndexProperty

Identifies the DefaultSectionIndex dependency property.

Header
Header
Header

Gets or sets the content for the hub header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the hub header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

IsActiveView
IsActiveView
IsActiveView

Gets or sets a value that indicates whether the Hub instance is the active view in its owning SemanticZoom.

IsActiveViewProperty
IsActiveViewProperty
IsActiveViewProperty

Identifies the IsActiveView dependency property.

IsZoomedInView
IsZoomedInView
IsZoomedInView

Gets or sets a value that indicates whether the Hub instance is the zoomed-in view in its owning SemanticZoom.

IsZoomedInViewProperty
IsZoomedInViewProperty
IsZoomedInViewProperty

Identifies the IsZoomedInView dependency property.

Orientation
Orientation
Orientation

Gets or sets the orientation of a Hub.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the Orientation dependency property.


SectionHeaders
SectionHeaders
SectionHeaders

Gets a collection of the headers of the hub sections.

Sections
Sections
Sections

Gets all the hub sections in the Hub.

SectionsInView
SectionsInView
SectionsInView

Gets the hub sections currently on the screen.

SemanticZoomOwner
SemanticZoomOwner
SemanticZoomOwner

Gets or sets the SemanticZoom instance that hosts the Hub.

SemanticZoomOwnerProperty
SemanticZoomOwnerProperty
SemanticZoomOwnerProperty

Identifies the SemanticZoomOwner dependency property.

Methods
CompleteViewChange()
CompleteViewChange()
CompleteViewChange()

Changes related aspects of presentation when the overall view for a SemanticZoom changes.

CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)

Completes item-wise operations that are related to a view change when the Hub instance is the source view and
the new view is a potentially different implementing view.

CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)

Completes item-wise operations that are related to a view change when the Hub instance is the destination view
and the source view is a potentially different implementing view.

InitializeViewChange()
InitializeViewChange()
InitializeViewChange()

Initializes the changes to related aspects of presentation (such as scrolling UI or state) when the overall view for a
SemanticZoom is about to change.

MakeVisible(SemanticZoomLocation)
MakeVisible(SemanticZoomLocation)
MakeVisible(SemanticZoomLocation)

Forces content in the view to scroll until the item that's specified by SemanticZoomLocation is visible. Also focuses
the item if it finds the item.

ScrollToSection(HubSection)
ScrollToSection(HubSection)
ScrollToSection(HubSection)

Scrolls the hub to bring the specified hub section into view.

StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)

Initializes item-wise operations that are related to a view change when the Hub instance is the source view and the
pending destination view is a potentially different implementing view.

StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)

Initializes item-wise operations that are related to a view change when the source view is a different view and the
pending destination view is the Hub instance.

Events
SectionHeaderClick
SectionHeaderClick
SectionHeaderClick

Occurs when a section header is clicked and the section's IsHeaderInteractive property is true.
SectionsInViewChanged
SectionsInViewChanged
SectionsInViewChanged

Occurs when the SectionsInView collection changes.

See Also
Hub.CompleteViewChange Hub.CompleteViewChange
Hub.CompleteViewChange
I n this Article
Edit
Changes related aspects of presentation when the overall view for a SemanticZoom changes.
public : void CompleteViewChange()
void CompleteViewChange() const;
public void CompleteViewChange()

See SemanticZoom
Also
Hub.CompleteViewChangeFrom Hub.CompleteView
ChangeFrom Hub.CompleteViewChangeFrom
I n this Article
Edit
Completes item-wise operations that are related to a view change when the Hub instance is the source view and the
new view is a potentially different implementing view.
public : void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)
void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
See SemanticZoom
Also
Hub.CompleteViewChangeTo Hub.CompleteViewChange
To Hub.CompleteViewChangeTo
I n this Article
Edit
Completes item-wise operations that are related to a view change when the Hub instance is the destination view and
the source view is a potentially different implementing view.
public : void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)
void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
See SemanticZoom
Also
Hub.DefaultSectionIndex Hub.DefaultSectionIndex Hub.
DefaultSectionIndex
I n this Article
Edit
Gets or sets the index of the hub section to show first when the Hub is initialized.
public : int DefaultSectionIndex { get; set; }
int32_t DefaultSectionIndex();

void DefaultSectionIndex(int32_t defaultsectionindex);


public int DefaultSectionIndex { get; set; }

<Hub DefaultSectionIndex=int/>

Returns
int
The index of the hub section to show first when the Hub is initialized.
See HubSection
Also
Hub.DefaultSectionIndexProperty Hub.DefaultSection
IndexProperty Hub.DefaultSectionIndexProperty
I n this Article
Edit
Identifies the DefaultSectionIndex dependency property.
public : static DependencyProperty DefaultSectionIndexProperty { get; }
static DependencyProperty DefaultSectionIndexProperty();
public static DependencyProperty DefaultSectionIndexProperty { get; }

Returns
DependencyProperty
The identifier for the DefaultSectionIndex dependency property.
Hub.Header Hub.Header Hub.Header
I n this Article
Edit
Gets or sets the content for the hub header.

public : Platform::Object Header { get; set; }


winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<Hub Header="headerString"/>

Returns
object
The content of the hub header. The default is null.

Remarks
Add a header to let users know the context of your Hub. This is often the name of your app. It's important to remember
that although you can use arbitrary content in the header, the height of the header affects the amount of vertical space
available for your hub section content. The header remains fixed in its position and doesn't scroll with the hub sections.
You can use a data template for the header by setting the HeaderTemplate property.
Hub.HeaderProperty Hub.HeaderProperty Hub.Header
Property
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
Hub.HeaderTemplate Hub.HeaderTemplate Hub.Header
Template
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the hub header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<Hub HeaderTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
Hub.HeaderTemplateProperty Hub.HeaderTemplate
Property Hub.HeaderTemplateProperty
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
Hub Hub Hub
I n this Article
Edit
Initializes a new instance of the Hub class.

public : Hub()
Hub() const;
public Hub()
Hub.InitializeViewChange Hub.InitializeViewChange
Hub.InitializeViewChange
I n this Article
Edit
Initializes the changes to related aspects of presentation (such as scrolling UI or state) when the overall view for a
SemanticZoom is about to change.
public : void InitializeViewChange()
void InitializeViewChange() const;
public void InitializeViewChange()

See SemanticZoom
Also
Hub.IsActiveView Hub.IsActiveView Hub.IsActiveView
I n this Article
Edit
Gets or sets a value that indicates whether the Hub instance is the active view in its owning SemanticZoom.

public : Platform::Boolean IsActiveView { get; set; }


bool IsActiveView();

void IsActiveView(bool isactiveview);


public bool IsActiveView { get; set; }

Returns
bool
true if the Hub is the active view; otherwise, false.

Remarks
You typically don't set this property in XAML or in app code. The property is set implicitly when the view is set as either
the ZoomedInView or ZoomedOutView of a SemanticZoom control.
See SemanticZoom
Also
Hub.IsActiveViewProperty Hub.IsActiveViewProperty
Hub.IsActiveViewProperty
I n this Article
Edit
Identifies the IsActiveView dependency property.
public : static DependencyProperty IsActiveViewProperty { get; }
static DependencyProperty IsActiveViewProperty();
public static DependencyProperty IsActiveViewProperty { get; }

Returns
DependencyProperty
The identifier for the IsActiveView dependency property.
Hub.IsZoomedInView Hub.IsZoomedInView Hub.Is
ZoomedInView
I n this Article
Edit
Gets or sets a value that indicates whether the Hub instance is the zoomed-in view in its owning SemanticZoom.
public : Platform::Boolean IsZoomedInView { get; set; }
bool IsZoomedInView();

void IsZoomedInView(bool iszoomedinview);


public bool IsZoomedInView { get; set; }

Returns
bool
true if the Hub is the zoomed-in view; otherwise, false.

Remarks
You typically don't set this property in XAML or in app code. The property is set implicitly when the view is set as either
the ZoomedInView or ZoomedOutView of a SemanticZoom control.
See SemanticZoom
Also
Hub.IsZoomedInViewProperty Hub.IsZoomedInView
Property Hub.IsZoomedInViewProperty
I n this Article
Edit
Identifies the IsZoomedInView dependency property.
public : static DependencyProperty IsZoomedInViewProperty { get; }
static DependencyProperty IsZoomedInViewProperty();
public static DependencyProperty IsZoomedInViewProperty { get; }

Returns
DependencyProperty
The identifier for the IsZoomedInView dependency property.
Hub.MakeVisible Hub.MakeVisible Hub.MakeVisible
I n this Article
Edit
Forces content in the view to scroll until the item that's specified by SemanticZoomLocation is visible. Also focuses the
item if it finds the item.
public : void MakeVisible(SemanticZoomLocation item)
void MakeVisible(SemanticZoomLocation item) const;
public void MakeVisible(SemanticZoomLocation item)

Parameters
item SemanticZoomLocation
The item in the view to scroll to.

Remarks
You use the MakeVisible method to bring an item into view when the Hub control is used as a view in a SemanticZoom
control. To bring an item into view when the Hub control is not used in a SemanticZoom, use the ScrollToSection
method instead.
See SemanticZoom
Also
Hub.Orientation Hub.Orientation Hub.Orientation
I n this Article
Edit
Gets or sets the orientation of a Hub.

public : Orientation Orientation { get; set; }


Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

<Hub Orientation="Horizontal"/>
-or-
<Hub Orientation="Vertical"/>

Returns
Orientation
One of the Orientation values. The default is Horizontal.
Hub.OrientationProperty Hub.OrientationProperty Hub.
OrientationProperty
I n this Article
Edit
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
Hub.ScrollToSection Hub.ScrollToSection Hub.ScrollTo
Section
I n this Article
Edit
Scrolls the hub to bring the specified hub section into view.
public : void ScrollToSection(HubSection section)
void ScrollToSection(HubSection section) const;
public void ScrollToSection(HubSection section)

Parameters
section HubSection
The hub section to bring into view.

Remarks
You use the ScrollToSection method to bring a section into view when the Hub control is not used as a view in a
SemanticZoom control. To bring a section into view when the Hub control is used in a SemanticZoom, use the
MakeVisible method instead.
Hub.SectionHeaderClick Hub.SectionHeaderClick Hub.
SectionHeaderClick
I n this Article
Edit
Occurs when a section header is clicked and the section's IsHeaderInteractive property is true.
public : event HubSectionHeaderClickEventHandler SectionHeaderClick
// Register
event_token SectionHeaderClick(HubSectionHeaderClickEventHandler const& handler) const;

// Revoke with event_token


void SectionHeaderClick(event_token const& cookie) const;

// Revoke with event_revoker


SectionHeaderClick_revoker SectionHeaderClick(auto_revoke_t, HubSectionHeaderClickEventHandler
const& handler) const;
public event HubSectionHeaderClickEventHandler SectionHeaderClick

<Hub SectionHeaderClick="eventhandler" />

Remarks
You can make a section header interactive by setting the IsHeaderInteractive property to true. Typically, the user can
tap an interactive header to navigate to the corresponding app section page.
You get the section that was clicked from the SectionHeaderClickEventArgs.Section property of the event data.
When its IsHeaderInteractive property is true, the default header includes a chevron glyph, and "Hover" and "Pressed"
visual states. If you use a custom HeaderTemplate, you should provide similar visual cues to indicate that the header is
interactive.
Hub.SectionHeaders Hub.SectionHeaders Hub.Section
Headers
I n this Article
Edit
Gets a collection of the headers of the hub sections.
public : IObservableVector<Platform::Object> SectionHeaders { get; }
IObservableVector<winrt::Windows::Foundation::IInspectable> SectionHeaders();
public IObservableVector<object> SectionHeaders { get; }

Returns
IObservableVector<object>
The headers of the hub sections. The default is an empty collection.
See SectionHeaderClickSectionHeaderClickSectionHeaderClick
Also
Hub.Sections Hub.Sections Hub.Sections
I n this Article
Edit
Gets all the hub sections in the Hub.

public : IVector<HubSection> Sections { get; }


IVector<HubSection> Sections();
public IList<HubSection> Sections { get; }

<Hub ...>
oneOrMoreHubSections
</Hub>

Returns
IList<HubSection>
All the hub sections in the Hub. The default is an empty collection.
See HubSection
Also
Hub.SectionsInView Hub.SectionsInView Hub.SectionsIn
View
I n this Article
Edit
Gets the hub sections currently on the screen.
public : IVector<HubSection> SectionsInView { get; }
IVector<HubSection> SectionsInView();
public IList<HubSection> SectionsInView { get; }

Returns
IList<HubSection>
The hub sections currently on the screen.
Hub.SectionsInViewChanged Hub.SectionsInView
Changed Hub.SectionsInViewChanged
I n this Article
Edit
Occurs when the SectionsInView collection changes.
public : event SectionsInViewChangedEventHandler SectionsInViewChanged
// Register
event_token SectionsInViewChanged(SectionsInViewChangedEventHandler const& handler) const;

// Revoke with event_token


void SectionsInViewChanged(event_token const& cookie) const;

// Revoke with event_revoker


SectionsInViewChanged_revoker SectionsInViewChanged(auto_revoke_t, SectionsInViewChangedEventHandler
const& handler) const;
public event SectionsInViewChangedEventHandler SectionsInViewChanged

<Hub SectionsInViewChanged="eventhandler" />


Hub.SemanticZoomOwner Hub.SemanticZoomOwner
Hub.SemanticZoomOwner
I n this Article
Edit
Gets or sets the SemanticZoom instance that hosts the Hub.
public : SemanticZoom SemanticZoomOwner { get; set; }
SemanticZoom SemanticZoomOwner();

void SemanticZoomOwner(SemanticZoom semanticzoomowner);


public SemanticZoom SemanticZoomOwner { get; set; }

Returns
SemanticZoom
The SemanticZoom instance that hosts this Hub, or null if the Hub is not hosted in a SemanticZoom control.

Remarks
You don't set this property in XAML or in your app code. The property is set implicitly when the view is set as either the
ZoomedInView or ZoomedOutView of a SemanticZoom control.
See SemanticZoom
Also
Hub.SemanticZoomOwnerProperty Hub.SemanticZoom
OwnerProperty Hub.SemanticZoomOwnerProperty
I n this Article
Edit
Identifies the SemanticZoomOwner dependency property.
public : static DependencyProperty SemanticZoomOwnerProperty { get; }
static DependencyProperty SemanticZoomOwnerProperty();
public static DependencyProperty SemanticZoomOwnerProperty { get; }

Returns
DependencyProperty
The identifier for the SemanticZoomOwner dependency property.
Hub.StartViewChangeFrom Hub.StartViewChangeFrom
Hub.StartViewChangeFrom
I n this Article
Edit
Initializes item-wise operations that are related to a view change when the Hub instance is the source view and the
pending destination view is a potentially different implementing view.
public : void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)
void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
See SemanticZoom
Also
Hub.StartViewChangeTo Hub.StartViewChangeTo Hub.
StartViewChangeTo
I n this Article
Edit
Initializes item-wise operations that are related to a view change when the source view is a different view and the
pending destination view is the Hub instance.
public : void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)
void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
See SemanticZoom
Also
HubSection HubSection HubSection Class
Represents a single group of content in a Hub.

D eclaration
public : class HubSection : Control, IHubSection
struct winrt::Windows::UI::Xaml::Controls::HubSection : Control, IHubSection
public class HubSection : Control, IHubSection

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
You put the content of your Hub in various HubSection elements. Like the Hub, each HubSection has a Header and
HeaderTemplate property that you can use to set an optional header for the section. You can also make the section
header interactive. Typically, the user can tap an interactive header to navigate to the corresponding app section page.
When its IsHeaderInteractive property is true, the default header includes a chevron glyph, and "Hover" and "Pressed"
visual states, and it raises a SectionHeaderClick event.
You don't add content directly to a hub section; instead, you define the content of your HubSection in a DataTemplate.
Content can be defined inline, or bound to a data source. Any valid XAML can be used in a hub section.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the HubSection control.

R ES O U R CE K EY D ES CR IPTIO N

HubSectionHeaderForeground Header text color

HubSectionHeaderButtonForeground Button icon color at rest

HubSectionHeaderButtonForegroundPointerOver Button icon color on hover


HubSectionHeaderButtonForegroundPressed Button icon color when pressed

HubSectionHeaderButtonForegroundDisabled Button icon color when disabled

Constructors
HubSection()
HubSection()
HubSection()

Initializes a new instance of the HubSection class.

Properties
ContentTemplate
ContentTemplate
ContentTemplate

Gets or sets the data template that is used to display the content of the HubSection.

ContentTemplateProperty
ContentTemplateProperty
ContentTemplateProperty

Identifies the ContentTemplate dependency property.

Header
Header
Header

Gets or sets the content for the hub section header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the hub section header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

IsHeaderInteractive
IsHeaderInteractive
IsHeaderInteractive

Gets or sets a value that indicates whether the section header raises a SectionHeaderClick event on its containing
Hub.

IsHeaderInteractiveProperty
IsHeaderInteractiveProperty
IsHeaderInteractiveProperty

Identifies the IsHeaderInteractive dependency property.

See Also
Control
Control
Control
HubSection.ContentTemplate HubSection.Content
Template HubSection.ContentTemplate
I n this Article
Edit
Gets or sets the data template that is used to display the content of the HubSection.
public : DataTemplate ContentTemplate { get; set; }
DataTemplate ContentTemplate();

void ContentTemplate(DataTemplate contenttemplate);


public DataTemplate ContentTemplate { get; set; }

<HubSection>
<HubSection.ContentTemplate>
dataTemplate
</HubSection.ContentTemplate>
</HubSection>

Returns
DataTemplate
The data template that is used to display the content of the HubSection.
HubSection.ContentTemplateProperty HubSection.
ContentTemplateProperty HubSection.ContentTemplate
Property
I n this Article
Edit
Identifies the ContentTemplate dependency property.
public : static DependencyProperty ContentTemplateProperty { get; }
static DependencyProperty ContentTemplateProperty();
public static DependencyProperty ContentTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the ContentTemplate dependency property.
HubSection.Header HubSection.Header HubSection.
Header
I n this Article
Edit
Gets or sets the content for the hub section header.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<HubSection Header="headerString"/>

Returns
object
The content of the section header. The default is null.

Remarks
Add a header to let users know the context of your Hub section. It's important to remember that although you can use
arbitrary content in the header, the height of the header affects the amount of vertical space available for your hub
section content. The section header scrolls with the hub section.
You can use a data template for the header by setting the HeaderTemplate property.
You can make a section header interactive by setting the IsHeaderInteractive property to true. Typically, the user can
tap an interactive header to navigate to the corresponding app section page.
You can respond to a tapped header by handling the Hub.SectionHeaderClick event. You get the section that was
clicked from the SectionHeaderClickEventArgs.Section property of the event data.
Windows 10
When its IsHeaderInteractive property is true, the default header includes the text, See more. When a user taps the
See more text, the SectionHeaderClick event is raised. The text is rendered as a hyperlink, which uses the user selected
system accent color by default.
Windows 8.x
When its IsHeaderInteractive property is true, the default header includes a chevron glyph, and "Hover" and "Pressed"
visual states. If you use a custom HeaderTemplate, you should provide similar visual cues to indicate that the header is
interactive.
HubSection.HeaderProperty HubSection.HeaderProperty
HubSection.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
HubSection.HeaderTemplate HubSection.Header
Template HubSection.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the hub section header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<HubSection>
<HubSection.HeaderTemplate>
singleDataTemplate
</HubSection.HeaderTemplate>
</HubSection>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
HubSection.HeaderTemplateProperty HubSection.
HeaderTemplateProperty HubSection.HeaderTemplate
Property
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
HubSection HubSection HubSection
I n this Article
Edit
Initializes a new instance of the HubSection class.

public : HubSection()
HubSection() const;
public HubSection()
HubSection.IsHeaderInteractive HubSection.IsHeader
Interactive HubSection.IsHeaderInteractive
I n this Article
Edit
Gets or sets a value that indicates whether the section header raises a SectionHeaderClick event on its containing Hub.
public : Platform::Boolean IsHeaderInteractive { get; set; }
bool IsHeaderInteractive();

void IsHeaderInteractive(bool isheaderinteractive);


public bool IsHeaderInteractive { get; set; }

<HubSection IsHeaderInteractive="bool" />

Returns
bool
true if the section header raises a SectionHeaderClick event; otherwise, false. The default is false.

Remarks
You can make a section header interactive by setting the IsHeaderInteractive property to true. Typically, the user can
tap an interactive header to navigate to the corresponding app section page.
You can respond to a tapped header by handling the Hub.SectionHeaderClick event. You get the section that was
clicked from the SectionHeaderClickEventArgs.Section property of the event data.
Windows 10
When its IsHeaderInteractive property is true, the default header includes the text, See more. When a user taps the
See more text, the SectionHeaderClick event is raised. The text is rendered as a hyperlink, which uses the user selected
system accent color by default.
Windows 8.x
When its IsHeaderInteractive property is true, the default header includes a chevron glyph, and "Hover" and "Pressed"
visual states. If you use a custom HeaderTemplate, you should provide similar visual cues to indicate that the header is
interactive.
HubSection.IsHeaderInteractiveProperty HubSection.Is
HeaderInteractiveProperty HubSection.IsHeader
InteractiveProperty
I n this Article
Edit
Identifies the IsHeaderInteractive dependency property.
public : static DependencyProperty IsHeaderInteractiveProperty { get; }
static DependencyProperty IsHeaderInteractiveProperty();
public static DependencyProperty IsHeaderInteractiveProperty { get; }

Returns
DependencyProperty
The identifier for the IsHeaderInteractive dependency property.
HubSectionCollection HubSectionCollection HubSection
Collection Class
Represents an ordered collection of HubSection objects.

D eclaration
public : sealed class HubSectionCollection : IIterable<HubSection>, IVector<HubSection>
struct winrt::Windows::UI::Xaml::Controls::HubSectionCollection : IIterable<HubSection>,
IVector<HubSection>
public sealed class HubSectionCollection : IEnumerable<HubSection>, IList<HubSection>

I nheritance H ierarchy
None

Remarks
A HubSectionCollection is the type of object that you get from the Sections property of a Hub. All the properties that
use a HubSectionCollection in the Windows Runtime API are read-only properties, where the property is initialized
with zero items when an object is first instantiated. But you can then add, remove or query items in the collection at run
time, using the HubSectionCollection properties and methods.
Enumerating the collection in C# or Microsoft V isual B asic
A HubSectionCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate
the items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable
explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerable with a
HubSection constraint.

Properties
Item[Int32]
Item[Int32]
Item[Int32]

Gets or sets the element at the specified index.

Size
Size
Size

Gets the size (count) of the collection.

Methods
Append(HubSection)
Append(HubSection)
Append(HubSection)

Adds a new item to the collection.


Clear()
Clear()
Clear()

Removes all items from the collection.

First()
First()
First()

Returns the iterator for iteration over the items in the collection.

GetAt(UInt32)
GetAt(UInt32)
GetAt(UInt32)

Returns the item located at the specified index.

GetEnumerator()
GetEnumerator()
GetEnumerator()

Returns an enumerator that iterates through the collection.

GetMany(UInt32, HubSection[])
GetMany(UInt32, HubSection[])
GetMany(UInt32, HubSection[])

Retrieves multiple elements in a single pass through the iterator.

GetView()
GetView()
GetView()

Gets an immutable view into the collection.

IndexOf(T)
IndexOf(T)
IndexOf(T)

Determines the index of a specific item in the System.Collections.Generic.IList`1.

IndexOf(HubSection, UInt32)
IndexOf(HubSection, UInt32)
IndexOf(HubSection, UInt32)
Retrieves the index of the specified item.

Insert(Int32, T)
Insert(Int32, T)
Insert(Int32, T)

Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

InsertAt(UInt32, HubSection)
InsertAt(UInt32, HubSection)
InsertAt(UInt32, HubSection)

Inserts the specified item at the specified index.

RemoveAt(Int32)
RemoveAt(Int32)
RemoveAt(Int32)

Removes the System.Collections.Generic.IList`1 item at the specified index.

RemoveAt(UInt32)
RemoveAt(UInt32)
RemoveAt(UInt32)

Removes the item at the specified index.

RemoveAtEnd()
RemoveAtEnd()
RemoveAtEnd()

Removes the last item in the collection.

ReplaceAll(HubSection[])
ReplaceAll(HubSection[])
ReplaceAll(HubSection[])

Initially clears the collection, then inserts the provided array as new items.

SetAt(UInt32, HubSection)
SetAt(UInt32, HubSection)
SetAt(UInt32, HubSection)

Sets the value at the specified index to the item value specified.
See Also
HubSection
HubSectionCollection.Append HubSectionCollection.
Append HubSectionCollection.Append
I n this Article
Edit
Adds a new item to the collection.
public : void Append(HubSection value)
void Append(HubSection value) const;
// This member is not implemented in C#

Parameters
value HubSection
The new item to add.

Remarks
To add an item to a position in the collection that's not at the collection end, use InsertAt.
If you are programming using C# or Microsoft Visual Basic, the equivalent method is Add.
HubSectionCollection.Clear HubSectionCollection.Clear
HubSectionCollection.Clear
I n this Article
Edit
Removes all items from the collection.
public : void Clear()
void Clear() const;
// This member is not implemented in C#
HubSectionCollection.First HubSectionCollection.First
HubSectionCollection.First
I n this Article
Edit
Returns the iterator for iteration over the items in the collection.
public : IIterator<HubSection> First()
IIterator<HubSection> First() const;
// This member is not implemented in C#

Returns
IIterator<HubSection>
The iterator object. The iterator's current position is at the 0-index position, or at the collection end if the collection is
empty.
HubSectionCollection.GetAt HubSectionCollection.GetAt
HubSectionCollection.GetAt
I n this Article
Edit
Returns the item located at the specified index.
public : HubSection GetAt(unsigned int index)
HubSection GetAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The integer index for the value to retrieve.
Returns
HubSection
The item value at the specified index.
IEnumerable<T>.GetEnumerator IEnumerable<T>.Get
Enumerator
I n this Article
Edit
Returns an enumerator that iterates through the collection.
// This member is not implemented in C++/CX
IEnumerator<T> GetEnumerator()

Returns
An enumerator that can be used to iterate through the collection.
HubSectionCollection.GetMany HubSectionCollection.
GetMany HubSectionCollection.GetMany
I n this Article
Edit
Retrieves multiple elements in a single pass through the iterator.
public : unsigned int GetMany(unsigned int startIndex, HubSection[] items)
uint32_t GetMany(uint32_t startIndex, HubSection[] items) const;
// This member is not implemented in C#

Parameters
startIndex UInt32
The index from which to start retrieval.
items HubSection[]
Provides the destination for the result. Size the initial array size as a "capacity" in order to specify how many results
should be retrieved.
Returns
uint
The number of items retrieved.
HubSectionCollection.GetView HubSectionCollection.Get
View HubSectionCollection.GetView
I n this Article
Edit
Gets an immutable view into the collection.
public : IVectorView<HubSection> GetView()
IVectorView<HubSection> GetView() const;
// This member is not implemented in C#

Returns
IReadOnlyList<HubSection>
An object representing the immutable collection view.
HubSectionCollection.IndexOf HubSectionCollection.
IndexOf HubSectionCollection.IndexOf
I n this Article

Overloads
IndexOf(T) IndexOf(T)
Determines the index of a specific item in the
System.Collections.Generic.IList`1.

IndexOf(HubSection, UInt32) IndexOf(HubSection, UInt32)


IndexOf(HubSection, UInt32) Retrieves the index of the specified item.

IndexOf(T) IndexOf(T)
Edit
Determines the index of a specific item in the System.Collections.Generic.IList`1.
// This member is not implemented in C++/CX
int IndexOf(T item)

Parameters
item TTT
The object to locate in the System.Collections.Generic.IList`1.
Returns
The index of item if found in the list; otherwise, -1.

IndexOf(HubSection, UInt32) IndexOf(HubSection, UInt32)


IndexOf(HubSection, UInt32)
Edit
Retrieves the index of the specified item.
public : Platform::Boolean IndexOf(HubSection value, unsigned int index)
bool IndexOf(HubSection value, uint32_t const& index) const;
// This member is not implemented in C#

Parameters
value HubSection
The value to find in the collection.
index UInt32
The index of the item, if it is found.
Returns
bool
true if an item with the specified value was found; otherwise, false.
IList<T>.Insert IList<T>.Insert
I n this Article
Edit
Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

// This member is not implemented in C++/CX


void Insert(int index, T item)

Parameters
index
The zero-based index at which item should be inserted.
item TT
The object to insert into the System.Collections.Generic.IList`1.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.
HubSectionCollection.InsertAt HubSectionCollection.
InsertAt HubSectionCollection.InsertAt
I n this Article
Edit
Inserts the specified item at the specified index.
public : void InsertAt(unsigned int index, HubSection value)
void InsertAt(uint32_t index, HubSection value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value HubSection
The value to set.

Remarks
InsertAt expands the collection and moves all subsequent index items by one.
IList<T>.Item IList<T>.Item
I n this Article
Edit
Gets or sets the element at the specified index.

// This member is not implemented in C++/CX


T this[int index] { get; set; }

Parameters
index
The zero-based index of the element to get or set.
Returns
TT
The element at the specified index.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The property is set and the System.Collections.Generic.IList`1 is read-only.
HubSectionCollection.RemoveAt HubSectionCollection.
RemoveAt HubSectionCollection.RemoveAt
I n this Article

Overloads
RemoveAt(Int32) RemoveAt(Int32)
Removes the System.Collections.Generic.IList`1 item at the
specified index.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Removes the item at the specified index.

RemoveAt(Int32) RemoveAt(Int32)
Edit
Removes the System.Collections.Generic.IList`1 item at the specified index.
// This member is not implemented in C++/CX
void RemoveAt(int index)

Parameters
index
The zero-based index of the item to remove.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Edit
Removes the item at the specified index.
public : void RemoveAt(unsigned int index)
void RemoveAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The index position of the item to remove.
Remarks
If successful, calling this method reduces the collection size by one. Items with index values greater than the called
index have their index values reduced by one.
HubSectionCollection.RemoveAtEnd HubSection
Collection.RemoveAtEnd HubSectionCollection.Remove
AtEnd
I n this Article
Edit
Removes the last item in the collection.
public : void RemoveAtEnd()
void RemoveAtEnd() const;
// This member is not implemented in C#
HubSectionCollection.ReplaceAll HubSectionCollection.
ReplaceAll HubSectionCollection.ReplaceAll
I n this Article
Edit
Initially clears the collection, then inserts the provided array as new items.
public : void ReplaceAll(HubSection[] items)
void ReplaceAll(HubSection[] items) const;
// This member is not implemented in C#

Parameters
items HubSection[]
The new collection items.
HubSectionCollection.SetAt HubSectionCollection.SetAt
HubSectionCollection.SetAt
I n this Article
Edit
Sets the value at the specified index to the item value specified.
public : void SetAt(unsigned int index, HubSection value)
void SetAt(uint32_t index, HubSection value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value HubSection
The value to set.

Remarks
SetAt replaces the item at the index, and the collection count remains the same.
HubSectionCollection.Size HubSectionCollection.Size
HubSectionCollection.Size
I n this Article
Edit
Gets the size (count) of the collection.
public : unsigned int Size { get; }
uint32_t Size();
// This member is not implemented in C#

Returns
uint
The count of items in the collection.

Remarks
If you are programming using C# or Microsoft Visual Basic, use the Count property.
HubSectionHeaderClickEventArgs HubSectionHeader
ClickEventArgs HubSectionHeaderClickEventArgs Class
Provides data for the Hub.SectionHeaderClick event.

D eclaration
public : sealed class HubSectionHeaderClickEventArgs : IHubSectionHeaderClickEventArgs
struct winrt::Windows::UI::Xaml::Controls::HubSectionHeaderClickEventArgs :
IHubSectionHeaderClickEventArgs
public sealed class HubSectionHeaderClickEventArgs : IHubSectionHeaderClickEventArgs

I nheritance H ierarchy
None

Constructors
HubSectionHeaderClickEventArgs()
HubSectionHeaderClickEventArgs()
HubSectionHeaderClickEventArgs()

Initializes a new instance of the HubSectionHeaderClickEventArgs class.

Properties
Section
Section
Section

Gets the HubSection for the header that was clicked.

See Also
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs HubSectionHeaderClickEventArgs
HubSectionHeaderClickEventArgs HubSectionHeader
ClickEventArgs HubSectionHeaderClickEventArgs
I n this Article
Edit
Initializes a new instance of the HubSectionHeaderClickEventArgs class.
public : HubSectionHeaderClickEventArgs()
HubSectionHeaderClickEventArgs() const;
public HubSectionHeaderClickEventArgs()
HubSectionHeaderClickEventArgs.Section HubSection
HeaderClickEventArgs.Section HubSectionHeaderClick
EventArgs.Section
I n this Article
Edit
Gets the HubSection for the header that was clicked.
public : HubSection Section { get; }
HubSection Section();
public HubSection Section { get; }

Returns
HubSection
The HubSection for the header that was clicked.
HubSectionHeaderClickEventHandler HubSectionHeader
ClickEventHandler HubSectionHeaderClickEventHandler
Delegate
Represents the method that will handle a Hub.SectionHeaderClick event.

D eclaration
public : delegate void HubSectionHeaderClickEventHandler(Platform::Object sender,
HubSectionHeaderClickEventArgs e)
struct HubSectionHeaderClickEventHandler : winrt::Windows::Foundation::IUnknown
{
HubSectionHeaderClickEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> HubSectionHeaderClickEventHandler(L lambda);
template <typename F> HubSectionHeaderClickEventHandler(F* function);
template <typename O, typename M> HubSectionHeaderClickEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::HubSectionHeaderClickEventArgs const& e) const;
};
public delegate void HubSectionHeaderClickEventHandler(Object sender,
HubSectionHeaderClickEventArgs e)

I nheritance H ierarchy
None
HyperlinkButton HyperlinkButton HyperlinkButton Class
Represents a button control that functions as a hyperlink.

D eclaration
public : class HyperlinkButton : ButtonBase, IHyperlinkButton
struct winrt::Windows::UI::Xaml::Controls::HyperlinkButton : ButtonBase, IHyperlinkButton
public class HyperlinkButton : ButtonBase, IHyperlinkButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase

Remarks
HyperlinkButton is a button that appears as marked up text.

Note

By default, the HyperlinkButton appears as underlined text when you set a string as the value for the Content property.
The text does not appear underlined in the following cases:
You set a TextBlock as the value for the Content property, and set the Text property on the TextBlock.
You re-template the HyperlinkButton and change the name of the ContentPresenter template part. If you need a
button that appears as non-underlined text, consider using a standard Button control and applying the built-in
TextBlockButtonStyle system resource to its Style property.
H yperlink and H yperlinkB utton
There are two ways that you can add a hyperlink to a XAML app. Hyperlink and HyperlinkButton have the similar
purpose of enabling a user to launch a specific URI using a separate browser app.+ Use an inline Hyperlink text
element inside of a text control. A Hyperlink element flows with other text elements and you can use it in any
InlineCollection. For more info, see Hyperlink.
Use a HyperlinkButton control anywhere in the app. A HyperlinkButton is a specialized Button control that you can use
anywhere that you would use a Button.
Navigate to a UR I
To use the hyperlink to navigate to a Uniform Resource Identifier (URI), set the NavigateUri property. When a user
clicks or taps the HyperlinkButton, the specified Uniform Resource Identifier (URI) opens in the default browser. The
default browser runs in a separate process from your app.
 Tip

You don't have to use http: or https: schemes. You can use schemes such as ms-appx:, ms-appdata:, or ms-
resources:, if there's resource content at these locations that's appropriate to load in a browser. However, thefile:
scheme is specifically blocked. For more info, see URI schemes.
When a user clicks the HyperlinkButton, the value of the NavigateUri property is passed to a system handler for
Uniform Resource Identifier (URI) types and schemes. The system then launches the app that is registered for the
scheme of the Uniform Resource Identifier (URI) provided for NavigateUri.
If you don't want the HyperlinkButton to load content in a default Web browser (and don't want a browser to appear),
then don't set a value for NavigateUri. Instead, handle the Click event, and write code that does what you want.
H andle the Click event
Use the Click event for actions other than launching a Uniform Resource Identifier (URI) in a browser, such as
navigation within the app. For example, if you want to load a new app page rather than opening a browser, call a
Frame.Navigate method within your Click event handler to navigate to the new app page. If you want an external,
absolute Uniform Resource Identifier (URI) to load within a WebView control that also exists in your app, call
WebView.Navigate as part of your Click handler logic.
You don't typically handle the Click event as well as specifying a NavigateUri value, as these represent two different
ways of using the Hyperlink element. If your intent is to open the URI in the default browser, and you have specified a
value for NavigateUri, don't handle the Click event. Conversely, if you handle the Click event, don't specify a
NavigateUri.
There's nothing you can do within the Click event handler to prevent the default browser from loading any valid target
specified for NavigateUri; that action takes place automatically (asynchronously) when the hyperlink is activated and
can't be canceled from within the Click event handler.

Constructors
HyperlinkButton()
HyperlinkButton()
HyperlinkButton()

Initializes a new instance of the HyperlinkButton class.

Properties
NavigateUri
NavigateUri
NavigateUri

Gets or sets the Uniform Resource Identifier (URI) to navigate to when the HyperlinkButton is clicked.

NavigateUriProperty
NavigateUriProperty
NavigateUriProperty

Identifies the NavigateUri dependency property.

See Also
ButtonBase
ButtonBase
ButtonBase
HyperlinkButton HyperlinkButton HyperlinkButton
I n this Article
Edit
Initializes a new instance of the HyperlinkButton class.

public : HyperlinkButton()
HyperlinkButton() const;
public HyperlinkButton()
HyperlinkButton.NavigateUri HyperlinkButton.Navigate
Uri HyperlinkButton.NavigateUri
I n this Article
Edit
Gets or sets the Uniform Resource Identifier (URI) to navigate to when the HyperlinkButton is clicked.
public : Uri NavigateUri { get; set; }
Uri NavigateUri();

void NavigateUri(Uri navigateuri);


public Uri NavigateUri { get; set; }

<HyperlinkButton NavigateUri="uriString"/>

Returns
Uri
The Uniform Resource Identifier (URI) to navigate to when the HyperlinkButton is clicked.

Examples
Here's a HyperlinkButton as declared in XAML. It declares a string value for Content and also a NavigateUri value.
<HyperlinkButton Content="www.microsoft.com" NavigateUri="http://www.microsoft.com"/>

Remarks
When a user clicks or otherwise invokes a HyperlinkButton, it opens the URI you specified for the NavigateUri
property in the default browser.
You don't have to use http: or https: schemes for the URI. You can use schemes such as ms-appx:, ms-appdata:, or
ms-resources:, if there's resource content at these locations that's appropriate to load in a browser. However, thefile:
scheme is specifically blocked. For more info, see URI schemes.
HyperlinkButton is a control, so it has input events such as Tapped, and it's a ButtonBase subclass so it also has a Click
event. You don't typically specify a value for NavigateUri and also handle input events that are interpreted as clicking
the HyperlinkButton. The action of opening the NavigateUri in a default browser is a system action that takes place
without requiring any event handling. If your intent is that the HyperlinkButton should load a specified URI within a
WebView control that's also part of your app, then don't specify a value for NavigateUri. Handle the Click event
instead, and call WebView.Navigate, specifying the URI to load.
See Quickstart: Adding button controls
Also
HyperlinkButton.NavigateUriProperty HyperlinkButton.
NavigateUriProperty HyperlinkButton.NavigateUri
Property
I n this Article
Edit
Identifies the NavigateUri dependency property.
public : static DependencyProperty NavigateUriProperty { get; }
static DependencyProperty NavigateUriProperty();
public static DependencyProperty NavigateUriProperty { get; }

Returns
DependencyProperty
The identifier for the NavigateUri dependency property.
ICommandBarElement ICommandBarElement ICommand
BarElement Interface
Defines the compact view for command bar elements.

D eclaration
public : interface ICommandBarElement
struct winrt::Windows::UI::Xaml::Controls::ICommandBarElement
public interface ICommandBarElement

I nheritance H ierarchy
None

Properties
IsCompact
IsCompact
IsCompact

Gets or sets a value that indicates whether the element is shown with no label and reduced padding.
ICommandBarElement.IsCompact ICommandBarElement.
IsCompact ICommandBarElement.IsCompact
I n this Article
Edit
Gets or sets a value that indicates whether the element is shown with no label and reduced padding.
public : Platform::Boolean IsCompact { get; set; }
bool IsCompact();

void IsCompact(bool iscompact);


public bool IsCompact { get; set; }

Returns
bool
true if the element is shown in its compact state; otherwise, false. The default is false.
ICommandBarElement2 ICommandBarElement2 I
CommandBarElement2 Interface
Defines members to manage the command bar overflow menu.

D eclaration
public : interface ICommandBarElement2
struct winrt::Windows::UI::Xaml::Controls::ICommandBarElement2
public interface ICommandBarElement2

I nheritance H ierarchy
None

Properties
DynamicOverflowOrder
DynamicOverflowOrder
DynamicOverflowOrder

Gets or sets the order in which this item is moved to the CommandBar overflow menu.

IsInOverflow
IsInOverflow
IsInOverflow

Gets a value that indicates whether this item is in the overflow menu.
ICommandBarElement2.DynamicOverflowOrder I
CommandBarElement2.DynamicOverflowOrder I
CommandBarElement2.DynamicOverflowOrder
I n this Article
Edit
Gets or sets the order in which this item is moved to the CommandBar overflow menu.
public : int DynamicOverflowOrder { get; set; }
int32_t DynamicOverflowOrder();

void DynamicOverflowOrder(int32_t dynamicoverfloworder);


public int DynamicOverflowOrder { get; set; }

Returns
int
The order in which this item is moved to the overflow menu relative to other items.
ICommandBarElement2.IsInOverflow ICommandBar
Element2.IsInOverflow ICommandBarElement2.IsIn
Overflow
I n this Article
Edit
Gets a value that indicates whether this item is in the overflow menu.
public : Platform::Boolean IsInOverflow { get; }
bool IsInOverflow();
public bool IsInOverflow { get; }

Returns
bool
true if this item is in the overflow menu; otherwise, false.
IconElement IconElement IconElement Class
Represents the base class for an icon UI element.

D eclaration
public : class IconElement : FrameworkElement, IIconElement
struct winrt::Windows::UI::Xaml::Controls::IconElement : FrameworkElement, IIconElement
public class IconElement : FrameworkElement, IIconElement

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
I conElement derived classes
IconElement is the parent class for these classes:
BitmapIcon
FontIcon
PathIcon
SymbolIcon
IconSourceElement

Properties
Foreground
Foreground
Foreground

Gets or sets a brush that describes the foreground color.

ForegroundProperty
ForegroundProperty
ForegroundProperty

Identifies the Foreground dependency property.

See Also
FrameworkElement
FrameworkElement
IconElement.Foreground IconElement.Foreground Icon
Element.Foreground
I n this Article
Edit
Gets or sets a brush that describes the foreground color.
public : Brush Foreground { get; set; }
Brush Foreground();

void Foreground(Brush foreground);


public Brush Foreground { get; set; }

<icon Foreground="{StaticResource resourceName}"/>

Returns
Brush
The brush that paints the foreground of the control. The default is null, (a null brush) which is evaluated as Transparent
for rendering. However, this value is typically set by a default system resource at runtime, which is tied to the active
theme and other settings.

Examples
This example shows an AppBarButton that uses a SymbolIcon with its Foreground set to "Green".
<AppBarButton Label="Accept">
<AppBarButton.Icon>
<SymbolIcon Symbol="Accept" Foreground="Green"/>
</AppBarButton.Icon>
</AppBarButton>

Remarks
You can set the Foreground property on the AppBarButton or on an IconElement derived icon. If you set the
Foreground on the AppBarButton, it's applied only to the default visual state. It's not applied to the other visual states
defined in the AppBarButton template, like MouseOver . If you set the Foreground on the IconElement derived icon, the
color is applied to all visual states.
The only valid Brush type for the Foreground value is SolidColorBrush. If you attempt to use a brush that's not
declaring a solid color, the value is ignored at run time and replaced with a SolidColorBrush that is white or black,
depending on the current theme.
Foreground replaces the color information from a BitmapIcon.UriSource source file. Any non-transparent pixel in the
source image is replaced with the Foreground color.
See Adding app bars
Also Use brushes
IconElement.ForegroundProperty IconElement.
ForegroundProperty IconElement.ForegroundProperty
I n this Article
Edit
Identifies the Foreground dependency property.
public : static DependencyProperty ForegroundProperty { get; }
static DependencyProperty ForegroundProperty();
public static DependencyProperty ForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the Foreground dependency property.
IconSource IconSource IconSource Class
Represents the base class for an icon source.

D eclaration
public : class IconSource : DependencyObject, IIconSource
struct winrt::Windows::UI::Xaml::Controls::IconSource : DependencyObject, IIconSource
public class IconSource : DependencyObject, IIconSource

I nheritance H ierarchy
DependencyObject

Remarks
IconSource is similar to IconElement. However, because it is not a FrameworkElement, it can be shared.
I conSource derived classes
IconSource is the parent class for these classes:
BitmapIconSource
FontIconSource
PathIconSource
SymbolIconSource

Properties
Foreground
Foreground
Foreground

Gets or sets a brush that describes the foreground color.

ForegroundProperty
ForegroundProperty
ForegroundProperty

Identifies the Foreground dependency property.


IconSource.Foreground IconSource.Foreground Icon
Source.Foreground
I n this Article
Edit
Gets or sets a brush that describes the foreground color.
public : Brush Foreground { get; set; }
Brush Foreground();

void Foreground(Brush foreground);


public Brush Foreground { get; set; }

<iconSource Foreground="{StaticResource resourceName}"/>

Returns
Brush
The brush that paints the foreground of the control. The default is null, (a null brush) which is evaluated as Transparent
for rendering. However, this value is typically set by a default system resource at runtime, which is tied to the active
theme and other settings.
IconSource.ForegroundProperty IconSource.Foreground
Property IconSource.ForegroundProperty
I n this Article
Edit
Identifies the Foreground dependency property.
public : static DependencyProperty ForegroundProperty { get; }
static DependencyProperty ForegroundProperty();
public static DependencyProperty ForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the Foreground dependency property.
IconSourceElement IconSourceElement IconSource
Element Class
Represents an icon that uses an IconSource as its content.

D eclaration
public : class IconSourceElement : IconElement, IIconSourceElement
struct winrt::Windows::UI::Xaml::Controls::IconSourceElement : IconElement, IIconSourceElement
public class IconSourceElement : IconElement, IIconSourceElement

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
IconElement

Constructors
IconSourceElement()
IconSourceElement()
IconSourceElement()

Initializes a new instance of the IconSourceElement class.

Properties
IconSource
IconSource
IconSource

Gets or sets the IconSource used as the icon content.

IconSourceProperty
IconSourceProperty
IconSourceProperty

Identifies the IconSource dependency property.


IconSourceElement.IconSource IconSourceElement.Icon
Source IconSourceElement.IconSource
I n this Article
Edit
Gets or sets the IconSource used as the icon content.
public : IconSource IconSource { get; set; }
IconSource IconSource();

void IconSource(IconSource iconsource);


public IconSource IconSource { get; set; }

Returns
IconSource
The IconSource used as the icon content. The default is null.
IconSourceElement IconSourceElement IconSource
Element
I n this Article
Edit
Initializes a new instance of the IconSourceElement class.
public : IconSourceElement()
IconSourceElement() const;
public IconSourceElement()
IconSourceElement.IconSourceProperty IconSource
Element.IconSourceProperty IconSourceElement.Icon
SourceProperty
I n this Article
Edit
Identifies the IconSource dependency property.
public : static DependencyProperty IconSourceProperty { get; }
static DependencyProperty IconSourceProperty();
public static DependencyProperty IconSourceProperty { get; }

Returns
DependencyProperty
The identifier for the IconSource dependency property.
IInsertionPanel IInsertionPanel IInsertionPanel Interface
Provides methods to let an item be inserted between other items in a drag-and-drop operation.

D eclaration
public : interface IInsertionPanel
struct winrt::Windows::UI::Xaml::Controls::IInsertionPanel
public interface IInsertionPanel

I nheritance H ierarchy
None

Methods
GetInsertionIndexes(Point, Int32, Int32)
GetInsertionIndexes(Point, Int32, Int32)
GetInsertionIndexes(Point, Int32, Int32)

Returns the index values of the items that the specified point is between.
IInsertionPanel.GetInsertionIndexes IInsertionPanel.Get
InsertionIndexes IInsertionPanel.GetInsertionIndexes
I n this Article
Edit
Returns the index values of the items that the specified point is between.
public : void GetInsertionIndexes(Point position, int first, int second)
void GetInsertionIndexes(Point position, int32_t const& first, int32_t const& second) const;
public void GetInsertionIndexes(Point position, Int32 first, Int32 second)

Parameters
position Point
The point for which to get insertion indexes.
first Int32
The index of the item before the specified point.
second Int32
The index of the item after the specified point.

Remarks
Call this method when handling a DragOver event to return the indices of the two items between which the DragOver
is happening and where a potential drop and insertion would happen.
IItemContainerMapping IItemContainerMapping IItem
ContainerMapping Interface
Provides methods that let an ItemsControl map data items to UI containers.

D eclaration
public : interface IItemContainerMapping
struct winrt::Windows::UI::Xaml::Controls::IItemContainerMapping
public interface IItemContainerMapping

I nheritance H ierarchy
None

Methods
ContainerFromIndex(Int32)
ContainerFromIndex(Int32)
ContainerFromIndex(Int32)

Returns the container for the item at the specified index within the ItemCollection.

ContainerFromItem(Object)
ContainerFromItem(Object)
ContainerFromItem(Object)

Returns the container corresponding to the specified item.

IndexFromContainer(DependencyObject)
IndexFromContainer(DependencyObject)
IndexFromContainer(DependencyObject)

Returns the index to the item that has the specified, generated container.

ItemFromContainer(DependencyObject)
ItemFromContainer(DependencyObject)
ItemFromContainer(DependencyObject)

Returns the item that corresponds to the specified, generated container.


IItemContainerMapping.ContainerFromIndex IItem
ContainerMapping.ContainerFromIndex IItemContainer
Mapping.ContainerFromIndex
I n this Article
Edit
Returns the container for the item at the specified index within the ItemCollection.
public : DependencyObject ContainerFromIndex(int index)
DependencyObject ContainerFromIndex(int32_t index) const;
public DependencyObject ContainerFromIndex(Int32 index)

Parameters
index Int32
The index of the item to retrieve.
Returns
DependencyObject
The container for the item at the specified index within the item collection, if the item has a container; otherwise, null.
IItemContainerMapping.ContainerFromItem IItem
ContainerMapping.ContainerFromItem IItemContainer
Mapping.ContainerFromItem
I n this Article
Edit
Returns the container corresponding to the specified item.
public : DependencyObject ContainerFromItem(Platform::Object item)
DependencyObject ContainerFromItem(winrt::Windows::Foundation::IInspectable item) const;
public DependencyObject ContainerFromItem(Object item)

Parameters
item Object
The item to retrieve the container for.
Returns
DependencyObject
A container that corresponds to the specified item, if the item has a container and exists in the collection; otherwise,
null.
IItemContainerMapping.IndexFromContainer IItem
ContainerMapping.IndexFromContainer IItemContainer
Mapping.IndexFromContainer
I n this Article
Edit
Returns the index to the item that has the specified, generated container.
public : int IndexFromContainer(DependencyObject container)
int32_t IndexFromContainer(DependencyObject container) const;
public int IndexFromContainer(DependencyObject container)

Parameters
container DependencyObject
The generated container to retrieve the item index for.
Returns
int
The index to the item that corresponds to the specified generated container.
IItemContainerMapping.ItemFromContainer IItem
ContainerMapping.ItemFromContainer IItemContainer
Mapping.ItemFromContainer
I n this Article
Edit
Returns the item that corresponds to the specified, generated container.
public : Platform::Object ItemFromContainer(DependencyObject container)
winrt::Windows::Foundation::IInspectable ItemFromContainer(DependencyObject container) const;
public object ItemFromContainer(DependencyObject container)

Parameters
container DependencyObject
The DependencyObject that corresponds to the item to be returned.
Returns
object
The contained item, or the container if it does not contain an item.
Image Image Image Class
Represents a control that displays an image. The image source is specified by referring to an image file, using several
supported formats. The image source can also be set with a stream. See Remarks for the list of supported image
source formats.

D eclaration
public : sealed class Image : FrameworkElement, IImage, IImage2, IImage3
struct winrt::Windows::UI::Xaml::Controls::Image : FrameworkElement, IImage, IImage2, IImage3
public sealed class Image : FrameworkElement, IImage, IImage2, IImage3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
I mage file formats
An Image can display these image file formats:
Joint Photographic Experts Group (JPEG )
Portable Network Graphics (PNG )
bitmap (BMP )
Graphics Interchange Format (GIF )
Tagged Image File Format (TIFF )
JPEG XR
icons (ICO )
Scalable Vector Graphics (SVG )
Note

Icon files supported on Windows only. Not supported on Windows Phone 8.1
Starting in Windows 10, version 1607, the Image element supports animated Graphics Interchange Format (GIF )
images. When you use a BitmapImage as the image Source, you can access BitmapImage API to control playback of
the animated Graphics Interchange Format (GIF ) image. For more info, see the Remarks on the BitmapImage class
page.
Note

Animated Graphics Interchange Format (GIF ) support is available when your app is compiled for Windows 10, version
1607 and running on version 1607 (or later). When your app is compiled for or runs on previous versions, the first
frame of the Graphics Interchange Format (GIF ) is shown, but it is not animated.
Starting in Windows 10, version 1703, the Image element supports static Scalable Vector Graphics (SVG ) images
through SvgImageSource. SvgImageSource supports secure static mode from the SVG specification and does not
support animations or interactions. Direct2D supplies the underlying SVG rendering support and for more info on
specific SVG element and attribute support, see SVG Support. To learn more about how to insert a SVG in your app,
visit the SvgImageSource class page.
Note

Scalable Vector Graphics (SVG ) support is available when your app is compiled for Windows 10, version 1703 and
running on version 1703 (or later). When your app is compiled for or runs on previous versions, the SVG image will
not be shown.
Setting I mage.Source
To set the image source file that an Image displays, you set its Source property, either in XAML or in code. Here's a
simple example of setting Source in XAML:
<Image Width="200" Source="Images/myimage.png"/>

This usage is setting Source by Uniform Resource Identifier (URI), which is a shortcut that's enabled by XAML. Note
that the Uniform Resource Identifier (URI) here appears to be a relative Uniform Resource Identifier (URI); supporting
partial Uniform Resource Identifier (URI) is another XAML shortcut. The root of this Uniform Resource Identifier (URI)
is the base folder for an app project. This is usually the same location that the XAML file containing the Image tag is
loaded from. In this example, the image source file is in an Images subfolder within the app's file structure.
Setting the Source property is inherently an asynchronous action. Because it's a property, there isn't an awaitable
syntax, but for most scenarios you don't need to interact with the asynchronous aspects of image loading. The
framework will wait for the image source to be returned, and will start a layout cycle when the image source file is
available and decoded.
Setting the source to a Uniform Resource Identifier (URI) value that can't be resolved to a valid image source file
doesn't throw an exception. Instead, it fires an ImageFailed event. You can write an ImageFailed handler and attach it to
the Image object, and possibly use the ErrorMessage in event data to determine the nature of the failure. An error in
decoding can also fire ImageFailed. If you want to verify that an image source file was loaded correctly, you can handle
the ImageOpened event on the Image element.
You typically use image source files that you have included as part of your app download package. For large files, there
might be a very small delay while the image source file is decoded, if this is the first time the source is used. For more
info on app resources and how to package image source files in an app package, see Defining app resources.
You can also use image source files that aren't part of the app, for example images from external servers. These images
are downloaded by an internal HTTP request, and then decoded. If the image source file is a large file, or if there are
connection issues, there might be a delay before an external image can be displayed in an Image element.
Setting I mage.Source using code
If you create an Image object using code, call the default constructor, then set the Image.Source property. Setting the
Image.Source property requires an instance of the BitmapImage class, which you also must construct. If your image
source is a file referenced by Uniform Resource Identifier (URI), use the BitmapImage constructor that takes a Uniform
Resource Identifier (URI) parameter. When you reference local content, you must include the ms-appx: scheme in the
absolute Uniform Resource Identifier (URI) that you use as the BitmapImage constructor parameter. In code, you don't
get the processing shortcuts for combining relative Uniform Resource Identifier (URI) parts and the ms-appx: scheme
that happens automatically if you specify Source as a XAML attribute. Instead you must explicitly construct an absolute
Uniform Resource Identifier (URI) with the appropriate scheme. You typically use the ms-appx: scheme for an image
file that's packaged as part of your app.
 Tip

If you're using C# or Microsoft Visual Basic, you can get the BaseUri property of the Image, and pass that as the
baseUri parameter for System.Uri constructors that combine a Uniform Resource Identifier (URI) base location and a
relative path within that location.
Here's an example of setting Image.Source in C#. In this example, the Image object was created in XAML but doesn't
have a source or any other property values; instead these values are provided at run-time when the Image is loaded
from XAML.

void Image_Loaded(object sender, RoutedEventArgs e)


{
Image img = sender as Image;
BitmapImage bitmapImage = new BitmapImage();
img.Width = bitmapImage.DecodePixelWidth = 80; //natural px width of image source
// don't need to set Height, system maintains aspect ratio, and calculates the other
// dimension, so long as one dimension measurement is provided
bitmapImage.UriSource = new Uri(img.BaseUri,"Assets/StoreLogo.png");
img.Source = bitmapImage;
}

Using a stream source for an I mage source


If your image source is a stream, you must write code that sets your Image instance to use the stream. This can't be
done in XAML alone. Construct the Image to use, or reference an existing Image instance (which might have been
defined in XAML markup, but without a source). Then use the async SetSourceAsync method of BitmapImage to
define the image information from a stream, passing the stream to use as the streamSource parameter. Using a stream
for an image source is fairly common. For example, if your app enables a user to choose an image file using a
FileOpenPicker control, the object you get that represents the file the user chose can be opened as a stream, but
doesn't provide a Uniform Resource Identifier (URI) reference to the file.
In this example, the code is already awaitable because it's waiting for the user to choose a file and it only runs after that
happens. The stream to use comes from StorageFile.OpenAsync after a StorageFile instance is returned from the async
picker actions.

FileOpenPicker open = new FileOpenPicker();


// Open a stream for the selected file
StorageFile file = await open.PickSingleFileAsync();
// Ensure a file was selected
if (file != null)
{
using (IRandomAccessStream fileStream = await
file.OpenAsync(Windows.Storage.FileAccessMode.Read))
{
// Set the image source to the selected bitmap
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.DecodePixelWidth = 600; //match the target Image.Width, not shown
await bitmapImage.SetSourceAsync(fileStream);
Scenario2Image.Source = bitmapImage;
}
}

 Tip

If you're using C# or Microsoft Visual Basic, streams can use the System.IO.Stream type that you may be familiar with
from previous Microsoft .NET programming experience. You can call the AsStream extension method as an instance
method on any object of type IRandomAccessStream that you've obtained from a Windows Runtime API. The
previous example used IRandomAccessStream for parameter passing and didn't need to use AsStream. But if you ever
need to manipulate the stream, AsStream is there as a utility to convert to a System.IO.Stream if you need it.
See XAML images sample for more example code.
I mage files and performance
Large image files can impact performance because they load into memory. If you are referencing an image file where
you know that the source file is a large, high resolution image, but your app is displaying it in a UI region that's smaller
than the image's natural size, you should set the DecodePixelWidth property, or DecodePixelHeight. The
DecodePixel* properties enable you to pass information directly to the format-specific codec, and the codec can use
this information to decode more efficiently and to a smaller memory footprint. Set DecodePixelWidth to the same pixel
width of the area that you want your app to actually display. In other words, DecodePixelWidth for the BitmapImage
source should be the same value as the Width or ActualWidth of the Image control that displays that source.
You can either set DecodePixelWidth, or set DecodePixelHeight. If you set one of these two properties, the system
calculates the matching property to maintain the correct aspect ratio. You can also set both properties, but you typically
should use values that maintain that aspect ratio. If you want to change aspect ratios there are better ways to do so, for
example using a TranslateTransform as a RenderTransform.
To set DecodePixelWidth (or DecodePixelHeight ) in XAML, you must use a slightly more verbose XAML syntax that
includes an explicit BitmapImage element as a property element value, like this:

<Image>
<Image.Source>
<BitmapImage DecodePixelWidth="200" UriSource="images/myimage.png"/>
</Image.Source>
</Image>

DecodePixelWidth (or DecodePixelHeight ) are properties of BitmapImage, so you need an explicit BitmapImage
XAML object element in order to set the DecodePixel* properties as attributes in XAML.
If you are creating an Image instance in code, you are probably already creating a BitmapImage instance as a value to
provide for the Source property, so just set DecodePixelWidth (or DecodePixelHeight ) on the BitmapImage instance
before you set the UriSource property. The DecodePixelType property also affects how pixel values are interpreted by
the decode operations.
To prevent images from being decoded more than once, assign image source property from Uniform Resource
Identifier (URI) rather than using memory streams whenever you can. The XAML framework can associate the same
Uniform Resource Identifier (URI) in multiple places with one decoded image, but it cannot do the same for multiple
memory streams even if they contain the same data.
You can remove image files from the image cache by setting all associated Image.Source values to null.
For more info on the Image class and performance, see Optimize animations and media.
I mage file encoding and decoding
The underlying codec support for image files is supplied by Windows Imaging Component (WIC ) API. For more info
on specific image formats as documented for the codecs, see Native WIC Codecs.
The API for Image, BitmapImage and BitmapSource doesn't include any dedicated methods for encoding and
decoding of media formats. All of the decoding operations are built-in as actions that happen when the source is set or
reset. This makes the classes easier to use for constructing UI, because they have a default set of supported source file
formats and decoding behavior. Classes such as BitmapImage expose some of the decoding options and logic as part
of event data for ImageOpened or ImageFailed events. If you need advanced image file decoding, or image encoding,
you should use the API from the Windows.Graphics.Imaging namespace. You might need these API if your app
scenario involves image file format conversions, or manipulation of an image where the user can save the result as a
file. The encoding API are also supported by the Windows Imaging Component (WIC ) component of Windows.
I mage width and height
The Image class inherits the Width and Height properties from FrameworkElement, and these properties potentially
control the size that your Image control will render when it displays in UI. If you don't set a Width or a Height, then the
width and height is determined by the natural size of the image source. For example, if you load a bitmap image that is
300 pixels high and 400 pixels wide, as recorded in its source file format, these measurements are used for the width
and height when the Image control calculates its natural size. You can check ActualHeight and ActualWidth at run time
after the image renders to get the measurement information. Or, you can handle ImageOpened and check image file
properties such as PixelHeight and PixelWidth immediately before the image renders.
If you set just one of the Width or Height properties but not both, then the system can use that dimension as guidance
and calculate the other one, preserving the aspect ratio. If you're not sure of the source file dimensions, pick the
dimension that's the most important to control in your layout scenario and let the system calculate the other
dimension, and then the layout behavior of the container will typically adapt the layout to fit.
If you don't set Width and/or Height, and leave the image as its natural size, the Stretch property for the image can
control how the image source file will fill the space you specify as Width and Height. The default Stretch value is
Uniform, which preserves aspect ratio when it fits the image into a layout container. If the container's dimensions don't
have the same aspect ratio, then there will be empty space that's still part of Image but isn't showing any image pixels,
at least while using the Uniform value for Stretch. UniformToFill for Stretch won't leave empty space but might clip
the image if dimensions are different. Fill for Stretch won't leave empty space, but might change the aspect ratio. You
can experiment with these values to see what's best for image display in your layout scenario. Also, be aware that
certain layout containers might size an image that has no specific Width and Height to fill the entire layout space, in
which case you can choose to set specific sizes on either the image or the container for it.
NineG rid
Using the NineGrid technique is another option for sizing images that have a different natural size than your display
area, if the image has regions that should not be scaled uniformly. For example you can use a background image that
has an inherent border that should only stretch in one dimension, and corners that shouldn't stretch at all, but the
image center can stretch to fit the layout requirements in both dimensions. For more info, see NineGrid.
Resource qualification and localization for I mage
I mage source files and scaling
You should create your image sources at several recommended sizes, to ensure that your app looks great when
Windows 8 scales it. When specifying a Source for an Image, you can use a naming convention for resources that will
use the correct resource for device-specific scaling factors. This is determined by the app automatically at run-time. For
specifics of the naming conventions to use and more info, see Quickstart: Using file or image resources.
For more info on how to design images properly for scaling, see UX guidelines for layout and scaling.
Using unqualified resources
Unqualified resources is a technique you can use where the basic resource reference refers to a default resource, and
the resource management process can find the equivalent localized resource automatically. You can use automatic
handling for accessing unqualified resources with current scale and culture qualifiers, or you can use ResourceManager
and ResourceMap with qualifiers for culture and scale to obtain the resources directly. For more info see Resource
management system.
FlowD irection for I mage
If you set FlowDirection as RightToLeft for an Image, the visual content of an Image is flipped horizontally. However,
an Image element does not inherit the FlowDirection value from any parent element. Typically you only want image-
flipping behavior in images that are relevant to layout, but not necessarily to elements that have embedded text or
other components that wouldn't make sense flipped for a right-to-left audience. To get image-flip behavior, you must
set the FlowDirection element on the Image element specifically to RightToLeft, or set the FlowDirection property in
code-behind. Consider identifying the Image element by x:Uid directive, and specifying FlowDirection values as a
Windows Runtime resource, so that your localization experts can change this value later without changing the XAML
or code.
The I mage class and accessibility
The Image class is not a true control class in that it is not a descendant class of Control. You can't call focus to an Image
element, or place an Image element in a tab sequence. For more info on the accessibility aspects of using images and
the Image element in your UI, see Basic accessibility information.
Windows 8 behavior
For Windows 8, resources can use a resource qualifier pattern to load different resources depending on device-specific
scaling. However, resources aren't automatically reloaded if the scaling factor changes while the app is running. In this
case apps would have to take care of reloading resources, by handling the DpiChanged event (or the deprecated
LogicalDpiChanged event) and using ResourceManager API to manually reload the resource that's appropriate for the
new scaling factor. Starting with Windows 8.1, any resource that was originally retrieved for your app is automatically
re-evaluated if the scaling factor changes while the app is running. In addition, when that resource is the image source
for an Image object, then one of the source-load events (ImageOpened or ImageFailed ) is fired as a result of the
system's action of requesting the new resource and then applying it to the Image. The scenario where a run-time scale
change might happen is if the user moves your app to a different monitor when more than one is available.
If you migrate your app code from Windows 8 to Windows 8.1 you may want to account for this behavior change,
because it results in ImageOpened or ImageFailed events that happen at run-time when the scale change is handled,
even in cases where the Source is set in XAML. Also, if you did have code that handled DpiChanged
/LogicalDpiChanged and reset the resources, you should examine whether that code is still needed given the new
Windows 8.1 automatic reload behavior.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.

Constructors
Image()
Image()
Image()

Initializes a new instance of the Image class.

Properties
NineGrid
NineGrid
NineGrid

Gets or sets a value for a nine-grid metaphor that controls how the image can be resized. The nine-grid metaphor
enables you to stretch edges and corners of an image differently than its center. See Remarks for more info and an
illustration.

NineGridProperty
NineGridProperty
NineGridProperty

Identifies the NineGrid dependency property.

PlayToSource
PlayToSource
PlayToSource

Gets the information that is transmitted if the Image is used for a Play To scenario.
PlayToSourceProperty
PlayToSourceProperty
PlayToSourceProperty

Identifies the PlayToSource dependency property.

Source
Source
Source

Gets or sets the source for the image.

SourceProperty
SourceProperty
SourceProperty

Identifies the Source dependency property.

Stretch
Stretch
Stretch

Gets or sets a value that describes how an Image should be stretched to fill the destination rectangle.

StretchProperty
StretchProperty
StretchProperty

Identifies the Stretch dependency property.

Methods
GetAlphaMask()
GetAlphaMask()
GetAlphaMask()

Returns a mask that represents the alpha channel of an image as a CompositionBrush.

GetAsCastingSource()
GetAsCastingSource()
GetAsCastingSource()

Returns the image as a CastingSource.

Events
ImageFailed
ImageFailed
ImageFailed

Occurs when there is an error associated with image retrieval or format.

ImageOpened
ImageOpened
ImageOpened

Occurs when the image source is downloaded and decoded with no failure. You can use this event to determine
the natural size of the image source.

See Also
FrameworkElement
FrameworkElement
FrameworkElement
FrameworkElement
FlowDirection
Source Source Source
FrameworkElement
Image.GetAlphaMask Image.GetAlphaMask Image.Get
AlphaMask
I n this Article
Edit
Returns a mask that represents the alpha channel of an image as a CompositionBrush.
public : CompositionBrush GetAlphaMask()
CompositionBrush GetAlphaMask() const;
public CompositionBrush GetAlphaMask()

Returns
CompositionBrush
A mask that represents the alpha channel of an image.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
This method gets an alpha mask from an image as a CompositionBrush that you can use as an input to composition
shadows and effects. The alpha mask CompositionBrush has the same alignment and stretch property values that the
source XAML element applies to its rendered content so that you can use those values to correctly position shadows or
effects relative to the XAML element.
Version compatibility
The GetAlphaMask method is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not call this method without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
method before you use it.
if (ApiInformation.IsMethodPresent("Windows.UI.Xaml.Controls.Image", "GetAlphaMask"))
{
var compositionBrush = image1.GetAlphaMask();
}
Image.GetAsCastingSource Image.GetAsCastingSource
Image.GetAsCastingSource
I n this Article
Edit
Returns the image as a CastingSource.
public : CastingSource GetAsCastingSource()
CastingSource GetAsCastingSource() const;
public CastingSource GetAsCastingSource()

Returns
CastingSource
The image as a CastingSource.

Remarks
For more info about using Image as a casting source, see Media casting.
See Media casting
Also
Image Image Image
I n this Article
Edit
Initializes a new instance of the Image class.

public : Image()
Image() const;
public Image()
Image.ImageFailed Image.ImageFailed Image.Image
Failed
I n this Article
Edit
Occurs when there is an error associated with image retrieval or format.
public : event ExceptionRoutedEventHandler ImageFailed
// Register
event_token ImageFailed(ExceptionRoutedEventHandler const& handler) const;

// Revoke with event_token


void ImageFailed(event_token const& cookie) const;

// Revoke with event_revoker


ImageFailed_revoker ImageFailed(auto_revoke_t, ExceptionRoutedEventHandler const& handler) const;
public event ExceptionRoutedEventHandler ImageFailed

<Image ImageFailed="eventhandler"/>

Remarks
Conditions in which this event can occur include:
File not found
Invalid (unrecognized or unsupported) file format
Unknown file format decoding error after upload
Qualified resource reload by the system You might be able to use the ErrorMessage in event data to determine the
nature of the failure.
ImageFailed and ImageOpened are mutually exclusive. One event or the other will always fire whenever an Image has
a Source value set or reset.
One scenario for handling ImageFailed is to set the UriSource of the underlying BitmapImage source to a different
local image file. This can serve as a fallback value to display instead of empty space. For example, if you are trying to
display an external image where it's possible that the source is no longer there, or for when the user has no Internet
connection, you could set the UriSource to reference a local fallback or placeholder image that's part of your app
package and is always guaranteed to be available.
When the Image element isn’t in the live visual tree, the Image element will not fire ImageOpened or ImageFailed
events. If you need to receive these events while the element isn’t in the live tree, use the BitmapImage.ImageOpened
/ImageFailed events.
private void Image_ImageFailed(object sender, ExceptionRoutedEventArgs e) {
Image img = sender as Image;
BitmapImage fallbackImage = new BitmapImage(new Uri("ms-appx:///Images/fallback.png"));
img.Width = 100; //set to known width of this source's natural size
//might instead want image to stretch to fill, depends on scenario
img.Source = fallbackImage;
}

Windows 8 behavior
For Windows 8, resources can use a resource qualifier pattern to load different resources depending on device-specific
scaling. However, resources aren't automatically reloaded if the scaling factor changes while the app is running. In this
case apps would have to take care of reloading resources, by handling the DpiChanged event (or the deprecated
LogicalDpiChanged event) and using ResourceManager API to manually reload the resource that's appropriate for the
new scaling factor. Starting with Windows 8.1, any resource that was originally retrieved for your app is automatically
re-evaluated if the scaling factor changes while the app is running. In addition, when that resource is the image source
for an Image object, then one of the source-load events (ImageOpened or ImageFailed ) is fired as a result of the
system's action of requesting the new resource and then applying it to the Image. The scenario where a run-time scale
change might happen is if the user moves your app to a different monitor when more than one is available.
If you migrate your app code from Windows 8 to Windows 8.1 you may want to account for this behavior change,
because it results in ImageOpened or ImageFailed events that happen at run-time when the scale change is handled,
even in cases where the Source is set in XAML. Also, if you did have code that handled DpiChanged
/LogicalDpiChanged and reset the resources, you should examine whether that code is still needed given the new
Windows 8.1 automatic reload behavior.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
Image.ImageOpened Image.ImageOpened Image.Image
Opened
I n this Article
Edit
Occurs when the image source is downloaded and decoded with no failure. You can use this event to determine the
natural size of the image source.
public : event RoutedEventHandler ImageOpened
// Register
event_token ImageOpened(RoutedEventHandler const& handler) const;

// Revoke with event_token


void ImageOpened(event_token const& cookie) const;

// Revoke with event_revoker


ImageOpened_revoker ImageOpened(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler ImageOpened

<Image ImageOpened="eventhandler"/>

Remarks
When ImageOpened fires, that serves as the notification that any asynchronous operations have completed and all the
properties of the object used as the image source are ready for use. For example, to determine the size of the image,
handle ImageOpened, and check the value of the PixelWidth and PixelHeight properties on the object referenced as
Image.Source. The event data for the ImageOpened event isn't typically useful.
When the Image element isn’t in the live visual tree, the Image element will not fire ImageOpened or ImageFailed
events. If you need to receive these events while the element isn’t in the live tree, use the BitmapImage.ImageOpened
/ImageFailed events.
Windows 8 behavior
For Windows 8, resources can use a resource qualifier pattern to load different resources depending on device-specific
scaling. However, resources aren't automatically reloaded if the scaling factor changes while the app is running. In this
case apps would have to take care of reloading resources, by handling the DpiChanged event (or the deprecated
LogicalDpiChanged event) and using ResourceManager API to manually reload the resource that's appropriate for the
new scaling factor. Starting with Windows 8.1, any resource that was originally retrieved for your app is automatically
re-evaluated if the scaling factor changes while the app is running. In addition, when that resource is the image source
for an Image object, then one of the source-load events (ImageOpened or ImageFailed ) is fired as a result of the
system's action of requesting the new resource and then applying it to the Image. The scenario where a run-time scale
change might happen is if the user moves your app to a different monitor when more than one is available.
If you migrate your app code from Windows 8 to Windows 8.1 you may want to account for this behavior change,
because it results in ImageOpened or ImageFailed events that happen at run-time when the scale change is handled,
even in cases where the Source is set in XAML. Also, if you did have code that handled DpiChanged
/LogicalDpiChanged and reset the resources, you should examine whether that code is still needed given the new
Windows 8.1 automatic reload behavior.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
See ImageFailedImageFailedImageFailed
Also Image and ImageBrush
Image.NineGrid Image.NineGrid Image.NineGrid
I n this Article
Edit
Gets or sets a value for a nine-grid metaphor that controls how the image can be resized. The nine-grid metaphor
enables you to stretch edges and corners of an image differently than its center. See Remarks for more info and an
illustration.
public : Thickness NineGrid { get; set; }
Thickness NineGrid();

void NineGrid(Thickness ninegrid);


public Thickness NineGrid { get; set; }

<Image NineGrid="left,top,right,bottom" />

Returns
Thickness
A Thickness value that sets the Left, Top, Right, Bottom measurements for the nine-grid resizing metaphor.

Remarks
When you use nine-grid rendering, you can specify how different areas of the image are stretched. This feature is
useful for preserving the detail on image corners when an image scales or stretches.
Nine-grid rendering divides an image into a grid of nine sections:

Nine-grid rendering enables you to preserve the original dimensions of the corners (boxes 1, 3, 7, and 9).
The top and bottom (boxes 2 and 8) are stretched horizontally only, and the sides (boxes 4 and 6) are stretched
vertically only. The center (box 5) is stretched in both dimensions. To use nine-grid rendering, you create an
@Windows.UI.Xaml.Controls.Image?text=Image element and specify a value for the
@Windows.UI.Xaml.Controls.Image.NineGrid?text=NineGrid property—pixel values for the lengths of the left, top,
right, and bottom sides of the grid. In XAML, you specify the @Windows.UI.Xaml.Controls.Image.NineGrid?
text=NineGrid attribute value as a string that specifies pixel values for the sides in left, top, right, bottom order.
Internally, this syntax creates a @Windows.UI.Xaml.Thickness?text=Thickness object that represents this type of
measurement. If you want a uniform value, you can specify just one value that's applied to all four edges.
Applying nine-grid rendering is very useful when the image itself includes some type of border or edge decoration
embedded within the image source. For example, imagine you're using an image source for a Button that has the
outline as part of an image with transparency. You might want the center area that contains an icon to stretch. But if
you stretch the corners you might get aliasing artifacts from rounded corners. Or the border sides might get too thick
and wouldn't look as good when scaled. To prevent that, you could use a NineGrid with uniform values that always
keep the pixel size of the border the same size as in the image source.
Either in code or in XAML, the values for the Thickness that you use to set the NineGrid property are device-
independent pixel values.
Here's example XAML for an Image element using a NineGrid value:
<Image Source="Images/9grid.bmp" NineGrid="30,20,30,20" />
A NineGrid value is only relevant for image rendering if the image does not have specific values set for Width and/or
Height, and where the image is being stretched (image is rendered into a larger container space and the value for
Stretch is not** None**).
See Thickness
Also XAML images sample
Image.NineGridProperty Image.NineGridProperty Image.
NineGridProperty
I n this Article
Edit
Identifies the NineGrid dependency property.
public : static DependencyProperty NineGridProperty { get; }
static DependencyProperty NineGridProperty();
public static DependencyProperty NineGridProperty { get; }

Returns
DependencyProperty
The identifier for the NineGrid dependency property.
Image.PlayToSource Image.PlayToSource Image.PlayTo
Source
I n this Article
Edit
Gets the information that is transmitted if the Image is used for a Play To scenario.
public : PlayToSource PlayToSource { get; }
PlayToSource PlayToSource();
public PlayToSource PlayToSource { get; }

Returns
PlayToSource
A reference object that carries the Play To source information.

Remarks
You can use Play To to enable users to easily stream audio, video, or images from their computer to devices in their
home network. Image.PlayToSource is specifically for the XAML images version of this scenario.
Play To is part of the Devices charm. Users open the Devices charm to select devices from their home network that
they can stream the media content to. When a user selects a Play To target from the Devices charm, Play To fires the
SourceRequested event. Play To then streams the media element that was passed to the SetSource method to the
target device that the user has selected. Image.PlayToSource provides the PlayToSource controller object that the
PlayToManager can use in this scenario. For an example of how to use Play To in an application, see PlayReady DRM.
See PlayReady DRM
Also Play To sample
Image.PlayToSourceProperty Image.PlayToSource
Property Image.PlayToSourceProperty
I n this Article
Edit
Identifies the PlayToSource dependency property.
public : static DependencyProperty PlayToSourceProperty { get; }
static DependencyProperty PlayToSourceProperty();
public static DependencyProperty PlayToSourceProperty { get; }

Returns
DependencyProperty
The identifier for the PlayToSource dependency property.
Image.Source Image.Source Image.Source
I n this Article
Edit
Gets or sets the source for the image.

public : ImageSource Source { get; set; }


ImageSource Source();

void Source(ImageSource source);


public ImageSource Source { get; set; }

<Image Source="uri"/>

Returns
ImageSource
An object that represents the image source file for the drawn image. Typically you set this with a BitmapImage object,
constructed with the Uniform Resource Identifier (URI) that describes the path to a valid image source file. Or, you can
initialize a BitmapSource with a stream, perhaps a stream from a storage file.

Remarks
Setting the Source property is inherently an asynchronous action. Because it's a property, there isn't an awaitable
syntax, but for most scenarios you don't need to interact with the asynchronous aspects of image source file loading.
The framework will wait for the image source to be returned, and will rerun layout when the image source file becomes
available.
Setting the source to a Uniform Resource Identifier (URI) value that can't be resolved to a valid image source file does
not throw an exception. Instead, it fires an ImageFailed event. Decoding failures also fire ImageFailed. You can write an
ImageFailed handler and attach it to the Image object to detect this, and possibly use the ErrorMessage in event data to
determine the nature of the failure. Also, if you want to verify that an image source file was loaded correctly, you can
handle the ImageOpened event on the Image element.
Setting Source in X A ML
You can set the Source property as an attribute in XAML. In this case, you're setting the Source attribute value as a
Uniform Resource Identifier (URI) string that describes the location of the source image file. This behavior relies on
underlying type conversion that processes the string as a Uniform Resource Identifier (URI), and calls the equivalent of
the BitmapImage(Uri) constructor. Setting the Source property using a Uniform Resource Identifier (URI) string is a
shortcut enabled by XAML. Note that the Uniform Resource Identifier (URI) here appears to be a relative Uniform
Resource Identifier (URI); supporting partial Uniform Resource Identifier (URI) is another XAML shortcut.
<Image Width="200" Source="Images/myImage.png"/>

The XAML parser interprets any strings that represent a relative Uniform Resource Identifier (URI) using the base
Uniform Resource Identifier (URI) of the XAML page that is being parsed. For example, if you specify a value
"Images/myImage.png" in XAML, that string is interpreted as a relative path suffix that is appended to the base
Uniform Resource Identifier (URI) location within the app package where the XAML page itself exists. If the previous
Image element is added to a page that’s in the root of the app package, the Uniform Resource Identifier (URI) is
interpreted as ms-appx:///Images/myImage.png. If the Image is added to a page that’s in a Pages folder in the app, the
Uniform Resource Identifier (URI) is interpreted as ms-appx:///Pages/Images/myImage.png.
If the source image is not part of the app package, you must use an absolute Uniform Resource Identifier (URI) to set
the Source property in XAML. For more info, see How to load file resources, and examples later in this document.
A property element syntax in XAML is also possible, specifying a BitmapImage object element with valid source as the
property value.
Setting Source in code
To set the Image.Source property in code requires an instance of BitmapImage (or BitmapSource ), which you also
must construct. If your image source is a stream, use the async SetSourceAsync method of BitmapImage to define the
image information from the stream. For more info, see the section.
If your image source is a file referenced by Uniform Resource Identifier (URI), set the BitmapImage.UriSource
property, or use the BitmapImage constructor that takes a Uniform Resource Identifier (URI) parameter. The Windows
Runtime enforces that a Uniform Resource Identifier (URI) must be absolute; you can't use relative Uniform Resource
Identifier (URI) in Windows Runtime code. If you are using a .NET Framework System.Uri value, and you use a
signature that requires a UriKind value, make sure to specify Absolute.
When you reference local content, you must include the ms-appx: scheme in the absolute Uniform Resource Identifier
(URI) that you use as the BitmapImage.UriSource. In code, you don't get the processing shortcuts for combining
relative Uniform Resource Identifier (URI) parts and the ms-appx: scheme that happens automatically if you specify
Source as a XAML attribute. Instead you must explicitly construct an absolute Uniform Resource Identifier (URI) with
the appropriate scheme.
Here's how to set the source to an image from the app package.

Image img = new Image();


BitmapImage bitmapImage = new BitmapImage();
Uri uri = new Uri("ms-appx:///Assets/Logo.png");
bitmapImage.UriSource = uri;
img.Source = bitmapImage;

// OR

Image img = new Image();


img.Source = new BitmapImage(new Uri("ms-appx:///Assets/Logo.png"));

Windows::UI::Xaml::Controls::Image img;
Windows::UI::Xaml::Media::Imaging::BitmapImage bitmapImage;
Windows::Foundation::Uri uri{ L"ms-appx:///Assets/LockScreenLogo.png" };
bitmapImage.UriSource(uri);
img.Source(bitmapImage);

// OR

Windows::UI::Xaml::Controls::Image img;
img.Source(Windows::UI::Xaml::Media::Imaging::BitmapImage{ Windows::Foundation::Uri{ L"ms-
appx:///Assets/LockScreenLogo.png" } });

If you need to ensure that the Image control is ready before trying to use it in code, handle the Loaded event, and set
the Source property in the event handler.
Note

The FrameworkElement.Loaded event occurs when the Image control is loaded into the XAML page. The
ImageOpened event occurs when the image file is opened in the Image control.
Here's an example of setting Image.Source in the handler for the Loaded event. In this example, the Image object was
created in XAML but doesn't have a source or any other property values; instead these values are provided at run-time
when the Image is loaded from XAML.
<Image Loaded="Image_Loaded"/>

void Image_Loaded(object sender, RoutedEventArgs e)


{
Image img = sender as Image;
if (img != null)
{
BitmapImage bitmapImage = new BitmapImage();
img.Width = bitmapImage.DecodePixelWidth = 280;
bitmapImage.UriSource = new Uri("ms-appx:///Assets/Logo.png");
img.Source = bitmapImage;
}
}

void MainPage::Image_Loaded(winrt::Windows::Foundation::IInspectable const& sender,


winrt::Windows::UI::Xaml::RoutedEventArgs const& /* e */)
{
auto img{ sender.as<Windows::UI::Xaml::Controls::Image>() }; // throws if QI fails, so no need
for null-check afterwards.
Windows::UI::Xaml::Media::Imaging::BitmapImage bitmapImage;
img.Width(280);
bitmapImage.DecodePixelWidth(280);
bitmapImage.UriSource(Windows::Foundation::Uri{ L"ms-appx:///Assets/LockScreenLogo.png" });
img.Source(bitmapImage);
}

You can handle the ImageOpened event if there are any timing issues with retrieving or decoding the image source,
where you might need alternate content to display until the image source is available. See XAML images sample for
example code.
Using a relative UR I in code
We saw previously that the XAML parser interprets a relative Uniform Resource Identifier (URI) using the base
Uniform Resource Identifier (URI) of the XAML page that is being parsed. To achieve the same result in code, you can
construct a Uri using one of the constructors that creates a Uniform Resource Identifier (URI) by combining an
absolute base and then a relative path within that location. For the first parameter, call BaseUri on Page where the
Image is loaded. (You can also call BaseUri on the Image instance where you are setting the source, or another element
on the page. See the Caution below.) This creates a Uniform Resource Identifier (URI) with the ms-appx: scheme and
adds the path that is part of the XAML page's location. For the second parameter, pass the relative Uniform Resource
Identifier (URI) string that describes the source image location.
In C# or Microsoft Visual Basic, the Uri type is projected as System.Uri, so use the System.Uri(Uri, String) constructor
that takes a string as the second parameter. In Visual C++ component extensions (C++/CX) use Uri(String,String).
<Image x:Name="capturedPhoto"/>

BitmapImage bitmapImage = new BitmapImage();


// Call BaseUri on the root Page element and combine it with a relative path
// to consruct an absolute URI.
bitmapImage.UriSource = new Uri(this.BaseUri, "Assets/placeholder.png");
capturedPhoto.Source = bitmapImage;

Note

If you instantiate a new Image in code, the BaseUri property is null until the Image is added to the visual tree of the a
page. For example, the following code throws an ArgumentNull exception. To avoid the exception, add the Image to
the visual tree before setting the Source property.
This example throws an exception because it calls BaseUri on the Image before the Image is added to the page. It's
assumed that 'stackPanel1' is a StackPanel element declared in XAML.
Image img = new Image();
BitmapImage bitmapImage = new BitmapImage();

// AN EXCEPTION IS THROWN BECAUSE img.BaseUri IS NULL AT THIS POINT.


Uri uri = new Uri(img.BaseUri, "Assets/Logo.png");

bitmapImage.UriSource = uri;
img.Source = bitmapImage;
stackPanel1.Children.Add(img);

To avoid this error, you can call BaseUri on the Page itself, as shown previously, or add the Image to the page before
calling BaseUri, as shown here.
In this example, the Image is added to the page before the call to BaseUri, so BaseUri is not null. It's assumed that
'stackPanel1' is a StackPanel element declared in XAML.

Image img = new Image();


// Add the image to the page.
stackPanel1.Children.Add(img);

BitmapImage bitmapImage = new BitmapImage();


// img.BaseUri in not null because img has been added to the page.
Uri uri = new Uri(img.BaseUri, "Assets/Logo.png");
bitmapImage.UriSource = uri;
img.Source = bitmapImage;

Using files from a network


To use a file from a network location as an image source, use the http: or https: schemes, as shown here. Specify the
absolute Uniform Resource Identifier (URI). For more info, see How to load file resources.

<Image Source="http://www.contoso.com/images/logo.png"/>

Image img = new Image();


img.Source = new BitmapImage(new Uri("http://www.contoso.com/images/logo.png"));

Using files from local storage


To use files that are placed in your app's local storage as an image source , use the ms-appdata: scheme, as shown
here. Specify the absolute Uniform Resource Identifier (URI). For more info, see How to load file resources.

<!-- Access an image file stored in the local folder -->


<Image Source="ms-appdata:///local/images/logo.png"/>

<!-- Access an image file stored in the roaming folder -->


<Image Source="ms-appdata:///roaming/images/logo.png"/>

<!-- Access an image file stored in the temp folder -->


<Image Source="ms-appdata:///temp/images/logo.png"/>

var uri = new System.Uri("ms-appdata:///local/images/logo.png");


var file = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(uri);

Image img = new Image();


img.Source = file;

Using a stream source to show images from the P ictures library


A typical use of Image elements in an app is to show pictures from the user’s Pictures library. These pictures might be
accessed programmatically or through a FileOpenPicker. In either case, the StorageFile object you get can be opened
as a stream, but doesn't provide a Uniform Resource Identifier (URI) reference to the image file. To use a stream as an
image source, you must write code that sets your Image instance to use the stream. This can't be done in XAML alone.
To display an individual image, use the StorageFile objects from enumerating the library and call OpenAsync to obtain
a stream. Use this stream to set the image source, by creating a new BitmapImage, then calling SetSourceAsync and
passing the stream to use as the streamSource parameter.
This example shows how to use a FileOpenPicker to access an image file from the Pictures library and set it as the
Source of an Image control. The code is already awaitable because it's waiting for the user to choose a file and it only
runs after that happens. The stream to use comes from StorageFile.OpenAsync after a StorageFile instance is returned
from the async picker actions. For more info on using file pickers, see Open files and folders with a picker.
Im p o rt a nt

Using a file picker in Windows Phone 8.x app requires additional steps that are beyond the scope of this example.
For more info, see How to continue your Windows Phone app after calling a file picker.

<Button Content="Get photo" Click="GetPhotoButton_Click"/>

<Image x:Name="image1" Width="300"/>

private async void GetPhotoButton_Click(object sender, RoutedEventArgs e)


{
// Set up the file picker.
Windows.Storage.Pickers.FileOpenPicker openPicker =
new Windows.Storage.Pickers.FileOpenPicker();
openPicker.SuggestedStartLocation =
Windows.Storage.Pickers.PickerLocationId.PicturesLibrary;
openPicker.ViewMode =
Windows.Storage.Pickers.PickerViewMode.Thumbnail;

// Filter to include a sample subset of file types.


openPicker.FileTypeFilter.Clear();
openPicker.FileTypeFilter.Add(".bmp");
openPicker.FileTypeFilter.Add(".png");
openPicker.FileTypeFilter.Add(".jpeg");
openPicker.FileTypeFilter.Add(".jpg");

// Open the file picker.


Windows.Storage.StorageFile file =
await openPicker.PickSingleFileAsync();

// 'file' is null if user cancels the file picker.


if (file != null)
{
// Open a stream for the selected file.
// The 'using' block ensures the stream is disposed
// after the image is loaded.
using (Windows.Storage.Streams.IRandomAccessStream fileStream =
await file.OpenAsync(Windows.Storage.FileAccessMode.Read))
{
// Set the image source to the selected bitmap.
Windows.UI.Xaml.Media.Imaging.BitmapImage bitmapImage =
new Windows.UI.Xaml.Media.Imaging.BitmapImage();

bitmapImage.SetSource(fileStream);
image1.Source = bitmapImage;
}
}
}

This example shows how to programmatically access an image file from the Pictures library and set it as the Source of
an Image control. To access the content of the Pictures library programmatically, call StorageFolder.GetFilesAsync.
Remember that you need to specify a capability to access the Pictures library programmatically.

protected async override void OnNavigatedTo(NavigationEventArgs e)


{
// Get the Pictures library
Windows.Storage.StorageFolder picturesFolder =
Windows.Storage.KnownFolders.PicturesLibrary;
IReadOnlyList<StorageFolder> folders =
await picturesFolder.GetFoldersAsync();

// Process file folders


foreach (StorageFolder folder in folders)
{
// Get and process files in folder
IReadOnlyList<StorageFile> fileList = await folder.GetFilesAsync();
foreach (StorageFile file in fileList)
{
Windows.UI.Xaml.Media.Imaging.BitmapImage bitmapImage =
new Windows.UI.Xaml.Media.Imaging.BitmapImage();

// Open a stream for the selected file.


// The 'using' block ensures the stream is disposed
// after the image is loaded.
using (Windows.Storage.Streams.IRandomAccessStream fileStream =
await file.OpenAsync(Windows.Storage.FileAccessMode.Read))
{
// Set the image source to the selected bitmap.
Windows.UI.Xaml.Media.Imaging.BitmapImage bitmapImage =
new Windows.UI.Xaml.Media.Imaging.BitmapImage();
bitmapImage.SetSource(fileStream);

// Create an Image control.


Image img = new Image();
img.Height = 50;
img.Source = bitmapImage;

// Add the Image control to the UI. 'imageGrid' is a


// VariableSizedWrapGrid declared in the XAML page.
imageGrid.Children.Add(img);
}
}
}
}

I mage sources and scaling


If you are referencing images that are packaged in your app, you should create your image sources at several
recommended sizes, to ensure that your app looks great when the Windows Runtime scales it. When specifying a
Source for an Image as a Uniform Resource Identifier (URI), you can use a naming convention that will automatically
reference the correct image resource for the current scaling as detected by the system at run-time. For specifics of the
naming convention and more info, see Quickstart: Using file or image resources.
For more info on how to design for scaling, see Responsive design 101 for or Remarks in Image.
I mage sources and resource qualifiers
You can use automatic handling for accessing unqualified resources with current scale and culture qualifiers, or you can
use ResourceManager and ResourceMap with qualifiers for culture and scale to obtain the resources directly. For more
info see Resource management system or Remarks in Image. For more info on app resources and how to package
image sources in an app, see Defining app resources.
See ImageFailedImageFailedImageFailed
Also ImageOpenedImageOpenedImageOpened
Image and ImageBrush
XAML images sample
Image.SourceProperty Image.SourceProperty Image.
SourceProperty
I n this Article
Edit
Identifies the Source dependency property.
public : static DependencyProperty SourceProperty { get; }
static DependencyProperty SourceProperty();
public static DependencyProperty SourceProperty { get; }

Returns
DependencyProperty
The identifier for the Source dependency property.
Image.Stretch Image.Stretch Image.Stretch
I n this Article
Edit
Gets or sets a value that describes how an Image should be stretched to fill the destination rectangle.

public : Stretch Stretch { get; set; }


Stretch Stretch();

void Stretch(Stretch stretch);


public Stretch Stretch { get; set; }

<Image Stretch="stretchValue"/>

Returns
Stretch
A value of the Stretch enumeration that specifies how the source image is rendered, if the Height and/or Width of the
Image are not explicitly specified. The default value is Uniform.

Remarks
The value of the Stretch property is only relevant if the Image instance is not already using explicitly set values for the
Height and/or Width property, and if the Image instance is inside a container that can stretch the image to fill some
available space in layout. If you set the value of the Stretch property to None, the image always retains its natural size,
even if there's a layout container that might stretch it otherwise. For more info on image sizing, see Remarks in Image.
I mage sources and scaling
You should create your image sources at several recommended sizes, to ensure that your app looks great when
Windows 8 scales it because of device scaling and resolution. This is often a better way to handling image resizing
rather than applying a nondefault Stretch value. When specifying a Source for an Image, you can use a naming
convention that will automatically reference the correct resource for the current scaling. For specifics of the naming
convention and more info, see Quickstart: Using file or image resources.
For more info on how to design for scaling, see UX guidelines for layout and scaling.
Note

A Stretch value of None doesn't work for image resources that are intended to support scaling. The scaling will be
detected and the appropriate scaled resource is loaded before the layout decisions implied by the None value are
applied.
Image.StretchProperty Image.StretchProperty Image.
StretchProperty
I n this Article
Edit
Identifies the Stretch dependency property.
public : static DependencyProperty StretchProperty { get; }
static DependencyProperty StretchProperty();
public static DependencyProperty StretchProperty { get; }

Returns
DependencyProperty
The identifier for the Stretch dependency property.
INavigate INavigate INavigate Interface
Defines the navigation action for navigation hosts and navigation initiators.

D eclaration
public : interface INavigate
struct winrt::Windows::UI::Xaml::Controls::INavigate
public interface INavigate

I nheritance H ierarchy
None

Remarks
This interface is mainly infrastructure. It's not expected that typical UWP app will implement this interface. Most apps
would use Page and Frame for their navigation structure instead. The Visual Studio templates create this navigation
structure for you both for apps/projects and for items/pages.

Methods
Navigate(TypeName)
Navigate(TypeName)
Navigate(TypeName)

Causes the navigation host to load content that is specified by a type reference.

See Also
INavigate.Navigate INavigate.Navigate INavigate.
Navigate
I n this Article
Edit
Causes the navigation host to load content that is specified by a type reference.
public : Platform::Boolean Navigate(TypeName sourcePageType)
bool Navigate(TypeName sourcePageType) const;
public bool Navigate(Type sourcePageType)

Parameters
sourcePageType Type
A type reference for the content to load.
Returns
bool
true if the navigation host can navigate according to its settings; otherwise, false.

Remarks
The INavigate interface is mainly infrastructure. It's not expected that typical UWP app will implement this interface.
Im p o rt a nt

If you are programming using a Microsoft .NET language (C# or Microsoft Visual Basic), the TypeName type projects
as System.Type.
See System.Type
Also
IncrementalLoadingTrigger IncrementalLoadingTrigger
IncrementalLoadingTrigger Enum
Defines constants that specify list view incremental loading behavior (IncrementalLoadingTrigger property).

D eclaration
public : enum class IncrementalLoadingTrigger
enum class winrt::Windows::UI::Xaml::Controls::IncrementalLoadingTrigger : int32_t
public enum IncrementalLoadingTrigger

I nheritance H ierarchy
None

Fields
Edge Uses an "edge" offset for incremental loading visual behavior, and enables the list view to notify the scroll host of
Edge incremental load per interaction with other settings (IncrementalLoadingThreshold, DataFetchSize ).
Edge

None Incremental loading does not occur.


None
None
InkCanvas InkCanvas InkCanvas Class
Defines an area that receives and displays all pen input as either an ink stroke or an erase stroke (input from an eraser
tip, or the pen tip when modified with an erase button).

D eclaration
public : class InkCanvas : FrameworkElement, IInkCanvas
struct winrt::Windows::UI::Xaml::Controls::InkCanvas : FrameworkElement, IInkCanvas
public class InkCanvas : FrameworkElement, IInkCanvas

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
Im p o rt a nt

The InkPresenter cannot be instantiated directly.


An InkCanvas has default Height and Width properties of zero, unless it is the child of an element that automatically
sizes its child elements, such as StackPanel or Grid controls.
By default, the InkCanvas does not support ink input from devices other than pen. You must specify support for other
devices through the InputDeviceTypes of an InkPresenter object.
Associate an InkToolbar with an InkCanvas to provide a customizable and extensible collection of buttons that activate
ink-related features in the InkCanvas. By default, the toolbar includes buttons for drawing, erasing, highlighting, and
displaying a ruler.
An InkCanvas control is bound to a single instance of an InkPresenter object (exposed through the InkPresenter
property). This object provides all default inking functionality exposed by the InkCanvas, along with a comprehensive
set of APIs for additional customization.
The configuration of the InkPresenter determines the pointer event handling behavior of the InkCanvas. You must set
InkPresenter.InputDeviceTypes to CoreInputDeviceTypes.None for the InkCanvas to process pointer events, otherwise
they are passed to the InkPresenter object.
To handle pointer events with the InkPresenter object, you must set RightDragAction to LeaveUnprocessed to pass the
input through as UnprocessedInput for custom processing by your app.

Constructors
InkCanvas()
InkCanvas()
InkCanvas()

Initializes a new instance of the InkCanvas class.

Properties
InkPresenter
InkPresenter
InkPresenter

Gets the underlying InkPresenter object associated with the InkCanvas.


Each InkCanvas control is associated with an instance of an InkPresenter object (exposed through the
InkPresenter property). The InkPresenter provides properties, methods, and events for managing the input,
processing, and rendering of ink data for an InkCanvas control.
The InkPresenter cannot be instantiated directly.

See Also
FrameworkElement
InkCanvas InkCanvas InkCanvas
I n this Article
Edit
Initializes a new instance of the InkCanvas class.

public : InkCanvas()
InkCanvas() const;
public InkCanvas()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkCanvas.InkPresenter InkCanvas.InkPresenter Ink
Canvas.InkPresenter
I n this Article
Edit
Gets the underlying InkPresenter object associated with the InkCanvas.
Each InkCanvas control is associated with an instance of an InkPresenter object (exposed through the InkPresenter
property). The InkPresenter provides properties, methods, and events for managing the input, processing, and
rendering of ink data for an InkCanvas control.
The InkPresenter cannot be instantiated directly.
public : InkPresenter InkPresenter { get; }
InkPresenter InkPresenter();
public InkPresenter InkPresenter { get; }

Returns
InkPresenter
The underlying InkPresenter object.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkPresenter
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbar InkToolbar InkToolbar Class
Represents a Universal Windows app control containing a customizable and extensible collection of buttons that
activate ink-related features in an associated InkCanvas.

D eclaration
public : class InkToolbar : Control, IInkToolbar, IInkToolbar2
struct winrt::Windows::UI::Xaml::Controls::InkToolbar : Control, IInkToolbar, IInkToolbar2
public class InkToolbar : Control, IInkToolbar, IInkToolbar2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Inking controls.
Associate an InkToolbar with an InkCanvas control through the TargetInkCanvas property.
By default, the toolbar includes buttons for drawing, erasing, highlighting, and displaying a ruler. Depending on the
feature, other settings and commands, such as ink color, stroke thickness, erase all, are provided in a flyout. An
"extension glyph" is displayed on the button to indicate the existence of the flyout.
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

Built-in buttons can be displayed by default, or you can specify which should be displayed by your app. See
InitialControls.
You cannot change the display order of the built-in buttons. The default display order is: InkToolbarBallpointPenButton,
InkToolbarPencilButton, InkToolbarHighlighterButton, InkToolbarEraserButton, and InkToolbarRulerButton. Custom
tool buttons are added between the highlighter button and the eraser button and custom toggle buttons are added
after the ruler button. (Custom buttons are added in the order they are specified.)
Custom drying and the InkToolbar
By default, ink input is processed on a low -latency background thread and rendered "wet" as it is drawn. When the
stroke is completed (pen or finger lifted, or mouse button released), the stroke is processed on the UI thread and
rendered "dry" to the InkCanvas layer (above the application content and replacing the wet ink). The ink platform
enables you to override this behavior and completely customize the inking experience by custom drying the ink input.
If your app overrides the default ink rendering behavior of the InkPresenter with a custom drying implementation, the
rendered ink strokes are no longer available to the InkToolbar and the built-in erase commands of the InkToolbar do
not work as expected. To provide erase functionality, you must handle all pointer events, perform hit-testing on each
stroke, and override the built-in "Erase all ink" command.
For more info on custom drying, see Pen interactions and Windows Ink in UWP apps.

Constructors
InkToolbar()
InkToolbar()
InkToolbar()

Initializes a new instance of the InkToolbar class.

Properties
ActiveTool
ActiveTool
ActiveTool

Gets or sets the currently selected feature in the "tools" group of the InkToolbar (see remarks). This property
provides access to the following objects:
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarEraserButton
InkToolbarHighlighterButton
InkToolbarCustomPenButton
InkToolbarCustomToolButton
Features in this group are mutually exclusive: selecting a feature deselects the currently active feature.
Note

InkToolbarRulerButton and InkToolbarCustomToggleButton objects work in conjunction with the active feature
and are not exposed to the ActiveTool property.

ActiveToolProperty
ActiveToolProperty
ActiveToolProperty

Identifies the ActiveTool dependency property.

ButtonFlyoutPlacement
ButtonFlyoutPlacement
ButtonFlyoutPlacement

Gets or sets the location of ink stroke configuration flyout relative to the InkToolbar.
ButtonFlyoutPlacementProperty
ButtonFlyoutPlacementProperty
ButtonFlyoutPlacementProperty

Identifies the ButtonFlyoutPlacement dependency property.

Children
Children
Children

Gets the collection of custom buttons displayed on the InkToolbar.

ChildrenProperty
ChildrenProperty
ChildrenProperty

Identifies the Children dependency property.

InitialControls
InitialControls
InitialControls

Gets or sets the collection of built-in buttons added to the InkToolbar at initialization.
This property overrides the default collection of built-in buttons.
By default, the InkToolbar consists of two distinct groups of button types:
A RadioButton group containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ), erasing
(InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. This group is where
InkToolbarCustomPenButton and InkToolbarCustomToolButton objects are added.

Feature selection is mutually exclusive.

A toggle button group containing the built-in ruler (InkToolbarRulerButton ) button. This group is where
InkToolbarCustomToggleButton objects are added.

Features are not mutually exclusive and can be used concurrently with other active tools.

InitialControlsProperty
InitialControlsProperty
InitialControlsProperty

Identifies the InitialControls dependency property.

InkDrawingAttributes
InkDrawingAttributes
InkDrawingAttributes

Gets the InkStroke properties specified through the InkToolbar.


InkDrawingAttributesProperty
InkDrawingAttributesProperty
InkDrawingAttributesProperty

Identifies the InkDrawingAttributes dependency property.

IsRulerButtonChecked
IsRulerButtonChecked
IsRulerButtonChecked

Gets or sets the state of the InkToolbarRulerButton (and associated tool) to on or off.
When turned on, the ruler works in conjunction with the active tool.

IsRulerButtonCheckedProperty
IsRulerButtonCheckedProperty
IsRulerButtonCheckedProperty

Identifies the IsRulerButtonChecked dependency property.

IsStencilButtonChecked
IsStencilButtonChecked
IsStencilButtonChecked

Gets or sets the state of the InkToolbarStencilButton (and associated tool) to on or off.
When turned on, the stencil works in conjunction with the active tool.

IsStencilButtonCheckedProperty
IsStencilButtonCheckedProperty
IsStencilButtonCheckedProperty

Identifies the IsStencilButtonChecked dependency property.

Orientation
Orientation
Orientation

Gets or sets the orientation of the InkToolbar.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the InkToolbar.Orientation dependency property.

TargetInkCanvas
TargetInkCanvas
TargetInkCanvas

Gets or sets the InkCanvas control associated with the InkToolbar.


All InkToolbar settings are propagated to the associated InkCanvas.

TargetInkCanvasProperty
TargetInkCanvasProperty
TargetInkCanvasProperty

Identifies the TargetInkCanvas dependency property.

Methods
GetMenuButton(InkToolbarMenuKind)
GetMenuButton(InkToolbarMenuKind)
GetMenuButton(InkToolbarMenuKind)

Retrieves a reference to an InkToolbarMenuButton object from the menu button group of the InkToolbar.

GetToggleButton(InkToolbarToggle)
GetToggleButton(InkToolbarToggle)
GetToggleButton(InkToolbarToggle)

Retrieves a reference to an InkToolbarToggleButton object from the toggle button group of the InkToolbar.

GetToolButton(InkToolbarTool)
GetToolButton(InkToolbarTool)
GetToolButton(InkToolbarTool)

Retrieves a reference to one of the following objects from the radio button group of the InkToolbar.
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarEraserButton
InkToolbarHighlighterButton
InkToolbarCustomPenButton
InkToolbarCustomToolButton

Events
ActiveToolChanged
ActiveToolChanged
ActiveToolChanged

Occurs when the currently selected feature in the RadioButton group of the InkToolbar is changed. This event
provides access to the following objects:
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarEraserButton
InkToolbarHighlighterButton
InkToolbarCustomPenButton
InkToolbarCustomToolButton
Features in this group are mutually exclusive: selecting a feature deselects the currently active feature.
Note

InkToolbarRulerButton and InkToolbarCustomToggleButton objects work in conjunction with the active feature
and are not exposed to the ActiveToolChanged event.

EraseAllClicked
EraseAllClicked
EraseAllClicked

Occurs when "Erase All Ink" is selected from the flyout for the InkToolbarEraserButton on the InkToolbar.

InkDrawingAttributesChanged
InkDrawingAttributesChanged
InkDrawingAttributesChanged

Occurs when any InkDrawingAttributes are changed.

IsRulerButtonCheckedChanged
IsRulerButtonCheckedChanged
IsRulerButtonCheckedChanged

Occurs when the toggled state of the InkToolbarRulerButton changes.

IsStencilButtonCheckedChanged
IsStencilButtonCheckedChanged
IsStencilButtonCheckedChanged

Occurs when the toggled state of the InkToolbaStencilButton changes.

See Also
Control
InkToolbarToggleButton
InkToolbarToolButton
InkToolbarToggleButton
InkToolbar.ActiveTool InkToolbar.ActiveTool InkToolbar.
ActiveTool
I n this Article
Edit
Gets or sets the currently selected feature in the "tools" group of the InkToolbar (see remarks). This property provides
access to the following objects:
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarEraserButton
InkToolbarHighlighterButton
InkToolbarCustomPenButton
InkToolbarCustomToolButton
Features in this group are mutually exclusive: selecting a feature deselects the currently active feature.
Note

InkToolbarRulerButton and InkToolbarCustomToggleButton objects work in conjunction with the active feature and are
not exposed to the ActiveTool property.
public : InkToolbarToolButton ActiveTool { get; set; }
InkToolbarToolButton ActiveTool();

void ActiveTool(InkToolbarToolButton activetool);


public InkToolbarToolButton ActiveTool { get; set; }

Returns
InkToolbarToolButton
The currently selected feature. By default, this is the first button on the InkToolbar.

Remarks
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
ActiveToolProperty
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbar.ActiveToolChanged InkToolbar.ActiveTool
Changed InkToolbar.ActiveToolChanged
I n this Article
Edit
Occurs when the currently selected feature in the RadioButton group of the InkToolbar is changed. This event provides
access to the following objects:
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarEraserButton
InkToolbarHighlighterButton
InkToolbarCustomPenButton
InkToolbarCustomToolButton
Features in this group are mutually exclusive: selecting a feature deselects the currently active feature.
Note

InkToolbarRulerButton and InkToolbarCustomToggleButton objects work in conjunction with the active feature and are
not exposed to the ActiveToolChanged event.
public : event TypedEventHandler<InkToolbar, object> ActiveToolChanged
// Register
event_token ActiveToolChanged(TypedEventHandler<InkToolbar, object> const& handler) const;

// Revoke with event_token


void ActiveToolChanged(event_token const& cookie) const;

// Revoke with event_revoker


ActiveToolChanged_revoker ActiveToolChanged(auto_revoke_t, TypedEventHandler<InkToolbar, object>
const& handler) const;
public event TypedEventHandler<InkToolbar, object> ActiveToolChanged

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
ActiveTool
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbar.ActiveToolProperty InkToolbar.ActiveTool
Property InkToolbar.ActiveToolProperty
I n this Article
Edit
Identifies the ActiveTool dependency property.
public : static DependencyProperty ActiveToolProperty { get; }
static DependencyProperty ActiveToolProperty();
public static DependencyProperty ActiveToolProperty { get; }

Returns
DependencyProperty
The identifier for the ActiveTool dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
ActiveTool
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbar.ButtonFlyoutPlacement InkToolbar.Button
FlyoutPlacement InkToolbar.ButtonFlyoutPlacement
I n this Article
Edit
Gets or sets the location of ink stroke configuration flyout relative to the InkToolbar.
public : InkToolbarButtonFlyoutPlacement ButtonFlyoutPlacement { get; set; }
InkToolbarButtonFlyoutPlacement ButtonFlyoutPlacement();

void ButtonFlyoutPlacement(InkToolbarButtonFlyoutPlacement buttonflyoutplacement);


public InkToolbarButtonFlyoutPlacement ButtonFlyoutPlacement { get; set; }

Returns
InkToolbarButtonFlyoutPlacement
The location of the flyout relative to the ink toolbar.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
ButtonFlyoutPlacementProperty
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbar.ButtonFlyoutPlacementProperty InkToolbar.
ButtonFlyoutPlacementProperty InkToolbar.ButtonFlyout
PlacementProperty
I n this Article
Edit
Identifies the ButtonFlyoutPlacement dependency property.
public : static DependencyProperty ButtonFlyoutPlacementProperty { get; }
static DependencyProperty ButtonFlyoutPlacementProperty();
public static DependencyProperty ButtonFlyoutPlacementProperty { get; }

Returns
DependencyProperty
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
ButtonFlyoutPlacement
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbar.Children InkToolbar.Children InkToolbar.
Children
I n this Article
Edit
Gets the collection of custom buttons displayed on the InkToolbar.
public : DependencyObjectCollection Children { get; }
DependencyObjectCollection Children();
public DependencyObjectCollection Children { get; }

Returns
DependencyObjectCollection
A collection of InkToolbar custom buttons.

Remarks
Children returns only the number of buttons on the InkToolbar that have been added manually (see ActiveTool and
InitialControls ). The default InkToolbar does not add any buttons to the value of this property.
Children does not include buttons declared in markup.
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
ChildrenProperty
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbar.ChildrenProperty InkToolbar.ChildrenProperty
InkToolbar.ChildrenProperty
I n this Article
Edit
Identifies the Children dependency property.
public : static DependencyProperty ChildrenProperty { get; }
static DependencyProperty ChildrenProperty();
public static DependencyProperty ChildrenProperty { get; }

Returns
DependencyProperty
The identifier for the Children dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Children
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbar.EraseAllClicked InkToolbar.EraseAllClicked Ink
Toolbar.EraseAllClicked
I n this Article
Edit
Occurs when "Erase All Ink" is selected from the flyout for the InkToolbarEraserButton on the InkToolbar.
public : event TypedEventHandler<InkToolbar, object> EraseAllClicked
// Register
event_token EraseAllClicked(TypedEventHandler<InkToolbar, object> const& handler) const;

// Revoke with event_token


void EraseAllClicked(event_token const& cookie) const;

// Revoke with event_revoker


EraseAllClicked_revoker EraseAllClicked(auto_revoke_t, TypedEventHandler<InkToolbar, object> const&
handler) const;
public event TypedEventHandler<InkToolbar, object> EraseAllClicked

Remarks
Each feature on the InkToolbar can support supplementary functionality in a flyout (an "extension glyph" on the feature
button indicates to the user that the functionality is available). "Erase All Ink" is the built-in flyout for the Eraser button.
To access the functionality, the feature button must be selected already, and the user must select the button again.

Custom drying and the InkToolbar By default, ink input is processed on a low -latency background thread and
rendered "wet" as it is drawn. When the stroke is completed (pen or finger lifted, or mouse button released), the
stroke is processed on the UI thread and rendered "dry" to the InkCanvas layer (above the application content and
replacing the wet ink). The ink platform enables you to override this behavior and completely customize the inking
experience by custom drying the ink input.

If your app overrides the default ink rendering behavior of the InkPresenter with a custom drying implementation, the
rendered ink strokes are no longer available to the InkToolbar and the built-in erase commands of the InkToolbar do
not work as expected. To provide erase functionality, you must handle all pointer events, perform hit-testing on each
stroke, and override the built-in "Erase all ink" command.
For more info on custom drying, see Pen interactions and Windows Ink in UWP apps.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
**InkToolbarEraserButton**
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.GetMenuButton InkToolbar.GetMenuButton
InkToolbar.GetMenuButton
I n this Article
Edit
Retrieves a reference to an InkToolbarMenuButton object from the menu button group of the InkToolbar.
public : InkToolbarMenuButton GetMenuButton(InkToolbarMenuKind menu)
InkToolbarMenuButton GetMenuButton(InkToolbarMenuKind menu) const;
public InkToolbarMenuButton GetMenuButton(InkToolbarMenuKind menu)

Parameters
menu InkToolbarMenuKind
Indicates the type of InkToolbarMenuButton to retrieve.
Returns
InkToolbarMenuButton
The InkToolbarMenuButton specified.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

See
Also
Pen and stylus interactions
Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
**GetToggleButton**
**GetToolButton**
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample](https://aka.ms/cpubsample-familynotessample) <!-- [Pen and stylus interactions]
(https://msdn.microsoft.com/library/3da4f2d2-5405-42a1-9ed9-3a87bcd84c43) [Add an InkToolbar to a
Universal Windows Platform (UWP ) app](https://docs.microsoft.com/windows/uwp/input-and-devices/ink-
toolbar) [Get Started Tutorial: Support ink in your UWP app](https://docs.microsoft.com/windows/uwp/get-
started/ink-walkthrough) ### Reference [GetToggleButton
InkToolbar.GetToggleButton InkToolbar.GetToggleButton
InkToolbar.GetToggleButton
I n this Article
Edit
Retrieves a reference to an InkToolbarToggleButton object from the toggle button group of the InkToolbar.
public : InkToolbarToggleButton GetToggleButton(InkToolbarToggle tool)
InkToolbarToggleButton GetToggleButton(InkToolbarToggle tool) const;
public InkToolbarToggleButton GetToggleButton(InkToolbarToggle tool)

Parameters
tool InkToolbarToggle
Indicates the type of InkToolbarToggleButton to retrieve.
Returns
InkToolbarToggleButton
The InkToolbarToggleButton specified.
See
Also
Pen and stylus interactions
Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
**GetMenuButton**
**GetToolButton**
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample](https://aka.ms/cpubsample-familynotessample) <!-- [Pen and stylus interactions]
(https://msdn.microsoft.com/library/3da4f2d2-5405-42a1-9ed9-3a87bcd84c43) [Add an InkToolbar to a
Universal Windows Platform (UWP ) app](https://docs.microsoft.com/windows/uwp/input-and-devices/ink-
toolbar) [Get Started Tutorial: Support ink in your UWP app](https://docs.microsoft.com/windows/uwp/get-
started/ink-walkthrough) ### Reference [GetMenuButton
InkToolbar.GetToolButton InkToolbar.GetToolButton Ink
Toolbar.GetToolButton
I n this Article
Edit
Retrieves a reference to one of the following objects from the radio button group of the InkToolbar.
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarEraserButton
InkToolbarHighlighterButton
InkToolbarCustomPenButton
InkToolbarCustomToolButton
public : InkToolbarToolButton GetToolButton(InkToolbarTool tool)
InkToolbarToolButton GetToolButton(InkToolbarTool tool) const;
public InkToolbarToolButton GetToolButton(InkToolbarTool tool)

Parameters
tool InkToolbarTool
Indicates the type of InkToolbarToolButton to retrieve.
Returns
InkToolbarToolButton
The InkToolbarToolButton specified, or null if the button has not been added to the InkToolbar.
See
Also
Pen and stylus interactions
Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
**GetMenuButton**
**GetToggleButton**
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample](https://aka.ms/cpubsample-familynotessample) <!-- [Pen and stylus interactions]
(https://msdn.microsoft.com/library/3da4f2d2-5405-42a1-9ed9-3a87bcd84c43) [Add an InkToolbar to a
Universal Windows Platform (UWP ) app](https://docs.microsoft.com/windows/uwp/input-and-devices/ink-
toolbar) [Get Started Tutorial: Support ink in your UWP app](https://docs.microsoft.com/windows/uwp/get-
started/ink-walkthrough) ### Reference [GetMenuButton
InkToolbar.InitialControls InkToolbar.InitialControls Ink
Toolbar.InitialControls
I n this Article
Edit
Gets or sets the collection of built-in buttons added to the InkToolbar at initialization.
This property overrides the default collection of built-in buttons.
By default, the InkToolbar consists of two distinct groups of button types:
A RadioButton group containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ), erasing
(InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. This group is where
InkToolbarCustomPenButton and InkToolbarCustomToolButton objects are added.

Feature selection is mutually exclusive.

A toggle button group containing the built-in ruler (InkToolbarRulerButton ) button. This group is where
InkToolbarCustomToggleButton objects are added.

Features are not mutually exclusive and can be used concurrently with other active tools.

public : InkToolbarInitialControls InitialControls { get; set; }


InkToolbarInitialControls InitialControls();

void InitialControls(InkToolbarInitialControls initialcontrols);


public InkToolbarInitialControls InitialControls { get; set; }

Returns
InkToolbarInitialControls
The collection of built-in buttons to add to the InkToolbar.

Examples
To specify which built-in buttons are displayed at initialization:
1. Set InitialControls to None.
2. Add the individual buttons.
3. Specify the InkToolbar UI experience, such as the default button. The following examples (both XAML and code-
behind) show how to clear the default buttons from the InkToolber, add ballpoint pen, pencil, and eraser buttons, and
set the default button to pencil.
XAML
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="HeaderPanel" Orientation="Horizontal" Grid.Row="0">
<TextBlock x:Name="Header"
Text="Basic ink sample"
Style="{ThemeResource HeaderTextBlockStyle}"
Margin="10,0,0,0" />
</StackPanel>
<Grid Grid.Row="1">
<Image Source="Assets\StoreLogo.png" />
<!-- Clear the default InkToolbar buttons by setting InitialControls to None. -->
<!-- Set the active tool to the pencil button. -->
<InkCanvas x:Name="inkCanvas" />
<InkToolbar x:Name="inkToolbar"
VerticalAlignment="Top"
TargetInkCanvas="{x:Bind inkCanvas}"
InitialControls="None"
ActiveTool="{x:Bind pencilButton}">
<!--
Add only the ballpoint pen, pencil, and eraser.
Note that the buttons are added to the toolbar in the order
defined by the framework, not the order we specify here.
-->
<InkToolbarEraserButton />
<InkToolbarBallpointPenButton />
<InkToolbarPencilButton x:Name="pencilButton"/>
</InkToolbar>
</Grid>
</Grid>

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">


<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel x:Name="HeaderPanel" Orientation="Horizontal" Grid.Row="0">
<TextBlock x:Name="Header"
Text="Basic ink sample"
Style="{ThemeResource HeaderTextBlockStyle}"
Margin="10,0,0,0" />
</StackPanel>
<Grid Grid.Row="1">
<Image Source="Assets\StoreLogo.png" />
<InkCanvas x:Name="inkCanvas" />
<InkToolbar x:Name="inkToolbar" VerticalAlignment="Top" TargetInkCanvas="{x:Bind inkCanvas}"
/>
</Grid>
</Grid>

/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// Here, we set up InkToolbar event listeners.
/// </summary>
public MainPage_CodeBehind()
{
this.InitializeComponent();
// Add handlers for InkToolbar events.
inkToolbar.Loading += inkToolbar_Loading;
//inkToolbar.Loaded += inkToolbar_Loaded;
}
/// <summary>
/// Handles the Loading event of the InkToolbar.
/// Here, we identify the buttons to include on the InkToolbar.
/// </summary>
/// <param name="sender">The InkToolbar</param>
/// <param name="args">The InkToolbar event data.
/// If there is no event data, this parameter is null</param>
private void inkToolbar_Loading(FrameworkElement sender, object args)
{
// Clear all built-in buttons from the InkToolbar.
inkToolbar.InitialControls = InkToolbarInitialControls.None;

// Add only the ballpoint pen, pencil, and eraser.


// Note that the buttons are added to the toolbar in the order
// defined by the framework, not the order we specify here.
InkToolbarBallpointPenButton ballpoint = new InkToolbarBallpointPenButton();
InkToolbarPencilButton pencil = new InkToolbarPencilButton();
InkToolbarEraserButton eraser = new InkToolbarEraserButton();
inkToolbar.Children.Add(eraser);
inkToolbar.Children.Add(ballpoint);
inkToolbar.Children.Add(pencil);
}

/// <summary>
/// Handle the Loaded event of the InkToolbar.
/// By default, the active tool is set to the first tool on the toolbar.
/// Here, we set the active tool to the pencil button.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void inkToolbar_Loaded(object sender, RoutedEventArgs e)
{
InkToolbarToolButton pencilButton = inkToolbar.GetToolButton(InkToolbarTool.Pencil);
inkToolbar.ActiveTool = pencilButton;
}

Remarks
Default built-in buttons, or those specified through InitialControls, are not added to the Children property.
Built-in or custom buttons added programmatically or declared in XAML, are added to the Children property.
Built-in buttons are displayed in a pre-determined order within their respective control groups. Custom buttons are
added to the appropriate control group in the order specified, after all built-in buttons.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
**InitialControlsProperty**
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.InitialControlsProperty InkToolbar.Initial
ControlsProperty InkToolbar.InitialControlsProperty
I n this Article
Edit
Identifies the InitialControls dependency property.
public : static DependencyProperty InitialControlsProperty { get; }
static DependencyProperty InitialControlsProperty();
public static DependencyProperty InitialControlsProperty { get; }

Returns
DependencyProperty
The identifier for the InitialControls dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
**InitialControls**
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.InkDrawingAttributes InkToolbar.InkDrawing
Attributes InkToolbar.InkDrawingAttributes
I n this Article
Edit
Gets the InkStroke properties specified through the InkToolbar.
public : InkDrawingAttributes InkDrawingAttributes { get; }
InkDrawingAttributes InkDrawingAttributes();
public InkDrawingAttributes InkDrawingAttributes { get; }

Returns
InkDrawingAttributes
The InkStroke properties.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
**InkDrawingAttributesProperty**
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.InkDrawingAttributesChanged InkToolbar.Ink
DrawingAttributesChanged InkToolbar.InkDrawing
AttributesChanged
I n this Article
Edit
Occurs when any InkDrawingAttributes are changed.
public : event TypedEventHandler<InkToolbar, object> InkDrawingAttributesChanged
// Register
event_token InkDrawingAttributesChanged(TypedEventHandler<InkToolbar, object> const& handler) const;

// Revoke with event_token


void InkDrawingAttributesChanged(event_token const& cookie) const;

// Revoke with event_revoker


InkDrawingAttributesChanged_revoker InkDrawingAttributesChanged(auto_revoke_t,
TypedEventHandler<InkToolbar, object> const& handler) const;
public event TypedEventHandler<InkToolbar, object> InkDrawingAttributesChanged

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
**InkDrawingAttributes**
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.InkDrawingAttributesProperty InkToolbar.Ink
DrawingAttributesProperty InkToolbar.InkDrawing
AttributesProperty
I n this Article
Edit
Identifies the InkDrawingAttributes dependency property.
public : static DependencyProperty InkDrawingAttributesProperty { get; }
static DependencyProperty InkDrawingAttributesProperty();
public static DependencyProperty InkDrawingAttributesProperty { get; }

Returns
DependencyProperty
The identifier for the InkDrawingAttributes dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
**InkDrawingAttributes**
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar InkToolbar InkToolbar
I n this Article
Edit
Initializes a new instance of the InkToolbar class.

public : InkToolbar()
InkToolbar() const;
public InkToolbar()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.IsRulerButtonChecked InkToolbar.IsRuler
ButtonChecked InkToolbar.IsRulerButtonChecked
I n this Article
Edit
Gets or sets the state of the InkToolbarRulerButton (and associated tool) to on or off.
When turned on, the ruler works in conjunction with the active tool.
public : Platform::Boolean IsRulerButtonChecked { get; set; }
bool IsRulerButtonChecked();

void IsRulerButtonChecked(bool isrulerbuttonchecked);


public bool IsRulerButtonChecked { get; set; }

Returns
bool
true if the ruler button is selected and the ruler is active; otherwise, false.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Simple ink sample (C#/C++)
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.IsRulerButtonCheckedChanged InkToolbar.Is
RulerButtonCheckedChanged InkToolbar.IsRulerButton
CheckedChanged
I n this Article
Edit
Occurs when the toggled state of the InkToolbarRulerButton changes.
public : event TypedEventHandler<InkToolbar, object> IsRulerButtonCheckedChanged
// Register
event_token IsRulerButtonCheckedChanged(TypedEventHandler<InkToolbar, object> const& handler) const;

// Revoke with event_token


void IsRulerButtonCheckedChanged(event_token const& cookie) const;

// Revoke with event_revoker


IsRulerButtonCheckedChanged_revoker IsRulerButtonCheckedChanged(auto_revoke_t,
TypedEventHandler<InkToolbar, object> const& handler) const;
public event TypedEventHandler<InkToolbar, object> IsRulerButtonCheckedChanged

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Complex ink sample (C++)
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.IsRulerButtonCheckedProperty InkToolbar.Is
RulerButtonCheckedProperty InkToolbar.IsRulerButton
CheckedProperty
I n this Article
Edit
Identifies the IsRulerButtonChecked dependency property.
public : static DependencyProperty IsRulerButtonCheckedProperty { get; }
static DependencyProperty IsRulerButtonCheckedProperty();
public static DependencyProperty IsRulerButtonCheckedProperty { get; }

Returns
DependencyProperty
The identifier for the IsRulerButtonChecked dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.IsStencilButtonChecked InkToolbar.IsStencil
ButtonChecked InkToolbar.IsStencilButtonChecked
I n this Article
Edit
Gets or sets the state of the InkToolbarStencilButton (and associated tool) to on or off.
When turned on, the stencil works in conjunction with the active tool.
public : Platform::Boolean IsStencilButtonChecked { get; set; }
bool IsStencilButtonChecked();

void IsStencilButtonChecked(bool isstencilbuttonchecked);


public bool IsStencilButtonChecked { get; set; }

Returns
bool
true if the stencil button is selected and the stencil is active; otherwise, false.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.IsStencilButtonCheckedChanged InkToolbar.Is
StencilButtonCheckedChanged InkToolbar.IsStencilButton
CheckedChanged
I n this Article
Edit
Occurs when the toggled state of the InkToolbaStencilButton changes.
public : event TypedEventHandler<InkToolbar, InkToolbarIsStencilButtonCheckedChangedEventArgs>
IsStencilButtonCheckedChanged
// Register
event_token IsStencilButtonCheckedChanged(TypedEventHandler<InkToolbar,
InkToolbarIsStencilButtonCheckedChangedEventArgs> const& handler) const;

// Revoke with event_token


void IsStencilButtonCheckedChanged(event_token const& cookie) const;

// Revoke with event_revoker


IsStencilButtonCheckedChanged_revoker IsStencilButtonCheckedChanged(auto_revoke_t,
TypedEventHandler<InkToolbar, InkToolbarIsStencilButtonCheckedChangedEventArgs> const& handler)
const;
public event TypedEventHandler<InkToolbar, InkToolbarIsStencilButtonCheckedChangedEventArgs>
IsStencilButtonCheckedChanged

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.IsStencilButtonCheckedProperty InkToolbar.Is
StencilButtonCheckedProperty InkToolbar.IsStencilButton
CheckedProperty
I n this Article
Edit
Identifies the IsStencilButtonChecked dependency property.
public : static DependencyProperty IsStencilButtonCheckedProperty { get; }
static DependencyProperty IsStencilButtonCheckedProperty();
public static DependencyProperty IsStencilButtonCheckedProperty { get; }

Returns
DependencyProperty
The identifier for the IsStencilButtonChecked dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.Orientation InkToolbar.Orientation InkToolbar.
Orientation
I n this Article
Edit
Gets or sets the orientation of the InkToolbar.
public : Orientation Orientation { get; set; }
Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

Returns
Orientation
The different orientations that ink toolbar can have.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.OrientationProperty InkToolbar.Orientation
Property InkToolbar.OrientationProperty
I n this Article
Edit
Identifies the InkToolbar.Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the InkToolbar.Orientation dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

See
Also
Pen and stylus interactions
Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample](https://aka.ms/cpubsample-familynotessample) <!-- [Pen and stylus interactions]
(https://msdn.microsoft.com/library/3da4f2d2-5405-42a1-9ed9-3a87bcd84c43) [Add an InkToolbar to a
Universal Windows Platform (UWP ) app](https://docs.microsoft.com/windows/uwp/input-and-devices/ink-
toolbar) [Get Started Tutorial: Support ink in your UWP app](https://docs.microsoft.com/windows/uwp/get-
started/ink-walkthrough) ### Reference P:Windows.UI.Xaml.Controls.InkToolbar.Orientation ### Samples *
[Simple ink sample (C#/C++)](https://go.microsoft.com/fwlink/p/?LinkID=620312) * [Complex ink sample
(C++)](https://go.microsoft.com/fwlink/p/?LinkID=620314) * [Ink sample (JavaScript)]
(https://go.microsoft.com/fwlink/p/?LinkID=620308) * [Get Started Tutorial: Support ink in your UWP app]
(https://aka.ms/appsample-ink) * [Coloring book sample](https://aka.ms/cpubsample-coloringbook) * [Family
notes sample
InkToolbar.TargetInkCanvas InkToolbar.TargetInkCanvas
InkToolbar.TargetInkCanvas
I n this Article
Edit
Gets or sets the InkCanvas control associated with the InkToolbar.
All InkToolbar settings are propagated to the associated InkCanvas.
public : InkCanvas TargetInkCanvas { get; set; }
InkCanvas TargetInkCanvas();

void TargetInkCanvas(InkCanvas targetinkcanvas);


public InkCanvas TargetInkCanvas { get; set; }

Returns
InkCanvas
The InkCanvas control to associate with the InkToolbar.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbar.TargetInkCanvasProperty InkToolbar.TargetInk
CanvasProperty InkToolbar.TargetInkCanvasProperty
I n this Article
Edit
Identifies the TargetInkCanvas dependency property.
public : static DependencyProperty TargetInkCanvasProperty { get; }
static DependencyProperty TargetInkCanvasProperty();
public static DependencyProperty TargetInkCanvasProperty { get; }

Returns
DependencyProperty
The identifier for the TargetInkCanvas dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarBallpointPenButton InkToolbarBallpointPen
Button InkToolbarBallpointPenButton Class
Represents an InkToolbar button that activates the built-in ballpoint pen.

D eclaration
public : class InkToolbarBallpointPenButton : InkToolbarPenButton, IInkToolbarBallpointPenButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarBallpointPenButton : InkToolbarPenButton,
IInkToolbarBallpointPenButton
public class InkToolbarBallpointPenButton : InkToolbarPenButton, IInkToolbarBallpointPenButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
RadioButton
InkToolbarToolButton
InkToolbarPenButton

Remarks
The ballpoint pen draws a solid, opaque stroke with a Circle PenTip. The stroke size varies with the active pen pressure
detected (default size is 2x2 pixels).
InkToolbarBallpointPenButton inherits from InkToolbarPenButton.
This button is part of the default radio button group that enables a user to select a single ink feature from a mutually
exclusive group of options.
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

Constructors
InkToolbarBallpointPenButton()
InkToolbarBallpointPenButton()
InkToolbarBallpointPenButton()

Initializes a new instance of the InkToolbarBallpointPenButton class.

See Also
InkToolbarPenButton
InkToolbarBallpointPenButton InkToolbarBallpointPen
Button InkToolbarBallpointPenButton
I n this Article
Edit
Initializes a new instance of the InkToolbarBallpointPenButton class.
public : InkToolbarBallpointPenButton()
InkToolbarBallpointPenButton() const;
public InkToolbarBallpointPenButton()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarPenButton
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarButtonFlyoutPlacement InkToolbarButton
FlyoutPlacement InkToolbarButtonFlyoutPlacement Enum
Specifies the location of the ink stroke configuration flyout relative to the InkToolbar.

D eclaration
public : enum class InkToolbarButtonFlyoutPlacement
enum class winrt::Windows::UI::Xaml::Controls::InkToolbarButtonFlyoutPlacement : int32_t
public enum InkToolbarButtonFlyoutPlacement

I nheritance H ierarchy
None

Fields
Auto Auto Auto The system determines which edge of the ink toolbar to align the flyout.

Bottom Bottom Bottom Flyout is aligned to the bottom edge of the ink toolbar.

Left Left Left Flyout is aligned to the left edge of the ink toolbar.

Right Right Right Flyout is aligned to the right edge of the ink toolbar.

Top Top Top Flyout is aligned to the top edge of the ink toolbar.

See Also
InkToolbarCustomPen InkToolbarCustomPen InkToolbar
CustomPen Class
Represents an InkToolbar pen for which the ink color palette and pen tip properties, such as shape, rotation, and size,
are defined by the host app.

D eclaration
public : class InkToolbarCustomPen : DependencyObject, IInkToolbarCustomPen,
IInkToolbarCustomPenOverrides
struct winrt::Windows::UI::Xaml::Controls::InkToolbarCustomPen : DependencyObject,
IInkToolbarCustomPen, IInkToolbarCustomPenOverrides
public class InkToolbarCustomPen : DependencyObject, IInkToolbarCustomPen,
IInkToolbarCustomPenOverrides

I nheritance H ierarchy
DependencyObject

Remarks
To create an app-defined pen and corresponding button on the InkToolbar, use this class in conjunction with
InkToolbarCustomPenButton.

Constructors
InkToolbarCustomPen()
InkToolbarCustomPen()
InkToolbarCustomPen()

Initializes a new instance of the InkToolbarCustomPen class.

Methods
CreateInkDrawingAttributes(Brush, Double)
CreateInkDrawingAttributes(Brush, Double)
CreateInkDrawingAttributes(Brush, Double)

Retrieves the InkToolbarCustomPen attributes used for an InkToolbarPenConfigurationControl.

CreateInkDrawingAttributesCore(Brush, Double)
CreateInkDrawingAttributesCore(Brush, Double)
CreateInkDrawingAttributesCore(Brush, Double)

When overridden in a derived class, retrieves an InkDrawingAttributes object used to specify the
ConfigurationContent for an InkToolbarCustomPen.
This method is not called by application code.

See Also
DependencyObject
InkToolbarCustomPen.CreateInkDrawingAttributes Ink
ToolbarCustomPen.CreateInkDrawingAttributes Ink
ToolbarCustomPen.CreateInkDrawingAttributes
I n this Article
Edit
Retrieves the InkToolbarCustomPen attributes used for an InkToolbarPenConfigurationControl.
public : InkDrawingAttributes CreateInkDrawingAttributes(Brush brush, double strokeWidth)
InkDrawingAttributes CreateInkDrawingAttributes(Brush brush, double strokeWidth) const;
public InkDrawingAttributes CreateInkDrawingAttributes(Brush brush, Double strokeWidth)

Parameters
brush Brush
The brush used to draw the stroke. The default is 0 (Black ).
strokeWidth Double
The width of the stroke. The default is 0.
Returns
InkDrawingAttributes
The attributes applied to the InkStroke when it is drawn.

Remarks
When providing a custom pen, it is possible to derive from InkToolbarCustomPen and specify a custom
InkToolbarPenConfigurationControl. The derived class overrides the CreateInkDrawingAttributesCore method to
change the default InkDrawingAttributes settings.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarCustomPen.CreateInkDrawingAttributesCore
InkToolbarCustomPen.CreateInkDrawingAttributesCore
InkToolbarCustomPen.CreateInkDrawingAttributesCore
I n this Article
Edit
When overridden in a derived class, retrieves an InkDrawingAttributes object used to specify the ConfigurationContent
for an InkToolbarCustomPen.
This method is not called by application code.
protected : virtual InkDrawingAttributes CreateInkDrawingAttributesCore(Brush brush, double
strokeWidth)
virtual InkDrawingAttributes CreateInkDrawingAttributesCore(Brush brush, double strokeWidth) const;
protected virtual InkDrawingAttributes CreateInkDrawingAttributesCore(Brush brush, Double
strokeWidth)

Parameters
brush Brush
The brush used to draw the stroke. The default is 0 (Black ).
strokeWidth Double
The width of the stroke. The default is 0.
Returns
InkDrawingAttributes
The attributes applied to the InkStroke when it is drawn.

Remarks
An InkToolbarCustomPenButton can reuse the standard InkToolbarPenConfigurationControl object to configure an
optional settings flyout for the custom pen. An "extension glyph" is displayed on the button to indicate the existence of
the flyout.
Derive from InkToolbarCustomPen and specify a custom InkToolbarPenConfigurationControl. Override the
CreateInkDrawingAttributesCore method to change the default InkDrawingAttributes settings.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarCustomPen InkToolbarCustomPen InkToolbar
CustomPen
I n this Article
Edit
Initializes a new instance of the InkToolbarCustomPen class.
protected : InkToolbarCustomPen()
InkToolbarCustomPen() const;
protected InkToolbarCustomPen()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarCustomPenInkToolbarCustomPenInkToolbarCustomPen
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarCustomPenButton InkToolbarCustomPenButton
InkToolbarCustomPenButton Class
Represents an InkToolbar button that activates a pen for which the ink color palette and pen tip properties, such as
shape, rotation, and size, are defined by the host app.

D eclaration
public : class InkToolbarCustomPenButton : InkToolbarPenButton, IInkToolbarCustomPenButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarCustomPenButton : InkToolbarPenButton,
IInkToolbarCustomPenButton
public class InkToolbarCustomPenButton : InkToolbarPenButton, IInkToolbarCustomPenButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
RadioButton
InkToolbarToolButton
InkToolbarPenButton

Remarks
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

Built-in buttons can be displayed by default, or you can specify which should be displayed by your app.
You cannot change the display order of the built-in buttons. The default display order is: InkToolbarBallpointPenButton,
InkToolbarPencilButton, InkToolbarHighlighterButton, InkToolbarEraserButton, and InkToolbarRulerButton, with
custom tool buttons appended to the radio button group and custom toggle buttons appended to the toggle button
group.
You can use the built-in InkToolbarPenConfigurationControl or you can specify a custom
InkToolbarPenConfigurationControl definition in the standard InkToolbar pen declaration.
For custom configurations, your pen class must derive from InkToolbarCustomPen, and override the
CreateInkDrawingAttributesCore method. You can then set an instance of the derived class into
InkToolbarCustomPenButton.CustomPen and provide the custom configuration UI elements.

Constructors
InkToolbarCustomPenButton()
InkToolbarCustomPenButton()
InkToolbarCustomPenButton()

Initializes a new instance of the InkToolbarCustomPenButton class.

Properties
ConfigurationContent
ConfigurationContent
ConfigurationContent

Gets or sets the content of an optional ink stroke configuration flyout associated with the
InkToolbarCustomPenButton.

ConfigurationContentProperty
ConfigurationContentProperty
ConfigurationContentProperty

Identifies the ConfigurationContent dependency property.

CustomPen
CustomPen
CustomPen

Gets or sets the InkToolbarCustomPen associated with the InkToolbarCustomPenButton.

CustomPenProperty
CustomPenProperty
CustomPenProperty

Identifies the CustomPen dependency property.

See Also
InkToolbarPenButton
InkToolbarCustomPen
InkToolbarPenButton
InkToolbarCustomPenButton.ConfigurationContent Ink
ToolbarCustomPenButton.ConfigurationContent Ink
ToolbarCustomPenButton.ConfigurationContent
I n this Article
Edit
Gets or sets the content of an optional ink stroke configuration flyout associated with the InkToolbarCustomPenButton.
public : UIElement ConfigurationContent { get; set; }
UIElement ConfigurationContent();

void ConfigurationContent(UIElement configurationcontent);


public UIElement ConfigurationContent { get; set; }

Returns
UIElement
The contents of the flyout. The default is null.

Remarks
Each feature on the InkToolbar can support supplementary functionality in a flyout (an "extension glyph" on the feature
button indicates to the user that the functionality is available).
To access the functionality, the feature button must be selected already, and the user must select the button again.
See
Also
Pen and stylus interactions
Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Windows.UI.Xaml.Controls classes
InkToolbarPenButton
DependencyObject
IsExtensionGlyphShown
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample](https://aka.ms/cpubsample-familynotessample) <!-- [Pen and stylus interactions]
(https://msdn.microsoft.com/library/3da4f2d2-5405-42a1-9ed9-3a87bcd84c43) [Add an InkToolbar to a
Universal Windows Platform (UWP ) app](https://docs.microsoft.com/windows/uwp/input-and-devices/ink-
toolbar) [Get Started Tutorial: Support ink in your UWP app](https://docs.microsoft.com/windows/uwp/get-
started/ink-walkthrough) ### Reference [Windows.UI.Xaml.Controls classes
InkToolbarPenButton
DependencyObject
InkToolbarCustomPenButton.ConfigurationContent
Property InkToolbarCustomPenButton.Configuration
ContentProperty InkToolbarCustomPenButton.
ConfigurationContentProperty
I n this Article
Edit
Identifies the ConfigurationContent dependency property.
public : static DependencyProperty ConfigurationContentProperty { get; }
static DependencyProperty ConfigurationContentProperty();
public static DependencyProperty ConfigurationContentProperty { get; }

Returns
DependencyProperty
The identifier for the ConfigurationContent dependency property.
See
Also
Pen and stylus interactions
Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Windows.UI.Xaml.Controls classes
InkToolbarPenButton
DependencyObject
IsExtensionGlyphShown
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample](https://aka.ms/cpubsample-familynotessample) <!-- [Pen and stylus interactions]
(https://msdn.microsoft.com/library/3da4f2d2-5405-42a1-9ed9-3a87bcd84c43) [Add an InkToolbar to a
Universal Windows Platform (UWP ) app](https://docs.microsoft.com/windows/uwp/input-and-devices/ink-
toolbar) [Get Started Tutorial: Support ink in your UWP app](https://docs.microsoft.com/windows/uwp/get-
started/ink-walkthrough) ### Reference [Windows.UI.Xaml.Controls classes
InkToolbarPenButton
DependencyObject
InkToolbarCustomPenButton.CustomPen InkToolbar
CustomPenButton.CustomPen InkToolbarCustomPen
Button.CustomPen
I n this Article
Edit
Gets or sets the InkToolbarCustomPen associated with the InkToolbarCustomPenButton.
public : InkToolbarCustomPen CustomPen { get; set; }
InkToolbarCustomPen CustomPen();

void CustomPen(InkToolbarCustomPen custompen);


public InkToolbarCustomPen CustomPen { get; set; }

Returns
InkToolbarCustomPen
The InkToolbarCustomPen that is enabled or disabled by the InkToolbarCustomPenButton.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarPenButton
InkToolbarCustomPen
DependencyObject
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarPenButton
InkToolbarCustomPen
InkToolbarCustomPenButton.CustomPenProperty Ink
ToolbarCustomPenButton.CustomPenProperty InkToolbar
CustomPenButton.CustomPenProperty
I n this Article
Edit
Identifies the CustomPen dependency property.
public : static DependencyProperty CustomPenProperty { get; }
static DependencyProperty CustomPenProperty();
public static DependencyProperty CustomPenProperty { get; }

Returns
DependencyProperty
The identifier for the CustomPen dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarPenButton
InkToolbarCustomPen
DependencyObject
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarPenButton
InkToolbarCustomPen
InkToolbarCustomPenButton InkToolbarCustomPenButton
InkToolbarCustomPenButton
I n this Article
Edit
Initializes a new instance of the InkToolbarCustomPenButton class.
public : InkToolbarCustomPenButton()
InkToolbarCustomPenButton() const;
public InkToolbarCustomPenButton()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarPenButton
InkToolbarCustomPen
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarCustomToggleButton InkToolbarCustomToggle
Button InkToolbarCustomToggleButton Class
Represents an InkToolbar button that sets the state of an app-defined feature to on or off. When turned on, the feature
works in conjunction with the active tool.

D eclaration
public : class InkToolbarCustomToggleButton : InkToolbarToggleButton,
IInkToolbarCustomToggleButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarCustomToggleButton :
InkToolbarToggleButton, IInkToolbarCustomToggleButton
public class InkToolbarCustomToggleButton : InkToolbarToggleButton,
IInkToolbarCustomToggleButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
CheckBox
InkToolbarToggleButton

Remarks
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

Constructors
InkToolbarCustomToggleButton()
InkToolbarCustomToggleButton()
InkToolbarCustomToggleButton()

Initializes a new instance of the InkToolbarCustomToggleButton class.


See Also
InkToolbarCustomToggleButton InkToolbarCustomToggle
Button InkToolbarCustomToggleButton
I n this Article
Edit
Initializes a new instance of the InkToolbarCustomToggleButton class.
public : InkToolbarCustomToggleButton()
InkToolbarCustomToggleButton() const;
public InkToolbarCustomToggleButton()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarCustomToolButton InkToolbarCustomTool
Button InkToolbarCustomToolButton Class
Represents an InkToolbar button that invokes a non-pen tool, defined by the host app.

D eclaration
public : class InkToolbarCustomToolButton : InkToolbarToolButton, IInkToolbarCustomToolButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarCustomToolButton : InkToolbarToolButton,
IInkToolbarCustomToolButton
public class InkToolbarCustomToolButton : InkToolbarToolButton, IInkToolbarCustomToolButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
RadioButton
InkToolbarToolButton

Remarks
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

Built-in buttons can be displayed by default, or you can specify which should be displayed by your app.

You cannot change the display order of the built-in buttons. The default display order is:
InkToolbarBallpointPenButton, InkToolbarPencilButton, InkToolbarHighlighterButton, InkToolbarEraserButton, and
InkToolbarRulerButton, with custom tool buttons appended to the radio button group and custom toggle buttons
appended to the toggle button group.

Constructors
InkToolbarCustomToolButton()
InkToolbarCustomToolButton()
InkToolbarCustomToolButton()
Initializes a new instance of the InkToolbarCustomToolButton class.

Properties
ConfigurationContent
ConfigurationContent
ConfigurationContent

Gets or sets the content of an optional ink stroke configuration flyout associated with the
InkToolbarCustomToolButton.

ConfigurationContentProperty
ConfigurationContentProperty
ConfigurationContentProperty

Identifies the ConfigurationContent dependency property.

See Also
InkToolbarCustomToolButton.ConfigurationContent Ink
ToolbarCustomToolButton.ConfigurationContent Ink
ToolbarCustomToolButton.ConfigurationContent
I n this Article
Edit
Gets or sets the content of an optional ink stroke configuration flyout associated with the
InkToolbarCustomToolButton.
public : UIElement ConfigurationContent { get; set; }
UIElement ConfigurationContent();

void ConfigurationContent(UIElement configurationcontent);


public UIElement ConfigurationContent { get; set; }

Returns
UIElement
The contents of the flyout. The default is null.

Remarks
Each feature on the InkToolbar can support supplementary functionality in a flyout (an "extension glyph" on the feature
button indicates to the user that the functionality is available).
To access the functionality, the feature button must be selected already, and the user must select the button again.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
IsExtensionGlyphShown
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
InkToolbarCustomToolButton.ConfigurationContent
Property InkToolbarCustomToolButton.Configuration
ContentProperty InkToolbarCustomToolButton.
ConfigurationContentProperty
I n this Article
Edit
Identifies the ConfigurationContent dependency property.
public : static DependencyProperty ConfigurationContentProperty { get; }
static DependencyProperty ConfigurationContentProperty();
public static DependencyProperty ConfigurationContentProperty { get; }

Returns
DependencyProperty
The identifier for the ConfigurationContent dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarCustomToolButton InkToolbarCustomTool
Button InkToolbarCustomToolButton
I n this Article
Edit
Initializes a new instance of the InkToolbarCustomToolButton class.
public : InkToolbarCustomToolButton()
InkToolbarCustomToolButton() const;
public InkToolbarCustomToolButton()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarCustomToolButtonInkToolbarCustomToolButtonInkToolbarCustomToolButton
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarEraserButton InkToolbarEraserButton Ink
ToolbarEraserButton Class
Represents an InkToolbar button that activates the built-in eraser tool.

D eclaration
public : class InkToolbarEraserButton : InkToolbarToolButton, IInkToolbarEraserButton,
IInkToolbarEraserButton2
struct winrt::Windows::UI::Xaml::Controls::InkToolbarEraserButton : InkToolbarToolButton,
IInkToolbarEraserButton, IInkToolbarEraserButton2
public class InkToolbarEraserButton : InkToolbarToolButton, IInkToolbarEraserButton,
IInkToolbarEraserButton2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
RadioButton
InkToolbarToolButton

Remarks
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

The eraser stroke has a default size of 2x2 pixels.


An ink stroke touched by the eraser stroke is deleted in its entirety, not just the portion under the erase stroke.
Custom drying and the InkToolbar
By default, ink input is processed on a low -latency background thread and rendered "wet" as it is drawn. When the
stroke is completed (pen or finger lifted, or mouse button released), the stroke is processed on the UI thread and
rendered "dry" to the InkCanvas layer (above the application content and replacing the wet ink). The ink platform
enables you to override this behavior and completely customize the inking experience by custom drying the ink input.
If your app overrides the default ink rendering behavior of the InkPresenter with a custom drying implementation, the
rendered ink strokes are no longer available to the InkToolbar and the built-in erase commands of the InkToolbar do
not work as expected. To provide erase functionality, you must handle all pointer events, perform hit-testing on each
stroke, and override the built-in "Erase all ink" command.
For more info on custom drying, see Pen interactions and Windows Ink in UWP apps.

Constructors
InkToolbarEraserButton()
InkToolbarEraserButton()
InkToolbarEraserButton()

Initializes a new instance of the InkToolbarEraserButton class.

Properties
IsClearAllVisible
IsClearAllVisible
IsClearAllVisible

Gets or sets whether the "Erase all ink" button is visible.

IsClearAllVisibleProperty
IsClearAllVisibleProperty
IsClearAllVisibleProperty

Identifies the IsClearAllVisible dependency property.

See Also
InkToolbarEraserButton InkToolbarEraserButton Ink
ToolbarEraserButton
I n this Article
Edit
Initializes a new instance of the InkToolbarEraserButton class.
public : InkToolbarEraserButton()
InkToolbarEraserButton() const;
public InkToolbarEraserButton()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarEraserButton
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarEraserButton.IsClearAllVisible InkToolbarEraser
Button.IsClearAllVisible InkToolbarEraserButton.IsClearAll
Visible
I n this Article
Edit
Gets or sets whether the "Erase all ink" button is visible.
public : Platform::Boolean IsClearAllVisible { get; set; }
bool IsClearAllVisible();

void IsClearAllVisible(bool isclearallvisible);


public bool IsClearAllVisible { get; set; }

Returns
bool
true if visible. Otherwise, false.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarEraserButton.IsClearAllVisibleProperty Ink
ToolbarEraserButton.IsClearAllVisibleProperty InkToolbar
EraserButton.IsClearAllVisibleProperty
I n this Article
Edit
Identifies the IsClearAllVisible dependency property.
public : static DependencyProperty IsClearAllVisibleProperty { get; }
static DependencyProperty IsClearAllVisibleProperty();
public static DependencyProperty IsClearAllVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsClearAllVisible dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarFlyoutItem InkToolbarFlyoutItem InkToolbar
FlyoutItem Class
Represents an InkToolbar button on a flyout. This item can be a basic button, a radio button, a radio toggle button, or a
check box.

D eclaration
public : class InkToolbarFlyoutItem : ButtonBase, IInkToolbarFlyoutItem
struct winrt::Windows::UI::Xaml::Controls::InkToolbarFlyoutItem : ButtonBase,
IInkToolbarFlyoutItem
public class InkToolbarFlyoutItem : ButtonBase, IInkToolbarFlyoutItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase

Constructors
InkToolbarFlyoutItem()
InkToolbarFlyoutItem()
InkToolbarFlyoutItem()

Initializes a new instance of the InkToolbarFlyoutItem class.

Properties
IsChecked
IsChecked
IsChecked

Gets or sets whether the flyout item is checked.

IsCheckedProperty
IsCheckedProperty
IsCheckedProperty

Identifies the IsChecked dependency property.

Kind
Kind
Kind

Gets or sets the type of button to use on the flyout.


KindProperty
KindProperty
KindProperty

Identifies the Kind dependency property.

Events
Checked
Checked
Checked

Occurs when the flyout item is checked.

Unchecked
Unchecked
Unchecked

Occurs when the flyout item is unchecked.

See Also
InkToolbarFlyoutItem.Checked InkToolbarFlyoutItem.
Checked InkToolbarFlyoutItem.Checked
I n this Article
Edit
Occurs when the flyout item is checked.
public : event TypedEventHandler<InkToolbarFlyoutItem, object> Checked
// Register
event_token Checked(TypedEventHandler<InkToolbarFlyoutItem, object> const& handler) const;

// Revoke with event_token


void Checked(event_token const& cookie) const;

// Revoke with event_revoker


Checked_revoker Checked(auto_revoke_t, TypedEventHandler<InkToolbarFlyoutItem, object> const&
handler) const;
public event TypedEventHandler<InkToolbarFlyoutItem, object> Checked

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
UncheckedUncheckedUnchecked
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarFlyoutItem InkToolbarFlyoutItem InkToolbar
FlyoutItem
I n this Article
Edit
Initializes a new instance of the InkToolbarFlyoutItem class.
public : InkToolbarFlyoutItem()
InkToolbarFlyoutItem() const;
public InkToolbarFlyoutItem()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarFlyoutItemInkToolbarFlyoutItemInkToolbarFlyoutItem
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarFlyoutItem.IsChecked InkToolbarFlyoutItem.Is
Checked InkToolbarFlyoutItem.IsChecked
I n this Article
Edit
Gets or sets whether the flyout item is checked.
public : Platform::Boolean IsChecked { get; set; }
bool IsChecked();

void IsChecked(bool ischecked);


public bool IsChecked { get; set; }

Returns
bool
true if checked. Otherwise, false.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
CheckedCheckedChecked
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarFlyoutItem.IsCheckedProperty InkToolbar
FlyoutItem.IsCheckedProperty InkToolbarFlyoutItem.Is
CheckedProperty
I n this Article
Edit
Identifies the IsChecked dependency property.
public : static DependencyProperty IsCheckedProperty { get; }
static DependencyProperty IsCheckedProperty();
public static DependencyProperty IsCheckedProperty { get; }

Returns
DependencyProperty
The identifier for the IsChecked dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
CheckedCheckedChecked
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarFlyoutItem.Kind InkToolbarFlyoutItem.Kind Ink
ToolbarFlyoutItem.Kind
I n this Article
Edit
Gets or sets the type of button to use on the flyout.
public : InkToolbarFlyoutItemKind Kind { get; set; }
InkToolbarFlyoutItemKind Kind();

void Kind(InkToolbarFlyoutItemKind kind);


public InkToolbarFlyoutItemKind Kind { get; set; }

Returns
InkToolbarFlyoutItemKind
The type of button.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarFlyoutItem.KindProperty InkToolbarFlyoutItem.
KindProperty InkToolbarFlyoutItem.KindProperty
I n this Article
Edit
Identifies the Kind dependency property.
public : static DependencyProperty KindProperty { get; }
static DependencyProperty KindProperty();
public static DependencyProperty KindProperty { get; }

Returns
DependencyProperty
The identifier for the Kind dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarFlyoutItem.Unchecked InkToolbarFlyoutItem.
Unchecked InkToolbarFlyoutItem.Unchecked
I n this Article
Edit
Occurs when the flyout item is unchecked.
public : event TypedEventHandler<InkToolbarFlyoutItem, object> Unchecked
// Register
event_token Unchecked(TypedEventHandler<InkToolbarFlyoutItem, object> const& handler) const;

// Revoke with event_token


void Unchecked(event_token const& cookie) const;

// Revoke with event_revoker


Unchecked_revoker Unchecked(auto_revoke_t, TypedEventHandler<InkToolbarFlyoutItem, object> const&
handler) const;
public event TypedEventHandler<InkToolbarFlyoutItem, object> Unchecked

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
CheckedCheckedChecked
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarFlyoutItemKind InkToolbarFlyoutItemKind Ink
ToolbarFlyoutItemKind Enum
Specifies the types of buttons that can be used on an InkToolbar flyout.

D eclaration
public : enum class InkToolbarFlyoutItemKind
enum class winrt::Windows::UI::Xaml::Controls::InkToolbarFlyoutItemKind : int32_t
public enum InkToolbarFlyoutItemKind

I nheritance H ierarchy
None

Fields
Check Check Check A check box.

Radio Radio Radio A basic radio button.

RadioCheck RadioCheck RadioCheck A radio button that can be toggled on or off.

Simple Simple Simple A basic button.

See Also
InkToolbarHighlighterButton InkToolbarHighlighterButton
InkToolbarHighlighterButton Class
Represents an InkToolbar toggle button control that activates the built-in highlighter pen.

D eclaration
public : class InkToolbarHighlighterButton : InkToolbarPenButton, IInkToolbarHighlighterButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarHighlighterButton : InkToolbarPenButton,
IInkToolbarHighlighterButton
public class InkToolbarHighlighterButton : InkToolbarPenButton, IInkToolbarHighlighterButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
RadioButton
InkToolbarToolButton
InkToolbarPenButton

Remarks
The highlighter draws a semi-transparent stroke with a Rectangle PenTip.
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

InkToolbarHighlighterButton inherits from InkToolbarPenButton.


By default, the stroke height is 36 pixels and the width is 12 pixels.
The size (in Device-Independent Pixels) of the highlighter stroke is obtained from the InkDrawingAttributes setting for
Size —the stroke height is set to Size.Width and the stroke width is set to Size.Width /3.

Constructors
InkToolbarHighlighterButton()
InkToolbarHighlighterButton()
InkToolbarHighlighterButton()

Initializes a new instance of the InkToolbarHighlighterButton class.

See Also
InkToolbarHighlighterButton InkToolbarHighlighterButton
InkToolbarHighlighterButton
I n this Article
Edit
Initializes a new instance of the InkToolbarHighlighterButton class.
public : InkToolbarHighlighterButton()
InkToolbarHighlighterButton() const;
public InkToolbarHighlighterButton()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarHighlighterButtonInkToolbarHighlighterButtonInkToolbarHighlighterButton
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarInitialControls InkToolbarInitialControls Ink
ToolbarInitialControls Enum
Defines constants that specify the built-in buttons (InitialControls ) added to an InkToolbar at initialization.

D eclaration
public : enum class InkToolbarInitialControls
enum class winrt::Windows::UI::Xaml::Controls::InkToolbarInitialControls : int32_t
public enum InkToolbarInitialControls

I nheritance H ierarchy
None

Fields
All All All All built-in buttons are added.

AllExceptPens AllExceptPens AllExceptPens All built-in, non-pen buttons are added:


InkToolbarEraserButton
InkToolbarRulerButton

None None None No built-in buttons are added.

PensOnly PensOnly PensOnly All built-in pen buttons are added:


InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarHighlighterButton

See Also
InkToolbarIsStencilButtonCheckedChangedEventArgs Ink
ToolbarIsStencilButtonCheckedChangedEventArgs Ink
ToolbarIsStencilButtonCheckedChangedEventArgs Class
Provides data for the IsStencilButtonCheckedChanged event.

D eclaration
public : sealed class InkToolbarIsStencilButtonCheckedChangedEventArgs :
IInkToolbarIsStencilButtonCheckedChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::InkToolbarIsStencilButtonCheckedChangedEventArgs :
IInkToolbarIsStencilButtonCheckedChangedEventArgs
public sealed class InkToolbarIsStencilButtonCheckedChangedEventArgs :
IInkToolbarIsStencilButtonCheckedChangedEventArgs

I nheritance H ierarchy
None

Constructors
InkToolbarIsStencilButtonCheckedChangedEventArgs()
InkToolbarIsStencilButtonCheckedChangedEventArgs()
InkToolbarIsStencilButtonCheckedChangedEventArgs()

Initializes a new instance of the InkToolbarIsStencilButtonCheckedChangedEventArgs class.

Properties
StencilButton
StencilButton
StencilButton

Gets the button for the selected stencil.

StencilKind
StencilKind
StencilKind

Gets the type of stencil.

See Also
InkToolbarIsStencilButtonCheckedChangedEventArgs Ink
ToolbarIsStencilButtonCheckedChangedEventArgs Ink
ToolbarIsStencilButtonCheckedChangedEventArgs
I n this Article
Edit
Initializes a new instance of the InkToolbarIsStencilButtonCheckedChangedEventArgs class.
public : InkToolbarIsStencilButtonCheckedChangedEventArgs()
InkToolbarIsStencilButtonCheckedChangedEventArgs() const;
public InkToolbarIsStencilButtonCheckedChangedEventArgs()

See
Also

sal Windows Platform (UWP ) app


nk in your UWP app
kedChangedEventArgsInkToolbarIsStencilButtonCheckedChangedEventArgsInkToolbarIsStencilButtonCheckedChangedEventArgs

nk in your UWP app


InkToolbarIsStencilButtonCheckedChangedEventArgs.
StencilButton InkToolbarIsStencilButtonCheckedChanged
EventArgs.StencilButton InkToolbarIsStencilButton
CheckedChangedEventArgs.StencilButton
I n this Article
Edit
Gets the button for the selected stencil.
public : InkToolbarStencilButton StencilButton { get; }
InkToolbarStencilButton StencilButton();
public InkToolbarStencilButton StencilButton { get; }

Returns
InkToolbarStencilButton
The stencil button.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarIsStencilButtonCheckedChangedEventArgs.
StencilKind InkToolbarIsStencilButtonCheckedChanged
EventArgs.StencilKind InkToolbarIsStencilButtonChecked
ChangedEventArgs.StencilKind
I n this Article
Edit
Gets the type of stencil.
public : InkToolbarStencilKind StencilKind { get; }
InkToolbarStencilKind StencilKind();
public InkToolbarStencilKind StencilKind { get; }

Returns
InkToolbarStencilKind
The type of stencil.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarMenuButton InkToolbarMenuButton InkToolbar
MenuButton Class
Represents an InkToolbar button that invokes a menu of tools, defined by the host app.

D eclaration
public : class InkToolbarMenuButton : ToggleButton, IInkToolbarMenuButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarMenuButton : ToggleButton,
IInkToolbarMenuButton
public class InkToolbarMenuButton : ToggleButton, IInkToolbarMenuButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton

Properties
IsExtensionGlyphShown
IsExtensionGlyphShown
IsExtensionGlyphShown

Gets or sets whether an extension glyph is shown on the menu button.

IsExtensionGlyphShownProperty
IsExtensionGlyphShownProperty
IsExtensionGlyphShownProperty

Identifies the IsExtensionGlyphShown dependency property.

MenuKind
MenuKind
MenuKind

Gets the type of menu button.

See Also
InkToolbarMenuButton.IsExtensionGlyphShown Ink
ToolbarMenuButton.IsExtensionGlyphShown InkToolbar
MenuButton.IsExtensionGlyphShown
I n this Article
Edit
Gets or sets whether an extension glyph is shown on the menu button.
public : Platform::Boolean IsExtensionGlyphShown { get; set; }
bool IsExtensionGlyphShown();

void IsExtensionGlyphShown(bool isextensionglyphshown);


public bool IsExtensionGlyphShown { get; set; }

Returns
bool
true if the glyph is shown. Otherwise, false.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarMenuButton.IsExtensionGlyphShownProperty
InkToolbarMenuButton.IsExtensionGlyphShownProperty
InkToolbarMenuButton.IsExtensionGlyphShownProperty
I n this Article
Edit
Identifies the IsExtensionGlyphShown dependency property.
public : static DependencyProperty IsExtensionGlyphShownProperty { get; }
static DependencyProperty IsExtensionGlyphShownProperty();
public static DependencyProperty IsExtensionGlyphShownProperty { get; }

Returns
DependencyProperty
The identifier for the IsExtensionGlyphShown dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarMenuButton.MenuKind InkToolbarMenu
Button.MenuKind InkToolbarMenuButton.MenuKind
I n this Article
Edit
Gets the type of menu button.
public : InkToolbarMenuKind MenuKind { get; }
InkToolbarMenuKind MenuKind();
public InkToolbarMenuKind MenuKind { get; }

Returns
InkToolbarMenuKind
The type of menu button.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarMenuKind
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarMenuKind InkToolbarMenuKind InkToolbar
MenuKind Enum
Specifies the types of menu buttons that can be added to an InkToolbar.

D eclaration
public : enum class InkToolbarMenuKind
enum class winrt::Windows::UI::Xaml::Controls::InkToolbarMenuKind : int32_t
public enum InkToolbarMenuKind

I nheritance H ierarchy
None

Fields
Stencil Stencil Stencil Stencil menu button.

See Also
InkToolbarPenButton InkToolbarPenButton InkToolbarPen
Button Class
Provides a base class for all built-in and custom pen buttons on an InkToolbar.

D eclaration
public : class InkToolbarPenButton : InkToolbarToolButton, IInkToolbarPenButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarPenButton : InkToolbarToolButton,
IInkToolbarPenButton
public class InkToolbarPenButton : InkToolbarToolButton, IInkToolbarPenButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
RadioButton
InkToolbarToolButton

Remarks
The InkToolbarPenButton class cannot be instantiated directly. Use the various built-in and custom InkToolbar pen
buttons instead.
You must create an InkDrawingAttributes object based on the current stroke Size and Brush.
The size of the pen stroke is obtained from the InkDrawingAttributes setting for Size. By default, the stroke height and
width are set to Width.
By default, the InkToolbar contains the following built-in pen buttons:
Radio group toggle buttons
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarHighlighterButton
I nkToolbarPenB utton derived classes
InkToolbarPenButton is the base class for:
Pen buttons
InkToolbarPenButton
Custom pen buttons
InkToolbarCustomPenButton
Radio group toggle buttons (built-in)
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarHighlighterButton

Properties
MaxStrokeWidth
MaxStrokeWidth
MaxStrokeWidth

Gets or sets the maximum possible Size of an ink stroke.


For ballpoint pen and pencil strokes, MaxStrokeWidth specifies both the maximum Height and Width of a
Rectangle pen tip.
For highlighter strokes, MaxStrokeWidth specifies the maximum height of a Rectangle pen tip, while
MaxStrokeWidth /3 specifies the maximum width.
Custom pen stroke dimensions can be set as required.

MaxStrokeWidthProperty
MaxStrokeWidthProperty
MaxStrokeWidthProperty

Identifies the MaxStrokeWidth dependency property.

MinStrokeWidth
MinStrokeWidth
MinStrokeWidth

Gets or sets the minimum possible Size of an ink stroke.


For ballpoint pen and pencil strokes, MinStrokeWidth specifies both the minimum Height and Width of a
Rectangle pen tip.
For highlighter strokes, MinStrokeWidth specifies the minimum height of a Rectangle pen tip, while
MinStrokeWidth /3 specifies the minimum width.
Custom pen stroke dimensions can be set as required.

MinStrokeWidthProperty
MinStrokeWidthProperty
MinStrokeWidthProperty

Identifies the MinStrokeWidth dependency property.

Palette
Palette
Palette

Gets or sets the collection of brushes available on the ink stroke configuration flyout associated with the
InkToolbarPenButton. An "extension glyph" is displayed on the button to indicate the existence of the flyout.
PaletteProperty
PaletteProperty
PaletteProperty

Identifies the Palette dependency property.

SelectedBrush
SelectedBrush
SelectedBrush

Gets the brush used to draw the ink stroke.

SelectedBrushIndex
SelectedBrushIndex
SelectedBrushIndex

Gets or sets the selected brush in the Palette.

SelectedBrushIndexProperty
SelectedBrushIndexProperty
SelectedBrushIndexProperty

Identifies the SelectedBrushIndex dependency property.

SelectedBrushProperty
SelectedBrushProperty
SelectedBrushProperty

Identifies the SelectedBrush dependency property.

SelectedStrokeWidth
SelectedStrokeWidth
SelectedStrokeWidth

Gets or sets the value that specifies the Size of the pen tip used to draw the ink stroke.
For ballpoint pen and pencil strokes, the stroke width specifies both the Height and Width of a Rectangle pen tip.
For highlighter strokes, stroke width specifies the height of a Rectangle pen tip, while width/3 specifies the width.
Custom pen stroke dimensions can be set as required.

SelectedStrokeWidthProperty
SelectedStrokeWidthProperty
SelectedStrokeWidthProperty

Identifies the SelectedStrokeWidth dependency property.


See Also
InkToolbarPenButton.MaxStrokeWidth InkToolbarPen
Button.MaxStrokeWidth InkToolbarPenButton.MaxStroke
Width
I n this Article
Edit
Gets or sets the maximum possible Size of an ink stroke.
For ballpoint pen and pencil strokes, MaxStrokeWidth specifies both the maximum Height and Width of a Rectangle
pen tip.
For highlighter strokes, MaxStrokeWidth specifies the maximum height of a Rectangle pen tip, while MaxStrokeWidth
/3 specifies the maximum width.
Custom pen stroke dimensions can be set as required.
public : double MaxStrokeWidth { get; set; }
double MaxStrokeWidth();

void MaxStrokeWidth(double maxstrokewidth);


public double MaxStrokeWidth { get; set; }

Returns
double
The maximum possible width of the ink stroke. The default is 0.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.MaxStrokeWidthProperty Ink
ToolbarPenButton.MaxStrokeWidthProperty InkToolbar
PenButton.MaxStrokeWidthProperty
I n this Article
Edit
Identifies the MaxStrokeWidth dependency property.
public : static DependencyProperty MaxStrokeWidthProperty { get; }
static DependencyProperty MaxStrokeWidthProperty();
public static DependencyProperty MaxStrokeWidthProperty { get; }

Returns
DependencyProperty
The identifier for the MaxStrokeWidth dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.MinStrokeWidth InkToolbarPen
Button.MinStrokeWidth InkToolbarPenButton.MinStroke
Width
I n this Article
Edit
Gets or sets the minimum possible Size of an ink stroke.
For ballpoint pen and pencil strokes, MinStrokeWidth specifies both the minimum Height and Width of a Rectangle
pen tip.
For highlighter strokes, MinStrokeWidth specifies the minimum height of a Rectangle pen tip, while MinStrokeWidth
/3 specifies the minimum width.
Custom pen stroke dimensions can be set as required.
public : double MinStrokeWidth { get; set; }
double MinStrokeWidth();

void MinStrokeWidth(double minstrokewidth);


public double MinStrokeWidth { get; set; }

Returns
double
The maximum possible width of the ink stroke. The default is 0.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.MinStrokeWidthProperty InkToolbar
PenButton.MinStrokeWidthProperty InkToolbarPen
Button.MinStrokeWidthProperty
I n this Article
Edit
Identifies the MinStrokeWidth dependency property.
public : static DependencyProperty MinStrokeWidthProperty { get; }
static DependencyProperty MinStrokeWidthProperty();
public static DependencyProperty MinStrokeWidthProperty { get; }

Returns
DependencyProperty
The identifier for the MinStrokeWidth dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.Palette InkToolbarPenButton.Palette
InkToolbarPenButton.Palette
I n this Article
Edit
Gets or sets the collection of brushes available on the ink stroke configuration flyout associated with the
InkToolbarPenButton. An "extension glyph" is displayed on the button to indicate the existence of the flyout.
public : IVector<Brush> Palette { get; set; }
IVector<Brush> Palette();

void Palette(IVector<Brush> palette);


public IList<Brush> Palette { get; set; }

Returns
IList<Brush>
A collection of Brush objects that describe various properties of the ink stroke. The default is 0 (empty).
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.PaletteProperty InkToolbarPen
Button.PaletteProperty InkToolbarPenButton.Palette
Property
I n this Article
Edit
Identifies the Palette dependency property.
public : static DependencyProperty PaletteProperty { get; }
static DependencyProperty PaletteProperty();
public static DependencyProperty PaletteProperty { get; }

Returns
DependencyProperty
The identifier for the Palette dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.SelectedBrush InkToolbarPenButton.
SelectedBrush InkToolbarPenButton.SelectedBrush
I n this Article
Edit
Gets the brush used to draw the ink stroke.
public : Brush SelectedBrush { get; }
Brush SelectedBrush();
public Brush SelectedBrush { get; }

Returns
Brush
The brush used to draw the ink stroke. The default value is 0 (Black ).
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.SelectedBrushIndex InkToolbarPen
Button.SelectedBrushIndex InkToolbarPenButton.Selected
BrushIndex
I n this Article
Edit
Gets or sets the selected brush in the Palette.
public : int SelectedBrushIndex { get; set; }
int32_t SelectedBrushIndex();

void SelectedBrushIndex(int32_t selectedbrushindex);


public int SelectedBrushIndex { get; set; }

Returns
int
The index of the brush in the Palette. The default is 0.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.SelectedBrushIndexProperty Ink
ToolbarPenButton.SelectedBrushIndexProperty Ink
ToolbarPenButton.SelectedBrushIndexProperty
I n this Article
Edit
Identifies the SelectedBrushIndex dependency property.
public : static DependencyProperty SelectedBrushIndexProperty { get; }
static DependencyProperty SelectedBrushIndexProperty();
public static DependencyProperty SelectedBrushIndexProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedBrushIndex dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.SelectedBrushProperty InkToolbar
PenButton.SelectedBrushProperty InkToolbarPenButton.
SelectedBrushProperty
I n this Article
Edit
Identifies the SelectedBrush dependency property.
public : static DependencyProperty SelectedBrushProperty { get; }
static DependencyProperty SelectedBrushProperty();
public static DependencyProperty SelectedBrushProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedBrush dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.SelectedStrokeWidth InkToolbarPen
Button.SelectedStrokeWidth InkToolbarPenButton.
SelectedStrokeWidth
I n this Article
Edit
Gets or sets the value that specifies the Size of the pen tip used to draw the ink stroke.
For ballpoint pen and pencil strokes, the stroke width specifies both the Height and Width of a Rectangle pen tip.
For highlighter strokes, stroke width specifies the height of a Rectangle pen tip, while width/3 specifies the width.
Custom pen stroke dimensions can be set as required.

public : double SelectedStrokeWidth { get; set; }


double SelectedStrokeWidth();

void SelectedStrokeWidth(double selectedstrokewidth);


public double SelectedStrokeWidth { get; set; }

Returns
double
The width used to specify the Size of the pen tip. The default is 0.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenButton.SelectedStrokeWidthProperty Ink
ToolbarPenButton.SelectedStrokeWidthProperty Ink
ToolbarPenButton.SelectedStrokeWidthProperty
I n this Article
Edit
Identifies the SelectedStrokeWidth dependency property.
public : static DependencyProperty SelectedStrokeWidthProperty { get; }
static DependencyProperty SelectedStrokeWidthProperty();
public static DependencyProperty SelectedStrokeWidthProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedStrokeWidth dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPencilButton InkToolbarPencilButton Ink
ToolbarPencilButton Class
Represents an InkToolbar toggle button control that activates the built-in pencil.

D eclaration
public : class InkToolbarPencilButton : InkToolbarPenButton, IInkToolbarPencilButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarPencilButton : InkToolbarPenButton,
IInkToolbarPencilButton
public class InkToolbarPencilButton : InkToolbarPenButton, IInkToolbarPencilButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
RadioButton
InkToolbarToolButton
InkToolbarPenButton

Remarks
The pencil draws a soft-edged, textured, and semi-transparent stroke (useful for layered shading effects) with a Circle
PenTip. The stroke color (darkness) is dependent on the pen pressure detected.
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

InkToolbarPencilButton inherits from InkToolbarPenButton.

Constructors
InkToolbarPencilButton()
InkToolbarPencilButton()
InkToolbarPencilButton()

Initializes a new instance of the InkToolbarPencilButton class.


See Also
InkToolbarPencilButton InkToolbarPencilButton Ink
ToolbarPencilButton
I n this Article
Edit
Initializes a new instance of the InkToolbarPencilButton class.
public : InkToolbarPencilButton()
InkToolbarPencilButton() const;
public InkToolbarPencilButton()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarPencilButtonInkToolbarPencilButtonInkToolbarPencilButton
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenConfigurationControl InkToolbarPen
ConfigurationControl InkToolbarPenConfiguration
Control Class
Represents an object used to configure an optional flyout associated with an InkToolbarCustomPenButton. An
"extension glyph" is displayed on the button to indicate the existence of the flyout.

D eclaration
public : class InkToolbarPenConfigurationControl : Control, IInkToolbarPenConfigurationControl
struct winrt::Windows::UI::Xaml::Controls::InkToolbarPenConfigurationControl : Control,
IInkToolbarPenConfigurationControl
public class InkToolbarPenConfigurationControl : Control, IInkToolbarPenConfigurationControl

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
The InkToolbarPenConfigurationControl is configured by default for built-in pen buttons derived from
InkToolbarPenButton. Custom pen buttons can use these default settings or fully customize them (see examples).

Constructors
InkToolbarPenConfigurationControl()
InkToolbarPenConfigurationControl()
InkToolbarPenConfigurationControl()

Initializes a new instance of the InkToolbarPenConfigurationControl class.

Properties
PenButton
PenButton
PenButton

Gets the InkToolbarPenButton from which to derive the ConfigurationContent for the optional flyout.

PenButtonProperty
PenButtonProperty
PenButtonProperty

Identifies the PenButton dependency property.


See Also
InkToolbarPenConfigurationControl InkToolbarPen
ConfigurationControl InkToolbarPenConfiguration
Control
I n this Article
Edit
Initializes a new instance of the InkToolbarPenConfigurationControl class.
public : InkToolbarPenConfigurationControl()
InkToolbarPenConfigurationControl() const;
public InkToolbarPenConfigurationControl()

See Pen and stylus interactions


Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarPenConfigurationControlInkToolbarPenConfigurationControlInkToolbarPenConfigurationControl
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenConfigurationControl.PenButton InkToolbar
PenConfigurationControl.PenButton InkToolbarPen
ConfigurationControl.PenButton
I n this Article
Edit
Gets the InkToolbarPenButton from which to derive the ConfigurationContent for the optional flyout.
public : InkToolbarPenButton PenButton { get; }
InkToolbarPenButton PenButton();
public InkToolbarPenButton PenButton { get; }

Returns
InkToolbarPenButton
The base pen from which ConfigurationContent is derived.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarPenConfigurationControl.PenButtonProperty
InkToolbarPenConfigurationControl.PenButtonProperty
InkToolbarPenConfigurationControl.PenButtonProperty
I n this Article
Edit
Identifies the PenButton dependency property.
public : static DependencyProperty PenButtonProperty { get; }
static DependencyProperty PenButtonProperty();
public static DependencyProperty PenButtonProperty { get; }

Returns
DependencyProperty
The identifier for the PenButton dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarRulerButton InkToolbarRulerButton InkToolbar
RulerButton Class
Represents an InkToolbar button that sets the state of the built-in ruler tool to on or off.

D eclaration
public : class InkToolbarRulerButton : InkToolbarToggleButton, IInkToolbarRulerButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarRulerButton : InkToolbarToggleButton,
IInkToolbarRulerButton
public class InkToolbarRulerButton : InkToolbarToggleButton, IInkToolbarRulerButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
CheckBox
InkToolbarToggleButton

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use the InkToolbarStencilButton object
instead of this object. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
The InkToolbar consists of two distinct groups of button types:
One group of "tool" buttons containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ),
erasing (InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. Custom tools
(InkToolbarCustomPenButton and InkToolbarCustomToolButton ) are added here.

Feature selection is mutually exclusive.

A second group of "toggle" buttons containing the built-in ruler (InkToolbarRulerButton ) button. Custom toggles
(InkToolbarCustomToggleButton ) are added here.

Features are not mutually exclusive and can be used concurrently with other active tools.

Constructors
InkToolbarRulerButton()
InkToolbarRulerButton()
InkToolbarRulerButton()

Initializes a new instance of the InkToolbarRulerButton class.


Properties
Ruler
Ruler
Ruler

Gets the stencil associated with the InkToolbarRulerButton.

RulerProperty
RulerProperty
RulerProperty

Identifies the Ruler dependency property.

See Also
InkToolbarToggleButton
InkToolbarRulerButton InkToolbarRulerButton InkToolbar
RulerButton
I n this Article
Edit
Initializes a new instance of the InkToolbarRulerButton class.
public : InkToolbarRulerButton()
InkToolbarRulerButton() const;
public InkToolbarRulerButton()

Attributes DeprecatedAttribute

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use the InkToolbarStencilButton object
instead of this object. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarRulerButtonInkToolbarRulerButtonInkToolbarRulerButton
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarRulerButton.Ruler InkToolbarRulerButton.Ruler
InkToolbarRulerButton.Ruler
I n this Article
Edit
Gets the stencil associated with the InkToolbarRulerButton.
public : InkPresenterRuler Ruler { get; }
InkPresenterRuler Ruler();
public InkPresenterRuler Ruler { get; }

Returns
InkPresenterRuler
The stencil associated with the InkToolbarRulerButton.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use the InkToolbarStencilButton object
instead of this object. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarRulerButton.RulerProperty InkToolbarRuler
Button.RulerProperty InkToolbarRulerButton.Ruler
Property
I n this Article
Edit
Identifies the Ruler dependency property.
public : static DependencyProperty RulerProperty { get; }
static DependencyProperty RulerProperty();
public static DependencyProperty RulerProperty { get; }

Returns
DependencyProperty
The identifier for the Ruler dependency property.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use the InkToolbarStencilButton object
instead of this object. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton InkToolbarStencilButton Ink
ToolbarStencilButton Class
Represents an InkToolbar button that sets the state of stencil tool to on or off.

D eclaration
public : class InkToolbarStencilButton : InkToolbarMenuButton, IInkToolbarStencilButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarStencilButton : InkToolbarMenuButton,
IInkToolbarStencilButton
public class InkToolbarStencilButton : InkToolbarMenuButton, IInkToolbarStencilButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
InkToolbarMenuButton

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.

Constructors
InkToolbarStencilButton()
InkToolbarStencilButton()
InkToolbarStencilButton()

Initializes a new instance of the InkToolbarStencilButton class.

Properties
IsProtractorItemVisible
IsProtractorItemVisible
IsProtractorItemVisible

Gets or sets whether the built-in protractor stencil button is visible.

IsProtractorItemVisibleProperty
IsProtractorItemVisibleProperty
IsProtractorItemVisibleProperty

Identifies the IsProtractorItemVisible dependency property.


IsRulerItemVisible
IsRulerItemVisible
IsRulerItemVisible

Gets or sets whether the built-in ruler stencil button is visible.

IsRulerItemVisibleProperty
IsRulerItemVisibleProperty
IsRulerItemVisibleProperty

Identifies the IsRulerItemVisible dependency property.

Protractor
Protractor
Protractor

Gets a reference to the protractor tool of the InkPresenter object.

ProtractorProperty
ProtractorProperty
ProtractorProperty

Identifies the Protractor dependency property.

Ruler
Ruler
Ruler

Gets a reference to the ruler tool of the InkPresenter object.

RulerProperty
RulerProperty
RulerProperty

Identifies the Ruler dependency property.

SelectedStencil
SelectedStencil
SelectedStencil

Gets or sets the selected stencil button.

SelectedStencilProperty
SelectedStencilProperty
SelectedStencilProperty
Identifies the SelectedStencil dependency property.

See Also
InkToolbarStencilButton InkToolbarStencilButton Ink
ToolbarStencilButton
I n this Article
Edit
Initializes a new instance of the InkToolbarStencilButton class.
public : InkToolbarStencilButton()
InkToolbarStencilButton() const;
public InkToolbarStencilButton()

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
InkToolbarStencilButtonInkToolbarStencilButtonInkToolbarStencilButton
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.IsProtractorItemVisible Ink
ToolbarStencilButton.IsProtractorItemVisible InkToolbar
StencilButton.IsProtractorItemVisible
I n this Article
Edit
Gets or sets whether the built-in protractor stencil button is visible.
public : Platform::Boolean IsProtractorItemVisible { get; set; }
bool IsProtractorItemVisible();

void IsProtractorItemVisible(bool isprotractoritemvisible);


public bool IsProtractorItemVisible { get; set; }

Returns
bool
true if visible. Otherwise, false.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.IsProtractorItemVisibleProperty
InkToolbarStencilButton.IsProtractorItemVisibleProperty
InkToolbarStencilButton.IsProtractorItemVisibleProperty
I n this Article
Edit
Identifies the IsProtractorItemVisible dependency property.
public : static DependencyProperty IsProtractorItemVisibleProperty { get; }
static DependencyProperty IsProtractorItemVisibleProperty();
public static DependencyProperty IsProtractorItemVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsProtractorItemVisible dependency property.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.IsRulerItemVisible InkToolbar
StencilButton.IsRulerItemVisible InkToolbarStencilButton.
IsRulerItemVisible
I n this Article
Edit
Gets or sets whether the built-in ruler stencil button is visible.
public : Platform::Boolean IsRulerItemVisible { get; set; }
bool IsRulerItemVisible();

void IsRulerItemVisible(bool isruleritemvisible);


public bool IsRulerItemVisible { get; set; }

Returns
bool
true if visible. Otherwise, false.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.IsRulerItemVisibleProperty Ink
ToolbarStencilButton.IsRulerItemVisibleProperty Ink
ToolbarStencilButton.IsRulerItemVisibleProperty
I n this Article
Edit
Identifies the IsRulerItemVisible dependency property.
public : static DependencyProperty IsRulerItemVisibleProperty { get; }
static DependencyProperty IsRulerItemVisibleProperty();
public static DependencyProperty IsRulerItemVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsRulerItemVisible dependency property.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.Protractor InkToolbarStencil
Button.Protractor InkToolbarStencilButton.Protractor
I n this Article
Edit
Gets a reference to the protractor tool of the InkPresenter object.
public : InkPresenterProtractor Protractor { get; }
InkPresenterProtractor Protractor();
public InkPresenterProtractor Protractor { get; }

Returns
InkPresenterProtractor
The protractor tool.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.ProtractorProperty InkToolbar
StencilButton.ProtractorProperty InkToolbarStencil
Button.ProtractorProperty
I n this Article
Edit
Identifies the Protractor dependency property.
public : static DependencyProperty ProtractorProperty { get; }
static DependencyProperty ProtractorProperty();
public static DependencyProperty ProtractorProperty { get; }

Returns
DependencyProperty
The identifier for the Protractor dependency property.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.Ruler InkToolbarStencilButton.
Ruler InkToolbarStencilButton.Ruler
I n this Article
Edit
Gets a reference to the ruler tool of the InkPresenter object.
public : InkPresenterRuler Ruler { get; }
InkPresenterRuler Ruler();
public InkPresenterRuler Ruler { get; }

Returns
InkPresenterRuler
The ruler tool.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.RulerProperty InkToolbarStencil
Button.RulerProperty InkToolbarStencilButton.Ruler
Property
I n this Article
Edit
Identifies the Ruler dependency property.
public : static DependencyProperty RulerProperty { get; }
static DependencyProperty RulerProperty();
public static DependencyProperty RulerProperty { get; }

Returns
DependencyProperty
The identifier for the Ruler dependency property.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.SelectedStencil InkToolbarStencil
Button.SelectedStencil InkToolbarStencilButton.Selected
Stencil
I n this Article
Edit
Gets or sets the selected stencil button.
public : InkToolbarStencilKind SelectedStencil { get; set; }
InkToolbarStencilKind SelectedStencil();

void SelectedStencil(InkToolbarStencilKind selectedstencil);


public InkToolbarStencilKind SelectedStencil { get; set; }

Returns
InkToolbarStencilKind
The selected stencil button.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilButton.SelectedStencilProperty Ink
ToolbarStencilButton.SelectedStencilProperty InkToolbar
StencilButton.SelectedStencilProperty
I n this Article
Edit
Identifies the SelectedStencil dependency property.
public : static DependencyProperty SelectedStencilProperty { get; }
static DependencyProperty SelectedStencilProperty();
public static DependencyProperty SelectedStencilProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedStencil dependency property.

Remarks
Apps that target Windows Creators Update (SDK 15063) or later should use this object instead of
InkToolbarRulerButton. If your app also supports previous versions, see Version adaptive apps: Use new APIs while
maintaining compatibility with previous versions for more info.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarStencilKind InkToolbarStencilKind InkToolbar
StencilKind Enum
Specifies the types of InkToolbar stencils.

D eclaration
public : enum class InkToolbarStencilKind
enum class winrt::Windows::UI::Xaml::Controls::InkToolbarStencilKind : int32_t
public enum InkToolbarStencilKind

I nheritance H ierarchy
None

Fields
Protractor Protractor Protractor A protractor for drawing arcs and curves

Ruler Ruler Ruler A straight rule for drawing straight lines.

See Also
InkToolbarToggle InkToolbarToggle InkToolbarToggle
Enum
Defines constants that specify the button types exposed in the toggle button group of an InkToolbar.

D eclaration
public : enum class InkToolbarToggle
enum class winrt::Windows::UI::Xaml::Controls::InkToolbarToggle : int32_t
public enum InkToolbarToggle

I nheritance H ierarchy
None

Remarks
The InkToolbar consists of two distinct groups of button types:
A RadioButton group containing the built-in drawing (InkToolbarBallpointPenButton, InkToolbarPencilButton ), erasing
(InkToolbarEraserButton ), and highlighting (InkToolbarHighlighterButton ) buttons. This group is where
InkToolbarCustomPenButton and InkToolbarCustomToolButton objects are added.

Feature selection is mutually exclusive.

A toggle button group containing the built-in ruler (InkToolbarRulerButton ) button. This group is where
InkToolbarCustomToggleButton objects are added.

Features are not mutually exclusive and can be used concurrently with other active tools.

Fields
Custom Custom Custom A toggle button for a custom tool.

Ruler Ruler Ruler A toggle button for a stencil tool.

See Also
InkToolbarToggleButton InkToolbarToggleButton Ink
ToolbarToggleButton Class
Represents an object that provides infrastructure for both built-in and custom toggle buttons on an InkToolbar.

D eclaration
public : class InkToolbarToggleButton : CheckBox, IInkToolbarToggleButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarToggleButton : CheckBox,
IInkToolbarToggleButton
public class InkToolbarToggleButton : CheckBox, IInkToolbarToggleButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
CheckBox

Remarks
The InkToolbarToggleButton class cannot be instantiated directly. For user interface purposes, treat
InkToolbarToggleButton as an abstract base class. Use the various built-in and custom InkToolbar buttons instead.
By default, the InkToolbar contains the following built-in buttons: Radio group toggle buttons
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarHighlighterButton
InkToolbarEraserButton
Standalone toggle button
InkToolbarRulerButton
I nkToolbarToggleB utton derived classes
InkToolbarToggleButton is the base class for:
Standalone toggle button (built-in)
InkToolbarRulerButton
Custom toggle buttons
InkToolbarCustomToggleButton

Properties
ToggleKind
ToggleKind
ToggleKind

Gets the type of built-in or custom tool associated with the InkToolbarToggleButton.

See Also
CheckBox
InkToolbarToggleButton.ToggleKind InkToolbarToggle
Button.ToggleKind InkToolbarToggleButton.ToggleKind
I n this Article
Edit
Gets the type of built-in or custom tool associated with the InkToolbarToggleButton.
public : InkToolbarToggle ToggleKind { get; }
InkToolbarToggle ToggleKind();
public InkToolbarToggle ToggleKind { get; }

Returns
InkToolbarToggle
The type of tool.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarTool InkToolbarTool InkToolbarTool Enum
Defines constants that specify the type of built-in or custom tool associated with the InkToolbarToolButton.

D eclaration
public : enum class InkToolbarTool
enum class winrt::Windows::UI::Xaml::Controls::InkToolbarTool : int32_t
public enum InkToolbarTool

I nheritance H ierarchy
None

Fields
BallpointPen A pen tool that renders a solid, opaque stroke, with the stroke size dependent on the pen
BallpointPen pressure detected (default size is 2x2 pixels).
BallpointPen

CustomPen CustomPen A custom pen tool.


CustomPen

CustomTool CustomTool A custom non-pen tool.


CustomTool

Eraser Eraser Eraser A pen tool that deletes any ink strokes that intersect with the erase stroke.

Highlighter A pen tool that renders a semi-transparent highlighter overlay stroke.


Highlighter
Highlighter

Pencil Pencil Pencil A pen tool that renders a soft-edged, semi-transparent stroke that can be layered for shading
effects. The stroke opacity is dependent on the pen pressure detected.

See Also
InkToolbarToolButton InkToolbarToolButton InkToolbar
ToolButton Class
Provides a base class for all built-in and custom buttons on an InkToolbar.

D eclaration
public : class InkToolbarToolButton : RadioButton, IInkToolbarToolButton
struct winrt::Windows::UI::Xaml::Controls::InkToolbarToolButton : RadioButton,
IInkToolbarToolButton
public class InkToolbarToolButton : RadioButton, IInkToolbarToolButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton
RadioButton

Remarks
The InkToolbarToolButton class cannot be instantiated directly. Use the various built-in and custom InkToolbar pen
buttons instead.
By default, the InkToolbar contains the following built-in buttons:
Radio group toggle buttons
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarHighlighterButton
InkToolbarEraserButton
Standalone toggle button
InkToolbarRulerButton
I nkToolbarToolB utton derived classes
InkToolbarToolButton is the base class for:
Pen buttons
InkToolbarPenButton
Tool buttons
InkToolbarToolButton
Custom pen buttons
InkToolbarCustomPenButton
Custom tool buttons
InkToolbarCustomToolButton
Radio group toggle buttons (built-in)
InkToolbarBallpointPenButton
InkToolbarPencilButton
InkToolbarHighlighterButton
InkToolbarEraserButton
Standalone toggle button (built-in)
InkToolbarRulerButton

Properties
IsExtensionGlyphShown
IsExtensionGlyphShown
IsExtensionGlyphShown

Gets or sets whether a glyph is shown on the InkToolbarToolButton to indicate the presence of an ink stroke
configuration flyout.

IsExtensionGlyphShownProperty
IsExtensionGlyphShownProperty
IsExtensionGlyphShownProperty

Identifies the IsExtensionGlyphShown dependency property.

ToolKind
ToolKind
ToolKind

Gets the type of built-in or custom tool associated with the InkToolbarToolButton.

See Also
InkToolbarToolButton.IsExtensionGlyphShown InkToolbar
ToolButton.IsExtensionGlyphShown InkToolbarToolButton.
IsExtensionGlyphShown
I n this Article
Edit
Gets or sets whether a glyph is shown on the InkToolbarToolButton to indicate the presence of an ink stroke
configuration flyout.
public : Platform::Boolean IsExtensionGlyphShown { get; set; }
bool IsExtensionGlyphShown();

void IsExtensionGlyphShown(bool isextensionglyphshown);


public bool IsExtensionGlyphShown { get; set; }

Returns
bool
true if the glyph is shown; otherwise, false.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarToolButton.IsExtensionGlyphShownProperty
InkToolbarToolButton.IsExtensionGlyphShownProperty
InkToolbarToolButton.IsExtensionGlyphShownProperty
I n this Article
Edit
Identifies the IsExtensionGlyphShown dependency property.
public : static DependencyProperty IsExtensionGlyphShownProperty { get; }
static DependencyProperty IsExtensionGlyphShownProperty();
public static DependencyProperty IsExtensionGlyphShownProperty { get; }

Returns
DependencyProperty
The identifier for the IsExtensionGlyphShown dependency property.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
InkToolbarToolButton.ToolKind InkToolbarToolButton.Tool
Kind InkToolbarToolButton.ToolKind
I n this Article
Edit
Gets the type of built-in or custom tool associated with the InkToolbarToolButton.
public : InkToolbarTool ToolKind { get; }
InkToolbarTool ToolKind();
public InkToolbarTool ToolKind { get; }

Returns
InkToolbarTool
The type of tool.
See Pen and stylus interactions
Also Add an InkToolbar to a Universal Windows Platform (UWP ) app
Get Started Tutorial: Support ink in your UWP app
Ink sample (JavaScript)
Get Started Tutorial: Support ink in your UWP app
Coloring book sample
Family notes sample
IScrollAnchorProvider IScrollAnchorProvider IScroll
AnchorProvider Interface
Specifies a contract for a scrolling control that supports scroll anchoring.

D eclaration
public : interface IScrollAnchorProvider
struct winrt::Windows::UI::Xaml::Controls::IScrollAnchorProvider
public interface IScrollAnchorProvider

I nheritance H ierarchy
None

Remarks
Scroll Anchoring
Scroll anchoring is when a scrolling control automatically changes the position of its viewport to prevent the content
from visibly jumping. The jump is caused by a change in the content's layout. The scroll anchor provider applies a shift
after observing a change in the position of an anchor element within the content.
It's the responsibility of the implementing scroll control to determine what policy it will use in choosing a
CurrentAnchor from the set of registered candidates.
Expected Behavior

When a layout change impacts the size/position of the anchor element, the viewport should automatically shift to
maintain the previous position of the anchor element relative to the viewport.
Scroll anchoring (i.e. an automatic viewport shift) doesn't apply at all times. It should happen as a result of candidate
elements being added to or removed from the tree or changing in size. Other situations that may trigger a layout pass,
but do not necessarily cause automatic viewport shifts would include:
A user panning the content
A developer programmatically changing the view
Handling a BringIntoViewRequested event
The Anchor Element

The implementing control should choose an anchor element from the set of previously registered candidates and set it
as its CurrentAnchor.
Candidate Anchor Elements

The set of candidate anchor elements may change during any of the situations called out previously. Elements are
registered as potential anchor candidates by:
1. setting their UIElement.CanBeScrollAnchor property to true, or
2. programmatically registering the element using the RegisterAnchorCandidate method.
The CanBeScrollAnchor property can be set at any time. When set, the framework implicitly calls
RegisterAnchorCandidate /UnregisterAnchorCandidate, but only on the first IScrollAnchorProvider found in that
element's chain of ancestors.
The framework similarly registers/unregisters elements with CanBeScrollAnchor set to true as they are added or
removed from the live visual tree. But, once again, it is only done with the first IScrollAnchorProvider found in the
element's chain of ancestors.
A virtualizing control may choose to automatically set the CanBeScrollAnchor on its generated children elements.
ScrollV iewer: An Example
The ScrollViewer control performs scroll anchoring during its ArrangeOverride. It raises an AnchorRequested event at
the beginning of ArrangeOverride, which provides you with an opportunity to explicitly specify the anchor element.
Otherwise, it chooses a candidate in the viewport that is closest to a viewport-relative anchor point and then sets that
element as its CurrentAnchor.
The anchor point comes from the HorizontalAnchorRatio and VerticalAnchorRatio properties. When the ratios are zero
(default), the anchor point is the top left corner of the viewport (assuming the FlowDirection is LeftToRight). If the
ratios are both set to 0.5 then the anchor point is the center of the viewport. Similarly, when the ratios are both 1.0 then
the anchor point is the bottom right corner of the viewport.
Special Case: Anchoring at the edge

The beginning or end of the scrollable content represents a special anchor scenario. For example, consider the expected
behavior when a user in an email application has vertically scrolled down the list by some amount. When a new
message arrives it is inserted at the top of the list (outside the bounds of content the user currently sees). What the
user currently sees should not suddenly jump to a new position due to the arrival of a new message at the top of the
list. However, if their current scroll position is at the top, then the existing content should appear to shift down to make
room for the new message.
The inverse scenario is a chat experience. When the user is scrolled to the very bottom and a new message arrives the
content should appear to shift up to make room to display the new message. In reality, what happens is that the
viewport needs to shift down to track the new end of the scrollable content. When the user is not scrolled to the very
beginning/end of the content, then the position of the viewport with respect to some visible content that is considered
"interesting" should remain in sync (i.e. anchored).
The ScrollViewer treats the values of 0.0 and 1.0 for the HorizontalAnchorRatio and VerticalAnchorRatio properties
with special behavior. If both the value is 0.0 and the user is scrolled to the start, then the start position is used as the
anchor instead of an anchor candidate. Similarly, if both the value is 1.0 and the user is scrolled to the end then the end
of the content is used as the anchor. If the position of the end grows due to size changes then the new end is used.

Properties
CurrentAnchor
CurrentAnchor
CurrentAnchor

The currently chosen anchor element to use for scroll anchoring.

Methods
RegisterAnchorCandidate(UIElement)
RegisterAnchorCandidate(UIElement)
RegisterAnchorCandidate(UIElement)

Registers a UIElement as a potential scroll anchor candidate.

UnregisterAnchorCandidate(UIElement)
UnregisterAnchorCandidate(UIElement)
UnregisterAnchorCandidate(UIElement)

Unregisters a UIElement as a potential scroll anchor candidate.


IScrollAnchorProvider.CurrentAnchor IScrollAnchor
Provider.CurrentAnchor IScrollAnchorProvider.Current
Anchor
I n this Article
Edit
The currently chosen anchor element to use for scroll anchoring.
public : UIElement CurrentAnchor { get; }
UIElement CurrentAnchor();
public UIElement CurrentAnchor { get; }

Returns
UIElement
The most recently chosen UIElement for scroll anchoring after a layout pass, or null.

Remarks
If there are no anchor candidates registered with the IScrollAnchorProvider or none have been chosen, then
CurrentAnchor is null.
See IScrollAnchorProviderIScrollAnchorProviderIScrollAnchorProvider
Also
IScrollAnchorProvider.RegisterAnchorCandidate IScroll
AnchorProvider.RegisterAnchorCandidate IScrollAnchor
Provider.RegisterAnchorCandidate
I n this Article
Edit
Registers a UIElement as a potential scroll anchor candidate.
public : void RegisterAnchorCandidate(UIElement element)
void RegisterAnchorCandidate(UIElement element) const;
public void RegisterAnchorCandidate(UIElement element)

Parameters
element UIElement
A UIElement within the subtree of the IScrollAnchorProvider.

Remarks
When an element has CanBeScrollAnchor set to true the framework locates the first IScrollAnchorProvider in that
element's chain of ancestors and automatically calls its RegisterAnchorCandidate method. This occurs both when the
property is set on an existing element or an element is added to the live tree with the property already set.
Similarly, when the property is set to false (or an element is removed from the visual tree with the property set to
true), the framework calls UnregisterAnchorCandidate on the first IScrollAnchorProvider.
IScrollAnchorProvider.UnregisterAnchorCandidate IScroll
AnchorProvider.UnregisterAnchorCandidate IScroll
AnchorProvider.UnregisterAnchorCandidate
I n this Article
Edit
Unregisters a UIElement as a potential scroll anchor candidate.
public : void UnregisterAnchorCandidate(UIElement element)
void UnregisterAnchorCandidate(UIElement element) const;
public void UnregisterAnchorCandidate(UIElement element)

Parameters
element UIElement
A UIElement within the subtree of the IScrollAnchorProvider.

Remarks
When an element's CanBeScrollAnchor property changes to false (or the element is removed from the visual tree), the
framework locates the first IScrollAnchorProvider in that element's chain of ancestors and automatically calls its
UnregisterAnchorCandidate method.
ISemanticZoomInformation ISemanticZoomInformation I
SemanticZoomInformation Interface
Communicates the info needed for a view to serve as one of the two possible views ( ZoomedOutView or
ZoomedInView ) of a SemanticZoom.

D eclaration
public : interface ISemanticZoomInformation
struct winrt::Windows::UI::Xaml::Controls::ISemanticZoomInformation
public interface ISemanticZoomInformation

I nheritance H ierarchy
None

Remarks
The ISemanticZoomInformation interface provides info for a single view of a SemanticZoom control. However, it
doesn't provide info to synchronize the two views of a SemanticZoom. The ZoomedInView and ZoomedOutView
should be synchronized, so if a user selects a group in the ZoomedOutView, the details of that group are shown in the
ZoomedInView. You can use a CollectionViewSource or add code to synchronize the views. Any controls that you bind
to the same CollectionViewSource will always have the same current item. If both views use the same
CollectionViewSource as the their data source, the CollectionViewSource will synchronize the views automatically.
Otherwise, you can handle the SemanticZoom.ViewChangeStarted event and synchronize the items in the event
handler. See SemanticZoom for more info.

Properties
IsActiveView
IsActiveView
IsActiveView

Gets or sets a value that indicates whether the implementing view is the active view.

IsZoomedInView
IsZoomedInView
IsZoomedInView

Gets or sets a value that indicates whether the implementing view is the semantically more complete zoomed-in
view.

SemanticZoomOwner
SemanticZoomOwner
SemanticZoomOwner

Gets or sets the SemanticZoom owner that hosts the implementing view.
Methods
CompleteViewChange()
CompleteViewChange()
CompleteViewChange()

Changes related aspects of presentation (such as scrolling UI or state) when the overall view for a SemanticZoom
changes.

CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)

Completes item-wise operations related to a view change when the implementing view is the source view and the
new view is a potentially different implementing view.

CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)

Completes item-wise operations related to a view change when the implementing view is the destination view and
the source view is a potentially different implementing view.

InitializeViewChange()
InitializeViewChange()
InitializeViewChange()

Initializes the changes to related aspects of presentation (such as scrolling UI or state) when the overall view for a
SemanticZoom is about to change.

MakeVisible(SemanticZoomLocation)
MakeVisible(SemanticZoomLocation)
MakeVisible(SemanticZoomLocation)

Forces content in the view to scroll until the item specified by SemanticZoomLocation is visible. Also focuses that
item if found.

StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)

Initializes item-wise operations related to a view change when the implementing view is the source view and the
pending destination view is a potentially different implementing view.

StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)

Initializes item-wise operations related to a view change when the source view is a different view and the pending
destination view is the implementing view.

See Also
SemanticZoom
ISemanticZoomInformation.CompleteViewChange I
SemanticZoomInformation.CompleteViewChange I
SemanticZoomInformation.CompleteViewChange
I n this Article
Edit
Changes related aspects of presentation (such as scrolling UI or state) when the overall view for a SemanticZoom
changes.
public : void CompleteViewChange()
void CompleteViewChange() const;
public void CompleteViewChange()
ISemanticZoomInformation.CompleteViewChangeFrom I
SemanticZoomInformation.CompleteViewChangeFrom I
SemanticZoomInformation.CompleteViewChangeFrom
I n this Article
Edit
Completes item-wise operations related to a view change when the implementing view is the source view and the new
view is a potentially different implementing view.
public : void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)
void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
ISemanticZoomInformation.CompleteViewChangeTo I
SemanticZoomInformation.CompleteViewChangeTo I
SemanticZoomInformation.CompleteViewChangeTo
I n this Article
Edit
Completes item-wise operations related to a view change when the implementing view is the destination view and the
source view is a potentially different implementing view.
public : void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)
void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
ISemanticZoomInformation.InitializeViewChange I
SemanticZoomInformation.InitializeViewChange I
SemanticZoomInformation.InitializeViewChange
I n this Article
Edit
Initializes the changes to related aspects of presentation (such as scrolling UI or state) when the overall view for a
SemanticZoom is about to change.
public : void InitializeViewChange()
void InitializeViewChange() const;
public void InitializeViewChange()
ISemanticZoomInformation.IsActiveView ISemanticZoom
Information.IsActiveView ISemanticZoomInformation.Is
ActiveView
I n this Article
Edit
Gets or sets a value that indicates whether the implementing view is the active view.
public : Platform::Boolean IsActiveView { get; set; }
bool IsActiveView();

void IsActiveView(bool isactiveview);


public bool IsActiveView { get; set; }

Returns
bool
true if the implementing view is the active view; otherwise, false.
ISemanticZoomInformation.IsZoomedInView ISemantic
ZoomInformation.IsZoomedInView ISemanticZoom
Information.IsZoomedInView
I n this Article
Edit
Gets or sets a value that indicates whether the implementing view is the semantically more complete zoomed-in view.
public : Platform::Boolean IsZoomedInView { get; set; }
bool IsZoomedInView();

void IsZoomedInView(bool iszoomedinview);


public bool IsZoomedInView { get; set; }

Returns
bool
true if the implementing view is the zoomed-in view; otherwise, false.
ISemanticZoomInformation.MakeVisible ISemanticZoom
Information.MakeVisible ISemanticZoomInformation.
MakeVisible
I n this Article
Edit
Forces content in the view to scroll until the item specified by SemanticZoomLocation is visible. Also focuses that item
if found.
public : void MakeVisible(SemanticZoomLocation item)
void MakeVisible(SemanticZoomLocation item) const;
public void MakeVisible(SemanticZoomLocation item)

Parameters
item SemanticZoomLocation
The item in the view to scroll to.
ISemanticZoomInformation.SemanticZoomOwner I
SemanticZoomInformation.SemanticZoomOwner I
SemanticZoomInformation.SemanticZoomOwner
I n this Article
Edit
Gets or sets the SemanticZoom owner that hosts the implementing view.
public : SemanticZoom SemanticZoomOwner { get; set; }
SemanticZoom SemanticZoomOwner();

void SemanticZoomOwner(SemanticZoom semanticzoomowner);


public SemanticZoom SemanticZoomOwner { get; set; }

Returns
SemanticZoom
The SemanticZoom that hosts this view.
ISemanticZoomInformation.StartViewChangeFrom I
SemanticZoomInformation.StartViewChangeFrom I
SemanticZoomInformation.StartViewChangeFrom
I n this Article
Edit
Initializes item-wise operations related to a view change when the implementing view is the source view and the
pending destination view is a potentially different implementing view.
public : void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)
void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
ISemanticZoomInformation.StartViewChangeTo I
SemanticZoomInformation.StartViewChangeTo ISemantic
ZoomInformation.StartViewChangeTo
I n this Article
Edit
Initializes item-wise operations related to a view change when the source view is a different view and the pending
destination view is the implementing view.
public : void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)
void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
IsTextTrimmedChangedEventArgs IsTextTrimmedChanged
EventArgs IsTextTrimmedChangedEventArgs Class
Provides event data for the IsTextTrimmedChanged event.

D eclaration
public : sealed class IsTextTrimmedChangedEventArgs : IIsTextTrimmedChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::IsTextTrimmedChangedEventArgs :
IIsTextTrimmedChangedEventArgs
public sealed class IsTextTrimmedChangedEventArgs : IIsTextTrimmedChangedEventArgs

I nheritance H ierarchy
None
ItemClickEventArgs ItemClickEventArgs ItemClickEvent
Args Class
Provides event data for the ItemClick event.

D eclaration
public : sealed class ItemClickEventArgs : RoutedEventArgs, IItemClickEventArgs
struct winrt::Windows::UI::Xaml::Controls::ItemClickEventArgs : RoutedEventArgs,
IItemClickEventArgs
public sealed class ItemClickEventArgs : RoutedEventArgs, IItemClickEventArgs

I nheritance H ierarchy
RoutedEventArgs

Constructors
ItemClickEventArgs()
ItemClickEventArgs()
ItemClickEventArgs()

Initializes a new instance of the ItemClickEventArgs class.

Properties
ClickedItem
ClickedItem
ClickedItem

Gets a reference to the clicked item.

See Also
RoutedEventArgs
ItemClickEventArgs.ClickedItem ItemClickEventArgs.
ClickedItem ItemClickEventArgs.ClickedItem
I n this Article
Edit
Gets a reference to the clicked item.
public : Platform::Object ClickedItem { get; }
winrt::Windows::Foundation::IInspectable ClickedItem();
public object ClickedItem { get; }

Returns
object
The clicked item.
ItemClickEventArgs ItemClickEventArgs ItemClickEvent
Args
I n this Article
Edit
Initializes a new instance of the ItemClickEventArgs class.
public : ItemClickEventArgs()
ItemClickEventArgs() const;
public ItemClickEventArgs()
ItemClickEventHandler ItemClickEventHandler ItemClick
EventHandler Delegate
Represents the method that will handle an ItemClick event.

D eclaration
public : delegate void ItemClickEventHandler(Platform::Object sender, ItemClickEventArgs e)
struct ItemClickEventHandler : winrt::Windows::Foundation::IUnknown
{
ItemClickEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> ItemClickEventHandler(L lambda);
template <typename F> ItemClickEventHandler(F* function);
template <typename O, typename M> ItemClickEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::ItemClickEventArgs const& e) const;
};
public delegate void ItemClickEventHandler(Object sender, ItemClickEventArgs e)

I nheritance H ierarchy
None
ItemCollection ItemCollection ItemCollection Class
Holds the list of items that represent the content of an ItemsControl.

D eclaration
public : sealed class ItemCollection : IIterable<Platform::Object>,
IObservableVector<Platform::Object>, IVector<Platform::Object>
struct winrt::Windows::UI::Xaml::Controls::ItemCollection : IIterable<Platform::Object>,
IObservableVector<Platform::Object>, IVector<Platform::Object>
public sealed class ItemCollection : IEnumerable<Object>, IObservableVector<Object>,
IList<Object>

I nheritance H ierarchy
None

Remarks
Enumerating the collection in C# or Microsoft V isual B asic
An ItemCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the
items in the collection. The compiler does the type-casting for you and you won't need to cast to IEnumerable
explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast to IEnumerablewith an
Object or FrameworkElement constraint.

Properties
Item[Int32]
Item[Int32]
Item[Int32]

Gets or sets the element at the specified index.

Size
Size
Size

Gets the size (count) of the collection.

Methods
Append(Object)
Append(Object)
Append(Object)

Adds a new item to the collection.

Clear()
Clear()
Clear()

Removes all items from the collection.

First()
First()
First()

Returns the iterator for iteration over the items in the collection.

GetAt(UInt32)
GetAt(UInt32)
GetAt(UInt32)

Returns the item located at the specified index.

GetEnumerator()
GetEnumerator()
GetEnumerator()

Returns an enumerator that iterates through the collection.

GetMany(UInt32, Object[])
GetMany(UInt32, Object[])
GetMany(UInt32, Object[])

Retrieves multiple elements in a single pass through the iterator.

GetView()
GetView()
GetView()

Gets an immutable view into the collection.

IndexOf(T)
IndexOf(T)
IndexOf(T)

Determines the index of a specific item in the System.Collections.Generic.IList`1.

IndexOf(Object, UInt32)
IndexOf(Object, UInt32)
IndexOf(Object, UInt32)

Retrieves the index of the specified item.


Insert(Int32, T)
Insert(Int32, T)
Insert(Int32, T)

Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

InsertAt(UInt32, Object)
InsertAt(UInt32, Object)
InsertAt(UInt32, Object)

Inserts the specified item at the specified index.

RemoveAt(Int32)
RemoveAt(Int32)
RemoveAt(Int32)

Removes the System.Collections.Generic.IList`1 item at the specified index.

RemoveAt(UInt32)
RemoveAt(UInt32)
RemoveAt(UInt32)

Removes the item at the specified index.

RemoveAtEnd()
RemoveAtEnd()
RemoveAtEnd()

Removes the last item in the collection.

ReplaceAll(Object[])
ReplaceAll(Object[])
ReplaceAll(Object[])

Initially clears the collection, then inserts the provided array as new items.

SetAt(UInt32, Object)
SetAt(UInt32, Object)
SetAt(UInt32, Object)

Sets the value at the specified index to the item value specified.

Events
VectorChanged
VectorChanged
VectorChanged

Occurs when the items list of the collection has changed, or the collection is reset.

See Also
ItemCollection.Append ItemCollection.Append Item
Collection.Append
I n this Article
Edit
Adds a new item to the collection.
public : void Append(Platform::Object value)
void Append(winrt::Windows::Foundation::IInspectable value) const;
// This member is not implemented in C#

Parameters
value Object
The new item to add.
ItemCollection.Clear ItemCollection.Clear ItemCollection.
Clear
I n this Article
Edit
Removes all items from the collection.
public : void Clear()
void Clear() const;
// This member is not implemented in C#
ItemCollection.First ItemCollection.First ItemCollection.
First
I n this Article
Edit
Returns the iterator for iteration over the items in the collection.
public : IIterator<Platform::Object> First()
IIterator<winrt::Windows::Foundation::IInspectable> First() const;
// This member is not implemented in C#

Returns
IIterator<object>
The iterator object. The iterator's current position is at the 0-index position, or at the collection end if the collection is
empty.
ItemCollection.GetAt ItemCollection.GetAt Item
Collection.GetAt
I n this Article
Edit
Returns the item located at the specified index.
public : Platform::Object GetAt(unsigned int index)
winrt::Windows::Foundation::IInspectable GetAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The integer index for the value to retrieve.
Returns
object
The item value at the specified index.
IEnumerable<T>.GetEnumerator IEnumerable<T>.Get
Enumerator
I n this Article
Edit
Returns an enumerator that iterates through the collection.
// This member is not implemented in C++/CX
IEnumerator<T> GetEnumerator()

Returns
An enumerator that can be used to iterate through the collection.
ItemCollection.GetMany ItemCollection.GetMany Item
Collection.GetMany
I n this Article
Edit
Retrieves multiple elements in a single pass through the iterator.
public : unsigned int GetMany(unsigned int startIndex, Platform::Object[] items)
uint32_t GetMany(uint32_t startIndex, winrt::Windows::Foundation::IInspectable[] items) const;
// This member is not implemented in C#

Parameters
startIndex UInt32
The index from which to start retrieval.
items Object[]
Provides the destination for the result. Size the initial array size as a "capacity" in order to specify how many results
should be retrieved.
Returns
uint
The number of items retrieved.
ItemCollection.GetView ItemCollection.GetView Item
Collection.GetView
I n this Article
Edit
Gets an immutable view into the collection.
public : IVectorView<Platform::Object> GetView()
IVectorView<winrt::Windows::Foundation::IInspectable> GetView() const;
// This member is not implemented in C#

Returns
IReadOnlyList<object>
An object representing the immutable collection view.
ItemCollection.IndexOf ItemCollection.IndexOf Item
Collection.IndexOf
I n this Article

Overloads
IndexOf(T) IndexOf(T)
Determines the index of a specific item in the
System.Collections.Generic.IList`1.

IndexOf(Object, UInt32) IndexOf(Object, UInt32) IndexOf(


Object, UInt32) Retrieves the index of the specified item.

IndexOf(T) IndexOf(T)
Edit
Determines the index of a specific item in the System.Collections.Generic.IList`1.
// This member is not implemented in C++/CX
int IndexOf(T item)

Parameters
item TTT
The object to locate in the System.Collections.Generic.IList`1.
Returns
The index of item if found in the list; otherwise, -1.

IndexOf(Object, UInt32) IndexOf(Object, UInt32) IndexOf(Object,


UInt32)
Edit
Retrieves the index of the specified item.
public : Platform::Boolean IndexOf(Platform::Object value, unsigned int index)
bool IndexOf(winrt::Windows::Foundation::IInspectable value, uint32_t const& index) const;
// This member is not implemented in C#

Parameters
value Object
The value to find in the collection.
index UInt32
The index of the item, if it is found.
Returns
bool
true if an item with the specified value was found; otherwise, false.
IList<T>.Insert IList<T>.Insert
I n this Article
Edit
Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

// This member is not implemented in C++/CX


void Insert(int index, T item)

Parameters
index
The zero-based index at which item should be inserted.
item TT
The object to insert into the System.Collections.Generic.IList`1.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.
ItemCollection.InsertAt ItemCollection.InsertAt Item
Collection.InsertAt
I n this Article
Edit
Inserts the specified item at the specified index.
public : void InsertAt(unsigned int index, Platform::Object value)
void InsertAt(uint32_t index, winrt::Windows::Foundation::IInspectable value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value Object
The value to set.

Remarks
InsertAt expands the collection and moves all subsequent index items by one.
IList<T>.Item IList<T>.Item
I n this Article
Edit
Gets or sets the element at the specified index.

// This member is not implemented in C++/CX


T this[int index] { get; set; }

Parameters
index
The zero-based index of the element to get or set.
Returns
TT
The element at the specified index.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The property is set and the System.Collections.Generic.IList`1 is read-only.
ItemCollection.RemoveAt ItemCollection.RemoveAt Item
Collection.RemoveAt
I n this Article

Overloads
RemoveAt(Int32) RemoveAt(Int32)
Removes the System.Collections.Generic.IList`1 item at the
specified index.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Removes the item at the specified index.

RemoveAt(Int32) RemoveAt(Int32)
Edit
Removes the System.Collections.Generic.IList`1 item at the specified index.
// This member is not implemented in C++/CX
void RemoveAt(int index)

Parameters
index
The zero-based index of the item to remove.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Edit
Removes the item at the specified index.
public : void RemoveAt(unsigned int index)
void RemoveAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The index position of the item to remove.
Remarks
If successful, calling this method reduces the collection size by one. Items with index values greater than the called
index have their index values reduced by one.
ItemCollection.RemoveAtEnd ItemCollection.RemoveAt
End ItemCollection.RemoveAtEnd
I n this Article
Edit
Removes the last item in the collection.
public : void RemoveAtEnd()
void RemoveAtEnd() const;
// This member is not implemented in C#
ItemCollection.ReplaceAll ItemCollection.ReplaceAll Item
Collection.ReplaceAll
I n this Article
Edit
Initially clears the collection, then inserts the provided array as new items.
public : void ReplaceAll(Platform::Object[] items)
void ReplaceAll(winrt::Windows::Foundation::IInspectable[] items) const;
// This member is not implemented in C#

Parameters
items Object[]
The new collection items.

Remarks
For implementations that track a "changed" event, the initial reset fires an event, but the items added don't fire discrete
per-item events.
ItemCollection.SetAt ItemCollection.SetAt Item
Collection.SetAt
I n this Article
Edit
Sets the value at the specified index to the item value specified.
public : void SetAt(unsigned int index, Platform::Object value)
void SetAt(uint32_t index, winrt::Windows::Foundation::IInspectable value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value Object
The value to set.

Remarks
SetAt replaces the item at the index, and the collection count remains the same.
ItemCollection.Size ItemCollection.Size ItemCollection.
Size
I n this Article
Edit
Gets the size (count) of the collection.
public : unsigned int Size { get; }
uint32_t Size();
// This member is not implemented in C#

Returns
uint
The count of items in the collection.
ItemCollection.VectorChanged ItemCollection.Vector
Changed ItemCollection.VectorChanged
I n this Article
Edit
Occurs when the items list of the collection has changed, or the collection is reset.
public : event VectorChangedEventHandler<Platform::Object> VectorChanged
// Register
event_token VectorChanged(VectorChangedEventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void VectorChanged(event_token const& cookie) const;

// Revoke with event_revoker


VectorChanged_revoker VectorChanged(auto_revoke_t, VectorChangedEventHandler<Platform::Object>
const& handler) const;
public event VectorChangedEventHandler<object> VectorChanged
ItemContainerGenerator ItemContainerGenerator Item
ContainerGenerator Class
Provides mappings between the items of an ItemsControl and their container elements.

D eclaration
public : sealed class ItemContainerGenerator : IItemContainerGenerator
struct winrt::Windows::UI::Xaml::Controls::ItemContainerGenerator : IItemContainerGenerator
public sealed class ItemContainerGenerator : IItemContainerGenerator

I nheritance H ierarchy
None

Remarks
You set an ItemContainerGenerator as the value of the ItemsControl.ItemContainerGenerator property.

Methods
ContainerFromIndex(Int32)
ContainerFromIndex(Int32)
ContainerFromIndex(Int32)
Note

ContainerFromIndex may be altered or unavailable for releases after Windows 8.1. Instead, use
ItemsControl.ContainerFromIndex.
Returns the container for the item at the specified index within the ItemCollection.

ContainerFromItem(Object)
ContainerFromItem(Object)
ContainerFromItem(Object)
Note

ContainerFromItem may be altered or unavailable for releases after Windows 8.1. Instead, use
ItemsControl.ContainerFromItem.
Returns the container corresponding to the specified item.

GenerateNext(Boolean)
GenerateNext(Boolean)
GenerateNext(Boolean)

Returns the container element used to display the next item, and indicates whether the container element has been
newly generated (realized).

GeneratorPositionFromIndex(Int32)
GeneratorPositionFromIndex(Int32)
GeneratorPositionFromIndex(Int32)
Gets the generated position of the item at the specified index.

GetItemContainerGeneratorForPanel(Panel)
GetItemContainerGeneratorForPanel(Panel)
GetItemContainerGeneratorForPanel(Panel)

Returns the ItemContainerGenerator that is appropriate for use by the specified panel.

IndexFromContainer(DependencyObject)
IndexFromContainer(DependencyObject)
IndexFromContainer(DependencyObject)
Note

IndexFromContainer may be altered or unavailable for releases after Windows 8.1. Instead, use
ItemsControl.IndexFromContainer.
Returns the index to the item that has the specified, generated container.

IndexFromGeneratorPosition(GeneratorPosition)
IndexFromGeneratorPosition(GeneratorPosition)
IndexFromGeneratorPosition(GeneratorPosition)

Returns the index that maps to the specified GeneratorPosition.

ItemFromContainer(DependencyObject)
ItemFromContainer(DependencyObject)
ItemFromContainer(DependencyObject)
Note

ItemFromContainer may be altered or unavailable for releases after Windows 8.1. Instead, use
ItemsControl.ItemFromContainer.
Returns the item that corresponds to the specified, generated container.

PrepareItemContainer(DependencyObject)
PrepareItemContainer(DependencyObject)
PrepareItemContainer(DependencyObject)

Prepares the specified element as the container for the corresponding item.

Recycle(GeneratorPosition, Int32)
Recycle(GeneratorPosition, Int32)
Recycle(GeneratorPosition, Int32)

Disassociates item containers from their data items and saves the containers so they can be reused later for other
data items.
Remove(GeneratorPosition, Int32)
Remove(GeneratorPosition, Int32)
Remove(GeneratorPosition, Int32)

Removes one or more generated (realized) items.

RemoveAll()
RemoveAll()
RemoveAll()

Removes all generated (realized) items.

StartAt(GeneratorPosition, GeneratorDirection, Boolean)


StartAt(GeneratorPosition, GeneratorDirection, Boolean)
StartAt(GeneratorPosition, GeneratorDirection, Boolean)

Prepares the generator to generate items, starting at the specified GeneratorPosition and moving in the specified
GeneratorDirection. This method also controls whether or not to start at a generated (realized) item.

Stop()
Stop()
Stop()

Disposes the ItemContainerGenerator.

Events
ItemsChanged
ItemsChanged
ItemsChanged

Occurs when the contents of the items collection changes.


ItemContainerGenerator.ContainerFromIndex Item
ContainerGenerator.ContainerFromIndex ItemContainer
Generator.ContainerFromIndex
I n this Article
Edit
Note

ContainerFromIndex may be altered or unavailable for releases after Windows 8.1. Instead, use
ItemsControl.ContainerFromIndex.
Returns the container for the item at the specified index within the ItemCollection.

public : DependencyObject ContainerFromIndex(int index)


DependencyObject ContainerFromIndex(int32_t index) const;
public DependencyObject ContainerFromIndex(Int32 index)

Parameters
index Int32
The index of the item to retrieve.
Returns
DependencyObject
The container for the item at the specified index within the item collection, if the item has a container; otherwise, null.
Attributes DeprecatedAttribute
ItemContainerGenerator.ContainerFromItem Item
ContainerGenerator.ContainerFromItem ItemContainer
Generator.ContainerFromItem
I n this Article
Edit
Note

ContainerFromItem may be altered or unavailable for releases after Windows 8.1. Instead, use
ItemsControl.ContainerFromItem.
Returns the container corresponding to the specified item.

public : DependencyObject ContainerFromItem(Platform::Object item)


DependencyObject ContainerFromItem(winrt::Windows::Foundation::IInspectable item) const;
public DependencyObject ContainerFromItem(Object item)

Parameters
item Object
The item to retrieve the container for.
Returns
DependencyObject
A container that corresponds to the specified item, if the item has a container and exists in the collection; otherwise,
null.
Attributes DeprecatedAttribute
ItemContainerGenerator.GenerateNext ItemContainer
Generator.GenerateNext ItemContainerGenerator.
GenerateNext
I n this Article
Edit
Returns the container element used to display the next item, and indicates whether the container element has been
newly generated (realized).
public : DependencyObject GenerateNext(bool isNewlyRealized)
DependencyObject GenerateNext(bool const& isNewlyRealized) const;
public DependencyObject GenerateNext(Boolean isNewlyRealized)

Parameters
isNewlyRealized Boolean
true if the returned DependencyObject is newly generated (realized); otherwise, false.
Returns
DependencyObject
A DependencyObject that is the container element that is used to display the next item.
ItemContainerGenerator.GeneratorPositionFromIndex
ItemContainerGenerator.GeneratorPositionFromIndex
ItemContainerGenerator.GeneratorPositionFromIndex
I n this Article
Edit
Gets the generated position of the item at the specified index.
public : GeneratorPosition GeneratorPositionFromIndex(int itemIndex)
GeneratorPosition GeneratorPositionFromIndex(int32_t itemIndex) const;
public GeneratorPosition GeneratorPositionFromIndex(Int32 itemIndex)

Parameters
itemIndex Int32
The index of the item to retrieve the position of.
Returns
GeneratorPosition
The position of the item as generated by the ItemContainerGenerator.
ItemContainerGenerator.GetItemContainerGeneratorFor
Panel ItemContainerGenerator.GetItemContainer
GeneratorForPanel ItemContainerGenerator.GetItem
ContainerGeneratorForPanel
I n this Article
Edit
Returns the ItemContainerGenerator that is appropriate for use by the specified panel.
public : ItemContainerGenerator GetItemContainerGeneratorForPanel(Panel panel)
ItemContainerGenerator GetItemContainerGeneratorForPanel(Panel panel) const;
public ItemContainerGenerator GetItemContainerGeneratorForPanel(Panel panel)

Parameters
panel Panel
The panel for which to return an appropriate ItemContainerGenerator.
Returns
ItemContainerGenerator ItemContainerGenerator ItemContainerGenerator
An ItemContainerGenerator appropriate for use by the specified panel.
ItemContainerGenerator.IndexFromContainer Item
ContainerGenerator.IndexFromContainer ItemContainer
Generator.IndexFromContainer
I n this Article
Edit
Note

IndexFromContainer may be altered or unavailable for releases after Windows 8.1. Instead, use
ItemsControl.IndexFromContainer.
Returns the index to the item that has the specified, generated container.

public : int IndexFromContainer(DependencyObject container)


int32_t IndexFromContainer(DependencyObject container) const;
public int IndexFromContainer(DependencyObject container)

Parameters
container DependencyObject
The generated container to retrieve the item index for.
Returns
int
The index to the item that corresponds to the specified generated container.
Attributes DeprecatedAttribute
ItemContainerGenerator.IndexFromGeneratorPosition
ItemContainerGenerator.IndexFromGeneratorPosition
ItemContainerGenerator.IndexFromGeneratorPosition
I n this Article
Edit
Returns the index that maps to the specified GeneratorPosition.
public : int IndexFromGeneratorPosition(GeneratorPosition position)
int32_t IndexFromGeneratorPosition(GeneratorPosition position) const;
public int IndexFromGeneratorPosition(GeneratorPosition position)

Parameters
position GeneratorPosition
The GeneratorPosition for the desired index.
Returns
int
The index that maps to the specified GeneratorPosition.
ItemContainerGenerator.ItemFromContainer Item
ContainerGenerator.ItemFromContainer ItemContainer
Generator.ItemFromContainer
I n this Article
Edit
Note

ItemFromContainer may be altered or unavailable for releases after Windows 8.1. Instead, use
ItemsControl.ItemFromContainer.
Returns the item that corresponds to the specified, generated container.

public : Platform::Object ItemFromContainer(DependencyObject container)


winrt::Windows::Foundation::IInspectable ItemFromContainer(DependencyObject container) const;
public object ItemFromContainer(DependencyObject container)

Parameters
container DependencyObject
The DependencyObject that corresponds to the item to be returned.
Returns
object
The contained item, or the container if it does not contain an item.
Attributes DeprecatedAttribute
ItemContainerGenerator.ItemsChanged ItemContainer
Generator.ItemsChanged ItemContainerGenerator.Items
Changed
I n this Article
Edit
Occurs when the contents of the items collection changes.
public : event ItemsChangedEventHandler ItemsChanged
// Register
event_token ItemsChanged(ItemsChangedEventHandler const& handler) const;

// Revoke with event_token


void ItemsChanged(event_token const& cookie) const;

// Revoke with event_revoker


ItemsChanged_revoker ItemsChanged(auto_revoke_t, ItemsChangedEventHandler const& handler) const;
public event ItemsChangedEventHandler ItemsChanged
ItemContainerGenerator.PrepareItemContainer Item
ContainerGenerator.PrepareItemContainer Item
ContainerGenerator.PrepareItemContainer
I n this Article
Edit
Prepares the specified element as the container for the corresponding item.
public : void PrepareItemContainer(DependencyObject container)
void PrepareItemContainer(DependencyObject container) const;
public void PrepareItemContainer(DependencyObject container)

Parameters
container DependencyObject
The container to prepare. Typically, container is the result of the previous call to GenerateNext.
ItemContainerGenerator.Recycle ItemContainer
Generator.Recycle ItemContainerGenerator.Recycle
I n this Article
Edit
Disassociates item containers from their data items and saves the containers so they can be reused later for other data
items.
public : void Recycle(GeneratorPosition position, int count)
void Recycle(GeneratorPosition position, int32_t count) const;
public void Recycle(GeneratorPosition position, Int32 count)

Parameters
position GeneratorPosition
The zero-based index of the first element to reuse. position must refer to a previously generated (realized) item.
count Int32
The number of elements to reuse, starting at position.
ItemContainerGenerator.Remove ItemContainer
Generator.Remove ItemContainerGenerator.Remove
I n this Article
Edit
Removes one or more generated (realized) items.
public : void Remove(GeneratorPosition position, int count)
void Remove(GeneratorPosition position, int32_t count) const;
public void Remove(GeneratorPosition position, Int32 count)

Parameters
position GeneratorPosition
The index of the element to remove. position must refer to a previously generated (realized) item, which means its
offset must be zero.
count Int32
The number of elements to remove, starting at position.
ItemContainerGenerator.RemoveAll ItemContainer
Generator.RemoveAll ItemContainerGenerator.RemoveAll
I n this Article
Edit
Removes all generated (realized) items.
public : void RemoveAll()
void RemoveAll() const;
public void RemoveAll()
ItemContainerGenerator.StartAt ItemContainerGenerator.
StartAt ItemContainerGenerator.StartAt
I n this Article
Edit
Prepares the generator to generate items, starting at the specified GeneratorPosition and moving in the specified
GeneratorDirection. This method also controls whether or not to start at a generated (realized) item.
public : void StartAt(GeneratorPosition position, GeneratorDirection direction, bool
allowStartAtRealizedItem)
void StartAt(GeneratorPosition position, GeneratorDirection direction, bool
allowStartAtRealizedItem) const;
public void StartAt(GeneratorPosition position, GeneratorDirection direction, Boolean
allowStartAtRealizedItem)

Parameters
position GeneratorPosition
A GeneratorPosition that specifies the position of the item to start generating items at.
direction GeneratorDirection
Specifies the position of the item to start generating items at.
allowStartAtRealizedItem Boolean
Specifies whether to start at a generated (realized) item.
ItemContainerGenerator.Stop ItemContainerGenerator.
Stop ItemContainerGenerator.Stop
I n this Article
Edit
Disposes the ItemContainerGenerator.
public : void Stop()
void Stop() const;
public void Stop()
ItemsControl ItemsControl ItemsControl Class
Represents a control that can be used to present a collection of items.

D eclaration
public : class ItemsControl : Control, IItemContainerMapping, IItemsControl, IItemsControl2,
IItemsControl3, IItemsControlOverrides
struct winrt::Windows::UI::Xaml::Controls::ItemsControl : Control, IItemContainerMapping,
IItemsControl, IItemsControl2, IItemsControl3, IItemsControlOverrides
public class ItemsControl : Control, IItemContainerMapping, IItemsControl, IItemsControl2,
IItemsControl3, IItemsControlOverrides

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
An ItemsControl object can serve two roles. It can be used to present a fixed set of items, or it can be used to display a
list obtained from data binding to a data source. Using an ItemsControl for data is more common. To display data,
specify the binding to the data as the ItemsSource value (or use the data context) and don't populate Items. If you want
to display a fixed list, populate Items with one or more FrameworkElement child objects, and don't specify
ItemsSource.
There are several controls that inherit from ItemsControl that you can use in your app, but you can also use an
ItemsControl directly, because it does offer a basic presentation of data or items. Controls that derive from
ItemsControl and which add additional presentation features include: ListView, GridView, ListBox, other Selector
derived controls (ComboBox, FlipView ), MenuFlyoutPresenter.
ListView and GridView are the two most commonly used controls for displaying data. For more info on how to use
these controls, including sample code, see Adding ListView and GridView controls.
ItemsSource typically references a list of items. This can be a fixed list from a business object, or a list that's designed to
fire notifications if the underlying data changes. The list might be a generic interface (for example IList) or a practical
class that implements the collection interfaces that Windows Runtime data binding supports. When you display items
in an ItemsControl, you can use the ItemTemplate property, the ItemsPanel property, or both to specify the appearance
of the items. The DisplayMemberPath property can be used for a master-details view of the data. For more info on
how to use these properties in data binding scenarios, how lists are supported, and how to implement two-way
bindings or notifications on changes, see the "Binding to collections" section of Data binding in depth. Support for data
and items is one of the areas where you'll use different interfaces and techniques for Visual C++ component
extensions (C++/CX) than you do for C# or Microsoft Visual Basic; Data binding in depth also includes a table for that
info.
You can provide a custom template for an ItemsControl because it is a Control class. But before retemplating
ItemsControl you should check whether one of the derived classes already offers a similar template and gives you the
presentation experience you want. In particular, if you're looking for data presentation that has an association with the
orientation of the items (list is either horizontal or vertical) you should look at ListView and GridView.
ItemsControl implements IItemContainerMapping, which is mainly a helper interface that supports other features. App
code seldom calls the IItemContainerMapping methods directly, and controls that derive from ItemsControl or any of
the deeper classes typically don't have to reimplement IItemContainerMapping.
I temsControl derived classes
ItemsControl is the parent class for MenuFlyoutPresenter and Selector. Most of the practical items controls derive
from Selector in some way, either through ListViewBase or directly from Selector.

Constructors
ItemsControl()
ItemsControl()
ItemsControl()

Initializes a new instance of the ItemsControl class.

Properties
DisplayMemberPath
DisplayMemberPath
DisplayMemberPath

Gets or sets the name or path of the property that is displayed for each data item.

DisplayMemberPathProperty
DisplayMemberPathProperty
DisplayMemberPathProperty

Identifies the DisplayMemberPath dependency property.

GroupStyle
GroupStyle
GroupStyle

Gets a collection of GroupStyle objects that define the appearance of each level of groups.

GroupStyleSelector
GroupStyleSelector
GroupStyleSelector

Gets or sets a reference to a custom GroupStyleSelector logic class. The GroupStyleSelector returns different
GroupStyle values to use for content based on the characteristics of that content.

GroupStyleSelectorProperty
GroupStyleSelectorProperty
GroupStyleSelectorProperty

Identifies the GroupStyleSelector dependency property.


IsGrouping
IsGrouping
IsGrouping

Gets a value that indicates whether the control is using grouping.

IsGroupingProperty
IsGroupingProperty
IsGroupingProperty

Identifies the IsGrouping dependency property.

ItemContainerGenerator
ItemContainerGenerator
ItemContainerGenerator

Gets the ItemContainerGenerator associated with this ItemsControl.

ItemContainerStyle
ItemContainerStyle
ItemContainerStyle

Gets or sets the style that is used when rendering the item containers.

ItemContainerStyleProperty
ItemContainerStyleProperty
ItemContainerStyleProperty

Identifies the ItemContainerStyle dependency property.

ItemContainerStyleSelector
ItemContainerStyleSelector
ItemContainerStyleSelector

Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector returns different Style values to
use for the item container based on characteristics of the object being displayed.

ItemContainerStyleSelectorProperty
ItemContainerStyleSelectorProperty
ItemContainerStyleSelectorProperty

Identifies the ItemContainerStyleSelector dependency property.

ItemContainerTransitions
ItemContainerTransitions
ItemContainerTransitions

Gets or sets the collection of Transition style elements that apply to the item containers of an ItemsControl.

ItemContainerTransitionsProperty
ItemContainerTransitionsProperty
ItemContainerTransitionsProperty

Identifies the ItemContainerTransitions dependency property.

Items
Items
Items

Gets the collection used to generate the content of the control.

ItemsPanel
ItemsPanel
ItemsPanel

Gets or sets the template that defines the panel that controls the layout of items.

ItemsPanelProperty
ItemsPanelProperty
ItemsPanelProperty

Identifies the ItemsPanel dependency property.

ItemsPanelRoot
ItemsPanelRoot
ItemsPanelRoot

Gets the Panel specified by ItemsPanel.

ItemsSource
ItemsSource
ItemsSource

Gets or sets an object source used to generate the content of the ItemsControl.

ItemsSourceProperty
ItemsSourceProperty
ItemsSourceProperty

Identifies the ItemsSource dependency property.


ItemTemplate
ItemTemplate
ItemTemplate

Gets or sets the DataTemplate used to display each item.

ItemTemplateProperty
ItemTemplateProperty
ItemTemplateProperty

Identifies the ItemTemplate dependency property.

ItemTemplateSelector
ItemTemplateSelector
ItemTemplateSelector

Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector referenced by
this property returns a template to apply to items.

ItemTemplateSelectorProperty
ItemTemplateSelectorProperty
ItemTemplateSelectorProperty

Identifies the ItemTemplateSelector dependency property.

Methods
ClearContainerForItemOverride(DependencyObject, Object)
ClearContainerForItemOverride(DependencyObject, Object)
ClearContainerForItemOverride(DependencyObject, Object)

Undoes the effects of the PrepareContainerForItemOverride method.

ContainerFromIndex(Int32)
ContainerFromIndex(Int32)
ContainerFromIndex(Int32)

Returns the container for the item at the specified index within the ItemCollection.

ContainerFromItem(Object)
ContainerFromItem(Object)
ContainerFromItem(Object)

Returns the container corresponding to the specified item.

GetContainerForItemOverride()
GetContainerForItemOverride()
GetContainerForItemOverride()

Creates or identifies the element that is used to display the given item.

GetItemsOwner(DependencyObject)
GetItemsOwner(DependencyObject)
GetItemsOwner(DependencyObject)

Returns the ItemsControl that the specified element hosts items for.

GroupHeaderContainerFromItemContainer(DependencyObject)
GroupHeaderContainerFromItemContainer(DependencyObject)
GroupHeaderContainerFromItemContainer(DependencyObject)

Returns the group header container that corresponds to the specified container element.

IndexFromContainer(DependencyObject)
IndexFromContainer(DependencyObject)
IndexFromContainer(DependencyObject)

Returns the index to the item that has the specified, generated container.

IsItemItsOwnContainerOverride(Object)
IsItemItsOwnContainerOverride(Object)
IsItemItsOwnContainerOverride(Object)

Determines whether the specified item is (or is eligible to be) its own container.

ItemFromContainer(DependencyObject)
ItemFromContainer(DependencyObject)
ItemFromContainer(DependencyObject)

Returns the item that corresponds to the specified, generated container.

ItemsControlFromItemContainer(DependencyObject)
ItemsControlFromItemContainer(DependencyObject)
ItemsControlFromItemContainer(DependencyObject)

Returns the ItemsControl that owns the specified container element.

OnGroupStyleSelectorChanged(GroupStyleSelector, GroupStyleSelector)
OnGroupStyleSelectorChanged(GroupStyleSelector, GroupStyleSelector)
OnGroupStyleSelectorChanged(GroupStyleSelector, GroupStyleSelector)

Invoked when the value of the GroupStyleSelector property changes.


OnItemContainerStyleChanged(Style, Style)
OnItemContainerStyleChanged(Style, Style)
OnItemContainerStyleChanged(Style, Style)

Invoked when the value of the ItemContainerStyle property changes.

OnItemContainerStyleSelectorChanged(StyleSelector, StyleSelector)
OnItemContainerStyleSelectorChanged(StyleSelector, StyleSelector)
OnItemContainerStyleSelectorChanged(StyleSelector, StyleSelector)

Invoked when the value of the ItemContainerStyleSelector property changes.

OnItemsChanged(Object)
OnItemsChanged(Object)
OnItemsChanged(Object)

Invoked when the value of the Items property changes.

OnItemTemplateChanged(DataTemplate, DataTemplate)
OnItemTemplateChanged(DataTemplate, DataTemplate)
OnItemTemplateChanged(DataTemplate, DataTemplate)

Invoked when the value of the ItemTemplate property changes.

OnItemTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
OnItemTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)
OnItemTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)

Invoked when the value of the ItemTemplateSelector property changes.

PrepareContainerForItemOverride(DependencyObject, Object)
PrepareContainerForItemOverride(DependencyObject, Object)
PrepareContainerForItemOverride(DependencyObject, Object)

Prepares the specified element to display the specified item.

See Also
Control
Control
Control
Control
ItemsControl.ClearContainerForItemOverride Items
Control.ClearContainerForItemOverride ItemsControl.
ClearContainerForItemOverride
I n this Article
Edit
Undoes the effects of the PrepareContainerForItemOverride method.
protected : virtual void ClearContainerForItemOverride(DependencyObject element, Platform::Object
item)
virtual void ClearContainerForItemOverride(DependencyObject element,
winrt::Windows::Foundation::IInspectable item) const;
protected virtual void ClearContainerForItemOverride(DependencyObject element, Object item)

Parameters
element DependencyObject
The container element.
item Object
The item.
ItemsControl.ContainerFromIndex ItemsControl.
ContainerFromIndex ItemsControl.ContainerFromIndex
I n this Article
Edit
Returns the container for the item at the specified index within the ItemCollection.
public : DependencyObject ContainerFromIndex(int index)
DependencyObject ContainerFromIndex(int32_t index) const;
public DependencyObject ContainerFromIndex(Int32 index)

Parameters
index Int32
The index of the item to retrieve.
Returns
DependencyObject
The container for the item at the specified index within the item collection, if the item has a container; otherwise, null.
ItemsControl.ContainerFromItem ItemsControl.Container
FromItem ItemsControl.ContainerFromItem
I n this Article
Edit
Returns the container corresponding to the specified item.
public : DependencyObject ContainerFromItem(Platform::Object item)
DependencyObject ContainerFromItem(winrt::Windows::Foundation::IInspectable item) const;
public DependencyObject ContainerFromItem(Object item)

Parameters
item Object
The item to retrieve the container for.
Returns
DependencyObject
A container that corresponds to the specified item, if the item has a container and exists in the collection; otherwise,
null.
ItemsControl.DisplayMemberPath ItemsControl.Display
MemberPath ItemsControl.DisplayMemberPath
I n this Article
Edit
Gets or sets the name or path of the property that is displayed for each data item.
public : Platform::String DisplayMemberPath { get; set; }
winrt::hstring DisplayMemberPath();

void DisplayMemberPath(winrt::hstring displaymemberpath);


public string DisplayMemberPath { get; set; }

<itemsControl DisplayMemberPath="propertyPath"/>

Returns
string
The name or path of the property that is displayed for each the data item in the control. The default is an empty string
("").
ItemsControl.DisplayMemberPathProperty ItemsControl.
DisplayMemberPathProperty ItemsControl.Display
MemberPathProperty
I n this Article
Edit
Identifies the DisplayMemberPath dependency property.
public : static DependencyProperty DisplayMemberPathProperty { get; }
static DependencyProperty DisplayMemberPathProperty();
public static DependencyProperty DisplayMemberPathProperty { get; }

Returns
DependencyProperty
The identifier for the DisplayMemberPath dependency property.
ItemsControl.GetContainerForItemOverride Items
Control.GetContainerForItemOverride ItemsControl.Get
ContainerForItemOverride
I n this Article
Edit
Creates or identifies the element that is used to display the given item.
protected : virtual DependencyObject GetContainerForItemOverride()
virtual DependencyObject GetContainerForItemOverride() const;
protected virtual DependencyObject GetContainerForItemOverride()

Returns
DependencyObject
The element that is used to display the given item.
ItemsControl.GetItemsOwner ItemsControl.GetItems
Owner ItemsControl.GetItemsOwner
I n this Article
Edit
Returns the ItemsControl that the specified element hosts items for.
public : static ItemsControl GetItemsOwner(DependencyObject element)
static ItemsControl GetItemsOwner(DependencyObject element) const;
public static ItemsControl GetItemsOwner(DependencyObject element)

Parameters
element DependencyObject
The host element.
Returns
ItemsControl ItemsControl ItemsControl
The ItemsControl that the specified element hosts items for, or null.
ItemsControl.GroupHeaderContainerFromItemContainer
ItemsControl.GroupHeaderContainerFromItemContainer
ItemsControl.GroupHeaderContainerFromItemContainer
I n this Article
Edit
Returns the group header container that corresponds to the specified container element.
public : DependencyObject GroupHeaderContainerFromItemContainer(DependencyObject itemContainer)
DependencyObject GroupHeaderContainerFromItemContainer(DependencyObject itemContainer) const;
public DependencyObject GroupHeaderContainerFromItemContainer(DependencyObject itemContainer)

Parameters
itemContainer DependencyObject
The container element to return the group header container for.
Returns
DependencyObject
The group header container associated with the specified item container.
ItemsControl.GroupStyle ItemsControl.GroupStyle Items
Control.GroupStyle
I n this Article
Edit
Gets a collection of GroupStyle objects that define the appearance of each level of groups.
public : IObservableVector<GroupStyle> GroupStyle { get; }
IObservableVector<GroupStyle> GroupStyle();
public IObservableVector<GroupStyle> GroupStyle { get; }

<itemsControl>
<itemsControl.GroupStyle>
oneOrMoreGroupStyleObjects
</itemsControl.GroupStyle>
</itemsControl>

Returns
IObservableVector<GroupStyle>
A collection of GroupStyle objects that define the appearance of each level of groups.

Remarks
Note

GroupStyle.ContainerStyle and GroupStyle.ContainerStyleSelector are deprecated in Windows 8.1, and are ignored in
ItemsControl.GroupStyle.
ItemsControl.GroupStyleSelector ItemsControl.Group
StyleSelector ItemsControl.GroupStyleSelector
I n this Article
Edit
Gets or sets a reference to a custom GroupStyleSelector logic class. The GroupStyleSelector returns different
GroupStyle values to use for content based on the characteristics of that content.
public : GroupStyleSelector GroupStyleSelector { get; set; }
GroupStyleSelector GroupStyleSelector();

void GroupStyleSelector(GroupStyleSelector groupstyleselector);


public GroupStyleSelector GroupStyleSelector { get; set; }

<itemsControl GroupStyleSelector="groupStyleSelectorReference" />

Returns
GroupStyleSelector
A reference to a custom GroupStyleSelector logic class.
ItemsControl.GroupStyleSelectorProperty ItemsControl.
GroupStyleSelectorProperty ItemsControl.GroupStyle
SelectorProperty
I n this Article
Edit
Identifies the GroupStyleSelector dependency property.
public : static DependencyProperty GroupStyleSelectorProperty { get; }
static DependencyProperty GroupStyleSelectorProperty();
public static DependencyProperty GroupStyleSelectorProperty { get; }

Returns
DependencyProperty
The identifier for the GroupStyleSelector dependency property.
ItemsControl.IndexFromContainer ItemsControl.Index
FromContainer ItemsControl.IndexFromContainer
I n this Article
Edit
Returns the index to the item that has the specified, generated container.
public : int IndexFromContainer(DependencyObject container)
int32_t IndexFromContainer(DependencyObject container) const;
public int IndexFromContainer(DependencyObject container)

Parameters
container DependencyObject
The generated container to retrieve the item index for.
Returns
int
The index to the item that corresponds to the specified generated container.
ItemsControl.IsGrouping ItemsControl.IsGrouping Items
Control.IsGrouping
I n this Article
Edit
Gets a value that indicates whether the control is using grouping.
public : Platform::Boolean IsGrouping { get; }
bool IsGrouping();
public bool IsGrouping { get; }

Returns
bool
true if a control is using grouping; otherwise, false.
ItemsControl.IsGroupingProperty ItemsControl.Is
GroupingProperty ItemsControl.IsGroupingProperty
I n this Article
Edit
Identifies the IsGrouping dependency property.
public : static DependencyProperty IsGroupingProperty { get; }
static DependencyProperty IsGroupingProperty();
public static DependencyProperty IsGroupingProperty { get; }

Returns
DependencyProperty
The identifier for the IsGrouping dependency property.
ItemsControl.IsItemItsOwnContainerOverride Items
Control.IsItemItsOwnContainerOverride ItemsControl.Is
ItemItsOwnContainerOverride
I n this Article
Edit
Determines whether the specified item is (or is eligible to be) its own container.
protected : virtual Platform::Boolean IsItemItsOwnContainerOverride(Platform::Object item)
virtual bool IsItemItsOwnContainerOverride(winrt::Windows::Foundation::IInspectable item) const;
protected virtual bool IsItemItsOwnContainerOverride(Object item)

Parameters
item Object
The item to check.
Returns
bool
true if the item is (or is eligible to be) its own container; otherwise, false.
ItemsControl.ItemContainerGenerator ItemsControl.Item
ContainerGenerator ItemsControl.ItemContainer
Generator
I n this Article
Edit
Gets the ItemContainerGenerator associated with this ItemsControl.
public : ItemContainerGenerator ItemContainerGenerator { get; }
ItemContainerGenerator ItemContainerGenerator();
public ItemContainerGenerator ItemContainerGenerator { get; }

Returns
ItemContainerGenerator
The ItemContainerGenerator associated with this ItemsControl.
ItemsControl.ItemContainerStyle ItemsControl.Item
ContainerStyle ItemsControl.ItemContainerStyle
I n this Article
Edit
Gets or sets the style that is used when rendering the item containers.
public : Style ItemContainerStyle { get; set; }
Style ItemContainerStyle();

void ItemContainerStyle(Style itemcontainerstyle);


public Style ItemContainerStyle { get; set; }

<itemsControl>
<itemsControl.ItemContainerStyle>
inlineStyle
</itemsControl.ItemContainerStyle>
</itemsControl>

Returns
Style
The style applied to the item containers. The default is null.
ItemsControl.ItemContainerStyleProperty ItemsControl.
ItemContainerStyleProperty ItemsControl.ItemContainer
StyleProperty
I n this Article
Edit
Identifies the ItemContainerStyle dependency property.
public : static DependencyProperty ItemContainerStyleProperty { get; }
static DependencyProperty ItemContainerStyleProperty();
public static DependencyProperty ItemContainerStyleProperty { get; }

Returns
DependencyProperty
The identifier for the ItemContainerStyle dependency property.
ItemsControl.ItemContainerStyleSelector ItemsControl.
ItemContainerStyleSelector ItemsControl.ItemContainer
StyleSelector
I n this Article
Edit
Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector returns different Style values to use for
the item container based on characteristics of the object being displayed.
public : StyleSelector ItemContainerStyleSelector { get; set; }
StyleSelector ItemContainerStyleSelector();

void ItemContainerStyleSelector(StyleSelector itemcontainerstyleselector);


public StyleSelector ItemContainerStyleSelector { get; set; }

<itemsControl ItemContainerStyleSelector="styleSelectorReference" />

Returns
StyleSelector
A custom StyleSelector logic class.
ItemsControl.ItemContainerStyleSelectorProperty Items
Control.ItemContainerStyleSelectorProperty Items
Control.ItemContainerStyleSelectorProperty
I n this Article
Edit
Identifies the ItemContainerStyleSelector dependency property.
public : static DependencyProperty ItemContainerStyleSelectorProperty { get; }
static DependencyProperty ItemContainerStyleSelectorProperty();
public static DependencyProperty ItemContainerStyleSelectorProperty { get; }

Returns
DependencyProperty
The identifier for the ItemContainerStyleSelector dependency property.
ItemsControl.ItemContainerTransitions ItemsControl.Item
ContainerTransitions ItemsControl.ItemContainer
Transitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to the item containers of an ItemsControl.
public : TransitionCollection ItemContainerTransitions { get; set; }
TransitionCollection ItemContainerTransitions();

void ItemContainerTransitions(TransitionCollection itemcontainertransitions);


public TransitionCollection ItemContainerTransitions { get; set; }

<itemsControl>
<itemsControl.ItemContainerTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</itemsControl.ItemContainerTransitions>
</itemsControl>

Returns
TransitionCollection
The collection of Transition style elements that apply to the item containers of an ItemsControl.

Remarks
Note

Prior to Windows 10, version 1809 (SDK 17763), the XAML syntax for properties that have a TransitionCollection
value requires that you declare an explicit TransitionCollection object element as the value, and then provide object
elements as child elements of TransitionCollection for each of the transition animations you want to use. In Windows
10, version 1809 (SDK 17763) or later, TransitionCollection supports the implicit collection usage, so you can omit the
collection object element. For more info on implicit collections and XAML, see XAML syntax guide.
Items collections can have transition animations associated with add or remove actions, or for drop target scenarios.
This property is more typically set in a Style setter rather than inline on an object element in UI definition. For more
info, see Styling controls.
The default template for GridView includes existing transition animations. Specifically, the default
ItemContainerTransitions value already contains values for AddDeleteThemeTransition, ContentThemeTransition,
ReorderThemeTransition and EntranceThemeTransition (with IsStaggeringEnabled="False" ). If you are setting a new
value for ItemContainerTransitions on GridView, consider reproducing these same theme animations as a starting
point.
To remove all default content transitions from a GridView, you might have to re-template the
GroupStyle.ContainerStyle. The transition behavior for items and their containers are interrelated.
See TransitionCollection
Also
ItemsControl.ItemContainerTransitionsProperty Items
Control.ItemContainerTransitionsProperty ItemsControl.
ItemContainerTransitionsProperty
I n this Article
Edit
Identifies the ItemContainerTransitions dependency property.
public : static DependencyProperty ItemContainerTransitionsProperty { get; }
static DependencyProperty ItemContainerTransitionsProperty();
public static DependencyProperty ItemContainerTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the ItemContainerTransitions dependency property.
ItemsControl.ItemFromContainer ItemsControl.ItemFrom
Container ItemsControl.ItemFromContainer
I n this Article
Edit
Returns the item that corresponds to the specified, generated container.
public : Platform::Object ItemFromContainer(DependencyObject container)
winrt::Windows::Foundation::IInspectable ItemFromContainer(DependencyObject container) const;
public object ItemFromContainer(DependencyObject container)

Parameters
container DependencyObject
The DependencyObject that corresponds to the item to be returned.
Returns
object
The contained item, or the container if it does not contain an item.
ItemsControl.Items ItemsControl.Items ItemsControl.
Items
I n this Article
Edit
Gets the collection used to generate the content of the control.
public : ItemCollection Items { get; }
ItemCollection Items();
public ItemCollection Items { get; }

<itemsControl>
oneOrMoreItems
</itemsControl>

Returns
ItemCollection
The collection that is used to generate the content of the control, if it exists; otherwise, null. The default is an empty
collection.
ItemsControl ItemsControl ItemsControl
I n this Article
Edit
Initializes a new instance of the ItemsControl class.

public : ItemsControl()
ItemsControl() const;
public ItemsControl()
ItemsControl.ItemsControlFromItemContainer Items
Control.ItemsControlFromItemContainer ItemsControl.
ItemsControlFromItemContainer
I n this Article
Edit
Returns the ItemsControl that owns the specified container element.
public : static ItemsControl ItemsControlFromItemContainer(DependencyObject container)
static ItemsControl ItemsControlFromItemContainer(DependencyObject container) const;
public static ItemsControl ItemsControlFromItemContainer(DependencyObject container)

Parameters
container DependencyObject
The container element to return the ItemsControl for.
Returns
ItemsControl ItemsControl ItemsControl
The ItemsControl that owns the specified container element; otherwise, null.
ItemsControl.ItemsPanel ItemsControl.ItemsPanel Items
Control.ItemsPanel
I n this Article
Edit
Gets or sets the template that defines the panel that controls the layout of items.
public : ItemsPanelTemplate ItemsPanel { get; set; }
ItemsPanelTemplate ItemsPanel();

void ItemsPanel(ItemsPanelTemplate itemspanel);


public ItemsPanelTemplate ItemsPanel { get; set; }

<itemsControl>
<itemsControl.ItemsPanel>
singlePanelTemplate
</itemsControl.ItemsPanel>
</itemsControl>

Returns
ItemsPanelTemplate
An ItemsPanelTemplate that defines the panel to use for the layout of the items. The default value for the ItemsControl
is an ItemsPanelTemplate that specifies a StackPanel.

Remarks
Note

ComboBox uses a CarouselPanel as its ItemsPanel. Using a different panel as the ItemsPanel of ComboBox is not
supported and might result in undesired behavior.
ItemsControl.ItemsPanelProperty ItemsControl.Items
PanelProperty ItemsControl.ItemsPanelProperty
I n this Article
Edit
Identifies the ItemsPanel dependency property.
public : static DependencyProperty ItemsPanelProperty { get; }
static DependencyProperty ItemsPanelProperty();
public static DependencyProperty ItemsPanelProperty { get; }

Returns
DependencyProperty
The identifier for the ItemsPanel dependency property.
ItemsControl.ItemsPanelRoot ItemsControl.ItemsPanel
Root ItemsControl.ItemsPanelRoot
I n this Article
Edit
Gets the Panel specified by ItemsPanel.
public : Panel ItemsPanelRoot { get; }
Panel ItemsPanelRoot();
public Panel ItemsPanelRoot { get; }

Returns
Panel
The Panel specified by ItemsPanel. The default is null.
ItemsControl.ItemsSource ItemsControl.ItemsSource
ItemsControl.ItemsSource
I n this Article
Edit
Gets or sets an object source used to generate the content of the ItemsControl.
public : Platform::Object ItemsSource { get; set; }
winrt::Windows::Foundation::IInspectable ItemsSource();

void ItemsSource(winrt::Windows::Foundation::IInspectable itemssource);


public object ItemsSource { get; set; }

<itemsControl ItemsSource="bindingDeclaration"/>
-or-
<itemsControl ItemsSource="resourceReferenceToSource"/>

Returns
object
The object that is used to generate the content of the ItemsControl. The default is null.

Remarks
The ItemsSource property value must implement either the IIterable or IBindableIterable interface. For example, in a
C# application, it must implement IEnumerable or IEnumerable.
The ItemsControl can provide better performance if the ItemsSource property value also implements a random-access
list interface: IVector, IVectorView, IBindableVector, or IBindableVectorView. In C#, this means IList,
IReadOnlyCollection, or IList.
The ItemsControl can respond to changes if the ItemsSource property value also implements a change notification
interface: IObservableVector or INotifyCollectionChanged.
ItemsControl.ItemsSourceProperty ItemsControl.Items
SourceProperty ItemsControl.ItemsSourceProperty
I n this Article
Edit
Identifies the ItemsSource dependency property.
public : static DependencyProperty ItemsSourceProperty { get; }
static DependencyProperty ItemsSourceProperty();
public static DependencyProperty ItemsSourceProperty { get; }

Returns
DependencyProperty
The identifier for the ItemsSource dependency property.
ItemsControl.ItemTemplate ItemsControl.ItemTemplate
ItemsControl.ItemTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display each item.
public : DataTemplate ItemTemplate { get; set; }
DataTemplate ItemTemplate();

void ItemTemplate(DataTemplate itemtemplate);


public DataTemplate ItemTemplate { get; set; }

<itemsControl>
<itemsControl.ItemTemplate>
singleDataTemplate
</itemsControl.ItemTemplate>
</itemsControl>

Returns
DataTemplate
The template that specifies the visualization of the data objects. The default is null.
ItemsControl.ItemTemplateProperty ItemsControl.Item
TemplateProperty ItemsControl.ItemTemplateProperty
I n this Article
Edit
Identifies the ItemTemplate dependency property.
public : static DependencyProperty ItemTemplateProperty { get; }
static DependencyProperty ItemTemplateProperty();
public static DependencyProperty ItemTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the ItemTemplate dependency property.
ItemsControl.ItemTemplateSelector ItemsControl.Item
TemplateSelector ItemsControl.ItemTemplateSelector
I n this Article
Edit
Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector referenced by this
property returns a template to apply to items.
public : DataTemplateSelector ItemTemplateSelector { get; set; }
DataTemplateSelector ItemTemplateSelector();

void ItemTemplateSelector(DataTemplateSelector itemtemplateselector);


public DataTemplateSelector ItemTemplateSelector { get; set; }

<itemsControl ItemTemplateSelector="dataTemplateSelectorReference" />

Returns
DataTemplateSelector
A reference to a custom DataTemplateSelector logic class.
ItemsControl.ItemTemplateSelectorProperty Items
Control.ItemTemplateSelectorProperty ItemsControl.Item
TemplateSelectorProperty
I n this Article
Edit
Identifies the ItemTemplateSelector dependency property.
public : static DependencyProperty ItemTemplateSelectorProperty { get; }
static DependencyProperty ItemTemplateSelectorProperty();
public static DependencyProperty ItemTemplateSelectorProperty { get; }

Returns
DependencyProperty
The identifier for the ItemTemplateSelector dependency property.
ItemsControl.OnGroupStyleSelectorChanged Items
Control.OnGroupStyleSelectorChanged ItemsControl.On
GroupStyleSelectorChanged
I n this Article
Edit
Invoked when the value of the GroupStyleSelector property changes.
protected : virtual void OnGroupStyleSelectorChanged(GroupStyleSelector oldGroupStyleSelector,
GroupStyleSelector newGroupStyleSelector)
virtual void OnGroupStyleSelectorChanged(GroupStyleSelector oldGroupStyleSelector,
GroupStyleSelector newGroupStyleSelector) const;
protected virtual void OnGroupStyleSelectorChanged(GroupStyleSelector oldGroupStyleSelector,
GroupStyleSelector newGroupStyleSelector)

Parameters
oldGroupStyleSelector GroupStyleSelector
The previous value of the GroupStyleSelector property.
newGroupStyleSelector GroupStyleSelector
The current value of the GroupStyleSelector property.
ItemsControl.OnItemContainerStyleChanged Items
Control.OnItemContainerStyleChanged ItemsControl.On
ItemContainerStyleChanged
I n this Article
Edit
Invoked when the value of the ItemContainerStyle property changes.
protected : virtual void OnItemContainerStyleChanged(Style oldItemContainerStyle, Style
newItemContainerStyle)
virtual void OnItemContainerStyleChanged(Style oldItemContainerStyle, Style newItemContainerStyle)
const;
protected virtual void OnItemContainerStyleChanged(Style oldItemContainerStyle, Style
newItemContainerStyle)

Parameters
oldItemContainerStyle Style
The previous value of the ItemContainerStyle property.
newItemContainerStyle Style
The current value of the ItemContainerStyle property.
ItemsControl.OnItemContainerStyleSelectorChanged
ItemsControl.OnItemContainerStyleSelectorChanged
ItemsControl.OnItemContainerStyleSelectorChanged
I n this Article
Edit
Invoked when the value of the ItemContainerStyleSelector property changes.
protected : virtual void OnItemContainerStyleSelectorChanged(StyleSelector
oldItemContainerStyleSelector, StyleSelector newItemContainerStyleSelector)
virtual void OnItemContainerStyleSelectorChanged(StyleSelector oldItemContainerStyleSelector,
StyleSelector newItemContainerStyleSelector) const;
protected virtual void OnItemContainerStyleSelectorChanged(StyleSelector
oldItemContainerStyleSelector, StyleSelector newItemContainerStyleSelector)

Parameters
oldItemContainerStyleSelector StyleSelector
The previous value of the ItemContainerStyleSelector property.
newItemContainerStyleSelector StyleSelector
The current value of the ItemContainerStyleSelector property.
ItemsControl.OnItemsChanged ItemsControl.OnItems
Changed ItemsControl.OnItemsChanged
I n this Article
Edit
Invoked when the value of the Items property changes.
protected : virtual void OnItemsChanged(Platform::Object e)
virtual void OnItemsChanged(winrt::Windows::Foundation::IInspectable e) const;
protected virtual void OnItemsChanged(Object e)

Parameters
e Object
Event data. Not specifically typed in the current implementation.
ItemsControl.OnItemTemplateChanged ItemsControl.On
ItemTemplateChanged ItemsControl.OnItemTemplate
Changed
I n this Article
Edit
Invoked when the value of the ItemTemplate property changes.
protected : virtual void OnItemTemplateChanged(DataTemplate oldItemTemplate, DataTemplate
newItemTemplate)
virtual void OnItemTemplateChanged(DataTemplate oldItemTemplate, DataTemplate newItemTemplate)
const;
protected virtual void OnItemTemplateChanged(DataTemplate oldItemTemplate, DataTemplate
newItemTemplate)

Parameters
oldItemTemplate DataTemplate
The previous value of the ItemTemplate property.
newItemTemplate DataTemplate
The current value of the ItemTemplate property.
ItemsControl.OnItemTemplateSelectorChanged Items
Control.OnItemTemplateSelectorChanged ItemsControl.
OnItemTemplateSelectorChanged
I n this Article
Edit
Invoked when the value of the ItemTemplateSelector property changes.
protected : virtual void OnItemTemplateSelectorChanged(DataTemplateSelector oldItemTemplateSelector,
DataTemplateSelector newItemTemplateSelector)
virtual void OnItemTemplateSelectorChanged(DataTemplateSelector oldItemTemplateSelector,
DataTemplateSelector newItemTemplateSelector) const;
protected virtual void OnItemTemplateSelectorChanged(DataTemplateSelector oldItemTemplateSelector,
DataTemplateSelector newItemTemplateSelector)

Parameters
oldItemTemplateSelector DataTemplateSelector
The previous value of the ItemTemplateSelector property.
newItemTemplateSelector DataTemplateSelector
The current value of the ItemTemplateSelector property.
ItemsControl.PrepareContainerForItemOverride Items
Control.PrepareContainerForItemOverride ItemsControl.
PrepareContainerForItemOverride
I n this Article
Edit
Prepares the specified element to display the specified item.
protected : virtual void PrepareContainerForItemOverride(DependencyObject element, Platform::Object
item)
virtual void PrepareContainerForItemOverride(DependencyObject element,
winrt::Windows::Foundation::IInspectable item) const;
protected virtual void PrepareContainerForItemOverride(DependencyObject element, Object item)

Parameters
element DependencyObject
The element that's used to display the specified item.
item Object
The item to display.
ItemsPanelTemplate ItemsPanelTemplate ItemsPanel
Template Class
Specifies the panel that the ItemsPresenter creates for the layout of the items of an ItemsControl.

D eclaration
public : sealed class ItemsPanelTemplate : FrameworkTemplate, IItemsPanelTemplate
struct winrt::Windows::UI::Xaml::Controls::ItemsPanelTemplate : FrameworkTemplate,
IItemsPanelTemplate
public sealed class ItemsPanelTemplate : FrameworkTemplate, IItemsPanelTemplate

I nheritance H ierarchy
DependencyObject
FrameworkTemplate

Remarks
An ItemsPanelTemplate object element should contain exactly one FrameworkElement -derived class that serves as the
root element for items. In most cases this is a Panel -derived class. The expanded template serves as the parent for the
realized items and there generally is more than one item. Therefore the XAML content property of the intended root
element of an ItemsPanelTemplate should support a collection, as Panel.Children does.
Im p o rt a nt

The root element of the template declared for the ItemsPanelTemplate in the GroupStyle.Panel property cannot be a
virtualizing panel. Virtualizing panels are defined as any type that derives from VirtualizingPanel, for example the
VirtualizingStackPanel class.

Constructors
ItemsPanelTemplate()
ItemsPanelTemplate()
ItemsPanelTemplate()

Initializes a new instance of the ItemsPanelTemplate class.

See Also
FrameworkTemplate
ItemsPanelTemplate ItemsPanelTemplate ItemsPanel
Template
I n this Article
Edit
Initializes a new instance of the ItemsPanelTemplate class.
public : ItemsPanelTemplate()
ItemsPanelTemplate() const;
public ItemsPanelTemplate()
ItemsPickedEventArgs ItemsPickedEventArgs ItemsPicked
EventArgs Class
Provides data for the ItemsPicked event.

D eclaration
public : sealed class ItemsPickedEventArgs : DependencyObject, IItemsPickedEventArgs
struct winrt::Windows::UI::Xaml::Controls::ItemsPickedEventArgs : DependencyObject,
IItemsPickedEventArgs
public sealed class ItemsPickedEventArgs : DependencyObject, IItemsPickedEventArgs

I nheritance H ierarchy
DependencyObject

Constructors
ItemsPickedEventArgs()
ItemsPickedEventArgs()
ItemsPickedEventArgs()

Initializes a new instance of the ItemsPickedEventArgs class.

Properties
AddedItems
AddedItems
AddedItems

Gets the collection of items that were selected by the user.

RemovedItems
RemovedItems
RemovedItems

Gets the collection of items that were unselected.

See Also
DependencyObject
ItemsPickedEventArgs.AddedItems ItemsPickedEvent
Args.AddedItems ItemsPickedEventArgs.AddedItems
I n this Article
Edit
Gets the collection of items that were selected by the user.
public : IVector<Platform::Object> AddedItems { get; }
IVector<winrt::Windows::Foundation::IInspectable> AddedItems();
public IList<object> AddedItems { get; }

Returns
IList<object>
The collection of items that were selected by the user.
ItemsPickedEventArgs ItemsPickedEventArgs ItemsPicked
EventArgs
I n this Article
Edit
Initializes a new instance of the ItemsPickedEventArgs class.
public : ItemsPickedEventArgs()
ItemsPickedEventArgs() const;
public ItemsPickedEventArgs()
ItemsPickedEventArgs.RemovedItems ItemsPickedEvent
Args.RemovedItems ItemsPickedEventArgs.Removed
Items
I n this Article
Edit
Gets the collection of items that were unselected.
public : IVector<Platform::Object> RemovedItems { get; }
IVector<winrt::Windows::Foundation::IInspectable> RemovedItems();
public IList<object> RemovedItems { get; }

Returns
IList<object>
The collection of items that were unselected.
ItemsPresenter ItemsPresenter ItemsPresenter Class
Specifies where items are placed in a control, usually an ItemsControl.

D eclaration
public : sealed class ItemsPresenter : FrameworkElement, IItemsPresenter, IItemsPresenter2,
IScrollSnapPointsInfo
struct winrt::Windows::UI::Xaml::Controls::ItemsPresenter : FrameworkElement, IItemsPresenter,
IItemsPresenter2, IScrollSnapPointsInfo
public sealed class ItemsPresenter : FrameworkElement, IItemsPresenter, IItemsPresenter2,
IScrollSnapPointsInfo

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Constructors
ItemsPresenter()
ItemsPresenter()
ItemsPresenter()

Initializes a new instance of the ItemsPresenter class.

Properties
AreHorizontalSnapPointsRegular
AreHorizontalSnapPointsRegular
AreHorizontalSnapPointsRegular

Gets a value that indicates whether the horizontal snap points for the ItemsPresenter are equidistant from each
other.

AreVerticalSnapPointsRegular
AreVerticalSnapPointsRegular
AreVerticalSnapPointsRegular

Gets a value that indicates whether the vertical snap points for the ItemsPresenter are equidistant from each other.

Footer
Footer
Footer

Gets or sets the content for the items footer.

FooterProperty
FooterProperty
FooterProperty

Identifies the Footer dependency property.

FooterTemplate
FooterTemplate
FooterTemplate

Gets or sets the DataTemplate used to display the content of the items header.

FooterTemplateProperty
FooterTemplateProperty
FooterTemplateProperty

Identifies the FooterTemplate dependency property.

FooterTransitions
FooterTransitions
FooterTransitions

Gets or sets the collection of Transition style elements that apply to the footer of an ItemsPresenter.

FooterTransitionsProperty
FooterTransitionsProperty
FooterTransitionsProperty

Identifies the FooterTransitions dependency property.

Header
Header
Header

Gets or sets the content for the items header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the items header.
HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

HeaderTransitions
HeaderTransitions
HeaderTransitions

Gets or sets the collection of Transition style elements that apply to the header of an ItemsPresenter.

HeaderTransitionsProperty
HeaderTransitionsProperty
HeaderTransitionsProperty

Identifies the HeaderTransitions dependency property.

Padding
Padding
Padding

Gets or sets the distance between the ItemsPresenter and its child objects.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.

Methods
GetIrregularSnapPoints(Orientation, SnapPointsAlignment)
GetIrregularSnapPoints(Orientation, SnapPointsAlignment)
GetIrregularSnapPoints(Orientation, SnapPointsAlignment)

Returns a read-only collection of numbers that represent the snap points for the specified orientation.

GetRegularSnapPoints(Orientation, SnapPointsAlignment, Single)


GetRegularSnapPoints(Orientation, SnapPointsAlignment, Single)
GetRegularSnapPoints(Orientation, SnapPointsAlignment, Single)

Returns an original offset and interval for equidistant snap points for the specified orientation.

Events
HorizontalSnapPointsChanged
HorizontalSnapPointsChanged
HorizontalSnapPointsChanged

Occurs when the horizontal snap points change.

VerticalSnapPointsChanged
VerticalSnapPointsChanged
VerticalSnapPointsChanged

Occurs when the vertical snap points change.

See Also
FrameworkElement
ItemsPresenter.AreHorizontalSnapPointsRegular Items
Presenter.AreHorizontalSnapPointsRegular Items
Presenter.AreHorizontalSnapPointsRegular
I n this Article
Edit
Gets a value that indicates whether the horizontal snap points for the ItemsPresenter are equidistant from each other.
public : Platform::Boolean AreHorizontalSnapPointsRegular { get; }
bool AreHorizontalSnapPointsRegular();
public bool AreHorizontalSnapPointsRegular { get; }

Returns
bool
True if the horizontal snap points for the ItemsPresenter are equidistant from each other; otherwise, false.
ItemsPresenter.AreVerticalSnapPointsRegular Items
Presenter.AreVerticalSnapPointsRegular ItemsPresenter.
AreVerticalSnapPointsRegular
I n this Article
Edit
Gets a value that indicates whether the vertical snap points for the ItemsPresenter are equidistant from each other.
public : Platform::Boolean AreVerticalSnapPointsRegular { get; }
bool AreVerticalSnapPointsRegular();
public bool AreVerticalSnapPointsRegular { get; }

Returns
bool
True if the vertical snap points for the ItemsPresenter are equidistant from each other; otherwise, false.
ItemsPresenter.Footer ItemsPresenter.Footer Items
Presenter.Footer
I n this Article
Edit
Gets or sets the content for the items footer.
public : Platform::Object Footer { get; set; }
winrt::Windows::Foundation::IInspectable Footer();

void Footer(winrt::Windows::Foundation::IInspectable footer);


public object Footer { get; set; }

<ItemsPresenter Footer="footerString"/>

Returns
object
The content of the items footer. The default is null.

Remarks
You can set a data template for the Footer by using the FooterTemplate property.
ItemsPresenter.FooterProperty ItemsPresenter.Footer
Property ItemsPresenter.FooterProperty
I n this Article
Edit
Identifies the Footer dependency property.
public : static DependencyProperty FooterProperty { get; }
static DependencyProperty FooterProperty();
public static DependencyProperty FooterProperty { get; }

Returns
DependencyProperty
The identifier for the Footer dependency property.
ItemsPresenter.FooterTemplate ItemsPresenter.Footer
Template ItemsPresenter.FooterTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the items header.
public : DataTemplate FooterTemplate { get; set; }
DataTemplate FooterTemplate();

void FooterTemplate(DataTemplate footertemplate);


public DataTemplate FooterTemplate { get; set; }

<ItemsPresenter>
<ItemsPresenter.FooterTemplate>
singleDataTemplate
</ItemsPresenter.FooterTemplate>
</ItemsPresenter>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
ItemsPresenter.FooterTemplateProperty ItemsPresenter.
FooterTemplateProperty ItemsPresenter.FooterTemplate
Property
I n this Article
Edit
Identifies the FooterTemplate dependency property.
public : static DependencyProperty FooterTemplateProperty { get; }
static DependencyProperty FooterTemplateProperty();
public static DependencyProperty FooterTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the FooterTemplate dependency property.
ItemsPresenter.FooterTransitions ItemsPresenter.Footer
Transitions ItemsPresenter.FooterTransitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to the footer of an ItemsPresenter.
public : TransitionCollection FooterTransitions { get; set; }
TransitionCollection FooterTransitions();

void FooterTransitions(TransitionCollection footertransitions);


public TransitionCollection FooterTransitions { get; set; }

<ItemsPresenter>
<ItemsPresenter.FooterTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</ItemsPresenter.FooterTransitions>
</ItemsPresenter>

Returns
TransitionCollection
The collection of Transition style elements that apply to the footer of an ItemsPresenter.

Remarks
Note

Prior to Windows 10, version 1809 (SDK 17763), the XAML syntax for properties that have a TransitionCollection
value requires that you declare an explicit TransitionCollection object element as the value, and then provide object
elements as child elements of TransitionCollection for each of the transition animations you want to use. In Windows
10, version 1809 (SDK 17763) or later, TransitionCollection supports the implicit collection usage, so you can omit the
collection object element. For more info on implicit collections and XAML, see XAML syntax guide.
Transition animations play a particular role in the UI design of your app. The basic idea is that when there is a change
or transition, the animation draws the attention of the user to the change.
See TransitionCollection
Also
ItemsPresenter.FooterTransitionsProperty ItemsPresenter.
FooterTransitionsProperty ItemsPresenter.Footer
TransitionsProperty
I n this Article
Edit
Identifies the FooterTransitions dependency property.
public : static DependencyProperty FooterTransitionsProperty { get; }
static DependencyProperty FooterTransitionsProperty();
public static DependencyProperty FooterTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the FooterTransitions dependency property.
ItemsPresenter.GetIrregularSnapPoints ItemsPresenter.
GetIrregularSnapPoints ItemsPresenter.GetIrregularSnap
Points
I n this Article
Edit
Returns a read-only collection of numbers that represent the snap points for the specified orientation.
public : IVectorView<float> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment
alignment)
IVectorView<float> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment alignment)
const;
public IReadOnlyList<float> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment
alignment)

Parameters
orientation Orientation
The orientation of the requested snap points.
alignment SnapPointsAlignment
The alignment used by the caller when applying the requested snap points.
Returns
IReadOnlyList<float>
A read-only collection of numbers that represent the snap points for the specified orientation, or an empty collection
when no snap points are present.
ItemsPresenter.GetRegularSnapPoints ItemsPresenter.Get
RegularSnapPoints ItemsPresenter.GetRegularSnapPoints
I n this Article
Edit
Returns an original offset and interval for equidistant snap points for the specified orientation.
public : float GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment alignment, float
offset)
float GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment alignment, Single const&
offset) const;
public float GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment alignment, Single
offset)

Parameters
orientation Orientation
The orientation of the requested snap points.
alignment SnapPointsAlignment
The alignment used by the caller when applying the requested snap points.
offset Single
The offset of the first snap point.
Returns
float
The interval between equidistant snap points for the specified orientation or 0 when no snap points are present.
ItemsPresenter.Header ItemsPresenter.Header Items
Presenter.Header
I n this Article
Edit
Gets or sets the content for the items header.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<ItemsPresenter Header="headerString"/>

Returns
object
The content of the items header. The default value is null.

Remarks
You can set a data template for the Header by using the HeaderTemplate property.

Windows 8.1 Header alignment is handled differently in apps compiled for Windows 8 than in apps compiled for
Windows 8.1.+ In an app compiled for Windows 8, the header is always left-aligned when the orientation of the
items is Horizontal, or top-aligned when the orientation is Vertical. VerticalAlignment and HorizontalAlignment
values that you set are ignored.

In an app compiled for Windows 8.1, you can specify the header alignment. VerticalAlignment and
HorizontalAlignment values that you set are not ignored.
ItemsPresenter.HeaderProperty ItemsPresenter.Header
Property ItemsPresenter.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
ItemsPresenter.HeaderTemplate ItemsPresenter.Header
Template ItemsPresenter.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the items header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<ItemsPresenter>
<ItemsPresenter.HeaderTemplate>
singleDataTemplate
</ItemsPresenter.HeaderTemplate>
</ItemsPresenter>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.

Remarks
Windows 8.1 Header alignment is handled differently in apps compiled for Windows 8 than in apps compiled for
Windows 8.1.+ In an app compiled for Windows 8, the header is always left-aligned when the orientation of the
items is Horizontal, or top-aligned when the orientation is Vertical. VerticalAlignment and HorizontalAlignment
values that you set are ignored.

In an app compiled for Windows 8.1, you can specify the header alignment. VerticalAlignment and
HorizontalAlignment values that you set are not ignored.
ItemsPresenter.HeaderTemplateProperty ItemsPresenter.
HeaderTemplateProperty ItemsPresenter.HeaderTemplate
Property
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
ItemsPresenter.HeaderTransitions ItemsPresenter.Header
Transitions ItemsPresenter.HeaderTransitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to the header of an ItemsPresenter.
public : TransitionCollection HeaderTransitions { get; set; }
TransitionCollection HeaderTransitions();

void HeaderTransitions(TransitionCollection headertransitions);


public TransitionCollection HeaderTransitions { get; set; }

<ItemsPresenter>
<ItemsPresenter.HeaderTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</ItemsPresenter.HeaderTransitions>
</ItemsPresenter>

Returns
TransitionCollection
The collection of Transition style elements that apply to the header of an ItemsPresenter.

Remarks
Note

Prior to Windows 10, version 1809 (SDK 17763), the XAML syntax for properties that have a TransitionCollection
value requires that you declare an explicit TransitionCollection object element as the value, and then provide object
elements as child elements of TransitionCollection for each of the transition animations you want to use. In Windows
10, version 1809 (SDK 17763) or later, TransitionCollection supports the implicit collection usage, so you can omit the
collection object element. For more info on implicit collections and XAML, see XAML syntax guide.
Transition animations play a particular role in the UI design of your app. The basic idea is that when there is a change
or transition, the animation draws the attention of the user to the change.
See TransitionCollection
Also
ItemsPresenter.HeaderTransitionsProperty ItemsPresenter.
HeaderTransitionsProperty ItemsPresenter.Header
TransitionsProperty
I n this Article
Edit
Identifies the HeaderTransitions dependency property.
public : static DependencyProperty HeaderTransitionsProperty { get; }
static DependencyProperty HeaderTransitionsProperty();
public static DependencyProperty HeaderTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTransitions dependency property.
ItemsPresenter.HorizontalSnapPointsChanged Items
Presenter.HorizontalSnapPointsChanged ItemsPresenter.
HorizontalSnapPointsChanged
I n this Article
Edit
Occurs when the horizontal snap points change.
public : event EventHandler<Platform::Object> HorizontalSnapPointsChanged
// Register
event_token HorizontalSnapPointsChanged(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void HorizontalSnapPointsChanged(event_token const& cookie) const;

// Revoke with event_revoker


HorizontalSnapPointsChanged_revoker HorizontalSnapPointsChanged(auto_revoke_t,
EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> HorizontalSnapPointsChanged

<ItemsPresenter HorizontalSnapPointsChanged="eventhandler" />


ItemsPresenter ItemsPresenter ItemsPresenter
I n this Article
Edit
Initializes a new instance of the ItemsPresenter class.

public : ItemsPresenter()
ItemsPresenter() const;
public ItemsPresenter()
ItemsPresenter.Padding ItemsPresenter.Padding Items
Presenter.Padding
I n this Article
Edit
Gets or sets the distance between the ItemsPresenter and its child objects.
public : Thickness Padding { get; set; }
Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<ItemsPresenter Padding="uniform"/>
- or -
<ItemsPresenter Padding="left&right,top&bottom"/>
- or -
<ItemsPresenter Padding="left,top,right,bottom"/>

Returns
Thickness
The dimensions of the space between the presenter and its children as a Thickness value. Thickness is a structure that
stores dimension values using pixel measures.

Remarks
A Padding value applies to presentation rendering of each presented item and also to the header (if one is specified).
A related property is Margin (a property of FrameworkElement ). For ItemsPresenter , margin and padding would
typically blend together with the division between them not being apparent in the rendering. So it's typical to specify a
Margin or a Padding, but not both. For more info about the relationship between margin and padding, see Alignment,
margin, and padding or Define layouts with XAML.
See Thickness
Also Alignment, margin, and padding
Adding ListView and GridView controls
ItemsPresenter.PaddingProperty ItemsPresenter.Padding
Property ItemsPresenter.PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
ItemsPresenter.VerticalSnapPointsChanged Items
Presenter.VerticalSnapPointsChanged ItemsPresenter.
VerticalSnapPointsChanged
I n this Article
Edit
Occurs when the vertical snap points change.
public : event EventHandler<Platform::Object> VerticalSnapPointsChanged
// Register
event_token VerticalSnapPointsChanged(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void VerticalSnapPointsChanged(event_token const& cookie) const;

// Revoke with event_revoker


VerticalSnapPointsChanged_revoker VerticalSnapPointsChanged(auto_revoke_t,
EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> VerticalSnapPointsChanged

<ItemsPresenter VerticalSnapPointsChanged="eventhandler" />


ItemsStackPanel ItemsStackPanel ItemsStackPanel Class
Arranges child elements of an ItemsControl into a single line that can be oriented horizontally or vertically. Supports
pixel-based UI virtualization and grouped layouts.

D eclaration
public : sealed class ItemsStackPanel : Panel, IItemsStackPanel, IItemsStackPanel2
struct winrt::Windows::UI::Xaml::Controls::ItemsStackPanel : Panel, IItemsStackPanel,
IItemsStackPanel2
public sealed class ItemsStackPanel : Panel, IItemsStackPanel, IItemsStackPanel2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel

Remarks
ItemsStackPanel can be used only as the ItemsPanel of an ItemsControl that displays more than one item at a time. It
can't be used with an ItemsControl that displays only one item at a time, such as a ComboBox or FlipView.
ItemsStackPanel is the default ItemsPanel for ListView.
By default, the ItemsStackPanel stacks items vertically from top to bottom. You can set the Orientation property to
Horizontal to stack items from left to right.

Constructors
ItemsStackPanel()
ItemsStackPanel()
ItemsStackPanel()

Initializes a new instance of the ItemsStackPanel class.

Properties
AreStickyGroupHeadersEnabled
AreStickyGroupHeadersEnabled
AreStickyGroupHeadersEnabled

Gets or sets a value that specifies whether a group header moves with the group when the group is panned
vertically.

AreStickyGroupHeadersEnabledProperty
AreStickyGroupHeadersEnabledProperty
AreStickyGroupHeadersEnabledProperty

Identifies the AreStickyGroupHeadersEnabled dependency property.


CacheLength
CacheLength
CacheLength

Gets or sets the size of the buffers for items outside the viewport, in multiples of the viewport size.

CacheLengthProperty
CacheLengthProperty
CacheLengthProperty

Identifies the CacheLength dependency property.

FirstCacheIndex
FirstCacheIndex
FirstCacheIndex

Gets the index in the data collection of the first item in the cache.

FirstVisibleIndex
FirstVisibleIndex
FirstVisibleIndex

Gets the index in the data collection of the first item on the screen. Partially visible items are considered to be on
screen.

GroupHeaderPlacement
GroupHeaderPlacement
GroupHeaderPlacement

Gets or sets a value that specifies where group headers are positioned in relation to the group.

GroupHeaderPlacementProperty
GroupHeaderPlacementProperty
GroupHeaderPlacementProperty

Identifies the GroupHeaderPlacement dependency property.

GroupPadding
GroupPadding
GroupPadding

Gets or sets the amount of space around a group.

GroupPaddingProperty
GroupPaddingProperty
GroupPaddingProperty

Identifies the GroupPadding dependency property.

ItemsUpdatingScrollMode
ItemsUpdatingScrollMode
ItemsUpdatingScrollMode

Gets or sets a value that specifies scrolling behavior when the ItemsSource is updated.

LastCacheIndex
LastCacheIndex
LastCacheIndex

Gets the index in the data collection of the last item in the cache.

LastVisibleIndex
LastVisibleIndex
LastVisibleIndex

Gets the index in the data collection of the last item on the screen. Partially visible items are considered to be on
screen.

Orientation
Orientation
Orientation

Gets or sets the dimension by which child elements are stacked.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the Orientation dependency property.

ScrollingDirection
ScrollingDirection
ScrollingDirection

Gets a value that indicates whether items are panning forward or backward, or aren't panning.

See Also
Panel
Orientation
ItemsStackPanel.AreStickyGroupHeadersEnabled Items
StackPanel.AreStickyGroupHeadersEnabled ItemsStack
Panel.AreStickyGroupHeadersEnabled
I n this Article
Edit
Gets or sets a value that specifies whether a group header moves with the group when the group is panned vertically.
public : Platform::Boolean AreStickyGroupHeadersEnabled { get; set; }
bool AreStickyGroupHeadersEnabled();

void AreStickyGroupHeadersEnabled(bool arestickygroupheadersenabled);


public bool AreStickyGroupHeadersEnabled { get; set; }

Returns
bool
true if the group header moves with the group when the group is panned vertically; otherwise, false. The default is
true.

Examples
<ListView>
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsStackPanel AreStickyGroupHeadersEnabled="False"/>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>

Remarks
Group headers can be sticky only when the group is panned vertically and the GroupHeaderPlacement is Top. If the
panel's Orientation is Horizontal or GroupHeaderPlacement is not Top, this property is ignored.
ItemsStackPanel.AreStickyGroupHeadersEnabledProperty
ItemsStackPanel.AreStickyGroupHeadersEnabledProperty
ItemsStackPanel.AreStickyGroupHeadersEnabledProperty
I n this Article
Edit
Identifies the AreStickyGroupHeadersEnabled dependency property.
public : static DependencyProperty AreStickyGroupHeadersEnabledProperty { get; }
static DependencyProperty AreStickyGroupHeadersEnabledProperty();
public static DependencyProperty AreStickyGroupHeadersEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the AreStickyGroupHeadersEnabled dependency property.
ItemsStackPanel.CacheLength ItemsStackPanel.Cache
Length ItemsStackPanel.CacheLength
I n this Article
Edit
Gets or sets the size of the buffers for items outside the viewport, in multiples of the viewport size.
public : double CacheLength { get; set; }
double CacheLength();

void CacheLength(double cachelength);


public double CacheLength { get; set; }

ItemsStackPanel CacheLength="double" />

Returns
double
The size of the buffers for items outside the viewport, in multiples of the viewport size. The default is 4.0.

Remarks
To improve scrolling performance, ItemsStackPanel creates and caches item containers for items that are off-screen on
both sides of the viewport. The CacheLength property specifies the size of the buffers for the off-screen items. You
specify CacheLength in multiples of the current viewport size. For example, if the CacheLength is 4.0, 2 viewports
worth of items are buffered on each side of the viewport.
You can set a smaller cache length to optimize startup time, or set a larger cache size to optimize scrolling performance.
Item containers that are off-screen are created at a lower priority than those in the viewport.
ItemsStackPanel.CacheLengthProperty ItemsStackPanel.
CacheLengthProperty ItemsStackPanel.CacheLength
Property
I n this Article
Edit
Identifies the CacheLength dependency property.
public : static DependencyProperty CacheLengthProperty { get; }
static DependencyProperty CacheLengthProperty();
public static DependencyProperty CacheLengthProperty { get; }

Returns
DependencyProperty
The identifier for the CacheLength dependency property.
ItemsStackPanel.FirstCacheIndex ItemsStackPanel.First
CacheIndex ItemsStackPanel.FirstCacheIndex
I n this Article
Edit
Gets the index in the data collection of the first item in the cache.
public : int FirstCacheIndex { get; }
int32_t FirstCacheIndex();
public int FirstCacheIndex { get; }

Returns
int
The index in the data collection of the first item in the cache. The default is -1.

Remarks
The index of the container for the very first item and the focused items are not reported if they are not in the cache.
ItemsStackPanel.FirstVisibleIndex ItemsStackPanel.First
VisibleIndex ItemsStackPanel.FirstVisibleIndex
I n this Article
Edit
Gets the index in the data collection of the first item on the screen. Partially visible items are considered to be on
screen.
public : int FirstVisibleIndex { get; }
int32_t FirstVisibleIndex();
public int FirstVisibleIndex { get; }

Returns
int
The index in the data collection of the first item on the screen. The default is -1.
ItemsStackPanel.GroupHeaderPlacement ItemsStack
Panel.GroupHeaderPlacement ItemsStackPanel.Group
HeaderPlacement
I n this Article
Edit
Gets or sets a value that specifies where group headers are positioned in relation to the group.
public : GroupHeaderPlacement GroupHeaderPlacement { get; set; }
GroupHeaderPlacement GroupHeaderPlacement();

void GroupHeaderPlacement(GroupHeaderPlacement groupheaderplacement);


public GroupHeaderPlacement GroupHeaderPlacement { get; set; }

ItemsStackPanel GroupHeaderPlacement="groupHeaderPlacementMemberName" />

Returns
GroupHeaderPlacement
An enumeration value that specifies where group headers are positioned in relation to the group. The default is Top.

Remarks
Valid values are Top and Left.
ItemsStackPanel.GroupHeaderPlacementProperty Items
StackPanel.GroupHeaderPlacementProperty ItemsStack
Panel.GroupHeaderPlacementProperty
I n this Article
Edit
Identifies the GroupHeaderPlacement dependency property.
public : static DependencyProperty GroupHeaderPlacementProperty { get; }
static DependencyProperty GroupHeaderPlacementProperty();
public static DependencyProperty GroupHeaderPlacementProperty { get; }

Returns
DependencyProperty
The identifier for the GroupHeaderPlacement dependency property.
ItemsStackPanel.GroupPadding ItemsStackPanel.Group
Padding ItemsStackPanel.GroupPadding
I n this Article
Edit
Gets or sets the amount of space around a group.
public : Thickness GroupPadding { get; set; }
Thickness GroupPadding();

void GroupPadding(Thickness grouppadding);


public Thickness GroupPadding { get; set; }

<ItemsStackPanel GroupPadding="uniform"/>
- or -
<ItemsStackPanel GroupPadding="left&right,top&bottom"/>
- or -
<ItemsStackPanel GroupPadding="left,top,right,bottom"/>

Returns
Thickness
The amount of space around a group as a Thickness value. Thickness is a structure that stores dimension values using
pixel measures. The default is a uniform Thickness of 0.
ItemsStackPanel.GroupPaddingProperty ItemsStackPanel.
GroupPaddingProperty ItemsStackPanel.GroupPadding
Property
I n this Article
Edit
Identifies the GroupPadding dependency property.
public : static DependencyProperty GroupPaddingProperty { get; }
static DependencyProperty GroupPaddingProperty();
public static DependencyProperty GroupPaddingProperty { get; }

Returns
DependencyProperty
The identifier for the GroupPadding dependency property.
ItemsStackPanel ItemsStackPanel ItemsStackPanel
I n this Article
Edit
Initializes a new instance of the ItemsStackPanel class.

public : ItemsStackPanel()
ItemsStackPanel() const;
public ItemsStackPanel()
ItemsStackPanel.ItemsUpdatingScrollMode ItemsStack
Panel.ItemsUpdatingScrollMode ItemsStackPanel.Items
UpdatingScrollMode
I n this Article
Edit
Gets or sets a value that specifies scrolling behavior when the ItemsSource is updated.
public : ItemsUpdatingScrollMode ItemsUpdatingScrollMode { get; set; }
ItemsUpdatingScrollMode ItemsUpdatingScrollMode();

void ItemsUpdatingScrollMode(ItemsUpdatingScrollMode itemsupdatingscrollmode);


public ItemsUpdatingScrollMode ItemsUpdatingScrollMode { get; set; }

<ItemsStackPanel ItemsUpdatingScrollMode="itemsUpdatingScrollModeMemberName" />

Returns
ItemsUpdatingScrollMode
A value of the enumeration. The default is KeepItemsInView.

Remarks
This property controls how the ItemsStackPanel responds when the user has scrolled the items, and new items are
added to the ItemsSource.
For example, if a user scrolls down a list of emails, and the ItemsSource updates, adding a new email to the top of the
list:
If ItemsUpdatingScrollMode is KeepItemsInView, then the scroll offset is adjusted to keep the first visible item
showing at the top of the view.
If ItemsUpdatingScrollMode is KeepScrollOffset, then the scroll offset relative to the top of the list is maintained. As a
result, the items on the screen are pushed down to account for the new item added at the top.
In other cases, like in a chat app, items are added to the bottom of the list. In this case, you can set
ItemsUpdatingScrollMode to KeepLastItemInView. This adjusts the scroll offset to keep the last visible item showing
at the bottom of the view. (KeepLastItemInView is available starting with Windows 10, version 1607.)
 Tip

In Windows 8, the ListView control uses VirtualizingStackPanel as its default ItemsPanel; in Windows 8.1, the ListView
control uses ItemsStackPanel as its default ItemsPanel. When upgrading a ListView in a Windows 8 app to use
ItemsStackPanel, set the ItemsUpdatingScrollMode property to KeepScrollOffset if you need to keep the behavior of
the Windows 8 ListView.
ItemsStackPanel.LastCacheIndex ItemsStackPanel.Last
CacheIndex ItemsStackPanel.LastCacheIndex
I n this Article
Edit
Gets the index in the data collection of the last item in the cache.
public : int LastCacheIndex { get; }
int32_t LastCacheIndex();
public int LastCacheIndex { get; }

Returns
int
The index in the data collection of the last item in the cache. The default is -1.
ItemsStackPanel.LastVisibleIndex ItemsStackPanel.Last
VisibleIndex ItemsStackPanel.LastVisibleIndex
I n this Article
Edit
Gets the index in the data collection of the last item on the screen. Partially visible items are considered to be on screen.
public : int LastVisibleIndex { get; }
int32_t LastVisibleIndex();
public int LastVisibleIndex { get; }

Returns
int
The index in the data collection of the last item on the screen. The default is -1.
ItemsStackPanel.Orientation ItemsStackPanel.Orientation
ItemsStackPanel.Orientation
I n this Article
Edit
Gets or sets the dimension by which child elements are stacked.
public : Orientation Orientation { get; set; }
Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

ItemsStackPanel Orientation="orientationMemberName" />

Returns
Orientation
One of the enumeration values that specifies the orientation of child elements. The default is Vertical.
ItemsStackPanel.OrientationProperty ItemsStackPanel.
OrientationProperty ItemsStackPanel.Orientation
Property
I n this Article
Edit
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
ItemsStackPanel.ScrollingDirection ItemsStackPanel.
ScrollingDirection ItemsStackPanel.ScrollingDirection
I n this Article
Edit
Gets a value that indicates whether items are panning forward or backward, or aren't panning.
public : PanelScrollingDirection ScrollingDirection { get; }
PanelScrollingDirection ScrollingDirection();
public PanelScrollingDirection ScrollingDirection { get; }

Returns
PanelScrollingDirection
An enumeration value that indicates whether the items are panning Forward or Backward, or None if the items are
not panning.
ItemsUpdatingScrollMode ItemsUpdatingScrollMode
ItemsUpdatingScrollMode Enum
Defines constants that specify the scrolling behavior of items while updating.

D eclaration
public : enum class ItemsUpdatingScrollMode
enum class winrt::Windows::UI::Xaml::Controls::ItemsUpdatingScrollMode : int32_t
public enum ItemsUpdatingScrollMode

I nheritance H ierarchy
None

Remarks
See ItemsStackPanel.ItemsUpdatingScrollMode for more info.
Version history
V ER S IO N S D K V ER S IO N V ALU E AD D ED

1607 14393 KeepLastItemInView

Fields
KeepItemsInView Adjusts the scroll offset to keep the first visible item in the viewport when items are
KeepItemsInView added to the ItemsSource.
KeepItemsInView

KeepLastItemInView Adjusts the scroll offset to keep the last visible item in the viewport when items are
KeepLastItemInView added to the ItemsSource.
KeepLastItemInView

KeepScrollOffset Maintains the scroll offset relative to the beginning of the list, forcing items in the
KeepScrollOffset viewport to move down when items are added to the ItemsSource.
KeepScrollOffset
ItemsWrapGrid ItemsWrapGrid ItemsWrapGrid Class
Positions child elements sequentially from left to right or top to bottom in an ItemsControl that shows multiple items.
When elements extend beyond the container edge, elements are positioned in the next row or column. Supports pixel-
based UI virtualization and grouped layouts.

D eclaration
public : sealed class ItemsWrapGrid : Panel, IItemsWrapGrid, IItemsWrapGrid2
struct winrt::Windows::UI::Xaml::Controls::ItemsWrapGrid : Panel, IItemsWrapGrid,
IItemsWrapGrid2
public sealed class ItemsWrapGrid : Panel, IItemsWrapGrid, IItemsWrapGrid2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel

Remarks
ItemsWrapGrid can be used only as the ItemsPanel of an ItemsControl that displays more than one item at a time. It
can't be used with an ItemsControl that displays only one item at a time, such as a ComboBox or FlipView.
ItemsWrapGrid is the default ItemsPanel for GridView.
In an ItemsWrapGrid, elements are arranged in rows or columns that automatically wrap to a new row or column
when the elements reach the container edge. If the MaximumRowsOrColumns property is set, items wrap when the
specified number of rows or columns is reached instead.
Orientation
You set the Orientation property to specify whether the grid adds its items in rows or columns before wrapping. The
default is Orientation.Vertical.
Note

For Universal Windows Platform (UWP ) app on Windows 10, the default GridView template sets the Orientation to
Horizontal.
When the value is Vertical, the grid adds items in columns from top to bottom, then wraps from left to right. Columns
of items scroll or pan horizontally.

Item 1 Item 4 Item 7

Item 2 Item 5 Item 8

Item 3 Item 6 Item 9

When the value is Horizontal, the grid adds items in rows from left to right, then wraps from top to bottom. Rows of
items scroll or pan vertically.

Item 1 Item 2 Item 3


Item 4 Item 5 Item 6

Item 7 Item 8 Item 9

Constructors
ItemsWrapGrid()
ItemsWrapGrid()
ItemsWrapGrid()

Initializes a new instance of the ItemsWrapGrid class.

Properties
AreStickyGroupHeadersEnabled
AreStickyGroupHeadersEnabled
AreStickyGroupHeadersEnabled

Gets or sets a value that specifies whether a group header moves with the group when the group is panned
vertically.

AreStickyGroupHeadersEnabledProperty
AreStickyGroupHeadersEnabledProperty
AreStickyGroupHeadersEnabledProperty

Identifies the AreStickyGroupHeadersEnabled dependency property.

CacheLength
CacheLength
CacheLength

Gets or sets the size of the buffers for items outside the viewport, in multiples of the viewport size.

CacheLengthProperty
CacheLengthProperty
CacheLengthProperty

Identifies the CacheLength dependency property.

FirstCacheIndex
FirstCacheIndex
FirstCacheIndex

Gets the index in the data collection of the first item in the cache.

FirstVisibleIndex
FirstVisibleIndex
FirstVisibleIndex

Gets the index in the data collection of the first item on the screen. Partially visible items are considered to be on
screen.

GroupHeaderPlacement
GroupHeaderPlacement
GroupHeaderPlacement

Gets or sets a value that specifies where group headers are positioned in relation to the group.

GroupHeaderPlacementProperty
GroupHeaderPlacementProperty
GroupHeaderPlacementProperty

Identifies the GroupHeaderPlacement dependency property.

GroupPadding
GroupPadding
GroupPadding

Gets or sets the amount of space around a group.

GroupPaddingProperty
GroupPaddingProperty
GroupPaddingProperty

Identifies the GroupPadding dependency property.

ItemHeight
ItemHeight
ItemHeight

Gets or sets the height of the layout area for each item that is contained in an ItemsWrapGrid.

ItemHeightProperty
ItemHeightProperty
ItemHeightProperty

Identifies the ItemHeight dependency property.

ItemWidth
ItemWidth
ItemWidth
Gets or sets the width of the layout area for each item that is contained in an ItemsWrapGrid.

ItemWidthProperty
ItemWidthProperty
ItemWidthProperty

Identifies the ItemWidth dependency property.

LastCacheIndex
LastCacheIndex
LastCacheIndex

Gets the index in the data collection of the last item in the cache.

LastVisibleIndex
LastVisibleIndex
LastVisibleIndex

Gets the index in the data collection of the last item on the screen. Partially visible items are considered to be on
screen.

MaximumRowsOrColumns
MaximumRowsOrColumns
MaximumRowsOrColumns

Gets or sets a value that influences the wrap point, also accounting for Orientation.

MaximumRowsOrColumnsProperty
MaximumRowsOrColumnsProperty
MaximumRowsOrColumnsProperty

Identifies the MaximumRowsOrColumns dependency property.

Orientation
Orientation
Orientation

Gets or sets the dimension by which child elements are stacked.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the Orientation dependency property.


ScrollingDirection
ScrollingDirection
ScrollingDirection

Gets a value that indicates whether items are panning forward or backward, or aren't panning.

See Also
Panel
Orientation
ItemsWrapGrid.AreStickyGroupHeadersEnabled Items
WrapGrid.AreStickyGroupHeadersEnabled ItemsWrap
Grid.AreStickyGroupHeadersEnabled
I n this Article
Edit
Gets or sets a value that specifies whether a group header moves with the group when the group is panned vertically.
public : Platform::Boolean AreStickyGroupHeadersEnabled { get; set; }
bool AreStickyGroupHeadersEnabled();

void AreStickyGroupHeadersEnabled(bool arestickygroupheadersenabled);


public bool AreStickyGroupHeadersEnabled { get; set; }

Returns
bool
true if the group header moves with the group when the group is panned vertically; otherwise, false. The default is
true.

Examples
<GridView>
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid AreStickyGroupHeadersEnabled="False" Orientation="Horizontal"/>
</ItemsPanelTemplate>
</GridView.ItemsPanel>
</GridView>

Remarks
Group headers can be sticky only when the group is panned vertically and the GroupHeaderPlacement is Top. If the
panel's Orientation is Horizontal or GroupHeaderPlacement is not Top, this property is ignored.
ItemsWrapGrid.AreStickyGroupHeadersEnabledProperty
ItemsWrapGrid.AreStickyGroupHeadersEnabledProperty
ItemsWrapGrid.AreStickyGroupHeadersEnabledProperty
I n this Article
Edit
Identifies the AreStickyGroupHeadersEnabled dependency property.
public : static DependencyProperty AreStickyGroupHeadersEnabledProperty { get; }
static DependencyProperty AreStickyGroupHeadersEnabledProperty();
public static DependencyProperty AreStickyGroupHeadersEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the AreStickyGroupHeadersEnabled dependency property.
ItemsWrapGrid.CacheLength ItemsWrapGrid.Cache
Length ItemsWrapGrid.CacheLength
I n this Article
Edit
Gets or sets the size of the buffers for items outside the viewport, in multiples of the viewport size.
public : double CacheLength { get; set; }
double CacheLength();

void CacheLength(double cachelength);


public double CacheLength { get; set; }

ItemsWrapGrid CacheLength="double" />

Returns
double
The size of the buffers for items outside the viewport, in multiples of the viewport size. The default is 4.0.

Remarks
To improve scrolling performance, ItemsWrapGrid creates and caches item containers for items that are off-screen on
both sides of the viewport. The CacheLength property specifies the size of the buffers for the off-screen items. You
specify CacheLength in multiples of the current viewport size. For example, if the CacheLength is 4.0, 2 viewports
worth of items are buffered on each side of the viewport.
You can set a smaller cache length to optimize startup time, or set a larger cache size to optimize scrolling performance.
Item containers that are off-screen are created at a lower priority than those in the viewport.
ItemsWrapGrid.CacheLengthProperty ItemsWrapGrid.
CacheLengthProperty ItemsWrapGrid.CacheLength
Property
I n this Article
Edit
Identifies the CacheLength dependency property.
public : static DependencyProperty CacheLengthProperty { get; }
static DependencyProperty CacheLengthProperty();
public static DependencyProperty CacheLengthProperty { get; }

Returns
DependencyProperty
The identifier for the CacheLength dependency property.
ItemsWrapGrid.FirstCacheIndex ItemsWrapGrid.First
CacheIndex ItemsWrapGrid.FirstCacheIndex
I n this Article
Edit
Gets the index in the data collection of the first item in the cache.
public : int FirstCacheIndex { get; }
int32_t FirstCacheIndex();
public int FirstCacheIndex { get; }

Returns
int
The index in the data collection of the first item in the cache. The default is -1.

Remarks
The index of the container for the very first item and the focused items are not reported if they are not in the cache.
ItemsWrapGrid.FirstVisibleIndex ItemsWrapGrid.First
VisibleIndex ItemsWrapGrid.FirstVisibleIndex
I n this Article
Edit
Gets the index in the data collection of the first item on the screen. Partially visible items are considered to be on
screen.
public : int FirstVisibleIndex { get; }
int32_t FirstVisibleIndex();
public int FirstVisibleIndex { get; }

Returns
int
The index in the data collection of the first item on the screen. The default is -1.
ItemsWrapGrid.GroupHeaderPlacement ItemsWrapGrid.
GroupHeaderPlacement ItemsWrapGrid.GroupHeader
Placement
I n this Article
Edit
Gets or sets a value that specifies where group headers are positioned in relation to the group.
public : GroupHeaderPlacement GroupHeaderPlacement { get; set; }
GroupHeaderPlacement GroupHeaderPlacement();

void GroupHeaderPlacement(GroupHeaderPlacement groupheaderplacement);


public GroupHeaderPlacement GroupHeaderPlacement { get; set; }

ItemsWrapGrid GroupHeaderPlacement="groupHeaderPlacementMemberName" />

Returns
GroupHeaderPlacement
An enumeration value that specifies where group headers are positioned in relation to the group. The default is Top.

Remarks
Valid values are Top and Left.
ItemsWrapGrid.GroupHeaderPlacementProperty Items
WrapGrid.GroupHeaderPlacementProperty ItemsWrap
Grid.GroupHeaderPlacementProperty
I n this Article
Edit
Identifies the GroupHeaderPlacement dependency property.
public : static DependencyProperty GroupHeaderPlacementProperty { get; }
static DependencyProperty GroupHeaderPlacementProperty();
public static DependencyProperty GroupHeaderPlacementProperty { get; }

Returns
DependencyProperty
The identifier for the GroupHeaderPlacement dependency property.
ItemsWrapGrid.GroupPadding ItemsWrapGrid.Group
Padding ItemsWrapGrid.GroupPadding
I n this Article
Edit
Gets or sets the amount of space around a group.
public : Thickness GroupPadding { get; set; }
Thickness GroupPadding();

void GroupPadding(Thickness grouppadding);


public Thickness GroupPadding { get; set; }

<ItemsWrapGrid GroupPadding="uniform"/>
- or -
<ItemsWrapGrid GroupPadding="left&right,top&bottom"/>
- or -
<ItemsWrapGrid GroupPadding="left,top,right,bottom"/>

Returns
Thickness
The amount of space around a group as a Thickness value. Thickness is a structure that stores dimension values using
pixel measures. The default is a uniform Thickness of 0.
ItemsWrapGrid.GroupPaddingProperty ItemsWrapGrid.
GroupPaddingProperty ItemsWrapGrid.GroupPadding
Property
I n this Article
Edit
Identifies the GroupPadding dependency property.
public : static DependencyProperty GroupPaddingProperty { get; }
static DependencyProperty GroupPaddingProperty();
public static DependencyProperty GroupPaddingProperty { get; }

Returns
DependencyProperty
The identifier for the GroupPadding dependency property.
ItemsWrapGrid.ItemHeight ItemsWrapGrid.ItemHeight
ItemsWrapGrid.ItemHeight
I n this Article
Edit
Gets or sets the height of the layout area for each item that is contained in an ItemsWrapGrid.
public : double ItemHeight { get; set; }
double ItemHeight();

void ItemHeight(double itemheight);


public double ItemHeight { get; set; }

<ItemsWrapGrid ItemHeight="double" />

Returns
double
The height of the layout area for each item that is contained in an ItemsWrapGrid. The default is Double.NaN, which
results in the "Auto" layout behavior.

Remarks
"Auto" layout and D ouble.NaN
The default value of ItemHeight and ItemWidth is not 0, it is Double.NaN. ItemHeight and ItemWidth support the
ability to be an unset "Auto" value. Because ItemHeight and ItemWidth are Double values, Double.NaN is used as a
special value to represent this "Auto" behavior. The layout system interprets the "Auto" value to generally mean that
the object should be sized to the available size in layout, instead of to a specific pixel value. If you want the "Auto"
behavior for an object when it is used in layout, leave ItemHeight and ItemWidth unset at their Double.NaN default
value. If you have previously set values and want to reenable the "Auto" behavior with run-time code, set to
Double.NaN. In XAML such as templates, you can set attribute values using the string "Auto".
Note

Visual C++ component extensions (C++/CX) doesn't have a constant for NaN, it uses a value, which appears as "-
1.#IND" followed by zeros.
ItemsWrapGrid.ItemHeightProperty ItemsWrapGrid.Item
HeightProperty ItemsWrapGrid.ItemHeightProperty
I n this Article
Edit
Identifies the ItemHeight dependency property.
public : static DependencyProperty ItemHeightProperty { get; }
static DependencyProperty ItemHeightProperty();
public static DependencyProperty ItemHeightProperty { get; }

Returns
DependencyProperty
The identifier for the ItemHeight dependency property.
ItemsWrapGrid ItemsWrapGrid ItemsWrapGrid
I n this Article
Edit
Initializes a new instance of the ItemsWrapGrid class.

public : ItemsWrapGrid()
ItemsWrapGrid() const;
public ItemsWrapGrid()
ItemsWrapGrid.ItemWidth ItemsWrapGrid.ItemWidth
ItemsWrapGrid.ItemWidth
I n this Article
Edit
Gets or sets the width of the layout area for each item that is contained in an ItemsWrapGrid.
public : double ItemWidth { get; set; }
double ItemWidth();

void ItemWidth(double itemwidth);


public double ItemWidth { get; set; }

<ItemsWrapGrid ItemWidth="double" />

Returns
double
The width of the layout area for each item that is contained in an ItemsWrapGrid. The default is Double.NaN, which
results in the "Auto" layout behavior.

Remarks
"Auto" layout and D ouble.NaN
The default value of ItemHeight and ItemWidth is not 0, it is Double.NaN. ItemHeight and ItemWidth support the
ability to be an unset "Auto" value. Because ItemHeight and ItemWidth are Double values, Double.NaN is used as a
special value to represent this "Auto" behavior. The layout system interprets the "Auto" value to generally mean that
the object should be sized to the available size in layout, instead of to a specific pixel value. If you want the "Auto"
behavior for an object when it is used in layout, leave ItemHeight and ItemWidth unset at their Double.NaN default
value. If you have previously set values and want to reenable the "Auto" behavior with run-time code, set to
Double.NaN. In XAML such as templates, you can set attribute values using the string "Auto".
Note

Visual C++ component extensions (C++/CX) doesn't have a constant for NaN, it uses a value, which appears as "-
1.#IND" followed by zeros.
ItemsWrapGrid.ItemWidthProperty ItemsWrapGrid.Item
WidthProperty ItemsWrapGrid.ItemWidthProperty
I n this Article
Edit
Identifies the ItemWidth dependency property.
public : static DependencyProperty ItemWidthProperty { get; }
static DependencyProperty ItemWidthProperty();
public static DependencyProperty ItemWidthProperty { get; }

Returns
DependencyProperty
The identifier for the ItemWidth dependency property.
ItemsWrapGrid.LastCacheIndex ItemsWrapGrid.Last
CacheIndex ItemsWrapGrid.LastCacheIndex
I n this Article
Edit
Gets the index in the data collection of the last item in the cache.
public : int LastCacheIndex { get; }
int32_t LastCacheIndex();
public int LastCacheIndex { get; }

Returns
int
The index in the data collection of the last item in the cache. The default is -1.
ItemsWrapGrid.LastVisibleIndex ItemsWrapGrid.Last
VisibleIndex ItemsWrapGrid.LastVisibleIndex
I n this Article
Edit
Gets the index in the data collection of the last item on the screen. Partially visible items are considered to be on screen.
public : int LastVisibleIndex { get; }
int32_t LastVisibleIndex();
public int LastVisibleIndex { get; }

Returns
int
The index in the data collection of the last item on the screen. The default is -1.
ItemsWrapGrid.MaximumRowsOrColumns ItemsWrap
Grid.MaximumRowsOrColumns ItemsWrapGrid.Maximum
RowsOrColumns
I n this Article
Edit
Gets or sets a value that influences the wrap point, also accounting for Orientation.
public : int MaximumRowsOrColumns { get; set; }
int32_t MaximumRowsOrColumns();

void MaximumRowsOrColumns(int32_t maximumrowsorcolumns);


public int MaximumRowsOrColumns { get; set; }

<ItemsWrapGrid MaximumRowsOrColumns="int" />

Returns
int
The maximum rows or columns that this ItemsWrapGrid should present before it introduces wrapping to the layout.
The default is -1, which is a special value that indicates no maximum.
ItemsWrapGrid.MaximumRowsOrColumnsProperty Items
WrapGrid.MaximumRowsOrColumnsProperty ItemsWrap
Grid.MaximumRowsOrColumnsProperty
I n this Article
Edit
Identifies the MaximumRowsOrColumns dependency property.
public : static DependencyProperty MaximumRowsOrColumnsProperty { get; }
static DependencyProperty MaximumRowsOrColumnsProperty();
public static DependencyProperty MaximumRowsOrColumnsProperty { get; }

Returns
DependencyProperty
The identifier for the MaximumRowsOrColumns dependency property.
ItemsWrapGrid.Orientation ItemsWrapGrid.Orientation
ItemsWrapGrid.Orientation
I n this Article
Edit
Gets or sets the dimension by which child elements are stacked.
public : Orientation Orientation { get; set; }
Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

ItemsWrapGrid Orientation="orientationMemberName" />

Returns
Orientation
One of the enumeration values that specifies the orientation of child elements. The default is Vertical.

Remarks
Note

ItemsWrapGrid is the default ItemsPanel for GridView. For Universal Windows Platform (UWP ) app on Windows 10,
the default GridView template sets the Orientation to Horizontal.
ItemsWrapGrid.OrientationProperty ItemsWrapGrid.
OrientationProperty ItemsWrapGrid.OrientationProperty
I n this Article
Edit
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
ItemsWrapGrid.ScrollingDirection ItemsWrapGrid.
ScrollingDirection ItemsWrapGrid.ScrollingDirection
I n this Article
Edit
Gets a value that indicates whether items are panning forward or backward, or aren't panning.
public : PanelScrollingDirection ScrollingDirection { get; }
PanelScrollingDirection ScrollingDirection();
public PanelScrollingDirection ScrollingDirection { get; }

Returns
PanelScrollingDirection
An enumeration value that indicates whether the items are panning Forward or Backward, or None if the items are
not panning.
LightDismissOverlayMode LightDismissOverlayMode
LightDismissOverlayMode Enum
Defines constants that specify whether the area outside of a light-dismiss UI is darkened.

D eclaration
public : enum class LightDismissOverlayMode
enum class winrt::Windows::UI::Xaml::Controls::LightDismissOverlayMode : int32_t
public enum LightDismissOverlayMode

I nheritance H ierarchy
None

Remarks
Transient UI, such as a Flyout or the open drop-down of a ComboBox, closes when you click or tap outside of it. This is
called light-dismiss. "Overlay" refers to the area outside of a light-dismiss UI.
By default, the "overlay" is darkened on the Xbox, and not darkened on other devices families. You can set
LightDismissOverlayMode to On to make your app darken the "overlay" area on all device families, or set it to Off to
not darken the "overlay" area on all device families.

Fields
Auto Auto The device-family the app is running on determines whether the area outside of a light-dismiss UI is
Auto darkened.

Off Off Off The area outside of a light-dismiss UI is not darkened for all device families.

On On On The area outside of a light-dismiss UI is darkened for all device families.


ListBox ListBox ListBox Class
Presents a list of items the user can select from.

D eclaration
public : class ListBox : Selector, IListBox, IListBox2
struct winrt::Windows::UI::Xaml::Controls::ListBox : Selector, IListBox, IListBox2
public class ListBox : Selector, IListBox, IListBox2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Selector

Remarks
 Tip

For more info, design guidance, and code examples, see Lists.
ListBox lets users select from a pre-defined list of options presented like a text control. Use a ListBox when you want
the options to be visible all the time or when users can select more than one option at a time. ListBox controls are
always open, so several items can be displayed without user interaction.

Note

ListBox is useful when you are upgrading a Universal Windows 8 app that uses ListBox, and need to minimize changes.
For new apps in Windows 10, we recommend using the ListView control instead.
Using a ListB ox
Use a ListBox control to present a list of items that a user can select from. More than one item in a ListBox control is
visible at a time. You specify whether the ListBox control allows multiple selections by setting the SelectionMode
property. You can get or set the selected items for the list box by using the SelectedItems property.
Populating a ListB ox
You populate the ListBox control by adding UIElement items directly to the Items collection, or by binding the
ItemsSource property to a data source. ItemsSource items from data will initially clear the Items collection when the
binding is evaluated, so don't set both properties.
ListBox has a dedicated control for its items, ListBoxItem. But when you populate the Items collection, you can use
elements or data, you don't typically use explicit ListBoxItem objects. What happens internally is that when the ListBox
composes its visual tree from its templates, specifically when expanding the ItemTemplate, it creates a ListBoxItem
wrapper for each of the objects it's including as items. At run time, the Items collection still contains the original items
you declared. The created ListBoxItem wrappers are deeper in the visual tree, inside the items panel (see ItemsPanel )
as its children. You don't usually need direct access to a ListBoxItem object. But if you want to access the created
ListBoxItem wrappers, you can use Microsoft UI Automation techniques, or use VisualTreeHelper APIs, to walk into the
object tree representation and find them.
ListB ox vs. ListV iew and G ridV iew
ListBox has many similarities with ListView or GridView (they share the parent class ItemsControl ), but each control is
oriented towards different scenarios. ListBox is best for general UI composition, particularly when the elements are
always intended to be selectable, whereas ListView or GridView are best for data binding scenarios, particularly if
virtualization or large data sets are involved. For more info on virtualization, see Using virtualization with a list or grid.

Constructors
ListBox()
ListBox()
ListBox()

Initializes a new instance of the ListBox class.

Properties
SelectedItems
SelectedItems
SelectedItems

Gets the list of currently selected items for the ListBox control.

SelectionMode
SelectionMode
SelectionMode

Gets or sets the selection behavior for the ListBox control.

SelectionModeProperty
SelectionModeProperty
SelectionModeProperty

Identifies the SelectionMode dependency property.

SingleSelectionFollowsFocus
SingleSelectionFollowsFocus
SingleSelectionFollowsFocus

Gets or sets a value that indicates whether item selection changes when keyboard focus changes.

SingleSelectionFollowsFocusProperty
SingleSelectionFollowsFocusProperty
SingleSelectionFollowsFocusProperty

Identifies the SingleSelectionFollowsFocus dependency property.

Methods
ScrollIntoView(Object)
ScrollIntoView(Object)
ScrollIntoView(Object)

Causes the object to scroll into view.

SelectAll()
SelectAll()
SelectAll()

Selects all the items in the ListBox control.

See Also
Selector
ItemsControl
Selector
Selector
Selector
ListBox ListBox ListBox
I n this Article
Edit
Initializes a new instance of the ListBox class.

public : ListBox()
ListBox() const;
public ListBox()
ListBox.ScrollIntoView ListBox.ScrollIntoView ListBox.
ScrollIntoView
I n this Article
Edit
Causes the object to scroll into view.
public : void ScrollIntoView(Platform::Object item)
void ScrollIntoView(winrt::Windows::Foundation::IInspectable item) const;
public void ScrollIntoView(Object item)

Parameters
item Object
The object to scroll to.

Remarks
When the contents of the ItemsSource collection changes, particularly if many items are added to or removed from the
collection, you might need to call UpdateLayout prior to calling ScrollIntoView for the specified item to scroll into the
viewport.
ListBox.SelectAll ListBox.SelectAll ListBox.SelectAll
I n this Article
Edit
Selects all the items in the ListBox control.

public : void SelectAll()


void SelectAll() const;
public void SelectAll()

Examples
if (listBox.SelectionMode != SelectionMode.Single)
{
listBox.SelectAll();
}

if (listBox().SelectionMode() != Windows::UI::Xaml::Controls::SelectionMode::Single)
{
listBox().SelectAll();
}

If listBox.SelectionMode <> SelectionMode.Single Then


listBox.SelectAll()
End If

Remarks
W arning

The SelectAll method should only be called when the SelectionMode property is set to Multiple or Extended. If
SelectAll is called when the SelectionMode is Single, an exception is thrown.
ListBox.SelectedItems ListBox.SelectedItems ListBox.
SelectedItems
I n this Article
Edit
Gets the list of currently selected items for the ListBox control.
public : IVector<Platform::Object> SelectedItems { get; }
IVector<winrt::Windows::Foundation::IInspectable> SelectedItems();
public IList<object> SelectedItems { get; }

Returns
IList<object>
The list of currently selected items for the ListBox control.

Remarks
When SelectionMode is Multiple or Extended, use the SelectedItems property to get the items that are selected.
When SelectionMode is Single, use the Selector.SelectedItem property to get the item that's selected.
See SelectedItem
Also SelectedIndex
SelectionChanged
ListBox.SelectionMode ListBox.SelectionMode ListBox.
SelectionMode
I n this Article
Edit
Gets or sets the selection behavior for the ListBox control.
public : SelectionMode SelectionMode { get; set; }
SelectionMode SelectionMode();

void SelectionMode(SelectionMode selectionmode);


public SelectionMode SelectionMode { get; set; }

<ListBox SelectionMode="selectionModeValue"/>

Returns
SelectionMode
One of the SelectionMode values.

Remarks
By default, a user can select a single item in a ListBox. You can set the ListBox.SelectionMode property to a
SelectionMode enumeration value to enable multi-selection. Here are the selection mode values.

@Windows.UI.Xaml.Controls.SelectionMode?text=Single A user can select a single item using the space bar, mouse
click, or touch tap. A user can deselect an item using a
downward swipe gesture.
While pressing Ctrl: a user can deselect the item by using the
space bar, mouse click, or touch tap. Using the arrow keys, a
user can move focus independently of selection.

@Windows.UI.Xaml.Controls.ListViewSelectionMode? A user can select multiple items using the space bar, mouse
text=Multiple click, or touch tap to toggle selection on the focused item.
Using the arrow keys, a user can move focus independently of
selection.

@Windows.UI.Xaml.Controls.ListViewSelectionMode? With no modifier keys: the behavior is the same as


text=Extended @Windows.UI.Xaml.Controls.ListViewSelectionMode?
text=Single selection.
While pressing Ctrl: a user can select multiple items using the
space bar, mouse click, or touch tap to toggle selection on the
focused item. Using the arrow keys, a user can move focus
independently of selection.
While pressing Shift: a user can select multiple contiguous
items by clicking or tapping the first item in the selection and
then the last item in the selection. Using the arrow keys, a
user can create a contiguous selection starting with the item
selected when Shift is pressed.

When SelectionMode is Single, use the Selector.SelectedItem property to get the item that's selected. When
SelectionMode is Multiple or Extended, use the SelectedItems property to get the items that are selected.
See SelectedItem
Also
ListBox.SelectionModeProperty ListBox.SelectionMode
Property ListBox.SelectionModeProperty
I n this Article
Edit
Identifies the SelectionMode dependency property.
public : static DependencyProperty SelectionModeProperty { get; }
static DependencyProperty SelectionModeProperty();
public static DependencyProperty SelectionModeProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionMode dependency property.
ListBox.SingleSelectionFollowsFocus ListBox.Single
SelectionFollowsFocus ListBox.SingleSelectionFollows
Focus
I n this Article
Edit
Gets or sets a value that indicates whether item selection changes when keyboard focus changes.
public : Platform::Boolean SingleSelectionFollowsFocus { get; set; }
bool SingleSelectionFollowsFocus();

void SingleSelectionFollowsFocus(bool singleselectionfollowsfocus);


public bool SingleSelectionFollowsFocus { get; set; }

<ListBox SingleSelectionFollowsFocus="bool" />

Returns
bool
true if item selection changes when keyboard focus changes; otherwise, false. The default is true.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
This property is ignored if the list box's SelectionMode property is not set to Single.
By default, when a list box is configured for single selection, when the user moves keyboard focus to an item, the
focused item is also selected. For example, if keyboard focus is moved from the first item to the second item, the
SelectedIndex property is updated from 0 to 1.
Set this property to false to let a user move focus without the item selection following. For example, if each selection
change causes significant UI updates, you might prefer to let the user move focus to a non-adjacent item and then
press enter to update selection.
Version compatibility
The SingleSelectionFollowsFocus property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<ListBox x:Name="listBox1" Loaded="ListBox_Loaded"/>
private void ListBox_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.ListBox",
"SingleSelectionFollowsFocus"))
{
listBox1.SingleSelectionFollowsFocus = false;
}
}
ListBox.SingleSelectionFollowsFocusProperty ListBox.
SingleSelectionFollowsFocusProperty ListBox.Single
SelectionFollowsFocusProperty
I n this Article
Edit
Identifies the SingleSelectionFollowsFocus dependency property.
public : static DependencyProperty SingleSelectionFollowsFocusProperty { get; }
static DependencyProperty SingleSelectionFollowsFocusProperty();
public static DependencyProperty SingleSelectionFollowsFocusProperty { get; }

Returns
DependencyProperty
The identifier for the SingleSelectionFollowsFocus dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


ListBoxItem ListBoxItem ListBoxItem Class
Represents the container for an item in a ListBox control.

D eclaration
public : class ListBoxItem : SelectorItem, IListBoxItem
struct winrt::Windows::UI::Xaml::Controls::ListBoxItem : SelectorItem, IListBoxItem
public class ListBoxItem : SelectorItem, IListBoxItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem

Remarks
The ListBoxItem class provides the container for items displayed in a ListBox control. You populate the ListBox by
adding ListBoxItem s directly to its Items collection or by binding its ItemsSource property to a data source. When
items are added to the ListBox, a ListBoxItem container is created automatically for each item in the collection.
You can specify the look of the ListBoxItem by setting the ListBox 's ItemContainerStyle property to a Style with a
TargetType of ListBoxItem.

Constructors
ListBoxItem()
ListBoxItem()
ListBoxItem()

Initializes a new instance of the ListBoxItem class.

See Also
SelectorItem
SelectorItem
ListBoxItem ListBoxItem ListBoxItem
I n this Article
Edit
Initializes a new instance of the ListBoxItem class.

public : ListBoxItem()
ListBoxItem() const;
public ListBoxItem()
ListPickerFlyout ListPickerFlyout ListPickerFlyout Class
Represents a control that allows a user to pick one or more items from a list. See Remarks.

D eclaration
public : sealed class ListPickerFlyout : PickerFlyoutBase, IListPickerFlyout
struct winrt::Windows::UI::Xaml::Controls::ListPickerFlyout : PickerFlyoutBase,
IListPickerFlyout
public sealed class ListPickerFlyout : PickerFlyoutBase, IListPickerFlyout

I nheritance H ierarchy
DependencyObject
FlyoutBase
PickerFlyoutBase

Remarks
Im p o rt a nt

ListPickerFlyout is not supported for use in Universal Windows Platform (UWP ) app for Windows 10. Instead, to let a
user to pick one item from a list use a MenuFlyout. To let a user pick multiple items, use a Flyout with a list that has
multiple-selection enabled.

Constructors
ListPickerFlyout()
ListPickerFlyout()
ListPickerFlyout()

Initializes a new instance of the ListPickerFlyout class.

Properties
DisplayMemberPath
DisplayMemberPath
DisplayMemberPath

Gets or sets the name or path of the property that is displayed for each data item

DisplayMemberPathProperty
DisplayMemberPathProperty
DisplayMemberPathProperty

Identifies the DisplayMemberPath dependency property.

ItemsSource
ItemsSource
ItemsSource
Gets or sets an object source used to generate the content of the control.

ItemsSourceProperty
ItemsSourceProperty
ItemsSourceProperty

Identifies the ItemsSource dependency property.

ItemTemplate
ItemTemplate
ItemTemplate

Gets or sets the DataTemplate used to display each item.

ItemTemplateProperty
ItemTemplateProperty
ItemTemplateProperty

Identifies the ItemTemplate dependency property.

SelectedIndex
SelectedIndex
SelectedIndex

Gets or sets the index of the selected item.

SelectedIndexProperty
SelectedIndexProperty
SelectedIndexProperty

Identifies the SelectedIndex dependency property.

SelectedItem
SelectedItem
SelectedItem

Gets or sets the selected item.

SelectedItemProperty
SelectedItemProperty
SelectedItemProperty

Identifies the SelectedItem dependency property.


SelectedItems
SelectedItems
SelectedItems

Gets the list of currently selected items.

SelectedValue
SelectedValue
SelectedValue

Gets or sets the value of the selected item, obtained by using the SelectedValuePath

SelectedValuePath
SelectedValuePath
SelectedValuePath

Gets or sets the property path that is used to get the SelectedValue property of the SelectedItem property.

SelectedValuePathProperty
SelectedValuePathProperty
SelectedValuePathProperty

Identifies the SelectedValuePath dependency property.

SelectedValueProperty
SelectedValueProperty
SelectedValueProperty

Identifies the SelectedValue dependency property.

SelectionMode
SelectionMode
SelectionMode

Gets or sets the selection mode of the picker.

SelectionModeProperty
SelectionModeProperty
SelectionModeProperty

Identifies the SelectionMode dependency property.

Methods
ShowAtAsync(FrameworkElement)
ShowAtAsync(FrameworkElement)
ShowAtAsync(FrameworkElement)

Begins an asynchronous operation to show the flyout placed in relation to the specified element.

Events
ItemsPicked
ItemsPicked
ItemsPicked

Occurs when the user has selected items.

See Also
PickerFlyoutBase
ListPickerFlyout.DisplayMemberPath ListPickerFlyout.
DisplayMemberPath ListPickerFlyout.DisplayMemberPath
I n this Article
Edit
Gets or sets the name or path of the property that is displayed for each data item
public : Platform::String DisplayMemberPath { get; set; }
winrt::hstring DisplayMemberPath();

void DisplayMemberPath(winrt::hstring displaymemberpath);


public string DisplayMemberPath { get; set; }

Returns
string
The name or path of the property that is displayed for each the data item in the control. The default is an empty string
("").
ListPickerFlyout.DisplayMemberPathProperty ListPicker
Flyout.DisplayMemberPathProperty ListPickerFlyout.
DisplayMemberPathProperty
I n this Article
Edit
Identifies the DisplayMemberPath dependency property.
public : static DependencyProperty DisplayMemberPathProperty { get; }
static DependencyProperty DisplayMemberPathProperty();
public static DependencyProperty DisplayMemberPathProperty { get; }

Returns
DependencyProperty
The identifier for the DisplayMemberPath dependency property.
ListPickerFlyout.ItemsPicked ListPickerFlyout.ItemsPicked
ListPickerFlyout.ItemsPicked
I n this Article
Edit
Occurs when the user has selected items.
public : event TypedEventHandler<ListPickerFlyout, ItemsPickedEventArgs> ItemsPicked
// Register
event_token ItemsPicked(TypedEventHandler<ListPickerFlyout, ItemsPickedEventArgs> const& handler)
const;

// Revoke with event_token


void ItemsPicked(event_token const& cookie) const;

// Revoke with event_revoker


ItemsPicked_revoker ItemsPicked(auto_revoke_t, TypedEventHandler<ListPickerFlyout,
ItemsPickedEventArgs> const& handler) const;
public event TypedEventHandler<ListPickerFlyout, ItemsPickedEventArgs> ItemsPicked
ListPickerFlyout.ItemsSource ListPickerFlyout.ItemsSource
ListPickerFlyout.ItemsSource
I n this Article
Edit
Gets or sets an object source used to generate the content of the control.
public : Platform::Object ItemsSource { get; set; }
winrt::Windows::Foundation::IInspectable ItemsSource();

void ItemsSource(winrt::Windows::Foundation::IInspectable itemssource);


public object ItemsSource { get; set; }

Returns
object
The object that is used to generate the content of the control. The default is null.
ListPickerFlyout.ItemsSourceProperty ListPickerFlyout.
ItemsSourceProperty ListPickerFlyout.ItemsSource
Property
I n this Article
Edit
Identifies the ItemsSource dependency property.
public : static DependencyProperty ItemsSourceProperty { get; }
static DependencyProperty ItemsSourceProperty();
public static DependencyProperty ItemsSourceProperty { get; }

Returns
DependencyProperty
The identifier for the ItemsSource dependency property.
ListPickerFlyout.ItemTemplate ListPickerFlyout.Item
Template ListPickerFlyout.ItemTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display each item.
public : DataTemplate ItemTemplate { get; set; }
DataTemplate ItemTemplate();

void ItemTemplate(DataTemplate itemtemplate);


public DataTemplate ItemTemplate { get; set; }

Returns
DataTemplate
The template that specifies the visualization of the data objects. The default is null.
ListPickerFlyout.ItemTemplateProperty ListPickerFlyout.
ItemTemplateProperty ListPickerFlyout.ItemTemplate
Property
I n this Article
Edit
Identifies the ItemTemplate dependency property.
public : static DependencyProperty ItemTemplateProperty { get; }
static DependencyProperty ItemTemplateProperty();
public static DependencyProperty ItemTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the ItemTemplate dependency property.
ListPickerFlyout ListPickerFlyout ListPickerFlyout
I n this Article
Edit
Initializes a new instance of the ListPickerFlyout class.

public : ListPickerFlyout()
ListPickerFlyout() const;
public ListPickerFlyout()
ListPickerFlyout.SelectedIndex ListPickerFlyout.Selected
Index ListPickerFlyout.SelectedIndex
I n this Article
Edit
Gets or sets the index of the selected item.
public : int SelectedIndex { get; set; }
int32_t SelectedIndex();

void SelectedIndex(int32_t selectedindex);


public int SelectedIndex { get; set; }

Returns
int
The index of the selected item. The default is -1.
ListPickerFlyout.SelectedIndexProperty ListPickerFlyout.
SelectedIndexProperty ListPickerFlyout.SelectedIndex
Property
I n this Article
Edit
Identifies the SelectedIndex dependency property.
public : static DependencyProperty SelectedIndexProperty { get; }
static DependencyProperty SelectedIndexProperty();
public static DependencyProperty SelectedIndexProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedIndex dependency property.
ListPickerFlyout.SelectedItem ListPickerFlyout.Selected
Item ListPickerFlyout.SelectedItem
I n this Article
Edit
Gets or sets the selected item.
public : Platform::Object SelectedItem { get; set; }
winrt::Windows::Foundation::IInspectable SelectedItem();

void SelectedItem(winrt::Windows::Foundation::IInspectable selecteditem);


public object SelectedItem { get; set; }

Returns
object
The selected item. The default is null.
ListPickerFlyout.SelectedItemProperty ListPickerFlyout.
SelectedItemProperty ListPickerFlyout.SelectedItem
Property
I n this Article
Edit
Identifies the SelectedItem dependency property.
public : static DependencyProperty SelectedItemProperty { get; }
static DependencyProperty SelectedItemProperty();
public static DependencyProperty SelectedItemProperty { get; }

Returns
DependencyProperty
Identifies the SelectedItem dependency property.
ListPickerFlyout.SelectedItems ListPickerFlyout.Selected
Items ListPickerFlyout.SelectedItems
I n this Article
Edit
Gets the list of currently selected items.
public : IVector<Platform::Object> SelectedItems { get; }
IVector<winrt::Windows::Foundation::IInspectable> SelectedItems();
public IList<object> SelectedItems { get; }

Returns
IList<object>
The list of currently selected items.
ListPickerFlyout.SelectedValue ListPickerFlyout.Selected
Value ListPickerFlyout.SelectedValue
I n this Article
Edit
Gets or sets the value of the selected item, obtained by using the SelectedValuePath
public : Platform::Object SelectedValue { get; set; }
winrt::Windows::Foundation::IInspectable SelectedValue();

void SelectedValue(winrt::Windows::Foundation::IInspectable selectedvalue);


public object SelectedValue { get; set; }

Returns
object
The value of the selected item, obtained by using the SelectedValuePath, or null if no item is selected. The default value
is null.
ListPickerFlyout.SelectedValuePath ListPickerFlyout.
SelectedValuePath ListPickerFlyout.SelectedValuePath
I n this Article
Edit
Gets or sets the property path that is used to get the SelectedValue property of the SelectedItem property.
public : Platform::String SelectedValuePath { get; set; }
winrt::hstring SelectedValuePath();

void SelectedValuePath(winrt::hstring selectedvaluepath);


public string SelectedValuePath { get; set; }

Returns
string
The property path that is used to get the SelectedValue property of the SelectedItem property. The default is
String.Empty.
ListPickerFlyout.SelectedValuePathProperty ListPicker
Flyout.SelectedValuePathProperty ListPickerFlyout.
SelectedValuePathProperty
I n this Article
Edit
Identifies the SelectedValuePath dependency property.
public : static DependencyProperty SelectedValuePathProperty { get; }
static DependencyProperty SelectedValuePathProperty();
public static DependencyProperty SelectedValuePathProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedValuePath dependency property.
ListPickerFlyout.SelectedValueProperty ListPickerFlyout.
SelectedValueProperty ListPickerFlyout.SelectedValue
Property
I n this Article
Edit
Identifies the SelectedValue dependency property.
public : static DependencyProperty SelectedValueProperty { get; }
static DependencyProperty SelectedValueProperty();
public static DependencyProperty SelectedValueProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedValue dependency property.
ListPickerFlyout.SelectionMode ListPickerFlyout.Selection
Mode ListPickerFlyout.SelectionMode
I n this Article
Edit
Gets or sets the selection mode of the picker.
public : ListPickerFlyoutSelectionMode SelectionMode { get; set; }
ListPickerFlyoutSelectionMode SelectionMode();

void SelectionMode(ListPickerFlyoutSelectionMode selectionmode);


public ListPickerFlyoutSelectionMode SelectionMode { get; set; }

Returns
ListPickerFlyoutSelectionMode
The selection mode of the picker.
ListPickerFlyout.SelectionModeProperty ListPickerFlyout.
SelectionModeProperty ListPickerFlyout.SelectionMode
Property
I n this Article
Edit
Identifies the SelectionMode dependency property.
public : static DependencyProperty SelectionModeProperty { get; }
static DependencyProperty SelectionModeProperty();
public static DependencyProperty SelectionModeProperty { get; }

Returns
DependencyProperty
The identifier of the SelectionMode dependency property.
ListPickerFlyout.ShowAtAsync ListPickerFlyout.ShowAt
Async ListPickerFlyout.ShowAtAsync
I n this Article
Edit
Begins an asynchronous operation to show the flyout placed in relation to the specified element.
public : IAsyncOperation<IVectorView<Platform::Object>> ShowAtAsync(FrameworkElement target)
IAsyncOperation<IVectorView<winrt::Windows::Foundation::IInspectable>> ShowAtAsync(FrameworkElement
target) const;
public IAsyncOperation<IReadOnlyList<object>> ShowAtAsync(FrameworkElement target)

Parameters
target FrameworkElement
The element to use as the flyout's placement target.
Returns
IAsyncOperation<IReadOnlyList<object>>
An asynchronous operation.
Attributes RemoteAsyncAttribute
ListPickerFlyoutPresenter ListPickerFlyoutPresenter List
PickerFlyoutPresenter Class
Represents a control that allows a user to pick one or more items from a list. (Not recommended for Universal
Windows Platform (UWP ) app. See Flyout.)

D eclaration
public : sealed class ListPickerFlyoutPresenter : Control, IListPickerFlyoutPresenter
struct winrt::Windows::UI::Xaml::Controls::ListPickerFlyoutPresenter : Control,
IListPickerFlyoutPresenter
public sealed class ListPickerFlyoutPresenter : Control, IListPickerFlyoutPresenter

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

See Also
Control
ListPickerFlyoutSelectionMode ListPickerFlyoutSelection
Mode ListPickerFlyoutSelectionMode Enum
Defines constants that specify the selection mode of a ListPickerFlyout.

D eclaration
public : enum class ListPickerFlyoutSelectionMode
enum class winrt::Windows::UI::Xaml::Controls::ListPickerFlyoutSelectionMode : int32_t
public enum ListPickerFlyoutSelectionMode

I nheritance H ierarchy
None

Remarks
These values are used by the ListPickerFlyout.SelectionMode property.

Fields
Multiple Multiple Multiple The user can select multiple items.

Single Single Single A user can select only one item.


ListView ListView ListView Class
Represents a control that displays data items in a vertical stack.

D eclaration
public : class ListView : ListViewBase, IListView
struct winrt::Windows::UI::Xaml::Controls::ListView : ListViewBase, IListView
public class ListView : ListViewBase, IListView

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Selector
ListViewBase

Remarks
 Tip

For more info, design guidance, and code examples, see List view and grid view.
Use a ListView to display a collection of items stacked vertically or horizontally. To display a collection in rows and
columns, use a GridView.

ListView is an ItemsControl, so it can contain a collection of items of any type. To populate the view, add items to the
Items collection, or set the ItemsSource property to a data source.
By default, a data item is displayed in the ListView as the string representation of the data object it's bound to. To
specify exactly how items in the ListView are displayed, you create a DataTemplate to define the layout of controls used
to display an individual item. The controls in the layout can be bound to properties of a data object, or have content
defined inline. You assign the DataTemplate to the ItemTemplate property of the ListView. For common templates you
can use in your app, see Item templates for ListView.
Note

If you populate the ListView by setting the ItemsSource property, the ItemTemplate is applied to every item. If you
populate the Items collection directly, the ItemTemplate is applied only if the item is not a ListViewItem. See Examples
for more info.
If you use the ListView to display large sets of data, see Optimize ListView and GridView for tips to maintain a smooth
and responsive user experience.

Prerelease. Fall Creators Update (Windows 10 Insider Preview Build 16215 and later) - Behavior
change
By default, instead of performing selection, an active pen now scrolls/pans a list in UWP apps (like touch, touchpad,
and passive pen). If your app depends on the previous behavior, you can override pen scrolling and revert to the
previous behavior. See the @Windows.UI.Xaml.Controls.ScrollViewer?text=ScrollViewer class reference for details.

By default, a user can select a single item in a ListView. You can set the SelectionMode property to a
ListViewSelectionMode enumeration value to allow multi-selection or to disable selection. You can also change the
ListView interaction mode to make items respond to a user click like a button instead of being selected.
This table shows the ways a user can interact with a ListView, and how you can respond to the interaction.

TO ENAB LE THIS U S E THES E S E T TING S : HAND LE THIS EV ENT: U S E THIS PR O PER T Y TO


INTER ACTIO N: G E T THE S ELECTED ITEM:

No interaction @Windows.UI.Xaml.Controls. N/A N/A


ListViewBase.SelectionMode?
text=SelectionMode =
@Windows.UI.Xaml.Controls.
ListViewSelectionMode?
text=None,
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **False**

Single selection @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls.


ListViewBase.SelectionMode? Primitives.Selector.SelectionC Primitives.Selector.SelectedIt
text=SelectionMode = hanged? em?text=SelectedItem,
@Windows.UI.Xaml.Controls. text=SelectionChanged @Windows.UI.Xaml.Controls.
ListViewSelectionMode? Primitives.Selector.SelectedIn
text=Single, dex?text=SelectedIndex
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **False**

Contiguous multi-selection @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls.


ListViewBase.SelectionMode? Primitives.Selector.SelectionC ListViewBase.SelectedItems?
text=SelectionMode = hanged? text=SelectedItems
@Windows.UI.Xaml.Controls. text=SelectionChanged
ListViewSelectionMode?
text=Multiple,
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **False**

Non-contiguous multi- @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls.


selection ListViewBase.SelectionMode? Primitives.Selector.SelectionC ListViewBase.SelectedItems?
text=SelectionMode = hanged? text=SelectedItems
@Windows.UI.Xaml.Controls. text=SelectionChanged
ListViewSelectionMode?
text=Extended,
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **False**
Click @Windows.UI.Xaml.Controls. @Windows.UI.Xaml.Controls. N/A
ListViewBase.SelectionMode? ListViewBase.ItemClick?
text=SelectionMode = text=ItemClick
@Windows.UI.Xaml.Controls.
ListViewSelectionMode?
text=None,
@Windows.UI.Xaml.Controls.
ListViewBase.IsItemClickEnab
led?text=IsItemClickEnabled
= **True**
Note

The PointerWheelChanged event does not bubble up from a ListView. This means that a control that has a ListView
inside of it does not receive mouse wheel change messages if the pointer is over the ListView. For example, if you put a
ListView inside of a ScrollViewer, you can't scroll the ScrollViewer with the mouse wheel when the pointer is over the
ListView.
ListView supports data virtualization to improve performance with large data sets. Random access virtualization is
supported when the data source implements the appropriate interfaces, which vary depending on the programming
language:
Visual C++ component extensions (C++/CX) apps should implement IObservableVector.
C# or Visual Basic apps should implement INotifyCollectionChanged and System.Collections.IList (not IList).
Virtualization requires both of these interfaces. Incremental loading virtualization is supported when the data source
implements the ISupportIncrementalLoading interface. When incremental loading is supported, you can use these
members to control data loading: DataFetchSize, IncrementalLoadingThreshold, IncrementalLoadingTrigger,
LoadMoreItemsAsync.

Windows 8 In Windows 8, when the data item in a selected ListViewItem is replaced, the SelectedIndex value is
not cleared. In Windows 8.1, the SelectedIndex value is cleared.

ListView implements the ISemanticZoomInformation interface, so it can be used as a view in a SemanticZoom control.
When it's used in a SemanticZoom control, always set the ScrollViewer.IsVerticalScrollChainingEnabled attached
property to false on the ScrollViewer that's in the ListView 's control template, like this:
<ListView ScrollViewer.IsVerticalScrollChainingEnabled="False"> . These members have an effect only when
the ListView is hosted in a SemanticZoom control: IsActiveView, IsZoomedInView, SemanticZoomOwner,
CompleteViewChange, CompleteViewChangeFrom, CompleteViewChangeTo, InitializeViewChange, MakeVisible,
StartViewChangeFrom, StartViewChangeTo.
Selection behavior and CollectionV iewSource
List controls that derive from Selector have a default selection behavior that depends on what the items source is (the
type that's used for ItemsSource ). If the items source is a CollectionViewSource instance, then the behavior in the
selection control is that the selection will default to the current item. When the list is first displayed, the selection
defaults to the first item as current item. If you don't want the first item to be selected in this case, set
IsSynchronizedWithCurrentItem to false in the ListView.

Constructors
ListView()
ListView()
ListView()

Initializes a new instance of the ListView class.


See Also
ListViewBase
ListView ListView ListView
I n this Article
Edit
Initializes a new instance of the ListView class.

public : ListView()
ListView() const;
public ListView()
ListViewBase ListViewBase ListViewBase Class
Provides the infrastructure for the ListView and GridView classes.

D eclaration
public : class ListViewBase : Selector, IListViewBase, IListViewBase2, IListViewBase3,
IListViewBase4, IListViewBase5, IListViewBase6, ISemanticZoomInformation
struct winrt::Windows::UI::Xaml::Controls::ListViewBase : Selector, IListViewBase,
IListViewBase2, IListViewBase3, IListViewBase4, IListViewBase5, IListViewBase6,
ISemanticZoomInformation
public class ListViewBase : Selector, IListViewBase, IListViewBase2, IListViewBase3,
IListViewBase4, IListViewBase5, IListViewBase6, ISemanticZoomInformation

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Selector

Remarks
For user interface purposes, ListViewBase should be thought of as an abstract base class. Use ListView or GridView
instead. The main difference between ListView and GridView is that ListView has a vertical/portrait orientation and
GridView has a horizontal/landscape orientation. For more info, see ListView and GridView controls.
ListV iewB ase derived classes
ListViewBase is the parent class for GridView and ListView.

Constructors
ListViewBase()
ListViewBase()
ListViewBase()

Provides base-class initialization behavior for classes that are derived from the ListViewBase class.

Properties
CanDragItems
CanDragItems
CanDragItems

Gets or sets a value that indicates whether items in the view can be dragged as data payload.

CanDragItemsProperty
CanDragItemsProperty
CanDragItemsProperty
Identifies the CanDragItems dependency property.

CanReorderItems
CanReorderItems
CanReorderItems

Gets or sets a value that indicates whether items in the view can be reordered through user interaction.

CanReorderItemsProperty
CanReorderItemsProperty
CanReorderItemsProperty

Identifies the CanReorderItems dependency property.

DataFetchSize
DataFetchSize
DataFetchSize

Gets or sets the amount of data to fetch for virtualizing/prefetch operations.

DataFetchSizeProperty
DataFetchSizeProperty
DataFetchSizeProperty

Identifies the DataFetchSize dependency property.

Footer
Footer
Footer

Gets or sets the content for the list footer.

FooterProperty
FooterProperty
FooterProperty

Identifies the Footer dependency property.

FooterTemplate
FooterTemplate
FooterTemplate

Gets or sets the DataTemplate used to display the content of the view footer.
FooterTemplateProperty
FooterTemplateProperty
FooterTemplateProperty

Identifies the FooterTemplate dependency property.

FooterTransitions
FooterTransitions
FooterTransitions

Gets or sets the collection of Transition style elements that apply to the view footer.

FooterTransitionsProperty
FooterTransitionsProperty
FooterTransitionsProperty

Identifies the FooterTransitions dependency property.

Header
Header
Header

Gets or sets the content for the list header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the view header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

HeaderTransitions
HeaderTransitions
HeaderTransitions
Gets or sets the collection of Transition style elements that apply to the view header.

HeaderTransitionsProperty
HeaderTransitionsProperty
HeaderTransitionsProperty

Identifies the HeaderTransitions dependency property.

IncrementalLoadingThreshold
IncrementalLoadingThreshold
IncrementalLoadingThreshold

Gets or sets the threshold range that governs when the ListViewBase class will begin to prefetch more items.

IncrementalLoadingThresholdProperty
IncrementalLoadingThresholdProperty
IncrementalLoadingThresholdProperty

Identifies the IncrementalLoadingThreshold dependency property.

IncrementalLoadingTrigger
IncrementalLoadingTrigger
IncrementalLoadingTrigger

Gets or sets a value that indicates the conditions for prefetch operations by the ListViewBase class.

IncrementalLoadingTriggerProperty
IncrementalLoadingTriggerProperty
IncrementalLoadingTriggerProperty

Identifies the IncrementalLoadingTrigger dependency property.

IsActiveView
IsActiveView
IsActiveView

Gets or sets a value that indicates whether the ListViewBase instance is the active view in its owning
SemanticZoom.

IsActiveViewProperty
IsActiveViewProperty
IsActiveViewProperty

Identifies the IsActiveView dependency property.


IsItemClickEnabled
IsItemClickEnabled
IsItemClickEnabled

Gets or sets a value that indicates whether items in the view fire an ItemClick event in response to interaction.

IsItemClickEnabledProperty
IsItemClickEnabledProperty
IsItemClickEnabledProperty

Identifies the IsItemClickEnabled dependency property.

IsMultiSelectCheckBoxEnabled
IsMultiSelectCheckBoxEnabled
IsMultiSelectCheckBoxEnabled

Gets or sets a value that indicates whether a check box is shown to enable multi-selection.

IsMultiSelectCheckBoxEnabledProperty
IsMultiSelectCheckBoxEnabledProperty
IsMultiSelectCheckBoxEnabledProperty

Get the identifier for the IsMultiSelectCheckBoxEnabled dependency property.

IsSwipeEnabled
IsSwipeEnabled
IsSwipeEnabled

Gets or sets a value that indicates whether the view supports discrete input processing for a swipe interaction.

IsSwipeEnabledProperty
IsSwipeEnabledProperty
IsSwipeEnabledProperty

Identifies the IsSwipeEnabled dependency property.

IsZoomedInView
IsZoomedInView
IsZoomedInView

Gets or sets a value that indicates whether the ListViewBase instance is the zoomed-in view in its owning
SemanticZoom.

IsZoomedInViewProperty
IsZoomedInViewProperty
IsZoomedInViewProperty

Identifies the IsZoomedInView dependency property.

ReorderMode
ReorderMode
ReorderMode

Gets or sets the reorder behavior for a ListViewBase instance. When Enabled, unsorted and ungrouped lists can
be reordered by user manipulation.

ReorderModeProperty
ReorderModeProperty
ReorderModeProperty

Identifies the ReorderMode dependency property.

SelectedItems
SelectedItems
SelectedItems

Gets the currently selected items.

SelectedRanges
SelectedRanges
SelectedRanges

Gets a collection of ItemIndexRange objects that describe the currently selected items in the list.

SelectionMode
SelectionMode
SelectionMode

Gets or sets the selection behavior for a ListViewBase instance.

SelectionModeProperty
SelectionModeProperty
SelectionModeProperty

Identifies the SelectionMode dependency property.

SemanticZoomOwner
SemanticZoomOwner
SemanticZoomOwner

Gets or sets the SemanticZoom instance that hosts the ListViewBase.


SemanticZoomOwnerProperty
SemanticZoomOwnerProperty
SemanticZoomOwnerProperty

Identifies the SemanticZoomOwner dependency property.

ShowsScrollingPlaceholders
ShowsScrollingPlaceholders
ShowsScrollingPlaceholders

Gets or sets a value that indicates whether the view shows placeholder UI for items during scrolling.

ShowsScrollingPlaceholdersProperty
ShowsScrollingPlaceholdersProperty
ShowsScrollingPlaceholdersProperty

Identifies the ShowsScrollingPlaceholders dependency property.

SingleSelectionFollowsFocus
SingleSelectionFollowsFocus
SingleSelectionFollowsFocus

Gets or sets a value that indicates whether item selection changes when keyboard focus changes.

SingleSelectionFollowsFocusProperty
SingleSelectionFollowsFocusProperty
SingleSelectionFollowsFocusProperty

Identifies the SingleSelectionFollowsFocus dependency property.

Methods
CompleteViewChange()
CompleteViewChange()
CompleteViewChange()

Changes related aspects of presentation when the overall view for a SemanticZoom changes.

CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)

Completes item-wise operations that are related to a view change when the ListViewBase instance is the source
view and the new view is a potentially different implementing view.

CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
CompleteViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)

Completes item-wise operations that are related to a view change when the ListViewBase instance is the
destination view and the source view is a potentially different implementing view.

DeselectRange(ItemIndexRange)
DeselectRange(ItemIndexRange)
DeselectRange(ItemIndexRange)

Deselects a block of items described by the ItemIndexRange.

InitializeViewChange()
InitializeViewChange()
InitializeViewChange()

Initializes the changes to related aspects of presentation (such as scrolling UI or state) when the overall view for a
SemanticZoom is about to change.

IsDragSource()
IsDragSource()
IsDragSource()

Returns a value that indicates whether the list view is both the drag source and drop target in a drag-and-drop
operation.

LoadMoreItemsAsync()
LoadMoreItemsAsync()
LoadMoreItemsAsync()

Initiates the asynchronous request to load more data items, in accordance with the active incremental loading
settings.

MakeVisible(SemanticZoomLocation)
MakeVisible(SemanticZoomLocation)
MakeVisible(SemanticZoomLocation)

Forces content in the view to scroll until the item that's specified by SemanticZoomLocation is visible. Also focuses
the item if it finds the item.

PrepareConnectedAnimation(String, Object, String)


PrepareConnectedAnimation(String, Object, String)
PrepareConnectedAnimation(String, Object, String)

Returns a connected animation that's associated with the specified key, data item, and source element.
ScrollIntoView(Object)
ScrollIntoView(Object)
ScrollIntoView(Object)

Scrolls the list to bring the specified data item into view.

ScrollIntoView(Object, ScrollIntoViewAlignment)
ScrollIntoView(Object, ScrollIntoViewAlignment)
ScrollIntoView(Object, ScrollIntoViewAlignment)

Scrolls the list to bring the specified data item into view with the specified alignment.

SelectAll()
SelectAll()
SelectAll()

Selects all the items in a view.

SelectRange(ItemIndexRange)
SelectRange(ItemIndexRange)
SelectRange(ItemIndexRange)

Selects a block of items described by the ItemIndexRange.

SetDesiredContainerUpdateDuration(TimeSpan)
SetDesiredContainerUpdateDuration(TimeSpan)
SetDesiredContainerUpdateDuration(TimeSpan)

Sets the maximum target time between two render passes when a ListViewBase is updating its UI with data items
during initial load or scrolling.

StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeFrom(SemanticZoomLocation, SemanticZoomLocation)

Initializes item-wise operations that are related to a view change when the ListViewBase instance is the source
view and the pending destination view is a potentially different implementing view.

StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)
StartViewChangeTo(SemanticZoomLocation, SemanticZoomLocation)

Initializes item-wise operations that are related to a view change when the source view is a different view and the
pending destination view is the ListViewBase instance.
TryStartConnectedAnimationAsync(ConnectedAnimation, Object, String)
TryStartConnectedAnimationAsync(ConnectedAnimation, Object, String)
TryStartConnectedAnimationAsync(ConnectedAnimation, Object, String)

Attempts to start the animation.

Events
ChoosingGroupHeaderContainer
ChoosingGroupHeaderContainer
ChoosingGroupHeaderContainer

Occurs when an item container is to be chosen for a data group.

ChoosingItemContainer
ChoosingItemContainer
ChoosingItemContainer

Occurs when an item container is to be chosen for a data item.

ContainerContentChanging
ContainerContentChanging
ContainerContentChanging

Occurs when the data item associated with a UI container changes.

DragItemsCompleted
DragItemsCompleted
DragItemsCompleted

Occurs when a drag operation that involves one of the items in the view is ended. In order to receive this event, set
the CanDragItems property to True.

DragItemsStarting
DragItemsStarting
DragItemsStarting

Occurs when a drag operation that involves one of the items in the view is initiated.

ItemClick
ItemClick
ItemClick

Occurs when an item in the list view receives an interaction, and the IsItemClickEnabled property is true.
See Also
Selector
Selector
Selector
ListViewBase.CanDragItems ListViewBase.CanDragItems
ListViewBase.CanDragItems
I n this Article
Edit
Gets or sets a value that indicates whether items in the view can be dragged as data payload.
public : Platform::Boolean CanDragItems { get; set; }
bool CanDragItems();

void CanDragItems(bool candragitems);


public bool CanDragItems { get; set; }

<listViewBase CanDragItems="bool" />

Returns
bool
True if items in the view can be dragged as data payload; otherwise, false. The default is false.

Remarks
Setting IsSwipeEnabled to false disables some default touch interactions, so it should be set to true when these
interactions are needed. For example:
If item selection is enabled and you set IsSwipeEnabled to false, a user can deselect items by right-clicking with the
mouse, but can't deselect an item with touch by using a swipe gesture.
If you set CanDragItems to true and IsSwipeEnabled to false, a user can drag items with the mouse, but not with
touch.
If you set CanReorderItems to true and IsSwipeEnabled to false, a user can reorder items with the mouse, but not with
touch.
CanDragItems can be set to false as part of visual states that are intended to prevent users from dragging items in
views such as a GridView.
CanDragItems does not reflect transient states that might influence the ability to drag items, such as item population
lag. The primary scenario where you might get the value of CanDragItems in code is to verify that dynamic templates
or user-selectable options in your app UI have not changed the value since you last set it.
See AllowDrop
Also Drag and drop sample (Windows 10)
ListViewBase.CanDragItemsProperty ListViewBase.Can
DragItemsProperty ListViewBase.CanDragItemsProperty
I n this Article
Edit
Identifies the CanDragItems dependency property.
public : static DependencyProperty CanDragItemsProperty { get; }
static DependencyProperty CanDragItemsProperty();
public static DependencyProperty CanDragItemsProperty { get; }

Returns
DependencyProperty
The identifier for the CanDragItems dependency property.
ListViewBase.CanReorderItems ListViewBase.CanReorder
Items ListViewBase.CanReorderItems
I n this Article
Edit
Gets or sets a value that indicates whether items in the view can be reordered through user interaction.
public : Platform::Boolean CanReorderItems { get; set; }
bool CanReorderItems();

void CanReorderItems(bool canreorderitems);


public bool CanReorderItems { get; set; }

<listViewBase CanReorderItems="bool" />

Returns
bool
True if items in the view can be reordered through user interaction; otherwise, false. The default is false.

Examples
Here's a GridView that contains 6 rectangles that a user can reorder by drag-and-drop.
<GridView MaxHeight="310"
AllowDrop="True"
CanReorderItems="True">
<Rectangle Height="100" Width="100" Fill="Blue"/>
<Rectangle Height="100" Width="100" Fill="Red"/>
<Rectangle Height="100" Width="100" Fill="Yellow"/>
<Rectangle Height="100" Width="100" Fill="Green"/>
<Rectangle Height="100" Width="100" Fill="Gray"/>
<Rectangle Height="100" Width="100" Fill="LightBlue"/>
</GridView>

Remarks
To enable users to reorder items using drag-and-drop interaction, you must set both the CanReorderItems and
AllowDrop properties to true.
Built in reordering is not supported when items are grouped, or when a VariableSizedWrapGrid is used as the
ItemsPanel.
Setting IsSwipeEnabled to false disables some default touch interactions, so it should be set to true when these
interactions are needed. For example:
If item selection is enabled and you set IsSwipeEnabled to false, a user can deselect items by right-clicking with the
mouse, but can't deselect an item with touch by using a swipe gesture.
If you set CanDragItems to true and IsSwipeEnabled to false, a user can drag items with the mouse, but not with
touch.
If you set CanReorderItems to true and IsSwipeEnabled to false, a user can reorder items with the mouse, but not with
touch.
See AllowDrop
Also Drag and drop sample (Windows 10)
ListViewBase.CanReorderItemsProperty ListViewBase.
CanReorderItemsProperty ListViewBase.CanReorder
ItemsProperty
I n this Article
Edit
Identifies the CanReorderItems dependency property.
public : static DependencyProperty CanReorderItemsProperty { get; }
static DependencyProperty CanReorderItemsProperty();
public static DependencyProperty CanReorderItemsProperty { get; }

Returns
DependencyProperty
The identifier for the CanReorderItems dependency property.
ListViewBase.ChoosingGroupHeaderContainer ListView
Base.ChoosingGroupHeaderContainer ListViewBase.
ChoosingGroupHeaderContainer
I n this Article
Edit
Occurs when an item container is to be chosen for a data group.
public : event TypedEventHandler<ListViewBase, ChoosingGroupHeaderContainerEventArgs>
ChoosingGroupHeaderContainer
// Register
event_token ChoosingGroupHeaderContainer(TypedEventHandler<ListViewBase,
ChoosingGroupHeaderContainerEventArgs> const& handler) const;

// Revoke with event_token


void ChoosingGroupHeaderContainer(event_token const& cookie) const;

// Revoke with event_revoker


ChoosingGroupHeaderContainer_revoker ChoosingGroupHeaderContainer(auto_revoke_t,
TypedEventHandler<ListViewBase, ChoosingGroupHeaderContainerEventArgs> const& handler) const;
public event TypedEventHandler<ListViewBase, ChoosingGroupHeaderContainerEventArgs>
ChoosingGroupHeaderContainer

Remarks
You typically handle this event to enable accessibility. The group headers do not have an accessible name set by default.
This event provides access to the header instance and lets you to set the AutomationProperties.Name attached
property to an appropriate value.
ListViewBase.ChoosingItemContainer ListViewBase.
ChoosingItemContainer ListViewBase.ChoosingItem
Container
I n this Article
Edit
Occurs when an item container is to be chosen for a data item.
public : event TypedEventHandler<ListViewBase, ChoosingItemContainerEventArgs> ChoosingItemContainer
// Register
event_token ChoosingItemContainer(TypedEventHandler<ListViewBase, ChoosingItemContainerEventArgs>
const& handler) const;

// Revoke with event_token


void ChoosingItemContainer(event_token const& cookie) const;

// Revoke with event_revoker


ChoosingItemContainer_revoker ChoosingItemContainer(auto_revoke_t, TypedEventHandler<ListViewBase,
ChoosingItemContainerEventArgs> const& handler) const;
public event TypedEventHandler<ListViewBase, ChoosingItemContainerEventArgs> ChoosingItemContainer

Remarks
This event is raised only if the list or grid's ItemsPanel is an ItemsStackPanel or ItemsWrapGrid. If you replace the
ItemsPanel with another panel, the event is not raised.
ListViewBase.CompleteViewChange ListViewBase.
CompleteViewChange ListViewBase.CompleteView
Change
I n this Article
Edit
Changes related aspects of presentation when the overall view for a SemanticZoom changes.
public : void CompleteViewChange()
void CompleteViewChange() const;
public void CompleteViewChange()

Remarks
Controls derived from ListViewBase typically have an associated ScrollViewer as part of their template. The
ListViewBase implementation of CompleteViewChange perpetuates ScrollBarVisibility for any scroll bars across the
views when the views change.
ListViewBase.CompleteViewChangeFrom ListViewBase.
CompleteViewChangeFrom ListViewBase.CompleteView
ChangeFrom
I n this Article
Edit
Completes item-wise operations that are related to a view change when the ListViewBase instance is the source view
and the new view is a potentially different implementing view.
public : void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)
void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void CompleteViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
ListViewBase.CompleteViewChangeTo ListViewBase.
CompleteViewChangeTo ListViewBase.CompleteView
ChangeTo
I n this Article
Edit
Completes item-wise operations that are related to a view change when the ListViewBase instance is the destination
view and the source view is a potentially different implementing view.
public : void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)
void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void CompleteViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
ListViewBase.ContainerContentChanging ListViewBase.
ContainerContentChanging ListViewBase.Container
ContentChanging
I n this Article
Edit
Occurs when the data item associated with a UI container changes.
public : event TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>
ContainerContentChanging
// Register
event_token ContainerContentChanging(TypedEventHandler<ListViewBase,
ContainerContentChangingEventArgs> const& handler) const;

// Revoke with event_token


void ContainerContentChanging(event_token const& cookie) const;

// Revoke with event_revoker


ContainerContentChanging_revoker ContainerContentChanging(auto_revoke_t,
TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs> const& handler) const;
public event TypedEventHandler<ListViewBase, ContainerContentChangingEventArgs>
ContainerContentChanging

<listViewBase ContainerContentChanging="eventhandler" />

Remarks
This event is raised only if the list or grid's ItemsPanel is an ItemsStackPanel or ItemsWrapGrid. If you replace the
ItemsPanel with another panel, the event is not raised.
For info and examples, see the Update ListView and GridView items incrementally section of Optimize ListView and
GridView.
For more examples, download the XAML GridView grouping and SemanticZoom sample.
See Optimize ListView and GridView
Also XAML GridView grouping and SemanticZoom sample
ListViewBase.DataFetchSize ListViewBase.DataFetchSize
ListViewBase.DataFetchSize
I n this Article
Edit
Gets or sets the amount of data to fetch for virtualizing/prefetch operations.
public : double DataFetchSize { get; set; }
double DataFetchSize();

void DataFetchSize(double datafetchsize);


public double DataFetchSize { get; set; }

<listViewBase DataFetchSize="double" />

Returns
double
The amount of data to fetch per interval, in pages.
See IncrementalLoadingTrigger
Also Using virtualization with a list or grid
ListViewBase.DataFetchSizeProperty ListViewBase.Data
FetchSizeProperty ListViewBase.DataFetchSizeProperty
I n this Article
Edit
Identifies the DataFetchSize dependency property.
public : static DependencyProperty DataFetchSizeProperty { get; }
static DependencyProperty DataFetchSizeProperty();
public static DependencyProperty DataFetchSizeProperty { get; }

Returns
DependencyProperty
The identifier for the DataFetchSize dependency property.
ListViewBase.DeselectRange ListViewBase.DeselectRange
ListViewBase.DeselectRange
I n this Article
Edit
Deselects a block of items described by the ItemIndexRange.
public : void DeselectRange(ItemIndexRange itemIndexRange)
void DeselectRange(ItemIndexRange itemIndexRange) const;
public void DeselectRange(ItemIndexRange itemIndexRange)

Parameters
itemIndexRange ItemIndexRange
Information about the range of items, including the index of the first and last items in the range, and the number of
items.

Examples
Here's how to deselect the first 9 items in a ListView named itemListView .

if (itemListView.SelectionMode == ListViewSelectionMode.Multiple ||
itemListView.SelectionMode == ListViewSelectionMode.Extended)
{
itemListView.DeselectRange(new ItemIndexRange(0, 9));
}

Remarks
SelectRange and DeselectRange provide a more efficient way to modify the selection than using the SelectedItems
property. When you select items using index ranges, use the SelectedRanges property to get all selected ranges in the
list.
When you call DeselectRange, all items in the specified range are deselected, regardless of their original selection state.
You can deselect all items in a collection by using an ItemIndexRange with a FirstIndex value of 0 and a Length value
equal to the number of items in the collection.
Note

If the ItemsSource implements IItemsRangeInfo, the SelectedItems collection is not updated based on selection in the
list. Use the SelectedRanges property instead.
See ItemIndexRange
Also
ListViewBase.DragItemsCompleted ListViewBase.Drag
ItemsCompleted ListViewBase.DragItemsCompleted
I n this Article
Edit
Occurs when a drag operation that involves one of the items in the view is ended. In order to receive this event, set the
CanDragItems property to True.
public : event TypedEventHandler<ListViewBase, DragItemsCompletedEventArgs> DragItemsCompleted
// Register
event_token DragItemsCompleted(TypedEventHandler<ListViewBase, DragItemsCompletedEventArgs> const&
handler) const;

// Revoke with event_token


void DragItemsCompleted(event_token const& cookie) const;

// Revoke with event_revoker


DragItemsCompleted_revoker DragItemsCompleted(auto_revoke_t, TypedEventHandler<ListViewBase,
DragItemsCompletedEventArgs> const& handler) const;
public event TypedEventHandler<ListViewBase, DragItemsCompletedEventArgs> DragItemsCompleted

See Drag and drop sample (Windows 10)


Also
ListViewBase.DragItemsStarting ListViewBase.DragItems
Starting ListViewBase.DragItemsStarting
I n this Article
Edit
Occurs when a drag operation that involves one of the items in the view is initiated.
public : event DragItemsStartingEventHandler DragItemsStarting
// Register
event_token DragItemsStarting(DragItemsStartingEventHandler const& handler) const;

// Revoke with event_token


void DragItemsStarting(event_token const& cookie) const;

// Revoke with event_revoker


DragItemsStarting_revoker DragItemsStarting(auto_revoke_t, DragItemsStartingEventHandler const&
handler) const;
public event DragItemsStartingEventHandler DragItemsStarting

<listViewBase DragItemsStarting="eventhandler" />

Remarks
This event occurs when you start a drag-and-drop operation, including when you perform a reorder operation by drag-
and-drop. When you perform custom actions as a result of a drag-and-drop operation, you typically listen to this event
and provide more data using the DragItemsStartingEventArgs.Data property.
You can inspect the items being dragged by checking the DragItemsStartingEventArgs.Items property.
You can cancel the drag operation by setting the DragItemsStartingEventArgs.Cancel property to true.
See Drag and drop sample (Windows 10)
Also
ListViewBase.Footer ListViewBase.Footer ListViewBase.
Footer
I n this Article
Edit
Gets or sets the content for the list footer.
public : Platform::Object Footer { get; set; }
winrt::Windows::Foundation::IInspectable Footer();

void Footer(winrt::Windows::Foundation::IInspectable footer);


public object Footer { get; set; }

<listViewBase Footer="footerString"/>

Returns
object
The content of the list footer. The default is null.

Remarks
By default, the footer is shown at the bottom for a ListView, and on the right for a GridView. If the FlowDirection
property is set to RightToLeft, the footer is shown on the left for a GridView.
You can use a data template for the footer by setting the FooterTemplate property.
ListViewBase.FooterProperty ListViewBase.Footer
Property ListViewBase.FooterProperty
I n this Article
Edit
Identifies the Footer dependency property.
public : static DependencyProperty FooterProperty { get; }
static DependencyProperty FooterProperty();
public static DependencyProperty FooterProperty { get; }

Returns
DependencyProperty
The identifier for the Footer dependency property.
ListViewBase.FooterTemplate ListViewBase.Footer
Template ListViewBase.FooterTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the view footer.
public : DataTemplate FooterTemplate { get; set; }
DataTemplate FooterTemplate();

void FooterTemplate(DataTemplate footertemplate);


public DataTemplate FooterTemplate { get; set; }

<listViewBase FooterTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The template that specifies the visualization of the footer object. The default is null.
ListViewBase.FooterTemplateProperty ListViewBase.
FooterTemplateProperty ListViewBase.FooterTemplate
Property
I n this Article
Edit
Identifies the FooterTemplate dependency property.
public : static DependencyProperty FooterTemplateProperty { get; }
static DependencyProperty FooterTemplateProperty();
public static DependencyProperty FooterTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the FooterTemplate dependency property.
ListViewBase.FooterTransitions ListViewBase.Footer
Transitions ListViewBase.FooterTransitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to the view footer.
public : TransitionCollection FooterTransitions { get; set; }
TransitionCollection FooterTransitions();

void FooterTransitions(TransitionCollection footertransitions);


public TransitionCollection FooterTransitions { get; set; }

<listViewBase>
<listViewBase.FooterTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</listViewBase.FooterTransitions>
</listViewBase>

Returns
TransitionCollection
The collection of Transition style elements that apply to the list footer.

Remarks
Note

Prior to Windows 10, version 1809 (SDK 17763), the XAML syntax for properties that have a TransitionCollection
value requires that you declare an explicit TransitionCollection object element as the value, and then provide object
elements as child elements of TransitionCollection for each of the transition animations you want to use. In Windows
10, version 1809 (SDK 17763) or later, TransitionCollection supports the implicit collection usage, so you can omit the
collection object element. For more info on implicit collections and XAML, see XAML syntax guide.
Transition animations play a particular role in the UI design of your app. The basic idea is that when there is a change
or transition, the animation draws the attention of the user to the change.
See TransitionCollection
Also
ListViewBase.FooterTransitionsProperty ListViewBase.
FooterTransitionsProperty ListViewBase.FooterTransitions
Property
I n this Article
Edit
Identifies the FooterTransitions dependency property.
public : static DependencyProperty FooterTransitionsProperty { get; }
static DependencyProperty FooterTransitionsProperty();
public static DependencyProperty FooterTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the FooterTransitions dependency property.
ListViewBase.Header ListViewBase.Header ListViewBase.
Header
I n this Article
Edit
Gets or sets the content for the list header.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<listViewBase Header="headerString"/>

Returns
object
The content of the list header. The default value is null.

Examples
Here's a GridView header that contains a StackPanel with text and an image. This Extensible Application Markup
Language (XAML ) is a simplified version of the GridView used in GroupDetail page of the Microsoft Visual Studio
Grid App template.
<GridView x:Name="itemGridView"
Margin="0,-14,0,0"
Padding="120,0,120,50"
ItemsSource="{Binding Source={StaticResource itemsViewSource}}"
ItemTemplate="{StaticResource Standard500x130ItemTemplate}">

<GridView.Header>
<StackPanel Width="480" Margin="0,4,14,0">
<TextBlock Text="{Binding Subtitle}" Margin="0,0,18,20"
Style="{StaticResource SubheaderTextStyle}" MaxHeight="60"/>
<Image Source="{Binding Image}" Height="400" Margin="0,0,18,20"
Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
<TextBlock Text="{Binding Description}" Margin="0,0,18,0"
Style="{StaticResource BodyTextStyle}"/>
</StackPanel>
</GridView.Header>
</GridView>

Remarks
By default, the header is shown at the top for a ListView, and on the left for a GridView. If the FlowDirection property is
set to RightToLeft, the header is shown on the right for a GridView.
You can use a data template for the Header by setting the HeaderTemplate property.
See FlowDirection
Also
ListViewBase.HeaderProperty ListViewBase.Header
Property ListViewBase.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
ListViewBase.HeaderTemplate ListViewBase.Header
Template ListViewBase.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the view header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<listViewBase HeaderTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
ListViewBase.HeaderTemplateProperty ListViewBase.
HeaderTemplateProperty ListViewBase.HeaderTemplate
Property
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
ListViewBase.HeaderTransitions ListViewBase.Header
Transitions ListViewBase.HeaderTransitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to the view header.
public : TransitionCollection HeaderTransitions { get; set; }
TransitionCollection HeaderTransitions();

void HeaderTransitions(TransitionCollection headertransitions);


public TransitionCollection HeaderTransitions { get; set; }

<listViewBase>
<listViewBase.HeaderTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</listViewBase.HeaderTransitions>
</listViewBase>

Returns
TransitionCollection
The collection of Transition style elements that apply to the list header.

Remarks
Note

Prior to Windows 10, version 1809 (SDK 17763), the XAML syntax for properties that have a TransitionCollection
value requires that you declare an explicit TransitionCollection object element as the value, and then provide object
elements as child elements of TransitionCollection for each of the transition animations you want to use. In Windows
10, version 1809 (SDK 17763) or later, TransitionCollection supports the implicit collection usage, so you can omit the
collection object element. For more info on implicit collections and XAML, see XAML syntax guide.
Transition animations play a particular role in the UI design of your app. The basic idea is that when there is a change
or transition, the animation draws the attention of the user to the change.
See TransitionCollection
Also
ListViewBase.HeaderTransitionsProperty ListViewBase.
HeaderTransitionsProperty ListViewBase.Header
TransitionsProperty
I n this Article
Edit
Identifies the HeaderTransitions dependency property.
public : static DependencyProperty HeaderTransitionsProperty { get; }
static DependencyProperty HeaderTransitionsProperty();
public static DependencyProperty HeaderTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTransitions dependency property.
ListViewBase.IncrementalLoadingThreshold ListViewBase.
IncrementalLoadingThreshold ListViewBase.Incremental
LoadingThreshold
I n this Article
Edit
Gets or sets the threshold range that governs when the ListViewBase class will begin to prefetch more items.
public : double IncrementalLoadingThreshold { get; set; }
double IncrementalLoadingThreshold();

void IncrementalLoadingThreshold(double incrementalloadingthreshold);


public double IncrementalLoadingThreshold { get; set; }

<listViewBase IncrementalLoadingThreshold="double" />

Returns
double
The loading threshold, in terms of pages.

Remarks
The meaning of the page count given for IncrementalLoadingThreshold is that the ListViewBase does not need to
request more items via LoadMoreItemsAsync until the trigger condition (see IncrementalLoadingTrigger ) gets within
the IncrementalLoadingThreshold page range. Setting a larger number (for instance 10 or more) represents a belief
that the user might attempt to scroll through the list very quickly, and it is worthwhile devoting resources to loading
more items as quickly as possible. Setting a smaller number (for instance 5 or less) represents a belief that the user will
scroll through the list less quickly, and that the user's scroll rate will permit the items collection to catch up without
being as resource intensive.
IncrementalLoadingThreshold and DataFetchSize both contribute to the possible resource load that is the result of
prefetch operations.
See IncrementalLoadingTrigger
Also Using virtualization with a list or grid
ListViewBase.IncrementalLoadingThresholdProperty List
ViewBase.IncrementalLoadingThresholdProperty ListView
Base.IncrementalLoadingThresholdProperty
I n this Article
Edit
Identifies the IncrementalLoadingThreshold dependency property.
public : static DependencyProperty IncrementalLoadingThresholdProperty { get; }
static DependencyProperty IncrementalLoadingThresholdProperty();
public static DependencyProperty IncrementalLoadingThresholdProperty { get; }

Returns
DependencyProperty
The identifier for the IncrementalLoadingThreshold dependency property.
ListViewBase.IncrementalLoadingTrigger ListViewBase.
IncrementalLoadingTrigger ListViewBase.Incremental
LoadingTrigger
I n this Article
Edit
Gets or sets a value that indicates the conditions for prefetch operations by the ListViewBase class.
public : IncrementalLoadingTrigger IncrementalLoadingTrigger { get; set; }
IncrementalLoadingTrigger IncrementalLoadingTrigger();

void IncrementalLoadingTrigger(IncrementalLoadingTrigger incrementalloadingtrigger);


public IncrementalLoadingTrigger IncrementalLoadingTrigger { get; set; }

<listViewBase IncrementalLoadingTrigger="None" />


-or-
<listViewBase IncrementalLoadingTrigger="Edge" />

Returns
IncrementalLoadingTrigger
An enumeration value that indicates the conditions that trigger prefetch operations. The default is Edge.
See Using virtualization with a list or grid
Also
ListViewBase.IncrementalLoadingTriggerProperty List
ViewBase.IncrementalLoadingTriggerProperty ListView
Base.IncrementalLoadingTriggerProperty
I n this Article
Edit
Identifies the IncrementalLoadingTrigger dependency property.
public : static DependencyProperty IncrementalLoadingTriggerProperty { get; }
static DependencyProperty IncrementalLoadingTriggerProperty();
public static DependencyProperty IncrementalLoadingTriggerProperty { get; }

Returns
DependencyProperty
The identifier for the IncrementalLoadingTrigger dependency property.
ListViewBase.InitializeViewChange ListViewBase.Initialize
ViewChange ListViewBase.InitializeViewChange
I n this Article
Edit
Initializes the changes to related aspects of presentation (such as scrolling UI or state) when the overall view for a
SemanticZoom is about to change.
public : void InitializeViewChange()
void InitializeViewChange() const;
public void InitializeViewChange()

Remarks
Controls derived from ListViewBase typically have an associated ScrollViewer as part of their template. The
ListViewBase implementation of InitializeViewChange stores ScrollBarVisibility for current scroll bars, so that values
can be perpetuated across the views when the views change.
ListViewBase.IsActiveView ListViewBase.IsActiveView List
ViewBase.IsActiveView
I n this Article
Edit
Gets or sets a value that indicates whether the ListViewBase instance is the active view in its owning SemanticZoom.
public : Platform::Boolean IsActiveView { get; set; }
bool IsActiveView();

void IsActiveView(bool isactiveview);


public bool IsActiveView { get; set; }

Returns
bool
true if the ListViewBase is the active view; otherwise, false.

Remarks
You typically don't set this property in XAML or in app code. The property is set implicitly when the view is set as either
the ZoomedInView or ZoomedOutView of a SemanticZoom control.
See SemanticZoom
Also
ListViewBase.IsActiveViewProperty ListViewBase.IsActive
ViewProperty ListViewBase.IsActiveViewProperty
I n this Article
Edit
Identifies the IsActiveView dependency property.
public : static DependencyProperty IsActiveViewProperty { get; }
static DependencyProperty IsActiveViewProperty();
public static DependencyProperty IsActiveViewProperty { get; }

Returns
DependencyProperty
The identifier for the IsActiveView dependency property.
ListViewBase.IsDragSource ListViewBase.IsDragSource
ListViewBase.IsDragSource
I n this Article
Edit
Returns a value that indicates whether the list view is both the drag source and drop target in a drag-and-drop
operation.
public : Platform::Boolean IsDragSource()
bool IsDragSource() const;
public bool IsDragSource()

Returns
bool
true if the list view is both the drag source and drop target; otherwise, false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
For more info, see Drag and drop.
Version compatibility
The IsDragSource method is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not call this method without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
method before you use it.
if (ApiInformation.IsMethodPresent("Windows.UI.Xaml.Controls.ListViewBase", "IsDragSource"))
{
bool isDragSource = listView1.IsDragSource();
}
ListViewBase.IsItemClickEnabled ListViewBase.IsItemClick
Enabled ListViewBase.IsItemClickEnabled
I n this Article
Edit
Gets or sets a value that indicates whether items in the view fire an ItemClick event in response to interaction.
public : Platform::Boolean IsItemClickEnabled { get; set; }
bool IsItemClickEnabled();

void IsItemClickEnabled(bool isitemclickenabled);


public bool IsItemClickEnabled { get; set; }

<listViewBase IsItemClickEnabled="bool" />

Returns
bool
true if interaction fires an ItemClick event; otherwise, false. The default is false.

Remarks
By default, a user can select items in the view by tapping or clicking on them. You can change this behavior to make the
user interaction fire a click event instead of triggering item selection.
If you set the IsItemClickEnabled property to true, you must set the SelectionMode property to
ListViewSelectionMode.None. Handle the ItemClick event to respond to the user interaction.
See ItemClickItemClickItemClick
Also
ListViewBase.IsItemClickEnabledProperty ListViewBase.Is
ItemClickEnabledProperty ListViewBase.IsItemClick
EnabledProperty
I n this Article
Edit
Identifies the IsItemClickEnabled dependency property.
public : static DependencyProperty IsItemClickEnabledProperty { get; }
static DependencyProperty IsItemClickEnabledProperty();
public static DependencyProperty IsItemClickEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsItemClickEnabled dependency property.
ListViewBase.IsMultiSelectCheckBoxEnabled ListView
Base.IsMultiSelectCheckBoxEnabled ListViewBase.IsMulti
SelectCheckBoxEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a check box is shown to enable multi-selection.
public : Platform::Boolean IsMultiSelectCheckBoxEnabled { get; set; }
bool IsMultiSelectCheckBoxEnabled();

void IsMultiSelectCheckBoxEnabled(bool ismultiselectcheckboxenabled);


public bool IsMultiSelectCheckBoxEnabled { get; set; }

Returns
bool
true if a check box is shown to enable multi-selection; otherwise, false.
ListViewBase.IsMultiSelectCheckBoxEnabledProperty List
ViewBase.IsMultiSelectCheckBoxEnabledProperty List
ViewBase.IsMultiSelectCheckBoxEnabledProperty
I n this Article
Edit
Get the identifier for the IsMultiSelectCheckBoxEnabled dependency property.
public : static DependencyProperty IsMultiSelectCheckBoxEnabledProperty { get; }
static DependencyProperty IsMultiSelectCheckBoxEnabledProperty();
public static DependencyProperty IsMultiSelectCheckBoxEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsMultiSelectCheckBoxEnabled dependency property.
See Dependency properties overview
Also
ListViewBase.IsSwipeEnabled ListViewBase.IsSwipe
Enabled ListViewBase.IsSwipeEnabled
I n this Article
Edit
Gets or sets a value that indicates whether the view supports discrete input processing for a swipe interaction.
public : Platform::Boolean IsSwipeEnabled { get; set; }
bool IsSwipeEnabled();

void IsSwipeEnabled(bool isswipeenabled);


public bool IsSwipeEnabled { get; set; }

<listViewBase IsSwipeEnabled="bool" .../>

Returns
bool
true if discrete input processing for swipe interactions is enabled; otherwise, false. The default is true.

Remarks
Setting IsSwipeEnabled to false disables some default touch interactions, so it should be set to true when these
interactions are needed. For example:
If item selection is enabled and you set IsSwipeEnabled to false, a user can deselect items by right-clicking with the
mouse, but can't deselect an item with touch by using a swipe gesture.
If you set CanDragItems to true and IsSwipeEnabled to false, a user can drag items with the mouse, but not with
touch.
If you set CanReorderItems to true and IsSwipeEnabled to false, a user can reorder items with the mouse, but not with
touch.
You typically set IsSwipeEnabled to false to disable swipe animations when items in the view don't support interactions
that use the swipe gesture, like deselecting, dragging, and reordering. Disabling the animation when it's not needed can
improve the performance of your app.
See Touch interaction design
Also
ListViewBase.IsSwipeEnabledProperty ListViewBase.Is
SwipeEnabledProperty ListViewBase.IsSwipeEnabled
Property
I n this Article
Edit
Identifies the IsSwipeEnabled dependency property.
public : static DependencyProperty IsSwipeEnabledProperty { get; }
static DependencyProperty IsSwipeEnabledProperty();
public static DependencyProperty IsSwipeEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsSwipeEnabled dependency property.
ListViewBase.IsZoomedInView ListViewBase.IsZoomedIn
View ListViewBase.IsZoomedInView
I n this Article
Edit
Gets or sets a value that indicates whether the ListViewBase instance is the zoomed-in view in its owning
SemanticZoom.
public : Platform::Boolean IsZoomedInView { get; set; }
bool IsZoomedInView();

void IsZoomedInView(bool iszoomedinview);


public bool IsZoomedInView { get; set; }

Returns
bool
true if the ListViewBase is the zoomed-in view; otherwise, false.

Remarks
You typically don't set this property in XAML or in app code. The property is set implicitly when the view is set as either
the ZoomedInView or ZoomedOutView of a SemanticZoom control.
See SemanticZoom
Also
ListViewBase.IsZoomedInViewProperty ListViewBase.Is
ZoomedInViewProperty ListViewBase.IsZoomedInView
Property
I n this Article
Edit
Identifies the IsZoomedInView dependency property.
public : static DependencyProperty IsZoomedInViewProperty { get; }
static DependencyProperty IsZoomedInViewProperty();
public static DependencyProperty IsZoomedInViewProperty { get; }

Returns
DependencyProperty
The identifier for the IsZoomedInView dependency property.
ListViewBase.ItemClick ListViewBase.ItemClick ListView
Base.ItemClick
I n this Article
Edit
Occurs when an item in the list view receives an interaction, and the IsItemClickEnabled property is true.
public : event ItemClickEventHandler ItemClick
// Register
event_token ItemClick(ItemClickEventHandler const& handler) const;

// Revoke with event_token


void ItemClick(event_token const& cookie) const;

// Revoke with event_revoker


ItemClick_revoker ItemClick(auto_revoke_t, ItemClickEventHandler const& handler) const;
public event ItemClickEventHandler ItemClick

<listViewBase ItemClick="eventhandler" />

Remarks
If the list view is one of the views in a SemanticZoom, selection entails additional behavior that might change between
the views. This behavior is built in to the ListViewBase class, not theSemanticZoom class.
See How to change the interaction mode
Also
ListViewBase ListViewBase ListViewBase
I n this Article
Edit
Provides base-class initialization behavior for classes that are derived from the ListViewBase class.

protected : ListViewBase()
ListViewBase() const;
protected ListViewBase()
ListViewBase.LoadMoreItemsAsync ListViewBase.Load
MoreItemsAsync ListViewBase.LoadMoreItemsAsync
I n this Article
Edit
Initiates the asynchronous request to load more data items, in accordance with the active incremental loading settings.
public : IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync()
IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync() const;
public IAsyncOperation<LoadMoreItemsResult> LoadMoreItemsAsync()

Returns
IAsyncOperation<LoadMoreItemsResult>
When the operation completes, returns a LoadMoreItemsResult payload.
Attributes RemoteAsyncAttribute
See Using virtualization with a list or grid
Also
ListViewBase.MakeVisible ListViewBase.MakeVisible List
ViewBase.MakeVisible
I n this Article
Edit
Forces content in the view to scroll until the item that's specified by SemanticZoomLocation is visible. Also focuses the
item if it finds the item.
public : void MakeVisible(SemanticZoomLocation item)
void MakeVisible(SemanticZoomLocation item) const;
public void MakeVisible(SemanticZoomLocation item)

Parameters
item SemanticZoomLocation
The item in the view to scroll to.

Remarks
You use the MakeVisible method to bring an item into view when the ListViewBase control is used as a view in a
SemanticZoom control. To bring an item into view when the ListViewBase control is not used in a SemanticZoom, use
the ScrollIntoView method instead.
See SemanticZoom
Also
ListViewBase.PrepareConnectedAnimation ListViewBase.
PrepareConnectedAnimation ListViewBase.Prepare
ConnectedAnimation
I n this Article
Edit
Returns a connected animation that's associated with the specified key, data item, and source element.
public : ConnectedAnimation PrepareConnectedAnimation(Platform::String key, Platform::Object item,
Platform::String elementName)
ConnectedAnimation PrepareConnectedAnimation(winrt::hstring key,
winrt::Windows::Foundation::IInspectable item, winrt::hstring elementName) const;
public ConnectedAnimation PrepareConnectedAnimation(String key, Object item, String elementName)

Parameters
key String
The key for the animation.
item Object
The data item that is animated out of view.
elementName String
The name of the element in the ItemTemplate that provides the animated visual.
Returns
ConnectedAnimation
The animation with the specified key.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ListViewBase.ReorderMode ListViewBase.ReorderMode
ListViewBase.ReorderMode
I n this Article
Edit
Gets or sets the reorder behavior for a ListViewBase instance. When Enabled, unsorted and ungrouped lists can be
reordered by user manipulation.
public : ListViewReorderMode ReorderMode { get; set; }
ListViewReorderMode ReorderMode();

void ReorderMode(ListViewReorderMode reordermode);


public ListViewReorderMode ReorderMode { get; set; }

<listViewBase ReorderMode="Enabled"/>
-or-
<listViewBase ReorderMode="Disabled"/>

Returns
ListViewReorderMode
One of the ListViewReorderMode enumeration values. The default is Disabled.
ListViewBase.ReorderModeProperty ListViewBase.
ReorderModeProperty ListViewBase.ReorderMode
Property
I n this Article
Edit
Identifies the ReorderMode dependency property.
public : static DependencyProperty ReorderModeProperty { get; }
static DependencyProperty ReorderModeProperty();
public static DependencyProperty ReorderModeProperty { get; }

Returns
DependencyProperty
The identifier for the ReorderMode dependency property.
ListViewBase.ScrollIntoView ListViewBase.ScrollIntoView
ListViewBase.ScrollIntoView
I n this Article

Overloads
ScrollIntoView(Object) ScrollIntoView(Object) ScrollIntoView(
Object) Scrolls the list to bring the specified data item into view.

ScrollIntoView(Object, ScrollIntoViewAlignment) ScrollInto


View(Object, ScrollIntoViewAlignment) ScrollIntoView(Object, Scrolls the list to bring the specified data item into view with
ScrollIntoViewAlignment) the specified alignment.

ScrollIntoView(Object) ScrollIntoView(Object)
ScrollIntoView(Object)
Edit
Scrolls the list to bring the specified data item into view.

public : void ScrollIntoView(Platform::Object item)


void ScrollIntoView(winrt::Windows::Foundation::IInspectable item) const;
public void ScrollIntoView(Object item)

Parameters
item Object
The data item to bring into view.
Attributes OverloadAttribute
Remarks
You use the ScrollIntoView method to bring an item into view when the ListViewBase control is not used as a view in a
SemanticZoom control. To bring an item into view when the ListViewBase control is used in a SemanticZoom, use the
MakeVisible method instead.
When the contents of the ItemsSource collection changes, particularly if many items are added to or removed from the
collection, you might need to call UpdateLayout prior to calling ScrollIntoView for the specified item to scroll into the
viewport.
See
Also
ScrollIntoView (Object, ScrollIntoViewAlignment)ScrollIntoView (Object,
ScrollIntoViewAlignment)ScrollIntoView (Object, ScrollIntoViewAlignment)

ScrollIntoView(Object, ScrollIntoViewAlignment)
ScrollIntoView(Object, ScrollIntoViewAlignment)
ScrollIntoView(Object, ScrollIntoViewAlignment)
Edit
Scrolls the list to bring the specified data item into view with the specified alignment.
public : void ScrollIntoView(Platform::Object item, ScrollIntoViewAlignment alignment)
void ScrollIntoView(winrt::Windows::Foundation::IInspectable item, ScrollIntoViewAlignment
alignment) const;
public void ScrollIntoView(Object item, ScrollIntoViewAlignment alignment)

Parameters
item Object
The data item to bring into view.
alignment ScrollIntoViewAlignment
An enumeration value that specifies whether the item uses Default or Leading alignment.
Attributes OverloadAttribute
Remarks
You use the ScrollIntoView method to bring an item into view when the ListViewBase control is not used as a view in a
SemanticZoom control. To bring an item into view when the ListViewBase control is used in a SemanticZoom, use the
MakeVisible method instead.
When the contents of the ItemsSource collection changes, particularly if many items are added to or removed from the
collection, you might need to call UpdateLayout prior to calling ScrollIntoView for the specified item to scroll into the
viewport.
See ScrollIntoView (Object)ScrollIntoView (Object)ScrollIntoView (Object)
Also
ListViewBase.SelectAll ListViewBase.SelectAll ListView
Base.SelectAll
I n this Article
Edit
Selects all the items in a view.
public : void SelectAll()
void SelectAll() const;
public void SelectAll()

Examples
<GridView x:Name="itemGridView"/>

if (itemGridView.SelectionMode == ListViewSelectionMode.Multiple ||
itemGridView.SelectionMode == ListViewSelectionMode.Extended)
{
itemGridView.SelectAll();
}

if (itemGridView().SelectionMode() == Windows::UI::Xaml::Controls::ListViewSelectionMode::Multiple
||
itemGridView().SelectionMode() == Windows::UI::Xaml::Controls::ListViewSelectionMode::Extended)
{
itemGridView().SelectAll();
}

If itemGridView.SelectionMode = ListViewSelectionMode.Multiple OrElse


itemGridView.SelectionMode = ListViewSelectionMode.Extended Then

itemGridView.SelectAll()
End If

Remarks
W arning

Call the SelectAll method only when the SelectionMode property is set to Multiple or Extended. If you call SelectAll
when the SelectionMode is Single or None, an exception is thrown.
Starting in Windows 10, you can use the SelectRange and DeselectRange methods with the SelectedRanges property
to make selections using ranges of indexes. This is a more efficient way to describe item selection than using
SelectedItems, which requires the actual item object to be created for each selected item. To select all items using index
ranges, use SelectRange.
See ItemIndexRange
Also
ListViewBase.SelectedItems ListViewBase.SelectedItems
ListViewBase.SelectedItems
I n this Article
Edit
Gets the currently selected items.
public : IVector<Platform::Object> SelectedItems { get; }
IVector<winrt::Windows::Foundation::IInspectable> SelectedItems();
public IList<object> SelectedItems { get; }

Returns
IList<object>
A collection of the currently selected items. The default is an empty collection.

Remarks
When SelectionMode is Multiple or Extended, use the SelectedItems property to get the items that are selected.
When SelectionMode is Single, use the Selector.SelectedItem property to get the item that's selected.
Starting in Windows 10, you can use the SelectRange and DeselectRange methods with the SelectedRanges property
to make selections using ranges of indexes. This is a more efficient way to describe item selection than using
SelectedItems, which requires the actual item object to be created for each selected item.
Note

If the ItemsSource implements IItemsRangeInfo, the SelectedItems collection is not updated based on selection in the
list. Use the SelectedRanges property instead.
See SelectedItem
Also SelectedIndex
SelectionChanged
ListViewBase.SelectedRanges ListViewBase.Selected
Ranges ListViewBase.SelectedRanges
I n this Article
Edit
Gets a collection of ItemIndexRange objects that describe the currently selected items in the list.
public : IVectorView<ItemIndexRange> SelectedRanges { get; }
IVectorView<ItemIndexRange> SelectedRanges();
public IReadOnlyList<ItemIndexRange> SelectedRanges { get; }

Returns
IReadOnlyList<ItemIndexRange>
The collection of ItemIndexRange objects that describe the currently selected items in the list. The default is an empty
collection.

Remarks
Each ItemIndexRange in the SelectedRanges collection describes a contiguous block of selected items.
ItemIndexRange describes the selection by index, so item objects don't need to be created. This is a more efficient way
to describe item selection than using SelectedItems, which requires the actual item object to be created for each
selected item.
If your datasource performs data virtualization, you can use the SelectedRanges property with the SelectRange and
DeselectRange methods to modify selection of items that have not been created yet.
Note

If the ItemsSource implements IItemsRangeInfo, the SelectedItems collection is not updated based on selection in the
list. Use the SelectedRanges property instead.
See ItemIndexRange
Also
ListViewBase.SelectionMode ListViewBase.SelectionMode
ListViewBase.SelectionMode
I n this Article
Edit
Gets or sets the selection behavior for a ListViewBase instance.
public : ListViewSelectionMode SelectionMode { get; set; }
ListViewSelectionMode SelectionMode();

void SelectionMode(ListViewSelectionMode selectionmode);


public ListViewSelectionMode SelectionMode { get; set; }

<listViewBase SelectionMode="listViewSelectionModeMemberName" />

Returns
ListViewSelectionMode
One of the ListViewSelectionMode enumeration values. The default is Single selection.

Remarks
By default, a user can select a single item in a view. You can set the SelectionMode property to a
ListViewSelectionMode enumeration value to enable multi-selection or to disable selection. Here are the selection
mode values.

@Windows.UI.Xaml.Controls.ListViewSelectionMode? Item selection is disabled.


text=None

@Windows.UI.Xaml.Controls.ListViewSelectionMode? With no modifier keys:


text=Single A user can select a single item using the space bar, mouse
click, or touch tap.
A user can deselect an item using a downward swipe gesture.
While pressing Ctrl:
A user can deselect the item by using the space bar, mouse
click, or touch tap.
Using the arrow keys, a user can move focus independently of
selection.

@Windows.UI.Xaml.Controls.ListViewSelectionMode? With no modifier keys:


text=Multiple A user can select multiple items using the space bar, mouse
click, or touch tap to toggle selection on the focused item.
Using the arrow keys, a user can move focus independently of
selection.
@Windows.UI.Xaml.Controls.ListViewSelectionMode? With no modifier keys:
text=Extended The behavior is the same as
@Windows.UI.Xaml.Controls.ListViewSelectionMode?
text=Single selection.
While pressing Ctrl:
A user can select multiple items using the space bar, mouse
click, or touch tap to toggle selection on the focused item.
Using the arrow keys, a user can move focus independently of
selection.
While pressing Shift:
A user can select multiple contiguous items by clicking or
tapping the first item in the selection and then the last item in
the selection.
Using the arrow keys, a user can create a contiguous selection
starting with the item selected when Shift is pressed.

Note

Touch interactions are enabled only when IsSwipeEnabled is true.


If SelectionMode is None, and CanDragItems and CanReorderItems are false, you should set IsSwipeEnabled to false
to improve app performance. See the IsSwipeEnabled property for more info.
When SelectionMode is Single, use the Selector.SelectedItem property to get the item that's selected. When
SelectionMode is Multiple or Extended, use the SelectedItems property to get the items that are selected.
When item selection is disabled, you can make items respond to a user click like a button instead of being selected. To
do this, set SelectionMode to None, the IsItemClickEnabled property to true, and handle the ItemClick event.
For more info and examples, see How to change the interaction mode.
See SelectedItem
Also SelectedIndex
SelectionChanged
How to change the interaction mode
ListViewBase.SelectionModeProperty ListViewBase.
SelectionModeProperty ListViewBase.SelectionMode
Property
I n this Article
Edit
Identifies the SelectionMode dependency property.
public : static DependencyProperty SelectionModeProperty { get; }
static DependencyProperty SelectionModeProperty();
public static DependencyProperty SelectionModeProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionMode dependency property.
ListViewBase.SelectRange ListViewBase.SelectRange List
ViewBase.SelectRange
I n this Article
Edit
Selects a block of items described by the ItemIndexRange.
public : void SelectRange(ItemIndexRange itemIndexRange)
void SelectRange(ItemIndexRange itemIndexRange) const;
public void SelectRange(ItemIndexRange itemIndexRange)

Parameters
itemIndexRange ItemIndexRange
Information about the range of items, including the index of the first and last items in the range, and the number of
items.

Examples
Here's how to select the first 9 items in a ListView named itemListView .

if (itemListView.SelectionMode == ListViewSelectionMode.Multiple ||
itemListView.SelectionMode == ListViewSelectionMode.Extended)
{
itemListView.SelectRange(new ItemIndexRange(0, 9));
}

Remarks
SelectRange and DeselectRange provide a more efficient way to modify the selection than using the SelectedItems
property. When you select items using index ranges, use the SelectedRanges property to get all selected ranges in the
list.
When you call SelectRange, all items in the specified range are selected, regardless of their original selection state. You
can select all items in a collection by using an ItemIndexRange with a FirstIndex value of 0 and a Length value equal to
the number of items in the collection.
W arning

Call the SelectRange method only when the SelectionMode property is set to Multiple or Extended. If you call
SelectRange when the SelectionMode is Single or None, an exception is thrown.
Note

If the ItemsSource implements IItemsRangeInfo, the SelectedItems collection is not updated based on selection in the
list. Use the SelectedRanges property instead.
See ItemIndexRange
Also
ListViewBase.SemanticZoomOwner ListViewBase.
SemanticZoomOwner ListViewBase.SemanticZoom
Owner
I n this Article
Edit
Gets or sets the SemanticZoom instance that hosts the ListViewBase.
public : SemanticZoom SemanticZoomOwner { get; set; }
SemanticZoom SemanticZoomOwner();

void SemanticZoomOwner(SemanticZoom semanticzoomowner);


public SemanticZoom SemanticZoomOwner { get; set; }

Returns
SemanticZoom
The SemanticZoom instance that hosts this view, or null if the view is not hosted in a SemanticZoom control.

Remarks
You don't set this property in Extensible Application Markup Language (XAML ) or in your app code. The property is set
implicitly when the view is set as either the ZoomedInView or ZoomedOutView of a SemanticZoom control.
See SemanticZoom
Also
ListViewBase.SemanticZoomOwnerProperty ListView
Base.SemanticZoomOwnerProperty ListViewBase.
SemanticZoomOwnerProperty
I n this Article
Edit
Identifies the SemanticZoomOwner dependency property.
public : static DependencyProperty SemanticZoomOwnerProperty { get; }
static DependencyProperty SemanticZoomOwnerProperty();
public static DependencyProperty SemanticZoomOwnerProperty { get; }

Returns
DependencyProperty
The identifier for the SemanticZoomOwner dependency property.
ListViewBase.SetDesiredContainerUpdateDuration List
ViewBase.SetDesiredContainerUpdateDuration ListView
Base.SetDesiredContainerUpdateDuration
I n this Article
Edit
Sets the maximum target time between two render passes when a ListViewBase is updating its UI with data items
during initial load or scrolling.
public : void SetDesiredContainerUpdateDuration(TimeSpan duration)
void SetDesiredContainerUpdateDuration(TimeSpan duration) const;
public void SetDesiredContainerUpdateDuration(TimeSpan duration)

Parameters
duration TimeSpan
The maximum target time between two render passes.
ListViewBase.ShowsScrollingPlaceholders ListViewBase.
ShowsScrollingPlaceholders ListViewBase.ShowsScrolling
Placeholders
I n this Article
Edit
Gets or sets a value that indicates whether the view shows placeholder UI for items during scrolling.
public : Platform::Boolean ShowsScrollingPlaceholders { get; set; }
bool ShowsScrollingPlaceholders();

void ShowsScrollingPlaceholders(bool showsscrollingplaceholders);


public bool ShowsScrollingPlaceholders { get; set; }

<listViewBase ShowsScrollingPlaceholders="bool" />

Returns
bool
true if the view shows placeholder UI for items during scrolling; otherwise, false. The default is true.
ListViewBase.ShowsScrollingPlaceholdersProperty List
ViewBase.ShowsScrollingPlaceholdersProperty ListView
Base.ShowsScrollingPlaceholdersProperty
I n this Article
Edit
Identifies the ShowsScrollingPlaceholders dependency property.
public : static DependencyProperty ShowsScrollingPlaceholdersProperty { get; }
static DependencyProperty ShowsScrollingPlaceholdersProperty();
public static DependencyProperty ShowsScrollingPlaceholdersProperty { get; }

Returns
DependencyProperty
The identifier for the ShowsScrollingPlaceholders dependency property.
ListViewBase.SingleSelectionFollowsFocus ListViewBase.
SingleSelectionFollowsFocus ListViewBase.Single
SelectionFollowsFocus
I n this Article
Edit
Gets or sets a value that indicates whether item selection changes when keyboard focus changes.
public : Platform::Boolean SingleSelectionFollowsFocus { get; set; }
bool SingleSelectionFollowsFocus();

void SingleSelectionFollowsFocus(bool singleselectionfollowsfocus);


public bool SingleSelectionFollowsFocus { get; set; }

<listViewBase SingleSelectionFollowsFocus="bool" />

Returns
bool
true if item selection changes when keyboard focus changes; otherwise, false. The default is true.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
This property is ignored if the list view's SelectionMode property is not set to Single.
By default, when a list view is configured for single selection, when the user moves keyboard focus to an item, the
focused item is also selected. For example, if keyboard focus is moved from the first item to the second item, the
SelectedIndex property is updated from 0 to 1.
Set this property to false to let a user move focus without the item selection following. For example, if each selection
change causes significant UI updates, you might prefer to let the user move focus to a non-adjacent item and then
press enter to update selection.
Version compatibility
The SingleSelectionFollowsFocus property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<ListView x:Name="listView1" Loaded="ListView_Loaded"/>
private void ListView_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.ListViewBase",
"SingleSelectionFollowsFocus"))
{
listView1.SingleSelectionFollowsFocus = false;
}
}
ListViewBase.SingleSelectionFollowsFocusProperty List
ViewBase.SingleSelectionFollowsFocusProperty ListView
Base.SingleSelectionFollowsFocusProperty
I n this Article
Edit
Identifies the SingleSelectionFollowsFocus dependency property.
public : static DependencyProperty SingleSelectionFollowsFocusProperty { get; }
static DependencyProperty SingleSelectionFollowsFocusProperty();
public static DependencyProperty SingleSelectionFollowsFocusProperty { get; }

Returns
DependencyProperty
The identifier for the SingleSelectionFollowsFocus dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


ListViewBase.StartViewChangeFrom ListViewBase.Start
ViewChangeFrom ListViewBase.StartViewChangeFrom
I n this Article
Edit
Initializes item-wise operations that are related to a view change when the ListViewBase instance is the source view
and the pending destination view is a potentially different implementing view.
public : void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)
void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void StartViewChangeFrom(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
See SemanticZoom
Also
ListViewBase.StartViewChangeTo ListViewBase.StartView
ChangeTo ListViewBase.StartViewChangeTo
I n this Article
Edit
Initializes item-wise operations that are related to a view change when the source view is a different view and the
pending destination view is the ListViewBase instance.
public : void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)
void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination) const;
public void StartViewChangeTo(SemanticZoomLocation source, SemanticZoomLocation destination)

Parameters
source SemanticZoomLocation
The view item as represented in the source view.
destination SemanticZoomLocation
The view item as represented in the destination view.
See SemanticZoom
Also
ListViewBase.TryStartConnectedAnimationAsync ListView
Base.TryStartConnectedAnimationAsync ListViewBase.Try
StartConnectedAnimationAsync
I n this Article
Edit
Attempts to start the animation.
public : IAsyncOperation<Platform::Boolean> TryStartConnectedAnimationAsync(ConnectedAnimation
animation, Platform::Object item, Platform::String elementName)
IAsyncOperation<bool> TryStartConnectedAnimationAsync(ConnectedAnimation animation,
winrt::Windows::Foundation::IInspectable item, winrt::hstring elementName) const;
public IAsyncOperation<bool> TryStartConnectedAnimationAsync(ConnectedAnimation animation, Object
item, String elementName)

Parameters
animation ConnectedAnimation
The animation to start.
item Object
The data item that is animated into view.
elementName String
The name of the element in the ItemTemplate that provides the animated visual.
Returns
IAsyncOperation<bool>
true if the animation started; false if the animation has already been started, if it is no longer active, or if the
destination element is the same as the source element.
Attributes RemoteAsyncAttribute
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


ListViewBaseHeaderItem ListViewBaseHeaderItem List
ViewBaseHeaderItem Class
Provides the infrastructure for the ListViewHeaderItem and GridViewHeaderItem classes.

D eclaration
public : class ListViewBaseHeaderItem : ContentControl, IListViewBaseHeaderItem
struct winrt::Windows::UI::Xaml::Controls::ListViewBaseHeaderItem : ContentControl,
IListViewBaseHeaderItem
public class ListViewBaseHeaderItem : ContentControl, IListViewBaseHeaderItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
For user interface purposes, ListViewBaseHeaderItem should be thought of as an abstract base class. Use
ListViewHeaderItem or GridViewHeaderItem instead.
ListV iewB aseH eaderI tem derived classes
ListViewBaseHeaderItem is the parent class for GridViewHeaderItem and ListViewHeaderItem.

See Also
ContentControl
ListViewHeaderItem ListViewHeaderItem ListViewHeader
Item Class
Represents items in the header for grouped data inside a ListView.

D eclaration
public : class ListViewHeaderItem : ListViewBaseHeaderItem, IListViewHeaderItem
struct winrt::Windows::UI::Xaml::Controls::ListViewHeaderItem : ListViewBaseHeaderItem,
IListViewHeaderItem
public class ListViewHeaderItem : ListViewBaseHeaderItem, IListViewHeaderItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ListViewBaseHeaderItem

Remarks
ListViewHeaderItem is a control that's created by the system and added to the visual tree when the data templates for
a grouped ListView are realized. Specifically, it's created when realizing the GroupStyle.HeaderTemplate. You don't
typically define elements for ListViewHeaderItem in XAML. There's a default template for ListViewHeaderItem as part
of the built-in templates. The main app scenario for the ListViewHeaderItem class is to copy and replace the default
style and template with a style of your own, which also implicitly targets ListViewHeaderItem.
There's a dedicated automation peer class for ListViewHeaderItem, ListViewHeaderItemAutomationPeer. This is
because after the ListView is realized, all the created item parts need automation representation, so that Microsoft UI
Automation can report them in the tree it provides for assistive technology and other Microsoft UI Automation clients.
If you use the GroupStyle.HeaderContainerStyle property, the Style it contains must have a TargetType value of either
ListViewHeaderItem or GridViewHeaderItem.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the ListViewHeaderItem control.
R ES O U R CE K EY D ES CR IPTIO N

ListViewHeaderItemBackground Item background color

ListViewHeaderItemDividerStroke Divider line color

Constructors
ListViewHeaderItem()
ListViewHeaderItem()
ListViewHeaderItem()

Initializes a new instance of the ListViewHeaderItem class.

See Also
ListViewBaseHeaderItem
ListViewBaseHeaderItem
ListViewHeaderItem ListViewHeaderItem ListViewHeader
Item
I n this Article
Edit
Initializes a new instance of the ListViewHeaderItem class.
public : ListViewHeaderItem()
ListViewHeaderItem() const;
public ListViewHeaderItem()
ListViewItem ListViewItem ListViewItem Class
Represents the container for an item in a ListView control.

D eclaration
public : class ListViewItem : SelectorItem, IListViewItem
struct winrt::Windows::UI::Xaml::Controls::ListViewItem : SelectorItem, IListViewItem
public class ListViewItem : SelectorItem, IListViewItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem

Remarks
The ListViewItem class provides the container for items displayed in a ListView control. You populate the ListView by
adding objects directly to its Items collection or by binding its ItemsSource property to a data source. When items are
added to the ListView, a ListViewItem container is created automatically for each item in the collection.
You can specify the look of the ListViewItem by setting the ListView 's ItemContainerStyle property to a Style with a
TargetType of ListViewItem.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
If you style the control template, do not try to bind properties like IsSelected or Background properties on the
ListViewItemPresenter, perhaps to implement your own selection binding system, since your binding may be replaced
by the control's internal mechanism.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the ListViewItem control.

R ES O U R CE K EY D ES CR IPTIO N

ListViewItemForeground Text color at rest

ListViewItemForegroundPointerOver Text color on hover


ListViewItemForegroundPressed Text color when pressed

ListViewItemBackground Background color at rest

ListViewItemBackgroundPointerOver Background color on hover

ListViewItemBackgroundPressed Background color when pressed

ListViewItemBackgroundSelected Background color when selected

ListViewItemBackgroundSelectedPointerOver Background color on hover and selected

ListViewItemBackgroundSelectedPressed Background color when pressed and selected

ListViewItemFocusVisualPrimaryBrush Focus indicator color when focused

ListViewItemFocusVisualSecondaryBrush Secondary focus indicator color when focused

ListViewItemFocusBorderBrush Border color when focused

ListViewItemFocusSecondaryBorderBrush Secondary border color when focused

ListViewItemCheckBrush Check mark color on selected item

ListViewItemCheckBoxBrush Checkmark box color on selected item

ListViewItemDragBackground Item background color when being dragged

ListViewItemDragForeground Item foreground color when being dragged

ListViewItemPlaceholderBackground Background color of item placeholder

ListViewItemSelectionCheckMarkVisualEnabled Boolean that specifies whether checkmark visual is shown

ListViewItemCheckMode Specifies how checkmark is shown ("Overlay" or "Inline")

Windows 8.1 To assign a custom value based on the data item to the AutomationProperties.Name attached
property, you must bind to the item container's Content property. For example, assume you have a Customer data
item that has a Name property and you want to use the Customer.Name property as the
AutomationProperties.Name value.

In Windows 8, the data item is set as the DataContext of the item container, so you can use a binding like this:
AutomationProperties.Name="{Binding Name}" .

In Windows 8.1, the item container's DataContext is not set. To bind the AutomationProperties.Name value to the data
item's Name property, use a binding like this:
AutomationProperties.Name="{Binding Path=Content.Name,RelativeSource={RelativeSource Mode=Self}}" .

Constructors
ListViewItem()
ListViewItem()
ListViewItem()

Initializes a new instance of the ListViewItem class.

Properties
TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when you're
defining templates for a ListViewItem class.

See Also
SelectorItem
SelectorItem
SelectorItem
ListViewItem ListViewItem ListViewItem
I n this Article
Edit
Initializes a new instance of the ListViewItem class.

public : ListViewItem()
ListViewItem() const;
public ListViewItem()
ListViewItem.TemplateSettings ListViewItem.Template
Settings ListViewItem.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when you're
defining templates for a ListViewItem class.
public : ListViewItemTemplateSettings TemplateSettings { get; }
ListViewItemTemplateSettings TemplateSettings();
public ListViewItemTemplateSettings TemplateSettings { get; }

Returns
ListViewItemTemplateSettings
An object that provides calculated values for templates.
ListViewItemToKeyHandler ListViewItemToKeyHandler
ListViewItemToKeyHandler Delegate
Represents the method that will handle callback for the GetRelativeScrollPosition method.

D eclaration
public : delegate Platform::String ListViewItemToKeyHandler(Platform::Object item)
struct ListViewItemToKeyHandler : winrt::Windows::Foundation::IUnknown
{
ListViewItemToKeyHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> ListViewItemToKeyHandler(L lambda);
template <typename F> ListViewItemToKeyHandler(F* function);
template <typename O, typename M> ListViewItemToKeyHandler(O* object, M method);
winrt::hstring operator()(winrt::Windows::Foundation::IInspectable const& item) const;
};
public delegate string ListViewItemToKeyHandler(Object item)

I nheritance H ierarchy
None
ListViewKeyToItemHandler ListViewKeyToItemHandler
ListViewKeyToItemHandler Delegate
Represents the asynchronous method that will handle callback for the SetRelativeScrollPositionAsync method.

D eclaration
public : delegate IAsyncOperation<Platform::Object> ListViewKeyToItemHandler(Platform::String
key)
struct ListViewKeyToItemHandler : winrt::Windows::Foundation::IUnknown
{
ListViewKeyToItemHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> ListViewKeyToItemHandler(L lambda);
template <typename F> ListViewKeyToItemHandler(F* function);
template <typename O, typename M> ListViewKeyToItemHandler(O* object, M method);
winrt::Windows::Foundation::IAsyncOperation<winrt::Windows::Foundation::IInspectable>
operator()(winrt::hstring const& key) const;
};
public delegate IAsyncOperation<object> ListViewKeyToItemHandler(String key)

I nheritance H ierarchy
None
ListViewPersistenceHelper ListViewPersistenceHelper List
ViewPersistenceHelper Class
Represents a helper class to save and retrieve the relative scroll position of the ListView.

D eclaration
public : sealed class ListViewPersistenceHelper : IListViewPersistenceHelper
struct winrt::Windows::UI::Xaml::Controls::ListViewPersistenceHelper :
IListViewPersistenceHelper
public sealed class ListViewPersistenceHelper : IListViewPersistenceHelper

I nheritance H ierarchy
None

Remarks
If the ItemsStackPanel.ItemsUpdatingScrollMode property is set to KeepItemsInView, ListViewPersistenceHelper
attempts to restore the scroll position using the key of the first visible item. If ItemsUpdatingScrollMode is
KeepLastItemInView, it attempts to restore the scroll position using the key of the last visible item.

Methods
GetRelativeScrollPosition(ListViewBase, ListViewItemToKeyHandler)
GetRelativeScrollPosition(ListViewBase, ListViewItemToKeyHandler)
GetRelativeScrollPosition(ListViewBase, ListViewItemToKeyHandler)

Retrieves the relative scroll position of the ListView.

SetRelativeScrollPositionAsync(ListViewBase, String, ListViewKeyToItemHandler)


SetRelativeScrollPositionAsync(ListViewBase, String, ListViewKeyToItemHandler)
SetRelativeScrollPositionAsync(ListViewBase, String, ListViewKeyToItemHandler)

Begins an asynchronous action to set the relative scroll position of the ListView.
ListViewPersistenceHelper.GetRelativeScrollPosition List
ViewPersistenceHelper.GetRelativeScrollPosition ListView
PersistenceHelper.GetRelativeScrollPosition
I n this Article
Edit
Retrieves the relative scroll position of the ListView.
public : static Platform::String GetRelativeScrollPosition(ListViewBase listViewBase,
ListViewItemToKeyHandler itemToKeyHandler)
static winrt::hstring GetRelativeScrollPosition(ListViewBase listViewBase, ListViewItemToKeyHandler
itemToKeyHandler) const;
public static string GetRelativeScrollPosition(ListViewBase listViewBase, ListViewItemToKeyHandler
itemToKeyHandler)

Parameters
listViewBase ListViewBase
The ListView object.
itemToKeyHandler ListViewItemToKeyHandler
The method that will handle the retrieval of the item key.
Returns
string
The relative scroll position of the ListView.
ListViewPersistenceHelper.SetRelativeScrollPositionAsync
ListViewPersistenceHelper.SetRelativeScrollPositionAsync
ListViewPersistenceHelper.SetRelativeScrollPositionAsync
I n this Article
Edit
Begins an asynchronous action to set the relative scroll position of the ListView.
public : static IAsyncAction SetRelativeScrollPositionAsync(ListViewBase listViewBase,
Platform::String relativeScrollPosition, ListViewKeyToItemHandler keyToItemHandler)
static IAsyncAction SetRelativeScrollPositionAsync(ListViewBase listViewBase, winrt::hstring
relativeScrollPosition, ListViewKeyToItemHandler keyToItemHandler) const;
public static IAsyncAction SetRelativeScrollPositionAsync(ListViewBase listViewBase, String
relativeScrollPosition, ListViewKeyToItemHandler keyToItemHandler)

Parameters
listViewBase ListViewBase
The ListView.
relativeScrollPosition String
The relative scroll position of the ListView.
keyToItemHandler ListViewKeyToItemHandler
The method that will handle the retrieval of the ListView item given the key.
Returns
IAsyncAction
An asynchronous action.
Attributes RemoteAsyncAttribute
ListViewReorderMode ListViewReorderMode ListView
ReorderMode Enum
Defines constants that specify the reorder mode of a ListView or GridView.

D eclaration
public : enum class ListViewReorderMode
enum class winrt::Windows::UI::Xaml::Controls::ListViewReorderMode : int32_t
public enum ListViewReorderMode

I nheritance H ierarchy
None

Fields
Disabled Disabled Disabled A user can't reorder the list.

Enabled Enabled Enabled A user can reorder the list.


ListViewSelectionMode ListViewSelectionMode ListView
SelectionMode Enum
Defines constants that specify the selection mode of a ListView or GridView.

D eclaration
public : enum class ListViewSelectionMode
enum class winrt::Windows::UI::Xaml::Controls::ListViewSelectionMode : int32_t
public enum ListViewSelectionMode

I nheritance H ierarchy
None

Fields
Extended Extended The user can select multiple items by entering a special mode, for example when depressing a
Extended modifier key.

Multiple Multiple The user can select multiple items without entering a special mode.
Multiple

None None None A user can't select items.

Single Single Single A user can select a single item.


MediaElement MediaElement MediaElement Class
Represents an object that renders audio and video to the display. See Remarks.

D eclaration
public : sealed class MediaElement : FrameworkElement, IMediaElement, IMediaElement2,
IMediaElement3
struct winrt::Windows::UI::Xaml::Controls::MediaElement : FrameworkElement, IMediaElement,
IMediaElement2, IMediaElement3
public sealed class MediaElement : FrameworkElement, IMediaElement, IMediaElement2,
IMediaElement3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
[!IMPORTANT] In Windows 10, build 1607 and on we recommend that you use MediaPlayerElement in place of
MediaElement. MediaPlayerElement has the same functionality as MediaElement, while also enabling more
advanced media playback scenarios. Additionally, all future improvements in media playback will happen in
MediaPlayerElement.

 Tip

For more info, design guidance, and code examples, see Media playback.
Use a MediaElement control to play audio and video files in your app. Built– in media transport controls let users
interact with their media by providing a default playback experience comprised of various buttons including play,
pause, closed captions, and others. See MediaTransportControls for more info.
For info about the media formats that MediaElement supports, see Supported codecs.
For info about performance related to MediaElement, see Optimize animations and media.
Set the media source
Set the Source property of the MediaElement object to point to an audio or video file. The property can be set to the
Uniform Resource Identifier (URI) of a file that is included with the app or the Uniform Resource Identifier (URI) of a
file on the network. You can use the SetSource method to set the source to a file retrieved from the local system by
using a FileOpenPicker object.
By default, the media that is defined by the Source property plays immediately after the MediaElement object has
loaded. To suppress the media from starting automatically, set the AutoPlay property to false.
Live media streams report a NaturalDuration of Int64.MaxValue.
Here's how to create a MediaElement in XAML with the Source set to the path of a video file that is included in the app
and the AutoPlay property explicitly set to false.
<MediaElement Source="Media/video1.mp4" AutoPlay="false"/>

Here's how to create the MediaElement in code.


MediaElement mediaElement1 = new MediaElement();
mediaElement1.Source = new Uri("ms-appx:///Media/video1.mp4");
mediaElement1.AutoPlay = false;

// Add the MediaElement to the page.


rootGrid.Children.Add(mediaElement1);

H andle media events


You can respond to common media events such as the MediaOpened, MediaEnded, MediaFailed, and
CurrentStateChanged events. It is good practice to always handle the MediaFailed event.
Transport controls
Set the AreTransportControlsEnabled property to programmatically enable and disable the built in transport controls
for the MediaElement. The built in transport controls provide UI for playing, stopping, pausing, and seeking the media,
as well as UI for volume, mute, full window, track selection, and remaining time.
You can create your own media transport controls by setting AreTransportControlsEnabled to false, and using the
Play, Pause, and Stop methods. MediaElement also exposes a rich set of properties you can control like Position,
Volume, IsMuted, IsLooping, PlaybackRate, and Balance.
 Tip

For better performance, avoid data binding to the Position property to reflect frequent position updates (for example
with a progress bar). Instead, use the DispatcherTimer to query the Position property.
For more info and examples, see Create custom transport controls.
Open local media files
To open files on the local system or from Microsoft OneDrive, you can use the FileOpenPicker to get the file and
SetSource to set the media source, or you can programmatically access the user media folders.
If your app needs access without user interaction to the Music or Video folders, for example if you are enumerating all
the music or video files in the user's collection and displaying them in your app, then you need to declare the Music
Library and Video Library capabilities. For more info, see Files and folders in the Music, Pictures, and Videos
libraries.
The FileOpenPicker does not require special Capabilities to access files on the local file system, such as the user's
Music or Video folders, since the user has complete control over which file is being accessed. From a security and
privacy standpoint, it is best to minimize the number of capabilities your app uses.
To open local media using FileOpenP icker
1. Call FileOpenPicker to let the user pick a media file.
Use the FileOpenPicker class to select a media file. Set the FileTypeFilter to specify which file types the FileOpenPicker
will display. Call PickSingleFileAsync to launch the file picker and get the file.
1. Call SetSource to set the chosen media file as the MediaElement.Source.
To set the Source of the MediaElement to the StorageFile returned from the FileOpenPicker, you need to open a
stream. Call the OpenAsync method on the StorageFile returns a stream that you can pass into the
MediaElement.SetSource method. Then call Play on the MediaElement to start the media. This example shows how to
use the FileOpenPicker to choose a file and set the file as the Source of a MediaElement.
<MediaElement x:Name="mediaPlayer"/>
...
<Button Content="Choose file" Click="Button_Click"/>
private async void Button_Click(object sender, RoutedEventArgs e)
{
await SetLocalMedia();
}

async private System.Threading.Tasks.Task SetLocalMedia()


{
var openPicker = new Windows.Storage.Pickers.FileOpenPicker();

openPicker.FileTypeFilter.Add(".wmv");
openPicker.FileTypeFilter.Add(".mp4");
openPicker.FileTypeFilter.Add(".wma");
openPicker.FileTypeFilter.Add(".mp3");

var file = await openPicker.PickSingleFileAsync();

// mediaPlayer is a MediaElement defined in XAML


if (file != null)
{
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
mediaPlayer.SetSource(stream, file.ContentType);

mediaPlayer.Play();
}
}

Select audio tracks in different languages


Use the AudioStreamIndex property and the GetAudioStreamLanguage method to change the audio to a different
language track on a video. Videos can also contain multiple audio tracks in the same language, such as director
commentaries on films. This example specifically shows how to switch between different languages, but you can
modify this code to switch between any audio tracks.
To select audio tracks in different languages
1. Get the audio tracks.
To search for a track in a specific language, start by iterating through each audio track on the video. Use
AudioStreamCount as the max value for a for loop.
1. Get the language of the audio track.
Use the GetAudioStreamLanguage method to get the language of the track. The language of the track is identified by a
language code, such as "en" for English or "ja" for Japanese.
1. Set the active audio track.
When you find the track with the desired language, set the AudioStreamIndex to the index of the track. Setting
AudioStreamIndex to null selects the default audio track which is defined by the content. Here's some code that
attempts to set the audio track to the specified language. It iterates through the audio tracks on a MediaElement object
and uses GetAudioStreamLanguage to get the language of each track. If the desired language track exists, the
AudioStreamIndex is set to the index of that track.
/// <summary>
/// Attemps to set the audio track of a video to a specific language
/// </summary>
/// <param name="lcid">The id of the language. For example, "en" or "ja"</param>
/// <returns>true if the track was set; otherwise, false.</returns>
private bool SetAudioLanguage(string lcid, MediaElement media)
{
bool wasLanguageSet = false;

for (int index = 0; index < media.AudioStreamCount; index++)


{
if (media.GetAudioStreamLanguage(index) == lcid)
{
media.AudioStreamIndex = index;
wasLanguageSet = true;
}
}

return wasLanguageSet;
}

Full window playback


Use the IsFullWindow property to enable and disable full window rendering. When in full-window mode, input events
received on the MediaElement will still route through to the visual tree in the background. For example, if the
MediaElement is in a ListBox, turning the scroll wheel could cause the ListBox to scroll in the background. This can
cause unexpected behavior. If input events should not be routed when in full-window mode, the MediaElement should
handle the events.
Note

We recommend that you not use MediaElement in a Popup control. If a MediaElement hosted in a Popup is switched to
full-window mode, the Popup is rendered on top of the MediaElement. If you must use a MediaElement in a Popup,
you should collapse the Popup when the MediaElement enters full-window mode, and restore the Popup when the
MediaElement exits full-window mode. Use DependencyProperty.RegisterPropertyChangedCallback to be notified
when the MediaElement.IsFullWindow property changes. For an example, see the Examples section.
Keep media playing
To prevent the display from being deactivated when user action is no longer detected, such as when an app is playing
video, you can call DisplayRequest.RequestActive. To conserve power and battery life, you should call
DisplayRequest.RequestRelease to release the display request as soon as it is no longer required.
Here are some situations when you should release the display request:
Video playback is paused, for example by user action, buffering, or adjustment due to limited bandwidth.
Playback stops. For example, the video is done playing or the presentation is over.
A playback error has occurred. For example, network connectivity issues or a corrupted file. Here, you use the
CurrentStateChanged event to detect these situations. Then, use the IsAudioOnly property to determine whether an
audio or video file is playing, and keep the screen active only if video is playing.
<MediaElement Source="Media/video1.mp4"
CurrentStateChanged="MediaElement_CurrentStateChanged"/>
// Create this variable at a global scope. Set it to null.
private DisplayRequest appDisplayRequest = null;

private void MediaElement_CurrentStateChanged(object sender, RoutedEventArgs e)


{
MediaElement mediaElement = sender as MediaElement;
if (mediaElement != null && mediaElement.IsAudioOnly == false)
{
if (mediaElement.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Playing)
{
if (appDisplayRequest == null)
{
// This call creates an instance of the DisplayRequest object.
appDisplayRequest = new DisplayRequest();
appDisplayRequest.RequestActive();
}
}
else // CurrentState is Buffering, Closed, Opening, Paused, or Stopped.
{
if (appDisplayRequest != null)
{
// Deactivate the display request and set the var to null.
appDisplayRequest.RequestRelease();
appDisplayRequest = null;
}
}
}
}

Poster source
You can use the PosterSource property to provide your MediaElement with a visual representation before the media is
loaded. A PosterSource is an image, such as a screen shot or movie poster, that is displayed in place of the media. The
PosterSource is displayed in the following situations:
When a valid source is not set. For example, Source is not set, Source was set to Null, or the source is invalid (as is the
case when a MediaFailed event fires).
While media is loading. For example, a valid source is set, but the MediaOpened event has not fired yet.
When media is streaming to another device.
When the media is audio only.
Notes for previous versions
Windows 8.1
On Windows Phone, you can only have one MediaElement at a time.
To let audio continue to play when your app is in the background, set the AudioCategory property to
BackgroundCapableMedia. This also requires declaring the "Audio" background task capability in the app manifest.
These values are deprecated in Windows 10.
Windows 8
Prior to Windows 8.1, the IsFullWindow property in not available. To enable full window video playback you must set
the Width and Height of the MediaElement to the Window.Bounds of the current window. Specifically, use
Window.Current.Bounds.Width and Window.Current.Bounds.Height. Full window playback will not take
advantage of system optimizations if you set the dimensions of a parent element, such as a grid, or a containing
element instead of the MediaElement.
Prior to Windows 8.1, the Opacity property is not supported on MediaElement.
Prior to Windows 8.1, the AreTransportControlsEnabled property and built-in transport controls are not available. You
must provide your own transport controls. For more info and examples, see Create custom transport controls and
scenario 4 of the XAML media playback sample.
Windows P hone 8
Windows Phone 8.x app must use PickSingleFileAndContinue to open local media files.

Constructors
MediaElement()
MediaElement()
MediaElement()

Instantiates a new instance of the MediaElement class.

Properties
ActualStereo3DVideoPackingMode
ActualStereo3DVideoPackingMode
ActualStereo3DVideoPackingMode

Gets an enumeration value that determines the current value of stereo 3-D video frame-packing mode, accounting
for other factors such as whether the media engine is ready for use.

ActualStereo3DVideoPackingModeProperty
ActualStereo3DVideoPackingModeProperty
ActualStereo3DVideoPackingModeProperty

Identifies the ActualStereo3DVideoPackingMode dependency property.

AreTransportControlsEnabled
AreTransportControlsEnabled
AreTransportControlsEnabled

Gets or sets a value that determines whether the standard transport controls are enabled.

AreTransportControlsEnabledProperty
AreTransportControlsEnabledProperty
AreTransportControlsEnabledProperty

Identifies the AreTransportControlsEnabled dependency property.

AspectRatioHeight
AspectRatioHeight
AspectRatioHeight

Gets the height portion of the native aspect ratio of the media.
AspectRatioHeightProperty
AspectRatioHeightProperty
AspectRatioHeightProperty

Identifies the AspectRatioHeight dependency property.

AspectRatioWidth
AspectRatioWidth
AspectRatioWidth

Gets the width portion of the native aspect ratio of the media.

AspectRatioWidthProperty
AspectRatioWidthProperty
AspectRatioWidthProperty

Identifies the AspectRatioWidth dependency property.

AudioCategory
AudioCategory
AudioCategory

Gets or sets a value that describes the purpose of the audio information in an audio stream.

AudioCategoryProperty
AudioCategoryProperty
AudioCategoryProperty

Identifies the AudioCategory dependency property.

AudioDeviceType
AudioDeviceType
AudioDeviceType

Gets or sets a value that describes the primary usage of the device that is being used to play back audio.

AudioDeviceTypeProperty
AudioDeviceTypeProperty
AudioDeviceTypeProperty

Identifies the AudioDeviceType dependency property.

AudioStreamCount
AudioStreamCount
AudioStreamCount
Gets the number of audio streams that exist in the current media file.

AudioStreamCountProperty
AudioStreamCountProperty
AudioStreamCountProperty

Identifies the AudioStreamCount dependency property.

AudioStreamIndex
AudioStreamIndex
AudioStreamIndex

Gets or sets the index of the audio stream that plays along with the video component. The collection of audio
streams is composed at run time and represents all audio streams that are available in the media file.

AudioStreamIndexProperty
AudioStreamIndexProperty
AudioStreamIndexProperty

Identifies the AudioStreamIndex dependency property.

AutoPlay
AutoPlay
AutoPlay

Gets or sets a value that indicates whether media will begin playback automatically when the Source property is
set.

AutoPlayProperty
AutoPlayProperty
AutoPlayProperty

Identifies the AutoPlay dependency property.

Balance
Balance
Balance

Gets or sets a ratio of volume across stereo speakers.

BalanceProperty
BalanceProperty
BalanceProperty

Identifies the Balance dependency property.


BufferingProgress
BufferingProgress
BufferingProgress

Gets a value that indicates the current buffering progress.

BufferingProgressProperty
BufferingProgressProperty
BufferingProgressProperty

Identifies the BufferingProgress dependency property.

CanPause
CanPause
CanPause

Gets a value that indicates whether media can be paused if the Pause method is called.

CanPauseProperty
CanPauseProperty
CanPauseProperty

Identifies the CanPause dependency property.

CanSeek
CanSeek
CanSeek

Gets a value that indicates whether media can be repositioned by setting the value of the Position property.

CanSeekProperty
CanSeekProperty
CanSeekProperty

Identifies the CanSeek dependency property.

CurrentState
CurrentState
CurrentState

Gets the status of this MediaElement.

CurrentStateProperty
CurrentStateProperty
CurrentStateProperty
Identifies the CurrentState dependency property.

DefaultPlaybackRate
DefaultPlaybackRate
DefaultPlaybackRate

Gets or sets the default playback rate for the media engine. The playback rate applies when the user isn't using fast
forward or reverse.

DefaultPlaybackRateProperty
DefaultPlaybackRateProperty
DefaultPlaybackRateProperty

Identifies the DefaultPlaybackRate dependency property.

DownloadProgress
DownloadProgress
DownloadProgress

Gets a value that indicates the amount of download completed for content located on a remote server.

DownloadProgressOffset
DownloadProgressOffset
DownloadProgressOffset

Gets the offset of download progress, which is relevant in seek-ahead scenarios.

DownloadProgressOffsetProperty
DownloadProgressOffsetProperty
DownloadProgressOffsetProperty

Identifies the DownloadProgressOffset dependency property.

DownloadProgressProperty
DownloadProgressProperty
DownloadProgressProperty

Identifies the DownloadProgress dependency property.

IsAudioOnly
IsAudioOnly
IsAudioOnly

Gets a value that reports whether the current source media is an audio-only media file.
IsAudioOnlyProperty
IsAudioOnlyProperty
IsAudioOnlyProperty

Identifies the IsAudioOnly dependency property.

IsFullWindow
IsFullWindow
IsFullWindow

Gets a value that specifies if the MediaElement is rendering in full window mode. Setting this property enables or
disables full window rendering.

IsFullWindowProperty
IsFullWindowProperty
IsFullWindowProperty

Identifies the IsFullWindow dependency property.

IsLooping
IsLooping
IsLooping

Gets or sets a value that describes whether the media source currently loaded in the media engine should
automatically set the position to the media start after reaching its end.

IsLoopingProperty
IsLoopingProperty
IsLoopingProperty

Identifies the IsLooping dependency property.

IsMuted
IsMuted
IsMuted

Gets or sets a value indicating whether the audio is muted.

IsMutedProperty
IsMutedProperty
IsMutedProperty

Identifies the IsMuted dependency property.

IsStereo3DVideo
IsStereo3DVideo
IsStereo3DVideo

Gets a value that reports whether the current source media is a stereo 3-D video media file.

IsStereo3DVideoProperty
IsStereo3DVideoProperty
IsStereo3DVideoProperty

Identifies the IsStereo3DVideo dependency property.

Markers
Markers
Markers

Gets the collection of timeline markers associated with the currently loaded media file.

NaturalDuration
NaturalDuration
NaturalDuration

Gets the duration of the media file currently opened.

NaturalDurationProperty
NaturalDurationProperty
NaturalDurationProperty

Identifies the NaturalDuration dependency property.

NaturalVideoHeight
NaturalVideoHeight
NaturalVideoHeight

Gets the height of the video associated with the media.

NaturalVideoHeightProperty
NaturalVideoHeightProperty
NaturalVideoHeightProperty

Identifies the NaturalVideoHeight dependency property.

NaturalVideoWidth
NaturalVideoWidth
NaturalVideoWidth

Gets the width of the video associated with the media.


NaturalVideoWidthProperty
NaturalVideoWidthProperty
NaturalVideoWidthProperty

Identifies the NaturalVideoWidth dependency property.

PlaybackRate
PlaybackRate
PlaybackRate

Gets or sets the playback rate ratio for the media engine.

PlaybackRateProperty
PlaybackRateProperty
PlaybackRateProperty

Identifies the PlaybackRate dependency property.

PlayToPreferredSourceUri
PlayToPreferredSourceUri
PlayToPreferredSourceUri
Note

PlayToPreferredSourceUri is deprecated. Instead, call MediaElement.GetAsCastingSource and, on the


returned value, call CastingSource.PreferredSourceUri.
Gets or sets the path to the preferred media source which enables the Play To target device to stream the media
content, which can be DRM protected, from a different location, such as a cloud media server.

PlayToPreferredSourceUriProperty
PlayToPreferredSourceUriProperty
PlayToPreferredSourceUriProperty

Identifies the PlayToPreferredSourceUri dependency property.

PlayToSource
PlayToSource
PlayToSource

Gets the information that is transmitted if the MediaElement is used for a "PlayTo" scenario.

PlayToSourceProperty
PlayToSourceProperty
PlayToSourceProperty

Identifies the PlayToSource dependency property.


Position
Position
Position

Gets or sets the current position of progress through the media's playback time.

PositionProperty
PositionProperty
PositionProperty

Identifies the Position dependency property.

PosterSource
PosterSource
PosterSource

Gets or sets the image source that is used for a placeholder image during MediaElement loading transition states.

PosterSourceProperty
PosterSourceProperty
PosterSourceProperty

Identifies the PosterSource dependency property.

ProtectionManager
ProtectionManager
ProtectionManager

Gets or sets the dedicated object for media content protection that is associated with this MediaElement.

ProtectionManagerProperty
ProtectionManagerProperty
ProtectionManagerProperty

Identifies the ProtectionManager dependency property.

RealTimePlayback
RealTimePlayback
RealTimePlayback

Gets or sets a value that configures the MediaElement for real-time communications scenarios.

RealTimePlaybackProperty
RealTimePlaybackProperty
RealTimePlaybackProperty
Identifies the RealTimePlayback dependency property.

Source
Source
Source

Gets or sets a media source on the MediaElement.

SourceProperty
SourceProperty
SourceProperty

Identifies the Source dependency property.

Stereo3DVideoPackingMode
Stereo3DVideoPackingMode
Stereo3DVideoPackingMode

Gets or sets an enumeration value that determines the stereo 3-D video frame-packing mode for the current
media source.

Stereo3DVideoPackingModeProperty
Stereo3DVideoPackingModeProperty
Stereo3DVideoPackingModeProperty

Identifies the Stereo3DVideoPackingMode dependency property.

Stereo3DVideoRenderMode
Stereo3DVideoRenderMode
Stereo3DVideoRenderMode

Gets or sets an enumeration value that determines the stereo 3-D video render mode for the current media
source.

Stereo3DVideoRenderModeProperty
Stereo3DVideoRenderModeProperty
Stereo3DVideoRenderModeProperty

Identifies the Stereo3DVideoRenderMode dependency property.

Stretch
Stretch
Stretch

Gets or sets a value that describes how an MediaElement should be stretched to fill the destination rectangle.
StretchProperty
StretchProperty
StretchProperty

Identifies the Stretch dependency property.

TransportControls
TransportControls
TransportControls

Gets or sets the transport controls for the media.

Volume
Volume
Volume

Gets or sets the media's volume.

VolumeProperty
VolumeProperty
VolumeProperty

Identifies the Volume dependency property.

Methods
AddAudioEffect(String, Boolean, IPropertySet)
AddAudioEffect(String, Boolean, IPropertySet)
AddAudioEffect(String, Boolean, IPropertySet)

Applies an audio effect to playback. Takes effect for the next source that is set on this MediaElement.

AddVideoEffect(String, Boolean, IPropertySet)


AddVideoEffect(String, Boolean, IPropertySet)
AddVideoEffect(String, Boolean, IPropertySet)

Applies a video effect to playback. Takes effect for the next source that is set on this MediaElement.

CanPlayType(String)
CanPlayType(String)
CanPlayType(String)

Returns an enumeration value that describes the likelihood that the current MediaElement and its client
configuration can play that media source.

GetAsCastingSource()
GetAsCastingSource()
GetAsCastingSource()

Returns the media element as a CastingSource.

GetAudioStreamLanguage(IReference<Int32>)
GetAudioStreamLanguage(IReference<Int32>)
GetAudioStreamLanguage(IReference<Int32>)

Returns the RFC 1766 language for the specified audio stream.

Pause()
Pause()
Pause()

Pauses media at the current position.

Play()
Play()
Play()

Plays media from the current position.

RemoveAllEffects()
RemoveAllEffects()
RemoveAllEffects()

Removes all effects for the next source set for this MediaElement.

SetMediaStreamSource(IMediaSource)
SetMediaStreamSource(IMediaSource)
SetMediaStreamSource(IMediaSource)

Sets the Source of the MediaElement to the specified MediaStreamSource.

SetPlaybackSource(IMediaPlaybackSource)
SetPlaybackSource(IMediaPlaybackSource)
SetPlaybackSource(IMediaPlaybackSource)

Sets the source of the MediaElement to the specified media playback source.

SetSource(IRandomAccessStream, String)
SetSource(IRandomAccessStream, String)
SetSource(IRandomAccessStream, String)

Sets the Source property using the specified stream and MIME type.
Stop()
Stop()
Stop()

Stops and resets media to be played from the beginning.

Events
BufferingProgressChanged
BufferingProgressChanged
BufferingProgressChanged

Occurs when the BufferingProgress property changes.

CurrentStateChanged
CurrentStateChanged
CurrentStateChanged

Occurs when the value of the CurrentState property changes.

DownloadProgressChanged
DownloadProgressChanged
DownloadProgressChanged

Occurs when the DownloadProgress property has changed.

MarkerReached
MarkerReached
MarkerReached

Occurs when a timeline marker is encountered during media playback.

MediaEnded
MediaEnded
MediaEnded

Occurs when the MediaElement finishes playing audio or video.

MediaFailed
MediaFailed
MediaFailed

Occurs when there is an error associated with the media Source.

MediaOpened
MediaOpened
MediaOpened

Occurs when the media stream has been validated and opened, and the file headers have been read.

PartialMediaFailureDetected
PartialMediaFailureDetected
PartialMediaFailureDetected

Occurs when one or more streams fails to decode in content containing multiple streams.

RateChanged
RateChanged
RateChanged

Occurs when PlaybackRate or DefaultPlaybackRate value changes.

SeekCompleted
SeekCompleted
SeekCompleted

Occurs when the seek point of a requested seek operation is ready for playback.

VolumeChanged
VolumeChanged
VolumeChanged

Occurs when the value of the Volume property changes.

See Also
MediaElement.ActualStereo3DVideoPackingMode Media
Element.ActualStereo3DVideoPackingMode Media
Element.ActualStereo3DVideoPackingMode
I n this Article
Edit
Gets an enumeration value that determines the current value of stereo 3-D video frame-packing mode, accounting for
other factors such as whether the media engine is ready for use.
public : Stereo3DVideoPackingMode ActualStereo3DVideoPackingMode { get; }
Stereo3DVideoPackingMode ActualStereo3DVideoPackingMode();
public Stereo3DVideoPackingMode ActualStereo3DVideoPackingMode { get; }

Returns
Stereo3DVideoPackingMode
A value of the enumeration. May be None if media engine is not ready for use.

Remarks
ActualStereo3DVideoPackingMode is used to determine the current Stereo3DVideoPackingMode being used by the
subsystem. This could be different than what is set by the app author or if the app author sets None which is the
default of Stereo3DVideoPackingMode.
MediaElement.ActualStereo3DVideoPackingMode
Property MediaElement.ActualStereo3DVideoPacking
ModeProperty MediaElement.ActualStereo3DVideo
PackingModeProperty
I n this Article
Edit
Identifies the ActualStereo3DVideoPackingMode dependency property.
public : static DependencyProperty ActualStereo3DVideoPackingModeProperty { get; }
static DependencyProperty ActualStereo3DVideoPackingModeProperty();
public static DependencyProperty ActualStereo3DVideoPackingModeProperty { get; }

Returns
DependencyProperty
The identifier for the ActualStereo3DVideoPackingMode dependency property.
MediaElement.AddAudioEffect MediaElement.AddAudio
Effect MediaElement.AddAudioEffect
I n this Article
Edit
Applies an audio effect to playback. Takes effect for the next source that is set on this MediaElement.
public : void AddAudioEffect(Platform::String effectID, bool effectOptional, IPropertySet
effectConfiguration)
void AddAudioEffect(winrt::hstring effectID, bool effectOptional, IPropertySet effectConfiguration)
const;
public void AddAudioEffect(String effectID, Boolean effectOptional, IPropertySet
effectConfiguration)

Parameters
effectID String
The identifier for the desired effect.
effectOptional Boolean
true if the effect shouldn't block playback when the effect can't be used at run time. false if the effect should block
playback when the effect can't be used at run time.
effectConfiguration IPropertySet
A property set that transmits property values to specific effects as selected by effectID.

Remarks
The audio effects needs to be added before loading the source. Otherwise, it will be applied for the next source that is
set on this MediaElement.
MediaElement.AddVideoEffect MediaElement.AddVideo
Effect MediaElement.AddVideoEffect
I n this Article
Edit
Applies a video effect to playback. Takes effect for the next source that is set on this MediaElement.
public : void AddVideoEffect(Platform::String effectID, bool effectOptional, IPropertySet
effectConfiguration)
void AddVideoEffect(winrt::hstring effectID, bool effectOptional, IPropertySet effectConfiguration)
const;
public void AddVideoEffect(String effectID, Boolean effectOptional, IPropertySet
effectConfiguration)

Parameters
effectID String
The identifier for the desired effect.
effectOptional Boolean
true if the effect shouldn't block playback when the effect can't be used at run time. false if the effect should block
playback when the effect can't be used at run time.
effectConfiguration IPropertySet
A property set that transmits property values to specific effects as selected by effectID.
MediaElement.AreTransportControlsEnabled Media
Element.AreTransportControlsEnabled MediaElement.Are
TransportControlsEnabled
I n this Article
Edit
Gets or sets a value that determines whether the standard transport controls are enabled.
public : Platform::Boolean AreTransportControlsEnabled { get; set; }
bool AreTransportControlsEnabled();

void AreTransportControlsEnabled(bool aretransportcontrolsenabled);


public bool AreTransportControlsEnabled { get; set; }

<MediaElement AreTransportControlsEnabled="bool" />

Returns
bool
true if the standard transport controls are enabled; otherwise, false. The default is false.

Examples
Here is some code that creates a MediaElement with the built-in transport controls enabled and the AutoPlay property
set to false.

<MediaElement x:Name="mediaPlayer"
Source="Videos/video1.mp4"
Width="400"
AutoPlay="False"
AreTransportControlsEnabled="True" />

Remarks
The transport controls are exposed as a MediaTransportControls object that you can access through the
MediaElement.TransportControls property. See MediaTransportControls for more info.
If AreTransportControlsEnabled is true, the standard transport controls are enabled and displayed on the
MediaElement. If AreTransportControlsEnabled is false, the standard transport controls are not enabled and are not
displayed.
The transport controls hide themselves after a short period of no user interaction with the MediaElement. They
reappear when the user interacts with the MediaElement.
If the Width of MediaElement is not sufficient to display all of the transport controls, a subset of the controls are
displayed.
Notes for previous versions
Windows 8.1 You can't access and modify the built-in transport controls. If you create custom transport controls
for your app, set this property to false to disable the built-in controls.
MediaElement.AreTransportControlsEnabledProperty
MediaElement.AreTransportControlsEnabledProperty
MediaElement.AreTransportControlsEnabledProperty
I n this Article
Edit
Identifies the AreTransportControlsEnabled dependency property.
public : static DependencyProperty AreTransportControlsEnabledProperty { get; }
static DependencyProperty AreTransportControlsEnabledProperty();
public static DependencyProperty AreTransportControlsEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the AreTransportControlsEnabled dependency property.
MediaElement.AspectRatioHeight MediaElement.Aspect
RatioHeight MediaElement.AspectRatioHeight
I n this Article
Edit
Gets the height portion of the native aspect ratio of the media.
public : int AspectRatioHeight { get; }
int32_t AspectRatioHeight();
public int AspectRatioHeight { get; }

Returns
int
The height portion of the native aspect ratio of the media. This value holds meaning only when you compare it with the
value for the AspectRatioWidth property; the two properties together describe the aspect ratio.
MediaElement.AspectRatioHeightProperty Media
Element.AspectRatioHeightProperty MediaElement.
AspectRatioHeightProperty
I n this Article
Edit
Identifies the AspectRatioHeight dependency property.
public : static DependencyProperty AspectRatioHeightProperty { get; }
static DependencyProperty AspectRatioHeightProperty();
public static DependencyProperty AspectRatioHeightProperty { get; }

Returns
DependencyProperty
The identifier for the AspectRatioHeight dependency property.
MediaElement.AspectRatioWidth MediaElement.Aspect
RatioWidth MediaElement.AspectRatioWidth
I n this Article
Edit
Gets the width portion of the native aspect ratio of the media.
public : int AspectRatioWidth { get; }
int32_t AspectRatioWidth();
public int AspectRatioWidth { get; }

Returns
int
The width portion of the native aspect ratio of the media. This value holds meaning only when you compare it with the
value for the AspectRatioHeight property; the two properties together describe the aspect ratio.
MediaElement.AspectRatioWidthProperty MediaElement.
AspectRatioWidthProperty MediaElement.AspectRatio
WidthProperty
I n this Article
Edit
Identifies the AspectRatioWidth dependency property.
public : static DependencyProperty AspectRatioWidthProperty { get; }
static DependencyProperty AspectRatioWidthProperty();
public static DependencyProperty AspectRatioWidthProperty { get; }

Returns
DependencyProperty
The identifier for the AspectRatioWidth dependency property.
MediaElement.AudioCategory MediaElement.Audio
Category MediaElement.AudioCategory
I n this Article
Edit
Gets or sets a value that describes the purpose of the audio information in an audio stream.
public : AudioCategory AudioCategory { get; set; }
AudioCategory AudioCategory();

void AudioCategory(AudioCategory audiocategory);


public AudioCategory AudioCategory { get; set; }

<MediaElement AudioCategory="audioCategoryMemberName" /.

Returns
AudioCategory
A value of the enumeration.

Remarks
For hardware audio offload to be automatically applied, the audio category must be set to ForegroundOnlyMedia or
BackgroundCapableMedia. Hardware audio offload optimizes audio rendering which can improve functionality and
battery life.
See Audio categories sample
Also
MediaElement.AudioCategoryProperty MediaElement.
AudioCategoryProperty MediaElement.AudioCategory
Property
I n this Article
Edit
Identifies the AudioCategory dependency property.
public : static DependencyProperty AudioCategoryProperty { get; }
static DependencyProperty AudioCategoryProperty();
public static DependencyProperty AudioCategoryProperty { get; }

Returns
DependencyProperty
The identifier for the AudioCategory dependency property.
MediaElement.AudioDeviceType MediaElement.Audio
DeviceType MediaElement.AudioDeviceType
I n this Article
Edit
Gets or sets a value that describes the primary usage of the device that is being used to play back audio.
public : AudioDeviceType AudioDeviceType { get; set; }
AudioDeviceType AudioDeviceType();

void AudioDeviceType(AudioDeviceType audiodevicetype);


public AudioDeviceType AudioDeviceType { get; set; }

<MediaElement AudioDeviceType="audioDeviceTypeMemberName" /.

Returns
AudioDeviceType
A value of the enumeration.
MediaElement.AudioDeviceTypeProperty MediaElement.
AudioDeviceTypeProperty MediaElement.AudioDevice
TypeProperty
I n this Article
Edit
Identifies the AudioDeviceType dependency property.
public : static DependencyProperty AudioDeviceTypeProperty { get; }
static DependencyProperty AudioDeviceTypeProperty();
public static DependencyProperty AudioDeviceTypeProperty { get; }

Returns
DependencyProperty
The identifier for the AudioDeviceType dependency property.
MediaElement.AudioStreamCount MediaElement.Audio
StreamCount MediaElement.AudioStreamCount
I n this Article
Edit
Gets the number of audio streams that exist in the current media file.
public : int AudioStreamCount { get; }
int32_t AudioStreamCount();
public int AudioStreamCount { get; }

Returns
int
The number of audio streams that exist in the source media file. The default value is 0.
MediaElement.AudioStreamCountProperty Media
Element.AudioStreamCountProperty MediaElement.
AudioStreamCountProperty
I n this Article
Edit
Identifies the AudioStreamCount dependency property.
public : static DependencyProperty AudioStreamCountProperty { get; }
static DependencyProperty AudioStreamCountProperty();
public static DependencyProperty AudioStreamCountProperty { get; }

Returns
DependencyProperty
The identifier for the AudioStreamCount dependency property.
MediaElement.AudioStreamIndex MediaElement.Audio
StreamIndex MediaElement.AudioStreamIndex
I n this Article
Edit
Gets or sets the index of the audio stream that plays along with the video component. The collection of audio streams
is composed at run time and represents all audio streams that are available in the media file.
public : IReference<int> AudioStreamIndex { get; set; }
IReference<int32_t> AudioStreamIndex();

void AudioStreamIndex(IReference<int32_t> audiostreamindex);


public Nullable<int> AudioStreamIndex { get; set; }

<MediaElement AudioStreamIndex="int"/>

Returns
Nullable<int>
The index in the media file of the audio component that plays along with the video component. The index can be
unspecified, in which case the value is null. The default value is null.
If you're programming using C#or Microsoft Visual Basic, the type of this property is projected as int?(a nullable
integer).

Remarks
Setting AudioStreamIndex to null selects the default audio track, which is defined by the content.
MediaElement.AudioStreamIndexProperty Media
Element.AudioStreamIndexProperty MediaElement.Audio
StreamIndexProperty
I n this Article
Edit
Identifies the AudioStreamIndex dependency property.
public : static DependencyProperty AudioStreamIndexProperty { get; }
static DependencyProperty AudioStreamIndexProperty();
public static DependencyProperty AudioStreamIndexProperty { get; }

Returns
DependencyProperty
The identifier for the AudioStreamIndex dependency property.
MediaElement.AutoPlay MediaElement.AutoPlay Media
Element.AutoPlay
I n this Article
Edit
Gets or sets a value that indicates whether media will begin playback automatically when the Source property is set.
public : Platform::Boolean AutoPlay { get; set; }
bool AutoPlay();

void AutoPlay(bool autoplay);


public bool AutoPlay { get; set; }

<MediaElement AutoPlay="bool" .../>

Returns
bool
true if playback is automatic; otherwise, false. The default is true.
MediaElement.AutoPlayProperty MediaElement.AutoPlay
Property MediaElement.AutoPlayProperty
I n this Article
Edit
Identifies the AutoPlay dependency property.
public : static DependencyProperty AutoPlayProperty { get; }
static DependencyProperty AutoPlayProperty();
public static DependencyProperty AutoPlayProperty { get; }

Returns
DependencyProperty
The identifier for the AutoPlay dependency property.
MediaElement.Balance MediaElement.Balance Media
Element.Balance
I n this Article
Edit
Gets or sets a ratio of volume across stereo speakers.
public : double Balance { get; set; }
double Balance();

void Balance(double balance);


public double Balance { get; set; }

<MediaElement Balance="double" .../>

Returns
double
The ratio of volume across speakers in the range between -1 and 1. The default value is 0.
MediaElement.BalanceProperty MediaElement.Balance
Property MediaElement.BalanceProperty
I n this Article
Edit
Identifies the Balance dependency property.
public : static DependencyProperty BalanceProperty { get; }
static DependencyProperty BalanceProperty();
public static DependencyProperty BalanceProperty { get; }

Returns
DependencyProperty
The identifier for the Balance dependency property.
MediaElement.BufferingProgress MediaElement.Buffering
Progress MediaElement.BufferingProgress
I n this Article
Edit
Gets a value that indicates the current buffering progress.
public : double BufferingProgress { get; }
double BufferingProgress();
public double BufferingProgress { get; }

Returns
double
The amount of buffering that is completed for media content. The value ranges from 0 to 1. Multiply by 100 to obtain a
percentage.
MediaElement.BufferingProgressChanged MediaElement.
BufferingProgressChanged MediaElement.Buffering
ProgressChanged
I n this Article
Edit
Occurs when the BufferingProgress property changes.
public : event RoutedEventHandler BufferingProgressChanged
// Register
event_token BufferingProgressChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void BufferingProgressChanged(event_token const& cookie) const;

// Revoke with event_revoker


BufferingProgressChanged_revoker BufferingProgressChanged(auto_revoke_t, RoutedEventHandler const&
handler) const;
public event RoutedEventHandler BufferingProgressChanged

<MediaElement BufferingProgressChanged="eventhandler"/>
MediaElement.BufferingProgressProperty MediaElement.
BufferingProgressProperty MediaElement.Buffering
ProgressProperty
I n this Article
Edit
Identifies the BufferingProgress dependency property.
public : static DependencyProperty BufferingProgressProperty { get; }
static DependencyProperty BufferingProgressProperty();
public static DependencyProperty BufferingProgressProperty { get; }

Returns
DependencyProperty
The identifier for the BufferingProgress dependency property.
MediaElement.CanPause MediaElement.CanPause Media
Element.CanPause
I n this Article
Edit
Gets a value that indicates whether media can be paused if the Pause method is called.
public : Platform::Boolean CanPause { get; }
bool CanPause();
public bool CanPause { get; }

Returns
bool
true if the media can be paused; otherwise, false.
MediaElement.CanPauseProperty MediaElement.Can
PauseProperty MediaElement.CanPauseProperty
I n this Article
Edit
Identifies the CanPause dependency property.
public : static DependencyProperty CanPauseProperty { get; }
static DependencyProperty CanPauseProperty();
public static DependencyProperty CanPauseProperty { get; }

Returns
DependencyProperty
The identifier for the CanPause dependency property.
MediaElement.CanPlayType MediaElement.CanPlayType
MediaElement.CanPlayType
I n this Article
Edit
Returns an enumeration value that describes the likelihood that the current MediaElement and its client configuration
can play that media source.
public : MediaCanPlayResponse CanPlayType(Platform::String type)
MediaCanPlayResponse CanPlayType(winrt::hstring type) const;
public MediaCanPlayResponse CanPlayType(String type)

Parameters
type String
A string that describes the desired type as a MIME string.
Returns
MediaCanPlayResponse
A value of the enumeration that describes the likelihood that the current media engine can play the source.
MediaElement.CanSeek MediaElement.CanSeek Media
Element.CanSeek
I n this Article
Edit
Gets a value that indicates whether media can be repositioned by setting the value of the Position property.
public : Platform::Boolean CanSeek { get; }
bool CanSeek();
public bool CanSeek { get; }

Returns
bool
true if the media can be repositioned; otherwise, false.
MediaElement.CanSeekProperty MediaElement.CanSeek
Property MediaElement.CanSeekProperty
I n this Article
Edit
Identifies the CanSeek dependency property.
public : static DependencyProperty CanSeekProperty { get; }
static DependencyProperty CanSeekProperty();
public static DependencyProperty CanSeekProperty { get; }

Returns
DependencyProperty
The identifier for the CanSeek dependency property.
MediaElement.CurrentState MediaElement.CurrentState
MediaElement.CurrentState
I n this Article
Edit
Gets the status of this MediaElement.
public : MediaElementState CurrentState { get; }
MediaElementState CurrentState();
public MediaElementState CurrentState { get; }

Returns
MediaElementState
The current state of this MediaElement. The state can be one of the following (as defined in the MediaElementState
enumeration): Buffering, Closed, Opening, Paused, Playing, or Stopped. The default value is Closed.

Examples
The following example demonstrates one way to display the CurrentState of a MediaElement. It creates a
MediaElement and several buttons for controlling media playback. To display the current state of the MediaElement,
the example registers for the CurrentStateChanged event and uses an event handler to update a TextBlock.
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

<MediaElement CurrentStateChanged="Media_State_Changed"
x:Name="media" Source="xbox.wmv" Width="300" Height="300"
Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="3" />

<!-- Stops media playback.-->


<Button Click="StopMedia"
Grid.Column="0" Grid.Row="1" Content="Stop" />

<!-- Pauses media playback. -->


<Button Click="PauseMedia"
Grid.Column="1" Grid.Row="1" Content="Pause" />

<!-- Begins media playback. -->


<Button Click="PlayMedia"
Grid.Column="2" Grid.Row="1" Content="Play" />

<TextBlock
Grid.Column="0" Grid.Row="2" Margin="10"
FontSize="12">CurrentState:</TextBlock>

<TextBlock
x:Name="mediaStateTextBlock"
Grid.Column="1" Grid.Row="2" Margin="0,10,0,0"
FontSize="12"></TextBlock>

</Grid>

private void StopMedia(object sender, RoutedEventArgs e)


{
media.Stop();
}
private void PauseMedia(object sender, RoutedEventArgs e)
{
media.Pause();
}
private void PlayMedia(object sender, RoutedEventArgs e)
{
media.Play();
}
private void Media_State_Changed(object sender, RoutedEventArgs e)
{
mediaStateTextBlock.Text = media.CurrentState.ToString();
}
MediaElement.CurrentStateChanged MediaElement.
CurrentStateChanged MediaElement.CurrentState
Changed
I n this Article
Edit
Occurs when the value of the CurrentState property changes.
public : event RoutedEventHandler CurrentStateChanged
// Register
event_token CurrentStateChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void CurrentStateChanged(event_token const& cookie) const;

// Revoke with event_revoker


CurrentStateChanged_revoker CurrentStateChanged(auto_revoke_t, RoutedEventHandler const& handler)
const;
public event RoutedEventHandler CurrentStateChanged

<MediaElement CurrentStateChanged="eventhandler"/>
MediaElement.CurrentStateProperty MediaElement.
CurrentStateProperty MediaElement.CurrentState
Property
I n this Article
Edit
Identifies the CurrentState dependency property.
public : static DependencyProperty CurrentStateProperty { get; }
static DependencyProperty CurrentStateProperty();
public static DependencyProperty CurrentStateProperty { get; }

Returns
DependencyProperty
The identifier for the CurrentState dependency property.
MediaElement.DefaultPlaybackRate MediaElement.
DefaultPlaybackRate MediaElement.DefaultPlaybackRate
I n this Article
Edit
Gets or sets the default playback rate for the media engine. The playback rate applies when the user isn't using fast
forward or reverse.
public : double DefaultPlaybackRate { get; set; }
double DefaultPlaybackRate();

void DefaultPlaybackRate(double defaultplaybackrate);


public double DefaultPlaybackRate { get; set; }

<MediaElement DefaultPlaybackRate="double"/>

Returns
double
The default playback rate. The default is 1.0, which indicates normal playback speed.

Remarks
The current PlaybackRate is set to the value of DefaultPlaybackRate whenever Play is called. So setting
DefaultPlaybackRate to a different value has no effect until Play is called.
To set a rate that will persist throughout the lifetime of the MediaElement, use DefaultPlaybackRate. Once playback
ends, due to the MediaEnded event being raised or if Pause or Stop are called, the PlaybackRate will be effectively lost.
MediaElement.DefaultPlaybackRateProperty Media
Element.DefaultPlaybackRateProperty MediaElement.
DefaultPlaybackRateProperty
I n this Article
Edit
Identifies the DefaultPlaybackRate dependency property.
public : static DependencyProperty DefaultPlaybackRateProperty { get; }
static DependencyProperty DefaultPlaybackRateProperty();
public static DependencyProperty DefaultPlaybackRateProperty { get; }

Returns
DependencyProperty
The identifier for the DefaultPlaybackRate dependency property.
MediaElement.DownloadProgress MediaElement.
DownloadProgress MediaElement.DownloadProgress
I n this Article
Edit
Gets a value that indicates the amount of download completed for content located on a remote server.
public : double DownloadProgress { get; }
double DownloadProgress();
public double DownloadProgress { get; }

Returns
double
A value that indicates the amount of download completed for content that is located on a remote server. The value
ranges from 0 to 1. Multiply by 100 to obtain a percentage.
MediaElement.DownloadProgressChanged Media
Element.DownloadProgressChanged MediaElement.
DownloadProgressChanged
I n this Article
Edit
Occurs when the DownloadProgress property has changed.
public : event RoutedEventHandler DownloadProgressChanged
// Register
event_token DownloadProgressChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void DownloadProgressChanged(event_token const& cookie) const;

// Revoke with event_revoker


DownloadProgressChanged_revoker DownloadProgressChanged(auto_revoke_t, RoutedEventHandler const&
handler) const;
public event RoutedEventHandler DownloadProgressChanged

<MediaElement DownloadProgressChanged="eventhandler"/>
MediaElement.DownloadProgressOffset MediaElement.
DownloadProgressOffset MediaElement.Download
ProgressOffset
I n this Article
Edit
Gets the offset of download progress, which is relevant in seek-ahead scenarios.
public : double DownloadProgressOffset { get; }
double DownloadProgressOffset();
public double DownloadProgressOffset { get; }

Returns
double
The offset of download progress.
MediaElement.DownloadProgressOffsetProperty Media
Element.DownloadProgressOffsetProperty Media
Element.DownloadProgressOffsetProperty
I n this Article
Edit
Identifies the DownloadProgressOffset dependency property.
public : static DependencyProperty DownloadProgressOffsetProperty { get; }
static DependencyProperty DownloadProgressOffsetProperty();
public static DependencyProperty DownloadProgressOffsetProperty { get; }

Returns
DependencyProperty
The identifier for the DownloadProgressOffset dependency property.
MediaElement.DownloadProgressProperty Media
Element.DownloadProgressProperty MediaElement.
DownloadProgressProperty
I n this Article
Edit
Identifies the DownloadProgress dependency property.
public : static DependencyProperty DownloadProgressProperty { get; }
static DependencyProperty DownloadProgressProperty();
public static DependencyProperty DownloadProgressProperty { get; }

Returns
DependencyProperty
The identifier for the DownloadProgress dependency property.
MediaElement.GetAsCastingSource MediaElement.GetAs
CastingSource MediaElement.GetAsCastingSource
I n this Article
Edit
Returns the media element as a CastingSource.
public : CastingSource GetAsCastingSource()
CastingSource GetAsCastingSource() const;
public CastingSource GetAsCastingSource()

Returns
CastingSource
The media element as a CastingSource.

Remarks
For more info about using MediaElement as a casting source, see Media casting.
See Media casting
Also
MediaElement.GetAudioStreamLanguage MediaElement.
GetAudioStreamLanguage MediaElement.GetAudio
StreamLanguage
I n this Article
Edit
Returns the RFC 1766 language for the specified audio stream.
public : Platform::String GetAudioStreamLanguage(IReference<int> index)
winrt::hstring GetAudioStreamLanguage(IReference<int32_t> index) const;
public string GetAudioStreamLanguage(Nullable<Int32> index)

Parameters
index Nullable<Int32>
The index of the stream to get the language for.
If you are programming using C#or Microsoft Visual Basic, the type of this parameter is projected as int?(a nullable
integer).
Returns
string
The RFC 1766 language for the specified audio stream, expressed as a string (for example, "en-us").
MediaElement.IsAudioOnly MediaElement.IsAudioOnly
MediaElement.IsAudioOnly
I n this Article
Edit
Gets a value that reports whether the current source media is an audio-only media file.
public : Platform::Boolean IsAudioOnly { get; }
bool IsAudioOnly();
public bool IsAudioOnly { get; }

Returns
bool
true if the current source media is audio-only, otherwise, false.
MediaElement.IsAudioOnlyProperty MediaElement.Is
AudioOnlyProperty MediaElement.IsAudioOnlyProperty
I n this Article
Edit
Identifies the IsAudioOnly dependency property.
public : static DependencyProperty IsAudioOnlyProperty { get; }
static DependencyProperty IsAudioOnlyProperty();
public static DependencyProperty IsAudioOnlyProperty { get; }

Returns
DependencyProperty
The identifier for the IsAudioOnly dependency property.
MediaElement.IsFullWindow MediaElement.IsFullWindow
MediaElement.IsFullWindow
I n this Article
Edit
Gets a value that specifies if the MediaElement is rendering in full window mode. Setting this property enables or
disables full window rendering.
public : Platform::Boolean IsFullWindow { get; set; }
bool IsFullWindow();

void IsFullWindow(bool isfullwindow);


public bool IsFullWindow { get; set; }

<MediaElement IsFullWindow="bool" />

Returns
bool
true if the MediaElement is in full window mode; otherwise, false. The default is false.

Remarks
Setting and un-setting this property enables and disables full window rendering.
Always use the IsFullWindow property to enable and disable full window rendering. This ensures system level
optimizations are used during media playback.
When in full-window mode, input events received on the MediaElement will still route through to the visual tree in the
background. For example, if the MediaElement is in a ListBox, turning the scroll wheel could cause the ListBox to scroll
in the background. This can cause unexpected behavior. If input events should not be routed when in full-window
mode, the MediaElement should handle the events.
MediaElement.IsFullWindowProperty MediaElement.Is
FullWindowProperty MediaElement.IsFullWindow
Property
I n this Article
Edit
Identifies the IsFullWindow dependency property.
public : static DependencyProperty IsFullWindowProperty { get; }
static DependencyProperty IsFullWindowProperty();
public static DependencyProperty IsFullWindowProperty { get; }

Returns
DependencyProperty
The identifier for the IsFullWindow dependency property.
MediaElement.IsLooping MediaElement.IsLooping Media
Element.IsLooping
I n this Article
Edit
Gets or sets a value that describes whether the media source currently loaded in the media engine should
automatically set the position to the media start after reaching its end.
public : Platform::Boolean IsLooping { get; set; }
bool IsLooping();

void IsLooping(bool islooping);


public bool IsLooping { get; set; }

<MediaElement IsLooping="bool"/>

Returns
bool
true to loop the media and play continuously. false to not loop the media automatically. The default is false.
MediaElement.IsLoopingProperty MediaElement.Is
LoopingProperty MediaElement.IsLoopingProperty
I n this Article
Edit
Identifies the IsLooping dependency property.
public : static DependencyProperty IsLoopingProperty { get; }
static DependencyProperty IsLoopingProperty();
public static DependencyProperty IsLoopingProperty { get; }

Returns
DependencyProperty
The identifier for the IsLooping dependency property.
MediaElement.IsMuted MediaElement.IsMuted Media
Element.IsMuted
I n this Article
Edit
Gets or sets a value indicating whether the audio is muted.
public : Platform::Boolean IsMuted { get; set; }
bool IsMuted();

void IsMuted(bool ismuted);


public bool IsMuted { get; set; }

<MediaElement IsMuted="bool" .../>

Returns
bool
true if audio is muted; otherwise, false. The default is false.
MediaElement.IsMutedProperty MediaElement.IsMuted
Property MediaElement.IsMutedProperty
I n this Article
Edit
Identifies the IsMuted dependency property.
public : static DependencyProperty IsMutedProperty { get; }
static DependencyProperty IsMutedProperty();
public static DependencyProperty IsMutedProperty { get; }

Returns
DependencyProperty
The identifier for the IsMuted dependency property.
MediaElement.IsStereo3DVideo MediaElement.IsStereo3
DVideo MediaElement.IsStereo3DVideo
I n this Article
Edit
Gets a value that reports whether the current source media is a stereo 3-D video media file.
public : Platform::Boolean IsStereo3DVideo { get; }
bool IsStereo3DVideo();
public bool IsStereo3DVideo { get; }

Returns
bool
true if the current source media is stereo 3-D video, otherwise, false.

Remarks
If this property value is true, check Stereo3DVideoRenderMode for information on the render mode.
MediaElement.IsStereo3DVideoProperty MediaElement.
IsStereo3DVideoProperty MediaElement.IsStereo3
DVideoProperty
I n this Article
Edit
Identifies the IsStereo3DVideo dependency property.
public : static DependencyProperty IsStereo3DVideoProperty { get; }
static DependencyProperty IsStereo3DVideoProperty();
public static DependencyProperty IsStereo3DVideoProperty { get; }

Returns
DependencyProperty
The identifier for the IsStereo3DVideo dependency property.
MediaElement.MarkerReached MediaElement.Marker
Reached MediaElement.MarkerReached
I n this Article
Edit
Occurs when a timeline marker is encountered during media playback.
public : event TimelineMarkerRoutedEventHandler MarkerReached
// Register
event_token MarkerReached(TimelineMarkerRoutedEventHandler const& handler) const;

// Revoke with event_token


void MarkerReached(event_token const& cookie) const;

// Revoke with event_revoker


MarkerReached_revoker MarkerReached(auto_revoke_t, TimelineMarkerRoutedEventHandler const& handler)
const;
public event TimelineMarkerRoutedEventHandler MarkerReached

<MediaElement MarkerReached="eventhandler"/>

Examples
The following example creates a MediaElement object and responds to its MarkerReached event. Each time a timeline
marker is reached, the example displays the timeline marker's Time, Type, and Text values.
<MediaElement Name="Media" Source="video.mp4" MarkerReached="Media_MarkerReached" />
<TextBlock Name="txOutput" />

private void Media_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e)


{
txOutput.Text =
string.Format("{0},{1},{2}", e.Marker.Time, e.Marker.Text, e.Marker.Type);
}
MediaElement.Markers MediaElement.Markers Media
Element.Markers
I n this Article
Edit
Gets the collection of timeline markers associated with the currently loaded media file.
public : TimelineMarkerCollection Markers { get; }
TimelineMarkerCollection Markers();
public TimelineMarkerCollection Markers { get; }

Returns
TimelineMarkerCollection
The collection of timeline markers (represented as TimelineMarker objects) associated with the currently loaded media
file. The default is an empty collection.

Examples
The following example creates a MediaElement object and responds to its MarkerReached event. Each time a timeline
marker is reached, the example displays the timeline marker's Time, Type, and Text values.
<MediaElement Name="Media" Source="video.mp4" MarkerReached="Media_MarkerReached" />
<TextBlock Name="txOutput" />

private void Media_MarkerReached(object sender, TimelineMarkerRoutedEventArgs e)


{
txOutput.Text =
string.Format("{0},{1},{2}", e.Marker.Time, e.Marker.Text, e.Marker.Type);
}

Remarks
A timeline marker is metadata associated with a particular point in a media file. These markers are usually created
ahead of time and stored in the media file itself. They are typically used to name different scenes in a video or provide
scripting cues. By handling the MediaElement object's MarkerReached event or by accessing the MediaElement
object's Markers property, you can use timeline markers to trigger actions or enable users to seek to selected positions
in the media file.
MediaElement MediaElement MediaElement
I n this Article
Edit
Instantiates a new instance of the MediaElement class.

public : MediaElement()
MediaElement() const;
public MediaElement()
MediaElement.MediaEnded MediaElement.MediaEnded
MediaElement.MediaEnded
I n this Article
Edit
Occurs when the MediaElement finishes playing audio or video.
public : event RoutedEventHandler MediaEnded
// Register
event_token MediaEnded(RoutedEventHandler const& handler) const;

// Revoke with event_token


void MediaEnded(event_token const& cookie) const;

// Revoke with event_revoker


MediaEnded_revoker MediaEnded(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler MediaEnded

<MediaElement MediaEnded="eventhandler" ../>


MediaElement.MediaFailed MediaElement.MediaFailed
MediaElement.MediaFailed
I n this Article
Edit
Occurs when there is an error associated with the media Source.
public : event ExceptionRoutedEventHandler MediaFailed
// Register
event_token MediaFailed(ExceptionRoutedEventHandler const& handler) const;

// Revoke with event_token


void MediaFailed(event_token const& cookie) const;

// Revoke with event_revoker


MediaFailed_revoker MediaFailed(auto_revoke_t, ExceptionRoutedEventHandler const& handler) const;
public event ExceptionRoutedEventHandler MediaFailed

<MediaElement MediaFailed="eventhandler" .../>

Examples
The following code creates a MediaFailed event handler that calls a helper function to retrieve the HRESULT from the
event arguments.
private void videoMediaElement_MediaFailed(object sender, ExceptionRoutedEventArgs e)
{
// get HRESULT from event args
string hr = GetHresultFromErrorMessage(e);

// Handle media failed event appropriately


}

private string GetHresultFromErrorMessage(ExceptionRoutedEventArgs e)


{
String hr = String.Empty;
String token = "HRESULT - ";
const int hrLength = 10; // eg "0xFFFFFFFF"

int tokenPos = e.ErrorMessage.IndexOf(token, StringComparison.Ordinal);


if (tokenPos != -1)
{
hr = e.ErrorMessage.Substring(tokenPos + token.Length, hrLength);
}

return hr;
}

Remarks
It is a best practice to always handle the MediaFailed event and take appropriate action.
MediaElement.MediaOpened MediaElement.Media
Opened MediaElement.MediaOpened
I n this Article
Edit
Occurs when the media stream has been validated and opened, and the file headers have been read.
public : event RoutedEventHandler MediaOpened
// Register
event_token MediaOpened(RoutedEventHandler const& handler) const;

// Revoke with event_token


void MediaOpened(event_token const& cookie) const;

// Revoke with event_revoker


MediaOpened_revoker MediaOpened(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler MediaOpened

<MediaElement MediaOpened="eventhandler" .../>

Examples
The following code shows how to determine if a media stream is a live stream.
private void media_MediaOpened(object sender, RoutedEventArgs e)
{
bool isLive = IsLiveStream(sender as MediaElement);
}

private bool IsLiveStream(MediaElement media)


{
bool isLive = false;

if (media.NaturalDuration.TimeSpan.Ticks == Int64.MaxValue)
{
isLive = true;
}

return isLive;
}

Remarks
Live media streams report a NaturalDuration of Int64.MaxValue.
Any calls to Play, Pause, and Stop methods that occur before the MediaOpened event is raised are ignored.
MediaElement.NaturalDuration MediaElement.Natural
Duration MediaElement.NaturalDuration
I n this Article
Edit
Gets the duration of the media file currently opened.
public : Duration NaturalDuration { get; }
Duration NaturalDuration();
public Duration NaturalDuration { get; }

Returns
Duration
The natural duration of the media. The default value is a Duration structure that evaluates as Automatic, which is the
value held if you query this property before MediaOpened.

Remarks
A Duration value has a TimeSpan component.

C# or Microsoft Visual Basic You can use utility methods of System.TimeSpan to get the duration components
in whatever format you want. For example you can get TimeSpan.Hours, TimeSpan.Minutes and
TimeSpan.Seconds separately.

Visual C++ component extensions (C++/CX) The data value of a Duration is a property named TimeSpan.
This has a TimeSpan structure value, and that structure has a field named Duration that reports the duration as an
int64 that counts in 100-nanosecond units. TimeSpan doesn't have any methods for getting components of the
time in hours:minutes:seconds format.

For more info, see Remarks in the Duration reference topic.


MediaElement.NaturalDurationProperty MediaElement.
NaturalDurationProperty MediaElement.NaturalDuration
Property
I n this Article
Edit
Identifies the NaturalDuration dependency property.
public : static DependencyProperty NaturalDurationProperty { get; }
static DependencyProperty NaturalDurationProperty();
public static DependencyProperty NaturalDurationProperty { get; }

Returns
DependencyProperty
The identifier for the NaturalDuration dependency property.
MediaElement.NaturalVideoHeight MediaElement.
NaturalVideoHeight MediaElement.NaturalVideoHeight
I n this Article
Edit
Gets the height of the video associated with the media.
public : int NaturalVideoHeight { get; }
int32_t NaturalVideoHeight();
public int NaturalVideoHeight { get; }

Returns
int
The height of the video that is associated with the media, in pixels. Audio files return 0. The default is 0.
MediaElement.NaturalVideoHeightProperty Media
Element.NaturalVideoHeightProperty MediaElement.
NaturalVideoHeightProperty
I n this Article
Edit
Identifies the NaturalVideoHeight dependency property.
public : static DependencyProperty NaturalVideoHeightProperty { get; }
static DependencyProperty NaturalVideoHeightProperty();
public static DependencyProperty NaturalVideoHeightProperty { get; }

Returns
DependencyProperty
The identifier for the NaturalVideoHeight dependency property.
MediaElement.NaturalVideoWidth MediaElement.
NaturalVideoWidth MediaElement.NaturalVideoWidth
I n this Article
Edit
Gets the width of the video associated with the media.
public : int NaturalVideoWidth { get; }
int32_t NaturalVideoWidth();
public int NaturalVideoWidth { get; }

Returns
int
The width of the video associated with the media. The default is 0.
MediaElement.NaturalVideoWidthProperty Media
Element.NaturalVideoWidthProperty MediaElement.
NaturalVideoWidthProperty
I n this Article
Edit
Identifies the NaturalVideoWidth dependency property.
public : static DependencyProperty NaturalVideoWidthProperty { get; }
static DependencyProperty NaturalVideoWidthProperty();
public static DependencyProperty NaturalVideoWidthProperty { get; }

Returns
DependencyProperty
The identifier for the NaturalVideoWidth dependency property.
MediaElement.PartialMediaFailureDetected Media
Element.PartialMediaFailureDetected MediaElement.
PartialMediaFailureDetected
I n this Article
Edit
Occurs when one or more streams fails to decode in content containing multiple streams.
public : event TypedEventHandler<MediaElement, PartialMediaFailureDetectedEventArgs>
PartialMediaFailureDetected
// Register
event_token PartialMediaFailureDetected(TypedEventHandler<MediaElement,
PartialMediaFailureDetectedEventArgs> const& handler) const;

// Revoke with event_token


void PartialMediaFailureDetected(event_token const& cookie) const;

// Revoke with event_revoker


PartialMediaFailureDetected_revoker PartialMediaFailureDetected(auto_revoke_t,
TypedEventHandler<MediaElement, PartialMediaFailureDetectedEventArgs> const& handler) const;
public event TypedEventHandler<MediaElement, PartialMediaFailureDetectedEventArgs>
PartialMediaFailureDetected

Remarks
If at least one stream in the content is successfully decoded, the decoded media is played and this event is raised. If the
stream that fails to decode is the only stream contained in the content, playback fails and the MediaFailed event is
raised.
MediaElement.Pause MediaElement.Pause Media
Element.Pause
I n this Article
Edit
Pauses media at the current position.
public : void Pause()
void Pause() const;
public void Pause()
MediaElement.Play MediaElement.Play MediaElement.
Play
I n this Article
Edit
Plays media from the current position.
public : void Play()
void Play() const;
public void Play()
MediaElement.PlaybackRate MediaElement.PlaybackRate
MediaElement.PlaybackRate
I n this Article
Edit
Gets or sets the playback rate ratio for the media engine.
public : double PlaybackRate { get; set; }
double PlaybackRate();

void PlaybackRate(double playbackrate);


public double PlaybackRate { get; set; }

<MediaElement PlaybackRate="double"/>

Returns
double
The playback rate ratio for the media. A value of 1.0 is the normal playback speed. Value can be negative to play
backwards.

Remarks
The current PlaybackRate is set to the value of DefaultPlaybackRate whenever Play is called. So setting
DefaultPlaybackRate to a different value has no effect until Play is called.
To set a rate that will persist throughout the lifetime of the MediaElement, use DefaultPlaybackRate. Once playback
ends, due to the MediaEnded event being raised or if Pause or Stop are called, the PlaybackRate will be effectively lost.
MediaElement.PlaybackRateProperty MediaElement.
PlaybackRateProperty MediaElement.PlaybackRate
Property
I n this Article
Edit
Identifies the PlaybackRate dependency property.
public : static DependencyProperty PlaybackRateProperty { get; }
static DependencyProperty PlaybackRateProperty();
public static DependencyProperty PlaybackRateProperty { get; }

Returns
DependencyProperty
The identifier for the PlaybackRate dependency property.
MediaElement.PlayToPreferredSourceUri MediaElement.
PlayToPreferredSourceUri MediaElement.PlayToPreferred
SourceUri
I n this Article
Edit
Note

PlayToPreferredSourceUri is deprecated. Instead, call MediaElement.GetAsCastingSource and, on the returned


value, call CastingSource.PreferredSourceUri.
Gets or sets the path to the preferred media source which enables the Play To target device to stream the media
content, which can be DRM protected, from a different location, such as a cloud media server.
public : Uri PlayToPreferredSourceUri { get; set; }
Uri PlayToPreferredSourceUri();

void PlayToPreferredSourceUri(Uri playtopreferredsourceuri);


public Uri PlayToPreferredSourceUri { get; set; }

<MediaElement PlayToPreferredSourceUri="uri" />

Returns
Uri
The path to the preferred media source.

Examples
Here is some code that shows how to set up Play To by reference.
<MediaElement Source="http://www.contoso.com/videos/video.mp4"
PlayToPreferredSourceUri="http://www.contoso.com/catalogid=1234">
</MediaElement>

MediaElement video = new MediaElement();

video.Source =
new Uri("http://www.contoso.com/videos/video.mp4");

video.PlayToPreferredSourceUri =
new Uri("http://www.contoso.com/catalogid=1234");

Remarks
PlayToSource.PreferredSourceUri enables Play To by reference. This allows streaming content on the Play To target
device from a different location, such as a cloud media server. This enables web pages and UWP app to play Digital
Rights Management (DRM ) protected content. The app specifies a preferred Uniform Resource Identifier (URI) that
will be sent to the Play To target device. This Uniform Resource Identifier (URI) can point to a cloud based media
server. If the PlayToSource.PreferredSourceUri value is present, the Play To target device can stream content directly
from the cloud, which can be Digital Rights Management (DRM ) protected, instead of streaming content from the
Windows machine which must be unprotected content.
A forward slash ("/") is appended to the Uniform Resource Identifier (URI) string when it is sent over the network to a
Play To device. This is done to conform to Uniform Resource Identifier (URI) standards.
MediaElement.PlayToPreferredSourceUriProperty Media
Element.PlayToPreferredSourceUriProperty Media
Element.PlayToPreferredSourceUriProperty
I n this Article
Edit
Identifies the PlayToPreferredSourceUri dependency property.
public : static DependencyProperty PlayToPreferredSourceUriProperty { get; }
static DependencyProperty PlayToPreferredSourceUriProperty();
public static DependencyProperty PlayToPreferredSourceUriProperty { get; }

Returns
DependencyProperty
The identifier for the PlayToPreferredSourceUri dependency property.
MediaElement.PlayToSource MediaElement.PlayToSource
MediaElement.PlayToSource
I n this Article
Edit
Gets the information that is transmitted if the MediaElement is used for a "PlayTo" scenario.
public : PlayToSource PlayToSource { get; }
PlayToSource PlayToSource();
public PlayToSource PlayToSource { get; }

Returns
PlayToSource
A reference object that carries the "PlayTo" source information.
MediaElement.PlayToSourceProperty MediaElement.Play
ToSourceProperty MediaElement.PlayToSourceProperty
I n this Article
Edit
Identifies the PlayToSource dependency property.
public : static DependencyProperty PlayToSourceProperty { get; }
static DependencyProperty PlayToSourceProperty();
public static DependencyProperty PlayToSourceProperty { get; }

Returns
DependencyProperty
The identifier for the PlayToSource dependency property.
MediaElement.Position MediaElement.Position Media
Element.Position
I n this Article
Edit
Gets or sets the current position of progress through the media's playback time.
public : TimeSpan Position { get; set; }
TimeSpan Position();

void Position(TimeSpan position);


public TimeSpan Position { get; set; }

Returns
TimeSpan
The amount of time since the beginning of the media. The default is a TimeSpan with value "0:0:0".

Remarks
Set this property to set a specific start-play position within the media.
A TimeSpan is represented as different types depending on the programming language you are using.

C# or Microsoft Visual Basic Use a System.TimeSpan structure. System.TimeSpan has utility members such as
Parse(String) that make it easy to create, change or compare time values.

Visual C++ component extensions (C++/CX) Use a Windows::Foundation::TimeSpan structure. This structure
has only one field member (Duration), which measures by 100-nanosecond units. If you intend to display a
Position value in an hours:minutes:seconds format, you'll have to write your own logic for converting to that format
from the Duration units.

If you are not sure of the current media source loaded as MediaElement.Source, always check CanSeek first. A
streaming media source results in the MediaElement reporting CanSeek as false, and in this case you cannot use
Position to set the playback point.
If Position is settable, then these value constraints apply:
If Position is set to a negative value, the value will revert to a TimeSpan with value "0:0:0".
If Position is set to a value larger than the media's NaturalDuration, then Position becomes the value of
NaturalDuration.
Notes on X A ML syntax
Setting a Position value in XAML is technically possible but not common. If you do set a Position in XAML, simulate
the "FromString" type conversion behavior for a TimeSpan, in other words specify the value in the form "HH:MM:SS".
MediaElement.PositionProperty MediaElement.Position
Property MediaElement.PositionProperty
I n this Article
Edit
Identifies the Position dependency property.
public : static DependencyProperty PositionProperty { get; }
static DependencyProperty PositionProperty();
public static DependencyProperty PositionProperty { get; }

Returns
DependencyProperty
The identifier the Position dependency property.
MediaElement.PosterSource MediaElement.PosterSource
MediaElement.PosterSource
I n this Article
Edit
Gets or sets the image source that is used for a placeholder image during MediaElement loading transition states.
public : ImageSource PosterSource { get; set; }
ImageSource PosterSource();

void PosterSource(ImageSource postersource);


public ImageSource PosterSource { get; set; }

<MediaElement PosterSource="imageUri" />

Returns
ImageSource
An image source for a transition ImageBrush that is applied to the MediaElement content area.

Remarks
A PosterSource is an image, such as a album cover or movie poster, that is displayed in place of video. It provides your
MediaElement with a visual representation before the media is loaded, or when the media is audio only.
The PosterSource is displayed in the following situations:
When a valid source is not set. For example, Source is not set, Source is set to Null, or the source is invalid (as is the
case when a MediaFailed event fires).
While media is loading. For example, a valid source is set, but the MediaOpened event has not fired yet.
While media is streaming to another device.
When the media is audio only.
MediaElement.PosterSourceProperty MediaElement.
PosterSourceProperty MediaElement.PosterSource
Property
I n this Article
Edit
Identifies the PosterSource dependency property.
public : static DependencyProperty PosterSourceProperty { get; }
static DependencyProperty PosterSourceProperty();
public static DependencyProperty PosterSourceProperty { get; }

Returns
DependencyProperty
The identifier for the PosterSource dependency property.
MediaElement.ProtectionManager MediaElement.
ProtectionManager MediaElement.ProtectionManager
I n this Article
Edit
Gets or sets the dedicated object for media content protection that is associated with this MediaElement.
public : MediaProtectionManager ProtectionManager { get; set; }
MediaProtectionManager ProtectionManager();

void ProtectionManager(MediaProtectionManager protectionmanager);


public MediaProtectionManager ProtectionManager { get; set; }

Returns
MediaProtectionManager
The dedicated object for media content protection.

Remarks
See the PlayReady sample for for an example of using ProtectionManager.
MediaElement.ProtectionManagerProperty Media
Element.ProtectionManagerProperty MediaElement.
ProtectionManagerProperty
I n this Article
Edit
Identifies the ProtectionManager dependency property.
public : static DependencyProperty ProtectionManagerProperty { get; }
static DependencyProperty ProtectionManagerProperty();
public static DependencyProperty ProtectionManagerProperty { get; }

Returns
DependencyProperty
The identifier for the ProtectionManager dependency property.
MediaElement.RateChanged MediaElement.Rate
Changed MediaElement.RateChanged
I n this Article
Edit
Occurs when PlaybackRate or DefaultPlaybackRate value changes.
public : event RateChangedRoutedEventHandler RateChanged
// Register
event_token RateChanged(RateChangedRoutedEventHandler const& handler) const;

// Revoke with event_token


void RateChanged(event_token const& cookie) const;

// Revoke with event_revoker


RateChanged_revoker RateChanged(auto_revoke_t, RateChangedRoutedEventHandler const& handler) const;
public event RateChangedRoutedEventHandler RateChanged

<MediaElement RateChanged="eventhandler"/>
MediaElement.RealTimePlayback MediaElement.Real
TimePlayback MediaElement.RealTimePlayback
I n this Article
Edit
Gets or sets a value that configures the MediaElement for real-time communications scenarios.
public : Platform::Boolean RealTimePlayback { get; set; }
bool RealTimePlayback();

void RealTimePlayback(bool realtimeplayback);


public bool RealTimePlayback { get; set; }

<MediaElement RealTimePlayback="bool" />

Returns
bool
true to configure for real-time communications. false to not configure the MediaElement for real-time
communications.

Remarks
Configuring for real-time playback changes the internal update logic to place higher emphasis on video refresh from
available samples, and also restricts playback to natural 1x speed. Setting the property requires an internal
reconstruction of the backing media engine.
See Real-time communication sample (Windows 10)
Also
MediaElement.RealTimePlaybackProperty MediaElement.
RealTimePlaybackProperty MediaElement.RealTime
PlaybackProperty
I n this Article
Edit
Identifies the RealTimePlayback dependency property.
public : static DependencyProperty RealTimePlaybackProperty { get; }
static DependencyProperty RealTimePlaybackProperty();
public static DependencyProperty RealTimePlaybackProperty { get; }

Returns
DependencyProperty
The identifier for the RealTimePlayback dependency property.
MediaElement.RemoveAllEffects MediaElement.Remove
AllEffects MediaElement.RemoveAllEffects
I n this Article
Edit
Removes all effects for the next source set for this MediaElement.
public : void RemoveAllEffects()
void RemoveAllEffects() const;
public void RemoveAllEffects()
MediaElement.SeekCompleted MediaElement.Seek
Completed MediaElement.SeekCompleted
I n this Article
Edit
Occurs when the seek point of a requested seek operation is ready for playback.
public : event RoutedEventHandler SeekCompleted
// Register
event_token SeekCompleted(RoutedEventHandler const& handler) const;

// Revoke with event_token


void SeekCompleted(event_token const& cookie) const;

// Revoke with event_revoker


SeekCompleted_revoker SeekCompleted(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler SeekCompleted

<MediaElement SeekCompleted="eventhandler"/>
MediaElement.SetMediaStreamSource MediaElement.Set
MediaStreamSource MediaElement.SetMediaStream
Source
I n this Article
Edit
Sets the Source of the MediaElement to the specified MediaStreamSource.
public : void SetMediaStreamSource(IMediaSource source)
void SetMediaStreamSource(IMediaSource source) const;
public void SetMediaStreamSource(IMediaSource source)

Parameters
source IMediaSource
The media source.
MediaElement.SetPlaybackSource MediaElement.Set
PlaybackSource MediaElement.SetPlaybackSource
I n this Article
Edit
Sets the source of the MediaElement to the specified media playback source.
public : void SetPlaybackSource(IMediaPlaybackSource source)
void SetPlaybackSource(IMediaPlaybackSource source) const;
public void SetPlaybackSource(IMediaPlaybackSource source)

Parameters
source IMediaPlaybackSource
The media playback source.
MediaElement.SetSource MediaElement.SetSource
MediaElement.SetSource
I n this Article
Edit
Sets the Source property using the specified stream and MIME type.
public : void SetSource(IRandomAccessStream stream, Platform::String mimeType)
void SetSource(IRandomAccessStream stream, winrt::hstring mimeType) const;
public void SetSource(IRandomAccessStream stream, String mimeType)

Parameters
stream IRandomAccessStream
The stream that contains the media to load.
mimeType String
The MIME type of the media resource, expressed as the string form typically seen in HTTP headers and requests. The
empty string "" can be passed in as the mimeType value if the MIME type is unknown.

Examples
Here is some code that creates MediaElement object and sets the media source using a FileOpenPicker control.
<MediaElement x:Name="mediaControl" Height="400" />

async private void SetLocalMedia()


{
var openPicker = new Windows.Storage.Pickers.FileOpenPicker();

openPicker.FileTypeFilter.Add(".wmv");
openPicker.FileTypeFilter.Add(".mp4");
openPicker.FileTypeFilter.Add(".wma");
openPicker.FileTypeFilter.Add(".mp3");

var file = await openPicker.PickSingleFileAsync();

// mediaControl is a MediaElement defined in XAML


if (null != file)
{
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
mediaControl.SetSource(stream, file.ContentType);
mediaControl.Play();
}
}

Remarks
You can use the FileOpenPicker control to get the file stream for a media file on the local system.
See Audio, video, and camera
Also Create custom transport controls
Supported audio and video formats
MediaElement.Source MediaElement.Source Media
Element.Source
I n this Article
Edit
Gets or sets a media source on the MediaElement.
public : Uri Source { get; set; }
Uri Source();

void Source(Uri source);


public Uri Source { get; set; }

<MediaElement Source="uri" .../>

Returns
Uri
The source of the element, as an object describing a Uniform Resource Identifier (URI). The default is null.
MediaElement.SourceProperty MediaElement.Source
Property MediaElement.SourceProperty
I n this Article
Edit
Identifies the Source dependency property.
public : static DependencyProperty SourceProperty { get; }
static DependencyProperty SourceProperty();
public static DependencyProperty SourceProperty { get; }

Returns
DependencyProperty
The identifier for the Source dependency property.
MediaElement.Stereo3DVideoPackingMode Media
Element.Stereo3DVideoPackingMode MediaElement.
Stereo3DVideoPackingMode
I n this Article
Edit
Gets or sets an enumeration value that determines the stereo 3-D video frame-packing mode for the current media
source.
public : Stereo3DVideoPackingMode Stereo3DVideoPackingMode { get; set; }
Stereo3DVideoPackingMode Stereo3DVideoPackingMode();

void Stereo3DVideoPackingMode(Stereo3DVideoPackingMode stereo3dvideopackingmode);


public Stereo3DVideoPackingMode Stereo3DVideoPackingMode { get; set; }

<MediaElement Stereo3DVideoPackingMode="stereo3DVideoPackingModeMemberName" .../>

Returns
Stereo3DVideoPackingMode
A value of the enumeration. See Remarks.

Examples
<MediaElement x:Name="me1" Stereo3DVideoPackingMode="TopBottom" Stereo3DVideoRenderMode="Stereo"/>

Remarks
The Stereo3DVideoPackingMode default is to allow the system to determine the packing mode from the metadata of
the video content. In order to reset a Stereo3DVideoPackingMode value once it has been set, use ClearValue.
Stereo3DVideoPackingMode is used in conjunction with Stereo3DVideoRenderMode to display 3-D content.
MediaElement.Stereo3DVideoPackingModeProperty
MediaElement.Stereo3DVideoPackingModeProperty
MediaElement.Stereo3DVideoPackingModeProperty
I n this Article
Edit
Identifies the Stereo3DVideoPackingMode dependency property.
public : static DependencyProperty Stereo3DVideoPackingModeProperty { get; }
static DependencyProperty Stereo3DVideoPackingModeProperty();
public static DependencyProperty Stereo3DVideoPackingModeProperty { get; }

Returns
DependencyProperty
The identifier for the Stereo3DVideoPackingMode dependency property.
MediaElement.Stereo3DVideoRenderMode Media
Element.Stereo3DVideoRenderMode MediaElement.
Stereo3DVideoRenderMode
I n this Article
Edit
Gets or sets an enumeration value that determines the stereo 3-D video render mode for the current media source.
public : Stereo3DVideoRenderMode Stereo3DVideoRenderMode { get; set; }
Stereo3DVideoRenderMode Stereo3DVideoRenderMode();

void Stereo3DVideoRenderMode(Stereo3DVideoRenderMode stereo3dvideorendermode);


public Stereo3DVideoRenderMode Stereo3DVideoRenderMode { get; set; }

<MediaElement Stereo3DVideoRenderMode="stereo3DVideoRenderModeMemberName" .../>

Returns
Stereo3DVideoRenderMode
A value of the enumeration.

Examples
<MediaElement x:Name="me1" Stereo3DVideoPackingMode="TopBottom" Stereo3DVideoRenderMode="Stereo"/>

Remarks
IsStereo3DVideo is an evaluated read-only property that is based on Stereo3DVideoRenderMode.
Set Stereo3DVideoRenderMode to Stereo when you want to enable the MediaElement to play 3D video. The API
works in conjunction with Stereo3DVideoPackingMode, which lets you set the packing mode or allows the sub systems
to infer it from the video file
MediaElement.Stereo3DVideoRenderModeProperty
MediaElement.Stereo3DVideoRenderModeProperty
MediaElement.Stereo3DVideoRenderModeProperty
I n this Article
Edit
Identifies the Stereo3DVideoRenderMode dependency property.
public : static DependencyProperty Stereo3DVideoRenderModeProperty { get; }
static DependencyProperty Stereo3DVideoRenderModeProperty();
public static DependencyProperty Stereo3DVideoRenderModeProperty { get; }

Returns
DependencyProperty
The identifier for the Stereo3DVideoRenderMode dependency property.
MediaElement.Stop MediaElement.Stop MediaElement.
Stop
I n this Article
Edit
Stops and resets media to be played from the beginning.
public : void Stop()
void Stop() const;
public void Stop()
MediaElement.Stretch MediaElement.Stretch Media
Element.Stretch
I n this Article
Edit
Gets or sets a value that describes how an MediaElement should be stretched to fill the destination rectangle.
public : Stretch Stretch { get; set; }
Stretch Stretch();

void Stretch(Stretch stretch);


public Stretch Stretch { get; set; }

<MediaElement Stretch="stretchMemberName" />

Returns
Stretch
A value of the Stretch enumeration that specifies how the source visual media is rendered. The default value is
Uniform.

Examples
Here is some code that shows how to create a zoom effect, similar to msZoom in Windows app using JavaScript. The
MediaElement content will fill up the entire layout space while preserving the aspect ratio of the content. This could
result in cropping if the aspect ratio of the content is not the same as the layout space.
private void ToggleZoom(MediaElement media)
{
if (media.Stretch != Stretch.UniformToFill)
{
// zoom
media.Stretch = Stretch.UniformToFill;
}
else
{
// unzoom
media.Stretch = Stretch.Uniform;
}
}

Remarks
Here's what the Stretch values represent for MediaElement content:
None: The original size of the content is preserved.
Fill: The content is resized to fill the destination dimensions. The aspect ratio of the video is not preserved.
UniformToFill: Uniformly stretches the MediaElement to fill the available layout space while preserving the aspect
ratio of the content. If the aspect ratio of the destination rectangle differs from the source, the source content is clipped
to fit the destination dimensions.
Uniform: Uniformly stretches the MediaElement to fill the layout space while preserve the aspect ratio of the image.
This will ensure that the entire image is displayed, undistorted and not cropped. This may result in letterboxing or
pillarboxing on the top or sides of the image, depending on the aspect ratio of the content.
See Stretch
Also
MediaElement.StretchProperty MediaElement.Stretch
Property MediaElement.StretchProperty
I n this Article
Edit
Identifies the Stretch dependency property.
public : static DependencyProperty StretchProperty { get; }
static DependencyProperty StretchProperty();
public static DependencyProperty StretchProperty { get; }

Returns
DependencyProperty
The identifier for the Stretch dependency property.
MediaElement.TransportControls MediaElement.
TransportControls MediaElement.TransportControls
I n this Article
Edit
Gets or sets the transport controls for the media.
public : MediaTransportControls TransportControls { get; set; }
MediaTransportControls TransportControls();

void TransportControls(MediaTransportControls transportcontrols);


public MediaTransportControls TransportControls { get; set; }

Returns
MediaTransportControls
The transport controls for the media.
MediaElement.Volume MediaElement.Volume Media
Element.Volume
I n this Article
Edit
Gets or sets the media's volume.
public : double Volume { get; set; }
double Volume();

void Volume(double volume);


public double Volume { get; set; }

<MediaElement Volume="double"/>

Returns
double
The media's volume represented on a linear scale between 0 and 1. The default is 0.5.
MediaElement.VolumeChanged MediaElement.Volume
Changed MediaElement.VolumeChanged
I n this Article
Edit
Occurs when the value of the Volume property changes.
public : event RoutedEventHandler VolumeChanged
// Register
event_token VolumeChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void VolumeChanged(event_token const& cookie) const;

// Revoke with event_revoker


VolumeChanged_revoker VolumeChanged(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler VolumeChanged

<MediaElement VolumeChanged="eventhandler" />


MediaElement.VolumeProperty MediaElement.Volume
Property MediaElement.VolumeProperty
I n this Article
Edit
Identifies the Volume dependency property.
public : static DependencyProperty VolumeProperty { get; }
static DependencyProperty VolumeProperty();
public static DependencyProperty VolumeProperty { get; }

Returns
DependencyProperty
The identifier for the Volume dependency property.
MediaPlayerElement MediaPlayerElement MediaPlayer
Element Class
Represents an object that uses a MediaPlayer to render audio and video to the display.

D eclaration
public : class MediaPlayerElement : Control, IMediaPlayerElement
struct winrt::Windows::UI::Xaml::Controls::MediaPlayerElement : Control, IMediaPlayerElement
public class MediaPlayerElement : Control, IMediaPlayerElement

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Media playback.
For info about the media formats that MediaPlayerElement supports, see Supported codecs.
Architectural overview
MediaPlayerElement is a lightweight XAML control that serves as a rendering surface for the robust MediaPlayer class,
which is part of the Windows.Media.Playback namespace. The majority of the media functionality is located on the
underlying MediaPlayer class, which you can access through the MediaPlayerElement.MediaPlayer property. To
change the underlying MediaPlayer for an instance of MediaPlayerElement, use the SetMediaPlayer method.
For more information about the MediaPlayer class, including guidelines on how to transition from MediaElement to
MediaPlayerElement, see the Media playback page.
Set the media source
Set the Source property of the MediaPlayerElement to point to an audio or video file. You can set it to a MediaSource,
MediaPlaybackItem, or MediaPlaybackList. The media files can be included with the app package or be on a network.
By default, the media that is defined by the Source property does not immediately play after the MediaPlayerElement
object has loaded. To start media playback automatically, set the AutoPlay property to true.
Here’s how to create a MediaPlayerElement in XAML with the Source set to the path of a video file that is included in
the app and the AutoPlay property explicitly set to true.
<MediaPlayerElement Source="ms-appx:///Media/video1.mp4" AutoPlay="True"/>

Here’s how to create the MediaPlayerElement in code.


MediaPlayerElement mediaPlayerElement1 = new MediaPlayerElement();
mediaPlayerElement1.Source = MediaSource.CreateFromUri(new Uri("ms-appx:///Media/video1.mp4"));
mediaPlayerElement1.AutoPlay = true;

H andle media events


You can respond to common media events located on the underlying MediaPlayer such as MediaOpened,
MediaEnded, and MediaFailed. If you have set the source to a MediaPlaybackItem or MediaPlaybackList, you should
respond to the media events on those classes instead as they provide more information.
Transport controls
Set the AreTransportControlsEnabled property to programmatically enable and disable the built in transport controls
for the MediaPlayerElement. The built in transport controls provide UI for playing, stopping, pausing, and seeking the
media as well as UI for volume, mute, full window, track selection, closed captions and remaining time.
You can create your own media transport controls by setting AreTransportControlsEnabled to false, and using the Play
and Pause methods on MediaPlayer. You can also control a rich set of properties by using the underlying MediaPlayer
such as Position, Volume, IsMuted, IsLoopingEnabled, and PlaybackRate.
 Tip

For better performance, avoid data binding to the Position property to reflect frequent position updates (for example
with a progress bar). Instead, use the DispatcherTimer to query the Position property.
For more info and examples, see Create custom transport controls.
Full window playback
Use the IsFullWindow property to enable and disable full window rendering. When in full-window mode the display is
automatically prevented from being deactivated when user action is no longer detected.
Note

We recommend that you not use MediaPlayerElement in a Popup control. If a MediaPlayerElement hosted in a Popup
is switched to full-window mode, the Popup is rendered on top of the MediaPlayerElement. If you must use a
MediaPlayerElement in a Popup, you should collapse the Popup when the MediaPlayerElement enters full-window
mode, and restore the Popup when the MediaPlayerElement exits full-window mode. Use
DependencyProperty.RegisterPropertyChangedCallback to be notified when the MediaPlayerElement.IsFullWindow
property changes. For an example, see the Examples section.
Keep media playing
To prevent the display from being deactivated when MediaPlayerElement is not in full-window mode, you can call
DisplayRequest.RequestActive. To conserve power and battery life, you should call DisplayRequest.RequestRelease to
release the display request as soon as it is no longer required.
Here are some situations when you should release the display request:
Video playback is paused, for example by user action, buffering, or adjustment due to limited bandwidth.
Playback stops. For example, the video is done playing or the presentation is over.
A playback error has occurred. For example, network connectivity issues or a corrupted file.
Here, you use the PlaybackStateChanged event to detect these situations. Then, use the NaturalVideoHeight property
of the MediaPlayer.PlaybackSession to determine whether an audio or video file is playing, and keep the screen active
only if video is playing.
<MediaPlayerElement x:Name="mpe" Source="ms-appx:///Media/video1.mp4"/>
// Create this variable at a global scope. Set it to null.
private DisplayRequest appDisplayRequest = null;

protected override void OnNavigatedTo(NavigationEventArgs e)


{
mpe.MediaPlayer.PlaybackSession.PlaybackStateChanged += MediaPlayerElement_CurrentStateChanged;
base.OnNavigatedTo(e);
}

private void MediaPlayerElement_CurrentStateChanged(MediaPlaybackSession sender, object args)


{
MediaPlaybackSession playbackSession = sender as MediaPlaybackSession;
if (playbackSession != null && playbackSession.NaturalVideoHeight != 0)
{
if(playbackSession.PlaybackState == MediaPlaybackState.Playing)
{
if(appDisplayRequest == null)
{
// This call creates an instance of the DisplayRequest object
appDisplayRequest = new DisplayRequest();
appDisplayRequest.RequestActive();
}
}
else // PlaybackState is Buffering, None, Opening, or Paused.
{
if(appDisplayRequest != null)
{
// Deactivate the display request and set the var to null.
appDisplayRequest.RequestRelease();
appDisplayRequest = null;
}
}
}
}

Poster source
You can use the PosterSource property to provide your MediaPlayerElement with a visual representation before the
media is loaded or while audio-only media is playing. . A PosterSource is an image, such as a screen shot, movie poster,
or album cover, that is displayed in place of the media. The PosterSource is displayed in the following situations:
When a valid source is not set. For example, Source is not set, Source was set to Null, or the source is invalid (as is the
case when a MediaFailed event fires).
While media is loading. For example, a valid source is set, but the MediaOpened event has not fired yet.
When media is streaming to another device.
When the media is audio only.

Constructors
MediaPlayerElement()
MediaPlayerElement()
MediaPlayerElement()

Initializes a new instance of the MediaPlayerElement class.

Properties
AreTransportControlsEnabled
AreTransportControlsEnabled
AreTransportControlsEnabled

Gets or sets a value that determines whether the standard transport controls are enabled.

AreTransportControlsEnabledProperty
AreTransportControlsEnabledProperty
AreTransportControlsEnabledProperty

Identifies the AreTransportControlsEnabled dependency property.

AutoPlay
AutoPlay
AutoPlay

Gets or sets a value that indicates whether media will begin playback automatically when the Source property is
set.

AutoPlayProperty
AutoPlayProperty
AutoPlayProperty

Identifies the AutoPlay dependency property.

IsFullWindow
IsFullWindow
IsFullWindow

Gets or sets a value that specifies if the MediaPlayerElement is rendering in full window mode.

IsFullWindowProperty
IsFullWindowProperty
IsFullWindowProperty

Identifies the IsFullWindow dependency property.

MediaPlayer
MediaPlayer
MediaPlayer

Gets the MediaPlayer instance used to render media.

MediaPlayerProperty
MediaPlayerProperty
MediaPlayerProperty

Identifies the MediaPlayer dependency property.

PosterSource
PosterSource
PosterSource

Gets or sets the image source that is used for a placeholder image during MediaPlayerElement loading transition
states.

PosterSourceProperty
PosterSourceProperty
PosterSourceProperty

Identifies the PosterSource dependency property.

Source
Source
Source

Gets or sets a media source on the MediaPlayerElement.

SourceProperty
SourceProperty
SourceProperty

Identifies the Source dependency property.

Stretch
Stretch
Stretch

Gets or sets a value that describes how an MediaPlayerElement should be stretched to fill the destination
rectangle.

StretchProperty
StretchProperty
StretchProperty

Identifies the Stretch dependency property.

TransportControls
TransportControls
TransportControls
Gets or sets the transport controls for the media.

Methods
SetMediaPlayer(MediaPlayer)
SetMediaPlayer(MediaPlayer)
SetMediaPlayer(MediaPlayer)

Sets the MediaPlayer instance used to render media.

See Also
Control
Control
Control
Control
Control
MediaPlayerElement.AreTransportControlsEnabled
MediaPlayerElement.AreTransportControlsEnabled
MediaPlayerElement.AreTransportControlsEnabled
I n this Article
Edit
Gets or sets a value that determines whether the standard transport controls are enabled.
public : Platform::Boolean AreTransportControlsEnabled { get; set; }
bool AreTransportControlsEnabled();

void AreTransportControlsEnabled(bool aretransportcontrolsenabled);


public bool AreTransportControlsEnabled { get; set; }

<MediaPlayerElement AreTransportControlsEnabled="bool"/>

Returns
bool
true if the standard transport controls are enabled; otherwise, false. The default is false.

Remarks
The transport controls are exposed as a MediaTransportControls object that you can access through the
MediaPlayerElement.TransportControls property. See MediaTransportControls for more info.
If AreTransportControlsEnabled is true, the standard transport controls are enabled and displayed on the
MediaPlayerElement. If AreTransportControlsEnabled is false, the standard transport controls are not enabled and are
not displayed.
The transport controls hide themselves after a short period of no user interaction with the MediaPlayerElement. They
reappear when the user interacts with the MediaPlayerElement.
If the Width of MediaPlayerElement is not sufficient to display all of the transport controls, a subset of the controls are
displayed.
Note

If you disable the MediaPlaybackCommandManager by setting IsEnabled to false, it will break the link between the
MediaPlayer the TransportControls provided by the MediaPlayerElement, so the built-in transport controls will no
longer automatically control the playback of the player. Instead, you must implement your own controls to control the
MediaPlayer.
MediaPlayerElement.AreTransportControlsEnabled
Property MediaPlayerElement.AreTransportControls
EnabledProperty MediaPlayerElement.AreTransport
ControlsEnabledProperty
I n this Article
Edit
Identifies the AreTransportControlsEnabled dependency property.
public : static DependencyProperty AreTransportControlsEnabledProperty { get; }
static DependencyProperty AreTransportControlsEnabledProperty();
public static DependencyProperty AreTransportControlsEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the AreTransportControlsEnabled dependency property.
MediaPlayerElement.AutoPlay MediaPlayerElement.Auto
Play MediaPlayerElement.AutoPlay
I n this Article
Edit
Gets or sets a value that indicates whether media will begin playback automatically when the Source property is set.
public : Platform::Boolean AutoPlay { get; set; }
bool AutoPlay();

void AutoPlay(bool autoplay);


public bool AutoPlay { get; set; }

<MediaPlayerElement AutoPlay="bool" .../>

Returns
bool
true if playback is automatic; otherwise, false. The default is true.
MediaPlayerElement.AutoPlayProperty MediaPlayer
Element.AutoPlayProperty MediaPlayerElement.AutoPlay
Property
I n this Article
Edit
Identifies the AutoPlay dependency property.
public : static DependencyProperty AutoPlayProperty { get; }
static DependencyProperty AutoPlayProperty();
public static DependencyProperty AutoPlayProperty { get; }

Returns
DependencyProperty
The identifier for the AutoPlay dependency property.
MediaPlayerElement.IsFullWindow MediaPlayerElement.
IsFullWindow MediaPlayerElement.IsFullWindow
I n this Article
Edit
Gets or sets a value that specifies if the MediaPlayerElement is rendering in full window mode.
public : Platform::Boolean IsFullWindow { get; set; }
bool IsFullWindow();

void IsFullWindow(bool isfullwindow);


public bool IsFullWindow { get; set; }

<MediaPlayerElement IsFullWindow="bool" />

Returns
bool
true if the MediaPlayerElement is in full window mode; otherwise, false. The default is false.

Remarks
Setting and un-setting this property enables and disables full window rendering.
Always use the IsFullWindow property to enable and disable full window rendering. This ensures system level
optimizations are used during media playback.
When in full-window mode, input events received on the MediaPlayerElement will still route through to the visual tree
in the background. For example, if the MediaPlayerElement is in a ListBox, turning the scroll wheel could cause the
ListBox to scroll in the background. This can cause unexpected behavior. If input events should not be routed when in
full-window mode, the MediaPlayerElement should handle the events.
MediaPlayerElement.IsFullWindowProperty MediaPlayer
Element.IsFullWindowProperty MediaPlayerElement.Is
FullWindowProperty
I n this Article
Edit
Identifies the IsFullWindow dependency property.
public : static DependencyProperty IsFullWindowProperty { get; }
static DependencyProperty IsFullWindowProperty();
public static DependencyProperty IsFullWindowProperty { get; }

Returns
DependencyProperty
The identifier for the IsFullWindow dependency property.
MediaPlayerElement.MediaPlayer MediaPlayerElement.
MediaPlayer MediaPlayerElement.MediaPlayer
I n this Article
Edit
Gets the MediaPlayer instance used to render media.
public : MediaPlayer MediaPlayer { get; }
MediaPlayer MediaPlayer();
public MediaPlayer MediaPlayer { get; }

Returns
MediaPlayer
The MediaPlayer instance used to render media.

Remarks
You can use the SetMediaPlayer method to change the underlying MediaPlayer instance. Changing the MediaPlayer
can cause non-trivial side effects because it can change other properties of the MediaPlayerElement.
MediaPlayerElement MediaPlayerElement MediaPlayer
Element
I n this Article
Edit
Initializes a new instance of the MediaPlayerElement class.
public : MediaPlayerElement()
MediaPlayerElement() const;
public MediaPlayerElement()
MediaPlayerElement.MediaPlayerProperty MediaPlayer
Element.MediaPlayerProperty MediaPlayerElement.
MediaPlayerProperty
I n this Article
Edit
Identifies the MediaPlayer dependency property.
public : static DependencyProperty MediaPlayerProperty { get; }
static DependencyProperty MediaPlayerProperty();
public static DependencyProperty MediaPlayerProperty { get; }

Returns
DependencyProperty
The identifier for the MediaPlayer dependency property.
MediaPlayerElement.PosterSource MediaPlayerElement.
PosterSource MediaPlayerElement.PosterSource
I n this Article
Edit
Gets or sets the image source that is used for a placeholder image during MediaPlayerElement loading transition
states.
public : ImageSource PosterSource { get; set; }
ImageSource PosterSource();

void PosterSource(ImageSource postersource);


public ImageSource PosterSource { get; set; }

<MediaPlayerElement PosterSource="imageUri" />

Returns
ImageSource
An image source for a transition ImageBrush that is applied to the MediaPlayerElement content area.

Remarks
A PosterSource is an image, such as a album cover or movie poster, that is displayed in place of video. It provides your
MediaPlayerElement with a visual representation before the media is loaded, or when the media is audio only.
The PosterSource is displayed in the following situations:
When a valid source is not set. For example, Source is not set, Source is set to Null, or the source is invalid (as is the
case when a MediaFailed event fires).
While media is loading. For example, a valid source is set, but the MediaOpened event has not fired yet.
While media is streaming to another device.
When the media is audio only.
MediaPlayerElement.PosterSourceProperty MediaPlayer
Element.PosterSourceProperty MediaPlayerElement.
PosterSourceProperty
I n this Article
Edit
Identifies the PosterSource dependency property.
public : static DependencyProperty PosterSourceProperty { get; }
static DependencyProperty PosterSourceProperty();
public static DependencyProperty PosterSourceProperty { get; }

Returns
DependencyProperty
The identifier for the PosterSource dependency property.
MediaPlayerElement.SetMediaPlayer MediaPlayer
Element.SetMediaPlayer MediaPlayerElement.SetMedia
Player
I n this Article
Edit
Sets the MediaPlayer instance used to render media.
public : void SetMediaPlayer(MediaPlayer mediaPlayer)
void SetMediaPlayer(MediaPlayer mediaPlayer) const;
public void SetMediaPlayer(MediaPlayer mediaPlayer)

Parameters
mediaPlayer MediaPlayer
The new MediaPlayer instance used to render media.

Remarks
You can use the SetMediaPlayer method to change the underlying MediaPlayer instance. Calling this method to
change the MediaPlayer can cause non-trivial side effects because it can change other properties of the
MediaPlayerElement.
Use the MediaPlayer property to get the current instance of MediaPlayer.
MediaPlayerElement.Source MediaPlayerElement.Source
MediaPlayerElement.Source
I n this Article
Edit
Gets or sets a media source on the MediaPlayerElement.
public : IMediaPlaybackSource Source { get; set; }
IMediaPlaybackSource Source();

void Source(IMediaPlaybackSource source);


public IMediaPlaybackSource Source { get; set; }

Returns
IMediaPlaybackSource
The source of the media. The default is null.
MediaPlayerElement.SourceProperty MediaPlayer
Element.SourceProperty MediaPlayerElement.Source
Property
I n this Article
Edit
Identifies the Source dependency property.
public : static DependencyProperty SourceProperty { get; }
static DependencyProperty SourceProperty();
public static DependencyProperty SourceProperty { get; }

Returns
DependencyProperty
The identifier for the Source dependency property.
MediaPlayerElement.Stretch MediaPlayerElement.Stretch
MediaPlayerElement.Stretch
I n this Article
Edit
Gets or sets a value that describes how an MediaPlayerElement should be stretched to fill the destination rectangle.
public : Stretch Stretch { get; set; }
Stretch Stretch();

void Stretch(Stretch stretch);


public Stretch Stretch { get; set; }

<MediaPlayerElement Stretch="stretchMemberName" />

Returns
Stretch
A value of the Stretch enumeration that specifies how the source visual media is rendered. The default value is
Uniform.

Remarks
Here's what the Stretch values represent for MediaPlayerElement content:
None: The original size of the content is preserved.
Fill: The content is resized to fill the destination dimensions. The aspect ratio of the video is not preserved.
UniformToFill: Uniformly stretches the MediaPlayerElement to fill the available layout space while preserving the
aspect ratio of the content. If the aspect ratio of the destination rectangle differs from the source, the source content is
clipped to fit the destination dimensions.
Uniform: Uniformly stretches the MediaPlayerElement to fill the layout space while preserve the aspect ratio of the
image. This will ensure that the entire image is displayed, undistorted and not cropped. This may result in letterboxing
or pillarboxing on the top or sides of the image, depending on the aspect ratio of the content.
MediaPlayerElement.StretchProperty MediaPlayer
Element.StretchProperty MediaPlayerElement.Stretch
Property
I n this Article
Edit
Identifies the Stretch dependency property.
public : static DependencyProperty StretchProperty { get; }
static DependencyProperty StretchProperty();
public static DependencyProperty StretchProperty { get; }

Returns
DependencyProperty
The identifier for the Stretch dependency property.
MediaPlayerElement.TransportControls MediaPlayer
Element.TransportControls MediaPlayerElement.
TransportControls
I n this Article
Edit
Gets or sets the transport controls for the media.
public : MediaTransportControls TransportControls { get; set; }
MediaTransportControls TransportControls();

void TransportControls(MediaTransportControls transportcontrols);


public MediaTransportControls TransportControls { get; set; }

Returns
MediaTransportControls
The transport controls for the media.
MediaPlayerPresenter MediaPlayerPresenter Media
PlayerPresenter Class
Represents an object that displays a MediaPlayer.

D eclaration
public : class MediaPlayerPresenter : FrameworkElement, IMediaPlayerPresenter
struct winrt::Windows::UI::Xaml::Controls::MediaPlayerPresenter : FrameworkElement,
IMediaPlayerPresenter
public class MediaPlayerPresenter : FrameworkElement, IMediaPlayerPresenter

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
MediaPlayerPresenter is intended to be used in the control template of the MediaPlayerElement control. You will
typically use MediaPlayerElement in your app rather than MediaPlayerPresenter.

Constructors
MediaPlayerPresenter()
MediaPlayerPresenter()
MediaPlayerPresenter()

Initializes a new instance of the MediaPlayerPresenter class.

Properties
IsFullWindow
IsFullWindow
IsFullWindow

Gets or sets a value that specifies if the MediaPlayerPresenter is rendering in full window mode.

IsFullWindowProperty
IsFullWindowProperty
IsFullWindowProperty

Identifies the IsFullWindow dependency property.

MediaPlayer
MediaPlayer
MediaPlayer
Gets or sets the MediaPlayer instance used to render media.

MediaPlayerProperty
MediaPlayerProperty
MediaPlayerProperty

Identifies the MediaPlayer dependency property.

Stretch
Stretch
Stretch

Gets or sets a value that describes how an MediaPlayerPresenter should be stretched to fill the destination
rectangle.

StretchProperty
StretchProperty
StretchProperty

Identifies the Stretch dependency property.

See Also
FrameworkElement
MediaPlayerPresenter.IsFullWindow MediaPlayer
Presenter.IsFullWindow MediaPlayerPresenter.IsFull
Window
I n this Article
Edit
Gets or sets a value that specifies if the MediaPlayerPresenter is rendering in full window mode.
public : Platform::Boolean IsFullWindow { get; set; }
bool IsFullWindow();

void IsFullWindow(bool isfullwindow);


public bool IsFullWindow { get; set; }

<MediaPlayerPresenter IsFullWindow="bool" />

Returns
bool
true if the MediaPlayerPresenter is in full window mode; otherwise, false. The default is false.
MediaPlayerPresenter.IsFullWindowProperty MediaPlayer
Presenter.IsFullWindowProperty MediaPlayerPresenter.Is
FullWindowProperty
I n this Article
Edit
Identifies the IsFullWindow dependency property.
public : static DependencyProperty IsFullWindowProperty { get; }
static DependencyProperty IsFullWindowProperty();
public static DependencyProperty IsFullWindowProperty { get; }

Returns
DependencyProperty
The identifier for the IsFullWindow dependency property.
MediaPlayerPresenter.MediaPlayer MediaPlayer
Presenter.MediaPlayer MediaPlayerPresenter.Media
Player
I n this Article
Edit
Gets or sets the MediaPlayer instance used to render media.
public : MediaPlayer MediaPlayer { get; set; }
MediaPlayer MediaPlayer();

void MediaPlayer(MediaPlayer mediaplayer);


public MediaPlayer MediaPlayer { get; set; }

Returns
MediaPlayer
The MediaPlayer instance used to render media.
MediaPlayerPresenter MediaPlayerPresenter Media
PlayerPresenter
I n this Article
Edit
Initializes a new instance of the MediaPlayerPresenter class.
public : MediaPlayerPresenter()
MediaPlayerPresenter() const;
public MediaPlayerPresenter()
MediaPlayerPresenter.MediaPlayerProperty MediaPlayer
Presenter.MediaPlayerProperty MediaPlayerPresenter.
MediaPlayerProperty
I n this Article
Edit
Identifies the MediaPlayer dependency property.
public : static DependencyProperty MediaPlayerProperty { get; }
static DependencyProperty MediaPlayerProperty();
public static DependencyProperty MediaPlayerProperty { get; }

Returns
DependencyProperty
The identifier for the MediaPlayer dependency property.
MediaPlayerPresenter.Stretch MediaPlayerPresenter.
Stretch MediaPlayerPresenter.Stretch
I n this Article
Edit
Gets or sets a value that describes how an MediaPlayerPresenter should be stretched to fill the destination rectangle.
public : Stretch Stretch { get; set; }
Stretch Stretch();

void Stretch(Stretch stretch);


public Stretch Stretch { get; set; }

<MediaPlayerPresenter Stretch="stretchMemberName" />

Returns
Stretch
A value of the Stretch enumeration that specifies how the source visual media is rendered. The default value is
Uniform.

Remarks
Here's what the Stretch values represent for MediaPlayerPresenter content:
None: The original size of the content is preserved.
Fill: The content is resized to fill the destination dimensions. The aspect ratio of the video is not preserved.
UniformToFill: Uniformly stretches the MediaPlayerPresenter to fill the available layout space while preserving the
aspect ratio of the content. If the aspect ratio of the destination rectangle differs from the source, the source content is
clipped to fit the destination dimensions.
Uniform: Uniformly stretches the MediaPlayerPresenter to fill the layout space while preserve the aspect ratio of the
image. This will ensure that the entire image is displayed, undistorted and not cropped. This may result in letterboxing
or pillarboxing on the top or sides of the image, depending on the aspect ratio of the content.
MediaPlayerPresenter.StretchProperty MediaPlayer
Presenter.StretchProperty MediaPlayerPresenter.Stretch
Property
I n this Article
Edit
Identifies the Stretch dependency property.
public : static DependencyProperty StretchProperty { get; }
static DependencyProperty StretchProperty();
public static DependencyProperty StretchProperty { get; }

Returns
DependencyProperty
The identifier for the Stretch dependency property.
MediaTransportControls MediaTransportControls Media
TransportControls Class
Represents the playback controls for a media player element.

D eclaration
public : class MediaTransportControls : Control, IMediaTransportControls,
IMediaTransportControls2, IMediaTransportControls3, IMediaTransportControls4
struct winrt::Windows::UI::Xaml::Controls::MediaTransportControls : Control,
IMediaTransportControls, IMediaTransportControls2, IMediaTransportControls3,
IMediaTransportControls4
public class MediaTransportControls : Control, IMediaTransportControls,
IMediaTransportControls2, IMediaTransportControls3, IMediaTransportControls4

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
The media transport controls let users interact with their media by providing a default playback experience comprised
of various buttons including play, pause, closed captions, and others. It has many properties to allow for easy
customization of the UI and configuration of which buttons are visible or enabled.
You can use the MediaTransportControls to make it easy for users to control their audio and video content. The
MediaTransportControls class is intended to be used only in conjunction with a MediaElement or MediaPlayerElement
control. It doesn't function as a stand-alone control. You access an instance of MediaTransportControls through the
MediaElement.TransportControls or MediaPlayerElement.TransportControls property.

Note

You can also integrate MediaElement with the system media transport controls. The system transport controls are the
controls that pop up when hardware media keys are pressed, such as the media buttons on keyboards. If the user
presses the pause key on a keyboard and your app supports the SystemMediaTransportControls, your app is notified
and you can take the appropriate action. For more info, see System Media Transport Controls.
Adding basic transport controls to a MediaElement
To use MediaTransportControls with a MediaElement, set the AreTransportControlsEnabled property to true on the
MediaElement.
Here's how to enable transport controls for a MediaElement in XAML.
<MediaElement x:Name="mediaElement1" Source="ms-appx:///Assets/video.mp4"
AreTransportControlsEnabled="True"/>

Here's how to do the same thing in code. For simplicity, the code is placed in the MainPage constructor. rootGrid
refers to the Grid element that is created in MainPage.xaml. It has been named so that the MediaElement can be added
to the XAML tree programmatically.
public MainPage()
{
this.InitializeComponent();

//Create a MediaElement and enable transport controls.


MediaElement mediaElement1 = new MediaElement();
mediaElement1.Source = new Uri("ms-appx:///Assets/video.mp4");
mediaElement1.AreTransportControlsEnabled = true;
rootGrid.Children.Add(mediaElement1);
}

Enabling compact mode


By default, the transport controls are shown in 2 rows. To show the transport controls in a single row, set the
IsCompact property to true.
A single row layout can provide a better experience when fewer transport controls are needed, like in an audio app. A
two row layout can provide a better experience when more transport controls are needed, like in a video app. You
should also consider the size of the target device when deciding whether to use the compact mode. For example, on a
smaller device such as a phone, using a single row layout might make your transport controls look crowded.
See the section of this document for more info about the differences in the two layouts.
Here's how to enable the compact mode in XAML.

<MediaElement x:Name="mediaElement1" Source="ms-appx:///Assets/audio.wma"


AreTransportControlsEnabled="True">
<MediaElement.TransportControls>
<MediaTransportControls IsCompact="True"/>
</MediaElement.TransportControls>
</MediaElement>

Here's how to do the same thing in code. For simplicity, the code is placed in the MainPage constructor. rootGrid
refers to the Grid element that is created in MainPage.xaml. It has been named so that the MediaElement can be added
to the XAML tree programmatically.
public MainPage()
{
this.InitializeComponent();

//Create a MediaElement and enable transport controls.


MediaElement mediaElement1 = new MediaElement();
mediaElement1.Source = new Uri("ms-appx:///Assets/audio.wma");
mediaElement1.AreTransportControlsEnabled = true;

//Enable compact mode for transport controls.


mediaElement1.TransportControls.IsCompact = true;

rootGrid.Children.Add(mediaElement1);
}

H iding, Showing, Enabling, and D isabling B uttons


MediaTransportControls includes a seek bar and buttons for common functions. You can control whether a button is
shown by setting the Is*ButtonVisible property. You can independently control whether a button is enabled by setting
the Is*Enabled property.
This table shows the built-in transport controls with their associated properties and default values.

ELEMENT IS *V IS IB LE IS *ENAB LED

Seek bar @Windows.UI.Xaml.Controls.MediaTran @Windows.UI.Xaml.Controls.MediaTran


sportControls.IsSeekBarVisible? sportControls.IsSeekEnabled?
text=IsSeekBarVisible (**true**) text=IsSeekEnabled ="**true** "

Play/pause N/A N/A

Fast forward @Windows.UI.Xaml.Controls.MediaTran @Windows.UI.Xaml.Controls.MediaTran


sportControls.IsFastForwardButtonVisibl sportControls.IsFastForwardEnabled?
e?text=IsFastForwardButtonVisible text=IsFastForwardEnabled (**false**)
(**false**)

Fast rewind @Windows.UI.Xaml.Controls.MediaTran @Windows.UI.Xaml.Controls.MediaTran


sportControls.IsFastRewindButtonVisibl sportControls.IsFastRewindEnabled?
e?text=IsFastRewindButtonVisible text=IsFastRewindEnabled (**false**)
(**false**)

Stop @Windows.UI.Xaml.Controls.MediaTran @Windows.UI.Xaml.Controls.MediaTran


sportControls.IsStopButtonVisible? sportControls.IsStopEnabled?
text=IsStopButtonVisible (**false**) text=IsStopEnabled (**false**)

Volume @Windows.UI.Xaml.Controls.MediaTran @Windows.UI.Xaml.Controls.MediaTran


sportControls.IsVolumeButtonVisible? sportControls.IsVolumeEnabled?
text=IsVolumeButtonVisible (**true**) text=IsVolumeEnabled (**true**)

Full screen @Windows.UI.Xaml.Controls.MediaTran @Windows.UI.Xaml.Controls.MediaTran


sportControls.IsFullWindowButtonVisibl sportControls.IsFullWindowEnabled?
e?text=IsFullWindowButtonVisible text=IsFullWindowEnabled (**true**)
(**true**)

Playback rate @Windows.UI.Xaml.Controls.MediaTran @Windows.UI.Xaml.Controls.MediaTran


sportControls.IsPlaybackRateButtonVisi sportControls.IsPlaybackRateEnabled?
ble?text=IsPlaybackRateButtonVisible text=IsPlaybackRateEnabled (**false**)
(**false**)

Aspect ratio (zoom) @Windows.UI.Xaml.Controls.MediaTran @Windows.UI.Xaml.Controls.MediaTran


sportControls.IsZoomButtonVisible? sportControls.IsZoomEnabled?
text=IsZoomButtonVisible (**true**) text=IsZoomEnabled (**true**)

Cast N/A N/A

Closed captions N/A - shown if a closed caption track is N/A


available.

Audio track selection N/A - shown if multiple audio tracks are N/A
available.

There are no properties to hide, show, enable, or disable the play/pause button, closed caption button, audio track
selection button, or the cast button. The play/pause and cast buttons are always visible and enabled. The closed caption
button is visible whenever closed caption tracks are available, and the audio track selection button is visible whenever
multiple audio tracks are available.
To remove these buttons, or to add custom buttons, you must re-template the MediaTransportControls. If you re-
template the control, you can also specify the order in which buttons drop out at different screen sizes. For more info,
see Create custom transport controls and the Media transport controls sample.
Here's how to configure transport control buttons in XAML. In this example, the aspect ratio button is hidden and
disabled, and the playback rate button is shown and enabled.
<MediaElement x:Name="mediaElement1" Source="ms-appx:///Assets/audio.wma"
AreTransportControlsEnabled="True">
<MediaElement.TransportControls>
<MediaTransportControls IsZoomButtonVisible="False" IsZoomEnabled="False"
IsPlaybackRateButtonVisible="True" IsPlaybackRateEnabled="True"/>
</MediaElement.TransportControls>
</MediaElement>

You can configure transport controls exactly the same way in MediaPlayerElement (available starting in Windows 10,
version 1607). In the example below we are setting the IsCompactOverlayButtonVisible property (available starting in
Windows 10, version 1803).

<MediaPlayerElement x:Name="mediaElement1" Source="ms-appx:///Assets/audio.wma"


AreTransportControlsEnabled="True">
<MediaPlayerElement.TransportControls>
<MediaTransportControls IsCompactOverlayButtonVisible="True"/>
</MediaPlayerElement.TransportControls>
</MediaPlayerElement>

Here's how to do the same thing in code. For simplicity, the code is placed in the MainPage constructor. rootGrid
refers to the Grid element that is created in MainPage.xaml. It has been named so that the MediaElement can be added
to the XAML tree programmatically.

public MainPage()
{
this.InitializeComponent();

//Create a MediaElement and enable transport controls.


MediaElement mediaElement1 = new MediaElement();
mediaElement1.Source = new Uri("ms-appx:///Assets/audio.wma");
mediaElement1.AreTransportControlsEnabled = true;

//Configure transport control buttons.


mediaElement1.TransportControls.IsZoomButtonVisible = false;
mediaElement1.TransportControls.IsZoomEnabled = false;
mediaElement1.TransportControls.IsPlaybackRateButtonVisible = true;
mediaElement1.TransportControls.IsPlaybackRateEnabled = true;

rootGrid.Children.Add(mediaElement1);
}

Anatomy
MediaTransportControls is a composite control made up of several other XAML controls, which are all contained
within a root Grid element.
In the default mode, the Grid has 2 rows. The first row contains a Slider (the seek bar) that shows the progress of the
media file, and lets the user seek forward or backward through the media. Below the Slider are two TextBlock s. These
display the elapsed and remaining time. The second row contains a CommandBar with AppBarButton s. The
AppBarButton s let the user perform actions like play and pause the media, change the volume, and make the video full
screen.
In the compact
mode, the @Windows.UI.Xaml.Controls.Slider?text=Slider and @Windows.UI.Xaml.Controls.CommandBar?
text=CommandBar are shown in a single row. The @Windows.UI.Xaml.Controls.TextBlock?text=TextBlock s for elapsed
and remaining time are hidden.

Constructors
MediaTransportControls()
MediaTransportControls()
MediaTransportControls()

Initializes a new instance of the MediaTransportControls class.

Properties
FastPlayFallbackBehaviour
FastPlayFallbackBehaviour
FastPlayFallbackBehaviour

Gets or sets a value that specifies how the fast-forward/fast-rewind buttons behave.

FastPlayFallbackBehaviourProperty
FastPlayFallbackBehaviourProperty
FastPlayFallbackBehaviourProperty

Identifies the FastPlayFallbackBehaviour dependency property.

IsCompact
IsCompact
IsCompact

Gets or sets a value that indicates whether transport controls are shown on one row instead of two.
IsCompactOverlayButtonVisible
IsCompactOverlayButtonVisible
IsCompactOverlayButtonVisible

Gets or sets a value that indicates whether the compact overlay button is shown.

IsCompactOverlayButtonVisibleProperty
IsCompactOverlayButtonVisibleProperty
IsCompactOverlayButtonVisibleProperty

Identifies the IsCompactOverlayButtonVisible dependency property.

IsCompactOverlayEnabled
IsCompactOverlayEnabled
IsCompactOverlayEnabled

Gets or sets a value that indicates whether a user can enter compact overlay mode.

IsCompactOverlayEnabledProperty
IsCompactOverlayEnabledProperty
IsCompactOverlayEnabledProperty

Identifies the IsCompactOverlayEnabled dependency property.

IsCompactProperty
IsCompactProperty
IsCompactProperty

Identifies the IsCompact dependency property.

IsFastForwardButtonVisible
IsFastForwardButtonVisible
IsFastForwardButtonVisible

Gets or sets a value that indicates whether the fast forward button is shown.

IsFastForwardButtonVisibleProperty
IsFastForwardButtonVisibleProperty
IsFastForwardButtonVisibleProperty

Identifies the IsFastForwardButtonVisible dependency property.

IsFastForwardEnabled
IsFastForwardEnabled
IsFastForwardEnabled
Gets or sets a value that indicates whether a user can fast forward the media.

IsFastForwardEnabledProperty
IsFastForwardEnabledProperty
IsFastForwardEnabledProperty

Identifies the IsFastForwardEnabled dependency property.

IsFastRewindButtonVisible
IsFastRewindButtonVisible
IsFastRewindButtonVisible

Gets or sets a value that indicates whether the rewind button is shown.

IsFastRewindButtonVisibleProperty
IsFastRewindButtonVisibleProperty
IsFastRewindButtonVisibleProperty

Identifies the IsFastRewindButtonVisible dependency property.

IsFastRewindEnabled
IsFastRewindEnabled
IsFastRewindEnabled

Gets or sets a value that indicates whether a user can rewind the media.

IsFastRewindEnabledProperty
IsFastRewindEnabledProperty
IsFastRewindEnabledProperty

Identifies the IsFastRewindEnabled dependency property.

IsFullWindowButtonVisible
IsFullWindowButtonVisible
IsFullWindowButtonVisible

Gets or sets a value that indicates whether the full screen button is shown.

IsFullWindowButtonVisibleProperty
IsFullWindowButtonVisibleProperty
IsFullWindowButtonVisibleProperty

Identifies the IsFullWindowButtonVisible dependency property.


IsFullWindowEnabled
IsFullWindowEnabled
IsFullWindowEnabled

Gets or sets a value that indicates whether a user can play the media in full-screen mode.

IsFullWindowEnabledProperty
IsFullWindowEnabledProperty
IsFullWindowEnabledProperty

Identifies the IsFullWindowEnabled dependency property.

IsNextTrackButtonVisible
IsNextTrackButtonVisible
IsNextTrackButtonVisible

Gets or sets a value that indicates whether the next track button is shown.

IsNextTrackButtonVisibleProperty
IsNextTrackButtonVisibleProperty
IsNextTrackButtonVisibleProperty

Identifies the IsNextTrackButtonVisible dependency property.

IsPlaybackRateButtonVisible
IsPlaybackRateButtonVisible
IsPlaybackRateButtonVisible

Gets or sets a value that indicates whether the playback rate button is shown.

IsPlaybackRateButtonVisibleProperty
IsPlaybackRateButtonVisibleProperty
IsPlaybackRateButtonVisibleProperty

Identifies the IsPlaybackRateButtonVisible dependency property.

IsPlaybackRateEnabled
IsPlaybackRateEnabled
IsPlaybackRateEnabled

Gets or sets a value that indicates whether a user can adjust the playback rate of the media.

IsPlaybackRateEnabledProperty
IsPlaybackRateEnabledProperty
IsPlaybackRateEnabledProperty
Identifies the IsPlaybackRateEnabled dependency property.

IsPreviousTrackButtonVisible
IsPreviousTrackButtonVisible
IsPreviousTrackButtonVisible

Gets or sets a value that indicates whether the previous track button is shown.

IsPreviousTrackButtonVisibleProperty
IsPreviousTrackButtonVisibleProperty
IsPreviousTrackButtonVisibleProperty

Identifies the IsPreviousTrackButtonVisible dependency property.

IsRepeatButtonVisible
IsRepeatButtonVisible
IsRepeatButtonVisible

Gets or sets a value that indicates whether the repeat button is shown.

IsRepeatButtonVisibleProperty
IsRepeatButtonVisibleProperty
IsRepeatButtonVisibleProperty

Identifies the IsRepeatButtonVisible dependency property.

IsRepeatEnabled
IsRepeatEnabled
IsRepeatEnabled

Gets or sets a value that indicates whether a user repeat the playback of the media.

IsRepeatEnabledProperty
IsRepeatEnabledProperty
IsRepeatEnabledProperty

Identifies the IsRepeatEnabled dependency property.

IsSeekBarVisible
IsSeekBarVisible
IsSeekBarVisible

Gets or sets a value that indicates whether the seek bar is shown.
IsSeekBarVisibleProperty
IsSeekBarVisibleProperty
IsSeekBarVisibleProperty

Identifies the IsSeekBarVisible dependency property.

IsSeekEnabled
IsSeekEnabled
IsSeekEnabled

Gets or sets a value that indicates whether a user can use the seek bar to find a location in the media.

IsSeekEnabledProperty
IsSeekEnabledProperty
IsSeekEnabledProperty

Identifies the IsSeekEnabled dependency property.

IsSkipBackwardButtonVisible
IsSkipBackwardButtonVisible
IsSkipBackwardButtonVisible

Gets or sets a value that indicates whether the skip backward button is shown.

IsSkipBackwardButtonVisibleProperty
IsSkipBackwardButtonVisibleProperty
IsSkipBackwardButtonVisibleProperty

Identifies the IsSkipBackwardButtonVisible dependency property.

IsSkipBackwardEnabled
IsSkipBackwardEnabled
IsSkipBackwardEnabled

Gets or sets a value that indicates whether a user can skip backward in the media.

IsSkipBackwardEnabledProperty
IsSkipBackwardEnabledProperty
IsSkipBackwardEnabledProperty

Identifies the IsSkipBackwardEnabled dependency property.

IsSkipForwardButtonVisible
IsSkipForwardButtonVisible
IsSkipForwardButtonVisible
Gets or sets a value that indicates whether the skip forward button is shown.

IsSkipForwardButtonVisibleProperty
IsSkipForwardButtonVisibleProperty
IsSkipForwardButtonVisibleProperty

Identifies the IsSkipForwardButtonVisible dependency property.

IsSkipForwardEnabled
IsSkipForwardEnabled
IsSkipForwardEnabled

Gets or sets a value that indicates whether a user can skip forward in the media.

IsSkipForwardEnabledProperty
IsSkipForwardEnabledProperty
IsSkipForwardEnabledProperty

Identifies the IsSkipForwardEnabled dependency property.

IsStopButtonVisible
IsStopButtonVisible
IsStopButtonVisible

Gets or sets a value that indicates whether the stop button is shown.

IsStopButtonVisibleProperty
IsStopButtonVisibleProperty
IsStopButtonVisibleProperty

Identifies the IsStopButtonVisible dependency property.

IsStopEnabled
IsStopEnabled
IsStopEnabled

Gets or sets a value that indicates whether a user can stop the media playback.

IsStopEnabledProperty
IsStopEnabledProperty
IsStopEnabledProperty

Identifies the IsStopEnabled dependency property.


IsVolumeButtonVisible
IsVolumeButtonVisible
IsVolumeButtonVisible

Gets or sets a value that indicates whether the volume button is shown.

IsVolumeButtonVisibleProperty
IsVolumeButtonVisibleProperty
IsVolumeButtonVisibleProperty

Identifies the IsVolumeButtonVisible dependency property.

IsVolumeEnabled
IsVolumeEnabled
IsVolumeEnabled

Gets or sets a value that indicates whether a user can adjust the volume of the media.

IsVolumeEnabledProperty
IsVolumeEnabledProperty
IsVolumeEnabledProperty

Identifies the IsVolumeEnabled dependency property.

IsZoomButtonVisible
IsZoomButtonVisible
IsZoomButtonVisible

Gets or sets a value that indicates whether the zoom button is shown.

IsZoomButtonVisibleProperty
IsZoomButtonVisibleProperty
IsZoomButtonVisibleProperty

Identifies the IsZoomButtonVisible dependency property.

IsZoomEnabled
IsZoomEnabled
IsZoomEnabled

Gets or sets a value that indicates whether a user can zoom the media.

IsZoomEnabledProperty
IsZoomEnabledProperty
IsZoomEnabledProperty
Identifies the IsZoomEnabled dependency property.

ShowAndHideAutomatically
ShowAndHideAutomatically
ShowAndHideAutomatically

Gets or sets a value that indicates whether the controls are shown and hidden automatically.

ShowAndHideAutomaticallyProperty
ShowAndHideAutomaticallyProperty
ShowAndHideAutomaticallyProperty

Identifies the ShowAndHideAutomatically dependency property.

Methods
Hide()
Hide()
Hide()

Hides the transport controls if they're shown.

Show()
Show()
Show()

Shows the tranport controls if they're hidden.

Events
ThumbnailRequested
ThumbnailRequested
ThumbnailRequested

Occurs whenever the app needs to display a thumbnail adjacent to the seek bar when the user performs a seek
operation.

See Also
Control
Control
Control
Control
Control
MediaTransportControls.FastPlayFallbackBehaviour
MediaTransportControls.FastPlayFallbackBehaviour
MediaTransportControls.FastPlayFallbackBehaviour
I n this Article
Edit
Gets or sets a value that specifies how the fast-forward/fast-rewind buttons behave.
public : FastPlayFallbackBehaviour FastPlayFallbackBehaviour { get; set; }
FastPlayFallbackBehaviour FastPlayFallbackBehaviour();

void FastPlayFallbackBehaviour(FastPlayFallbackBehaviour fastplayfallbackbehaviour);


public FastPlayFallbackBehaviour FastPlayFallbackBehaviour { get; set; }

Returns
FastPlayFallbackBehaviour
A value of the enumeration that specifies how the fast-forward/fast-rewind buttons behave.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.FastPlayFallbackBehaviour
Property MediaTransportControls.FastPlayFallback
BehaviourProperty MediaTransportControls.FastPlay
FallbackBehaviourProperty
I n this Article
Edit
Identifies the FastPlayFallbackBehaviour dependency property.
public : static DependencyProperty FastPlayFallbackBehaviourProperty { get; }
static DependencyProperty FastPlayFallbackBehaviourProperty();
public static DependencyProperty FastPlayFallbackBehaviourProperty { get; }

Returns
DependencyProperty
The identifier for the FastPlayFallbackBehaviour dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.Hide MediaTransportControls.
Hide MediaTransportControls.Hide
I n this Article
Edit
Hides the transport controls if they're shown.
public : void Hide()
void Hide() const;
public void Hide()

Additional features and requirements


Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


MediaTransportControls.IsCompact MediaTransport
Controls.IsCompact MediaTransportControls.IsCompact
I n this Article
Edit
Gets or sets a value that indicates whether transport controls are shown on one row instead of two.
public : Platform::Boolean IsCompact { get; set; }
bool IsCompact();

void IsCompact(bool iscompact);


public bool IsCompact { get; set; }

<MediaTransportControls IsCompact="bool" .../>

Returns
bool
true if the transport controls are shown in one row; false if the transport controls are shown in two rows. The default
is false.
MediaTransportControls.IsCompactOverlayButtonVisible
MediaTransportControls.IsCompactOverlayButtonVisible
MediaTransportControls.IsCompactOverlayButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the compact overlay button is shown.
public : Platform::Boolean IsCompactOverlayButtonVisible { get; set; }
bool IsCompactOverlayButtonVisible();

void IsCompactOverlayButtonVisible(bool iscompactoverlaybuttonvisible);


public bool IsCompactOverlayButtonVisible { get; set; }

Returns
bool
true to show the compact overlay button. false to hide the compact overlay button. The default is false.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


MediaTransportControls.IsCompactOverlayButtonVisible
Property MediaTransportControls.IsCompactOverlay
ButtonVisibleProperty MediaTransportControls.Is
CompactOverlayButtonVisibleProperty
I n this Article
Edit
Identifies the IsCompactOverlayButtonVisible dependency property.
public : static DependencyProperty IsCompactOverlayButtonVisibleProperty { get; }
static DependencyProperty IsCompactOverlayButtonVisibleProperty();
public static DependencyProperty IsCompactOverlayButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsCompactOverlayButtonVisible dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


MediaTransportControls.IsCompactOverlayEnabled
MediaTransportControls.IsCompactOverlayEnabled
MediaTransportControls.IsCompactOverlayEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can enter compact overlay mode.
public : Platform::Boolean IsCompactOverlayEnabled { get; set; }
bool IsCompactOverlayEnabled();

void IsCompactOverlayEnabled(bool iscompactoverlayenabled);


public bool IsCompactOverlayEnabled { get; set; }

Returns
bool
true to allow the user to enter compact overlay mode; otherwise, false.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


MediaTransportControls.IsCompactOverlayEnabled
Property MediaTransportControls.IsCompactOverlay
EnabledProperty MediaTransportControls.IsCompact
OverlayEnabledProperty
I n this Article
Edit
Identifies the IsCompactOverlayEnabled dependency property.
public : static DependencyProperty IsCompactOverlayEnabledProperty { get; }
static DependencyProperty IsCompactOverlayEnabledProperty();
public static DependencyProperty IsCompactOverlayEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsCompactOverlayEnabled dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


MediaTransportControls.IsCompactProperty Media
TransportControls.IsCompactProperty MediaTransport
Controls.IsCompactProperty
I n this Article
Edit
Identifies the IsCompact dependency property.
public : static DependencyProperty IsCompactProperty { get; }
static DependencyProperty IsCompactProperty();
public static DependencyProperty IsCompactProperty { get; }

Returns
DependencyProperty
The identifier for the IsCompact dependency property.
See Dependency properties overview
Also
MediaTransportControls.IsFastForwardButtonVisible
MediaTransportControls.IsFastForwardButtonVisible
MediaTransportControls.IsFastForwardButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the fast forward button is shown.
public : Platform::Boolean IsFastForwardButtonVisible { get; set; }
bool IsFastForwardButtonVisible();

void IsFastForwardButtonVisible(bool isfastforwardbuttonvisible);


public bool IsFastForwardButtonVisible { get; set; }

<MediaTransportControls IsFastForwardButtonVisible="bool" .../>

Returns
bool
true to show the fast forward button. false to hide the fast forward button. The default is false.
MediaTransportControls.IsFastForwardButtonVisible
Property MediaTransportControls.IsFastForwardButton
VisibleProperty MediaTransportControls.IsFastForward
ButtonVisibleProperty
I n this Article
Edit
Identifies the IsFastForwardButtonVisible dependency property.
public : static DependencyProperty IsFastForwardButtonVisibleProperty { get; }
static DependencyProperty IsFastForwardButtonVisibleProperty();
public static DependencyProperty IsFastForwardButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsFastForwardButtonVisible dependency property.
MediaTransportControls.IsFastForwardEnabled Media
TransportControls.IsFastForwardEnabled MediaTransport
Controls.IsFastForwardEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can fast forward the media.
public : Platform::Boolean IsFastForwardEnabled { get; set; }
bool IsFastForwardEnabled();

void IsFastForwardEnabled(bool isfastforwardenabled);


public bool IsFastForwardEnabled { get; set; }

<MediaTransportControls IsFastForwardEnabled="bool" .../>

Returns
bool
true to allow the user to fast forward; otherwise, false. The default is false.
MediaTransportControls.IsFastForwardEnabledProperty
MediaTransportControls.IsFastForwardEnabledProperty
MediaTransportControls.IsFastForwardEnabledProperty
I n this Article
Edit
Identifies the IsFastForwardEnabled dependency property.
public : static DependencyProperty IsFastForwardEnabledProperty { get; }
static DependencyProperty IsFastForwardEnabledProperty();
public static DependencyProperty IsFastForwardEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsFastForwardEnabled dependency property.
MediaTransportControls.IsFastRewindButtonVisible
MediaTransportControls.IsFastRewindButtonVisible
MediaTransportControls.IsFastRewindButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the rewind button is shown.
public : Platform::Boolean IsFastRewindButtonVisible { get; set; }
bool IsFastRewindButtonVisible();

void IsFastRewindButtonVisible(bool isfastrewindbuttonvisible);


public bool IsFastRewindButtonVisible { get; set; }

<MediaTransportControls IsFastRewindButtonVisible="bool" .../>

Returns
bool
true to show the rewind button. false to hide the rewind button. The default is false.
MediaTransportControls.IsFastRewindButtonVisible
Property MediaTransportControls.IsFastRewindButton
VisibleProperty MediaTransportControls.IsFastRewind
ButtonVisibleProperty
I n this Article
Edit
Identifies the IsFastRewindButtonVisible dependency property.
public : static DependencyProperty IsFastRewindButtonVisibleProperty { get; }
static DependencyProperty IsFastRewindButtonVisibleProperty();
public static DependencyProperty IsFastRewindButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsFastRewindButtonVisible dependency property.
MediaTransportControls.IsFastRewindEnabled Media
TransportControls.IsFastRewindEnabled MediaTransport
Controls.IsFastRewindEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can rewind the media.
public : Platform::Boolean IsFastRewindEnabled { get; set; }
bool IsFastRewindEnabled();

void IsFastRewindEnabled(bool isfastrewindenabled);


public bool IsFastRewindEnabled { get; set; }

<MediaTransportControls IsFastRewindEnabled="bool" .../>

Returns
bool
true to allow the user to rewind; otherwise, false. The default is false.
MediaTransportControls.IsFastRewindEnabledProperty
MediaTransportControls.IsFastRewindEnabledProperty
MediaTransportControls.IsFastRewindEnabledProperty
I n this Article
Edit
Identifies the IsFastRewindEnabled dependency property.
public : static DependencyProperty IsFastRewindEnabledProperty { get; }
static DependencyProperty IsFastRewindEnabledProperty();
public static DependencyProperty IsFastRewindEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsFastRewindEnabled dependency property.
MediaTransportControls.IsFullWindowButtonVisible
MediaTransportControls.IsFullWindowButtonVisible
MediaTransportControls.IsFullWindowButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the full screen button is shown.
public : Platform::Boolean IsFullWindowButtonVisible { get; set; }
bool IsFullWindowButtonVisible();

void IsFullWindowButtonVisible(bool isfullwindowbuttonvisible);


public bool IsFullWindowButtonVisible { get; set; }

<MediaTransportControls IsFullWindowButtonVisible="bool" .../>

Returns
bool
true to show the full screen button. false to hide the full screen button. The default is true.
MediaTransportControls.IsFullWindowButtonVisible
Property MediaTransportControls.IsFullWindowButton
VisibleProperty MediaTransportControls.IsFullWindow
ButtonVisibleProperty
I n this Article
Edit
Identifies the IsFullWindowButtonVisible dependency property.
public : static DependencyProperty IsFullWindowButtonVisibleProperty { get; }
static DependencyProperty IsFullWindowButtonVisibleProperty();
public static DependencyProperty IsFullWindowButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsFullWindowButtonVisible dependency property.
MediaTransportControls.IsFullWindowEnabled Media
TransportControls.IsFullWindowEnabled MediaTransport
Controls.IsFullWindowEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can play the media in full-screen mode.
public : Platform::Boolean IsFullWindowEnabled { get; set; }
bool IsFullWindowEnabled();

void IsFullWindowEnabled(bool isfullwindowenabled);


public bool IsFullWindowEnabled { get; set; }

<MediaTransportControls IsFullWindowEnabled="bool" .../>

Returns
bool
true to allow the user to play the media in full-screen mode; otherwise, false. The default is true.
MediaTransportControls.IsFullWindowEnabledProperty
MediaTransportControls.IsFullWindowEnabledProperty
MediaTransportControls.IsFullWindowEnabledProperty
I n this Article
Edit
Identifies the IsFullWindowEnabled dependency property.
public : static DependencyProperty IsFullWindowEnabledProperty { get; }
static DependencyProperty IsFullWindowEnabledProperty();
public static DependencyProperty IsFullWindowEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsFullWindowEnabled dependency property.
MediaTransportControls.IsNextTrackButtonVisible Media
TransportControls.IsNextTrackButtonVisible Media
TransportControls.IsNextTrackButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the next track button is shown.
public : Platform::Boolean IsNextTrackButtonVisible { get; set; }
bool IsNextTrackButtonVisible();

void IsNextTrackButtonVisible(bool isnexttrackbuttonvisible);


public bool IsNextTrackButtonVisible { get; set; }

<MediaTransportControls IsNextTrackButtonVisible="bool" .../>

Returns
bool
true to show the next track button. false to hide the next track button. The default is false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsNextTrackButtonVisible
Property MediaTransportControls.IsNextTrackButton
VisibleProperty MediaTransportControls.IsNextTrack
ButtonVisibleProperty
I n this Article
Edit
Identifies the IsNextTrackButtonVisible dependency property.
public : static DependencyProperty IsNextTrackButtonVisibleProperty { get; }
static DependencyProperty IsNextTrackButtonVisibleProperty();
public static DependencyProperty IsNextTrackButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsNextTrackButtonVisible dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsPlaybackRateButtonVisible
MediaTransportControls.IsPlaybackRateButtonVisible
MediaTransportControls.IsPlaybackRateButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the playback rate button is shown.
public : Platform::Boolean IsPlaybackRateButtonVisible { get; set; }
bool IsPlaybackRateButtonVisible();

void IsPlaybackRateButtonVisible(bool isplaybackratebuttonvisible);


public bool IsPlaybackRateButtonVisible { get; set; }

<MediaTransportControls IsPlaybackRateButtonVisible="bool" .../>

Returns
bool
true to show the playback rate button. false to hide the playback rate button. The default is false.
MediaTransportControls.IsPlaybackRateButtonVisible
Property MediaTransportControls.IsPlaybackRateButton
VisibleProperty MediaTransportControls.IsPlaybackRate
ButtonVisibleProperty
I n this Article
Edit
Identifies the IsPlaybackRateButtonVisible dependency property.
public : static DependencyProperty IsPlaybackRateButtonVisibleProperty { get; }
static DependencyProperty IsPlaybackRateButtonVisibleProperty();
public static DependencyProperty IsPlaybackRateButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsPlaybackRateButtonVisible dependency property.
MediaTransportControls.IsPlaybackRateEnabled Media
TransportControls.IsPlaybackRateEnabled Media
TransportControls.IsPlaybackRateEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can adjust the playback rate of the media.
public : Platform::Boolean IsPlaybackRateEnabled { get; set; }
bool IsPlaybackRateEnabled();

void IsPlaybackRateEnabled(bool isplaybackrateenabled);


public bool IsPlaybackRateEnabled { get; set; }

<MediaTransportControls IsPlaybackRateEnabled="bool" .../>

Returns
bool
true to allow the user to adjust the playback rate; otherwise, false. The default is false.
MediaTransportControls.IsPlaybackRateEnabledProperty
MediaTransportControls.IsPlaybackRateEnabledProperty
MediaTransportControls.IsPlaybackRateEnabledProperty
I n this Article
Edit
Identifies the IsPlaybackRateEnabled dependency property.
public : static DependencyProperty IsPlaybackRateEnabledProperty { get; }
static DependencyProperty IsPlaybackRateEnabledProperty();
public static DependencyProperty IsPlaybackRateEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsPlaybackRateEnabled dependency property.
MediaTransportControls.IsPreviousTrackButtonVisible
MediaTransportControls.IsPreviousTrackButtonVisible
MediaTransportControls.IsPreviousTrackButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the previous track button is shown.
public : Platform::Boolean IsPreviousTrackButtonVisible { get; set; }
bool IsPreviousTrackButtonVisible();

void IsPreviousTrackButtonVisible(bool isprevioustrackbuttonvisible);


public bool IsPreviousTrackButtonVisible { get; set; }

<MediaTransportControls IsPreviousTrackButtonVisible="bool" .../>

Returns
bool
true to show the previous track button. false to hide the previous track button. The default is false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsPreviousTrackButtonVisible
Property MediaTransportControls.IsPreviousTrackButton
VisibleProperty MediaTransportControls.IsPreviousTrack
ButtonVisibleProperty
I n this Article
Edit
Identifies the IsPreviousTrackButtonVisible dependency property.
public : static DependencyProperty IsPreviousTrackButtonVisibleProperty { get; }
static DependencyProperty IsPreviousTrackButtonVisibleProperty();
public static DependencyProperty IsPreviousTrackButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsPreviousTrackButtonVisible dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsRepeatButtonVisible Media
TransportControls.IsRepeatButtonVisible MediaTransport
Controls.IsRepeatButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the repeat button is shown.
public : Platform::Boolean IsRepeatButtonVisible { get; set; }
bool IsRepeatButtonVisible();

void IsRepeatButtonVisible(bool isrepeatbuttonvisible);


public bool IsRepeatButtonVisible { get; set; }

<MediaTransportControls IsRepeatButtonVisible="bool" .../>

Returns
bool
true to show the repeat button. false to hide the repeat button. The default is false.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


MediaTransportControls.IsRepeatButtonVisibleProperty
MediaTransportControls.IsRepeatButtonVisibleProperty
MediaTransportControls.IsRepeatButtonVisibleProperty
I n this Article
Edit
Identifies the IsRepeatButtonVisible dependency property.
public : static DependencyProperty IsRepeatButtonVisibleProperty { get; }
static DependencyProperty IsRepeatButtonVisibleProperty();
public static DependencyProperty IsRepeatButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsRepeatButtonVisible dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


MediaTransportControls.IsRepeatEnabled Media
TransportControls.IsRepeatEnabled MediaTransport
Controls.IsRepeatEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user repeat the playback of the media.
public : Platform::Boolean IsRepeatEnabled { get; set; }
bool IsRepeatEnabled();

void IsRepeatEnabled(bool isrepeatenabled);


public bool IsRepeatEnabled { get; set; }

<MediaTransportControls IsRepeatEnabled="bool" .../>

Returns
bool
true to allow the user to repeat the media; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


MediaTransportControls.IsRepeatEnabledProperty Media
TransportControls.IsRepeatEnabledProperty Media
TransportControls.IsRepeatEnabledProperty
I n this Article
Edit
Identifies the IsRepeatEnabled dependency property.
public : static DependencyProperty IsRepeatEnabledProperty { get; }
static DependencyProperty IsRepeatEnabledProperty();
public static DependencyProperty IsRepeatEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsRepeatEnabled dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


MediaTransportControls.IsSeekBarVisible MediaTransport
Controls.IsSeekBarVisible MediaTransportControls.IsSeek
BarVisible
I n this Article
Edit
Gets or sets a value that indicates whether the seek bar is shown.
public : Platform::Boolean IsSeekBarVisible { get; set; }
bool IsSeekBarVisible();

void IsSeekBarVisible(bool isseekbarvisible);


public bool IsSeekBarVisible { get; set; }

<MediaTransportControls IsSeekBarVisible="bool" .../>

Returns
bool
true to show the seek bar. false to hide the seek bar. The default is true.
MediaTransportControls.IsSeekBarVisibleProperty Media
TransportControls.IsSeekBarVisibleProperty Media
TransportControls.IsSeekBarVisibleProperty
I n this Article
Edit
Identifies the IsSeekBarVisible dependency property.
public : static DependencyProperty IsSeekBarVisibleProperty { get; }
static DependencyProperty IsSeekBarVisibleProperty();
public static DependencyProperty IsSeekBarVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsSeekBarVisible dependency property.
MediaTransportControls.IsSeekEnabled MediaTransport
Controls.IsSeekEnabled MediaTransportControls.IsSeek
Enabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can use the seek bar to find a location in the media.
public : Platform::Boolean IsSeekEnabled { get; set; }
bool IsSeekEnabled();

void IsSeekEnabled(bool isseekenabled);


public bool IsSeekEnabled { get; set; }

<MediaTransportControls IsSeekEnabled="bool" .../>

Returns
bool
true to allow the user to use the seek bar to find a location; otherwise, false. The default is true.
MediaTransportControls.IsSeekEnabledProperty Media
TransportControls.IsSeekEnabledProperty Media
TransportControls.IsSeekEnabledProperty
I n this Article
Edit
Identifies the IsSeekEnabled dependency property.
public : static DependencyProperty IsSeekEnabledProperty { get; }
static DependencyProperty IsSeekEnabledProperty();
public static DependencyProperty IsSeekEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsSeekEnabled dependency property.
MediaTransportControls.IsSkipBackwardButtonVisible
MediaTransportControls.IsSkipBackwardButtonVisible
MediaTransportControls.IsSkipBackwardButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the skip backward button is shown.
public : Platform::Boolean IsSkipBackwardButtonVisible { get; set; }
bool IsSkipBackwardButtonVisible();

void IsSkipBackwardButtonVisible(bool isskipbackwardbuttonvisible);


public bool IsSkipBackwardButtonVisible { get; set; }

<MediaTransportControls IsSkipBackwardButtonVisible="bool" .../>

Returns
bool
true to show the skip backward button. false to hide the skip backward button. The default is false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsSkipBackwardButtonVisible
Property MediaTransportControls.IsSkipBackwardButton
VisibleProperty MediaTransportControls.IsSkipBackward
ButtonVisibleProperty
I n this Article
Edit
Identifies the IsSkipBackwardButtonVisible dependency property.
public : static DependencyProperty IsSkipBackwardButtonVisibleProperty { get; }
static DependencyProperty IsSkipBackwardButtonVisibleProperty();
public static DependencyProperty IsSkipBackwardButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsSkipBackwardButtonVisible dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsSkipBackwardEnabled Media
TransportControls.IsSkipBackwardEnabled Media
TransportControls.IsSkipBackwardEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can skip backward in the media.
public : Platform::Boolean IsSkipBackwardEnabled { get; set; }
bool IsSkipBackwardEnabled();

void IsSkipBackwardEnabled(bool isskipbackwardenabled);


public bool IsSkipBackwardEnabled { get; set; }

<MediaTransportControls IsSkipBackwardEnabled="bool" .../>

Returns
bool
true to allow the user to skip backward; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsSkipBackwardEnabledProperty
MediaTransportControls.IsSkipBackwardEnabledProperty
MediaTransportControls.IsSkipBackwardEnabledProperty
I n this Article
Edit
Identifies the IsSkipBackwardEnabled dependency property.
public : static DependencyProperty IsSkipBackwardEnabledProperty { get; }
static DependencyProperty IsSkipBackwardEnabledProperty();
public static DependencyProperty IsSkipBackwardEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsSkipBackwardEnabled dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsSkipForwardButtonVisible
MediaTransportControls.IsSkipForwardButtonVisible
MediaTransportControls.IsSkipForwardButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the skip forward button is shown.
public : Platform::Boolean IsSkipForwardButtonVisible { get; set; }
bool IsSkipForwardButtonVisible();

void IsSkipForwardButtonVisible(bool isskipforwardbuttonvisible);


public bool IsSkipForwardButtonVisible { get; set; }

<MediaTransportControls IsSkipForwardButtonVisible="bool" .../>

Returns
bool
true to show the skip forward button. false to hide the skip forward button. The default is false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsSkipForwardButtonVisible
Property MediaTransportControls.IsSkipForwardButton
VisibleProperty MediaTransportControls.IsSkipForward
ButtonVisibleProperty
I n this Article
Edit
Identifies the IsSkipForwardButtonVisible dependency property.
public : static DependencyProperty IsSkipForwardButtonVisibleProperty { get; }
static DependencyProperty IsSkipForwardButtonVisibleProperty();
public static DependencyProperty IsSkipForwardButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsSkipForwardButtonVisible dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsSkipForwardEnabled Media
TransportControls.IsSkipForwardEnabled MediaTransport
Controls.IsSkipForwardEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can skip forward in the media.
public : Platform::Boolean IsSkipForwardEnabled { get; set; }
bool IsSkipForwardEnabled();

void IsSkipForwardEnabled(bool isskipforwardenabled);


public bool IsSkipForwardEnabled { get; set; }

<MediaTransportControls IsSkipForwardEnabled="bool" .../>

Returns
bool
true to allow the user to skip forward; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsSkipForwardEnabledProperty
MediaTransportControls.IsSkipForwardEnabledProperty
MediaTransportControls.IsSkipForwardEnabledProperty
I n this Article
Edit
Identifies the IsSkipForwardEnabled dependency property.
public : static DependencyProperty IsSkipForwardEnabledProperty { get; }
static DependencyProperty IsSkipForwardEnabledProperty();
public static DependencyProperty IsSkipForwardEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsSkipForwardEnabled dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


MediaTransportControls.IsStopButtonVisible Media
TransportControls.IsStopButtonVisible MediaTransport
Controls.IsStopButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the stop button is shown.
public : Platform::Boolean IsStopButtonVisible { get; set; }
bool IsStopButtonVisible();

void IsStopButtonVisible(bool isstopbuttonvisible);


public bool IsStopButtonVisible { get; set; }

<MediaTransportControls IsStopButtonVisible="bool" .../>

Returns
bool
true to show the stop button. false to hide the stop button. The default is false.
MediaTransportControls.IsStopButtonVisibleProperty
MediaTransportControls.IsStopButtonVisibleProperty
MediaTransportControls.IsStopButtonVisibleProperty
I n this Article
Edit
Identifies the IsStopButtonVisible dependency property.
public : static DependencyProperty IsStopButtonVisibleProperty { get; }
static DependencyProperty IsStopButtonVisibleProperty();
public static DependencyProperty IsStopButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsStopButtonVisible dependency property.
MediaTransportControls.IsStopEnabled MediaTransport
Controls.IsStopEnabled MediaTransportControls.IsStop
Enabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can stop the media playback.
public : Platform::Boolean IsStopEnabled { get; set; }
bool IsStopEnabled();

void IsStopEnabled(bool isstopenabled);


public bool IsStopEnabled { get; set; }

<MediaTransportControls IsStopEnabled="bool" .../>

Returns
bool
true to allow the user to stop playback; otherwise, false. The default is false.
MediaTransportControls.IsStopEnabledProperty Media
TransportControls.IsStopEnabledProperty Media
TransportControls.IsStopEnabledProperty
I n this Article
Edit
Identifies the IsStopEnabled dependency property.
public : static DependencyProperty IsStopEnabledProperty { get; }
static DependencyProperty IsStopEnabledProperty();
public static DependencyProperty IsStopEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsStopEnabled dependency property.
MediaTransportControls.IsVolumeButtonVisible Media
TransportControls.IsVolumeButtonVisible MediaTransport
Controls.IsVolumeButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the volume button is shown.
public : Platform::Boolean IsVolumeButtonVisible { get; set; }
bool IsVolumeButtonVisible();

void IsVolumeButtonVisible(bool isvolumebuttonvisible);


public bool IsVolumeButtonVisible { get; set; }

<MediaTransportControls IsVolumeButtonVisible="bool" .../>

Returns
bool
true to show the volume button. false to hide the volume button. The default is true.
MediaTransportControls.IsVolumeButtonVisibleProperty
MediaTransportControls.IsVolumeButtonVisibleProperty
MediaTransportControls.IsVolumeButtonVisibleProperty
I n this Article
Edit
Identifies the IsVolumeButtonVisible dependency property.
public : static DependencyProperty IsVolumeButtonVisibleProperty { get; }
static DependencyProperty IsVolumeButtonVisibleProperty();
public static DependencyProperty IsVolumeButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsVolumeButtonVisible dependency property.
MediaTransportControls.IsVolumeEnabled Media
TransportControls.IsVolumeEnabled MediaTransport
Controls.IsVolumeEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can adjust the volume of the media.
public : Platform::Boolean IsVolumeEnabled { get; set; }
bool IsVolumeEnabled();

void IsVolumeEnabled(bool isvolumeenabled);


public bool IsVolumeEnabled { get; set; }

<MediaTransportControls IsVolumeEnabled="bool" .../>

Returns
bool
true to allow the user to adjust the volume; otherwise, false. The default is true.
MediaTransportControls.IsVolumeEnabledProperty
MediaTransportControls.IsVolumeEnabledProperty
MediaTransportControls.IsVolumeEnabledProperty
I n this Article
Edit
Identifies the IsVolumeEnabled dependency property.
public : static DependencyProperty IsVolumeEnabledProperty { get; }
static DependencyProperty IsVolumeEnabledProperty();
public static DependencyProperty IsVolumeEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsVolumeEnabled dependency property.
MediaTransportControls.IsZoomButtonVisible Media
TransportControls.IsZoomButtonVisible MediaTransport
Controls.IsZoomButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the zoom button is shown.
public : Platform::Boolean IsZoomButtonVisible { get; set; }
bool IsZoomButtonVisible();

void IsZoomButtonVisible(bool iszoombuttonvisible);


public bool IsZoomButtonVisible { get; set; }

<MediaTransportControls IsZoomButtonVisible="bool" .../>

Returns
bool
true to show the zoom button. false to hide the zoom button. The default is true.
MediaTransportControls.IsZoomButtonVisibleProperty
MediaTransportControls.IsZoomButtonVisibleProperty
MediaTransportControls.IsZoomButtonVisibleProperty
I n this Article
Edit
Identifies the IsZoomButtonVisible dependency property.
public : static DependencyProperty IsZoomButtonVisibleProperty { get; }
static DependencyProperty IsZoomButtonVisibleProperty();
public static DependencyProperty IsZoomButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsZoomButtonVisible dependency property.
MediaTransportControls.IsZoomEnabled MediaTransport
Controls.IsZoomEnabled MediaTransportControls.IsZoom
Enabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can zoom the media.
public : Platform::Boolean IsZoomEnabled { get; set; }
bool IsZoomEnabled();

void IsZoomEnabled(bool iszoomenabled);


public bool IsZoomEnabled { get; set; }

<MediaTransportControls IsZoomEnabled="bool" .../>

Returns
bool
true to allow the user to zoom; otherwise, false. The default is true.
MediaTransportControls.IsZoomEnabledProperty Media
TransportControls.IsZoomEnabledProperty Media
TransportControls.IsZoomEnabledProperty
I n this Article
Edit
Identifies the IsZoomEnabled dependency property.
public : static DependencyProperty IsZoomEnabledProperty { get; }
static DependencyProperty IsZoomEnabledProperty();
public static DependencyProperty IsZoomEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsZoomEnabled dependency property.
MediaTransportControls MediaTransportControls Media
TransportControls
I n this Article
Edit
Initializes a new instance of the MediaTransportControls class.
public : MediaTransportControls()
MediaTransportControls() const;
public MediaTransportControls()
MediaTransportControls.Show MediaTransportControls.
Show MediaTransportControls.Show
I n this Article
Edit
Shows the tranport controls if they're hidden.
public : void Show()
void Show() const;
public void Show()

Additional features and requirements


Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


MediaTransportControls.ShowAndHideAutomatically
MediaTransportControls.ShowAndHideAutomatically
MediaTransportControls.ShowAndHideAutomatically
I n this Article
Edit
Gets or sets a value that indicates whether the controls are shown and hidden automatically.
public : Platform::Boolean ShowAndHideAutomatically { get; set; }
bool ShowAndHideAutomatically();

void ShowAndHideAutomatically(bool showandhideautomatically);


public bool ShowAndHideAutomatically { get; set; }

<MediaTransportControls ShowAndHideAutomatically="bool" .../>

Returns
bool
true if the controls are shown and hidden automatically; otherwise, false. The default is true.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


MediaTransportControls.ShowAndHideAutomatically
Property MediaTransportControls.ShowAndHide
AutomaticallyProperty MediaTransportControls.ShowAnd
HideAutomaticallyProperty
I n this Article
Edit
Identifies the ShowAndHideAutomatically dependency property.
public : static DependencyProperty ShowAndHideAutomaticallyProperty { get; }
static DependencyProperty ShowAndHideAutomaticallyProperty();
public static DependencyProperty ShowAndHideAutomaticallyProperty { get; }

Returns
DependencyProperty
The identifier for the ShowAndHideAutomatically dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


MediaTransportControls.ThumbnailRequested Media
TransportControls.ThumbnailRequested MediaTransport
Controls.ThumbnailRequested
I n this Article
Edit
Occurs whenever the app needs to display a thumbnail adjacent to the seek bar when the user performs a seek
operation.
public : event TypedEventHandler<MediaTransportControls,
MediaTransportControlsThumbnailRequestedEventArgs> ThumbnailRequested
// Register
event_token ThumbnailRequested(TypedEventHandler<MediaTransportControls,
MediaTransportControlsThumbnailRequestedEventArgs> const& handler) const;

// Revoke with event_token


void ThumbnailRequested(event_token const& cookie) const;

// Revoke with event_revoker


ThumbnailRequested_revoker ThumbnailRequested(auto_revoke_t,
TypedEventHandler<MediaTransportControls, MediaTransportControlsThumbnailRequestedEventArgs> const&
handler) const;
public event TypedEventHandler<MediaTransportControls,
MediaTransportControlsThumbnailRequestedEventArgs> ThumbnailRequested

Remarks
This event is raised only when the MediaTransportControls is used with a MediaPlayerElement. It is not raised when
the MediaTransportControls are used with a MediaElement.
MediaTransportControlsHelper MediaTransportControls
Helper MediaTransportControlsHelper Class
Provides properties and methods to customize media transport controls.

D eclaration
public : sealed class MediaTransportControlsHelper : IMediaTransportControlsHelper
struct winrt::Windows::UI::Xaml::Controls::MediaTransportControlsHelper :
IMediaTransportControlsHelper
public sealed class MediaTransportControlsHelper : IMediaTransportControlsHelper

I nheritance H ierarchy
None

Remarks
You do not instantiate this class directly. To use this class, set the MediaTransportControlsHelper.DropoutOrder
attached property on a control in the template of a MediaTransportControls object.

Properties
DropoutOrderProperty
DropoutOrderProperty
DropoutOrderProperty

Identifies the MediaTransportControlsHelper.DropoutOrder XAML attached property.

Methods
GetDropoutOrder(UIElement)
GetDropoutOrder(UIElement)
GetDropoutOrder(UIElement)

Gets the value of the MediaTransportControlsHelper.DropoutOrder XAML attached property for the target
element.

SetDropoutOrder(UIElement, IReference<Int32>)
SetDropoutOrder(UIElement, IReference<Int32>)
SetDropoutOrder(UIElement, IReference<Int32>)

Sets the value of the MediaTransportControlsHelper.DropoutOrder XAML attached property for a target element.
MediaTransportControlsHelper.DropoutOrderProperty
MediaTransportControlsHelper.DropoutOrderProperty
MediaTransportControlsHelper.DropoutOrderProperty
I n this Article
Edit
Identifies the MediaTransportControlsHelper.DropoutOrder XAML attached property.
public : static DependencyProperty DropoutOrderProperty { get; }
static DependencyProperty DropoutOrderProperty();
public static DependencyProperty DropoutOrderProperty { get; }

Returns
DependencyProperty
The identifier for the MediaTransportControlsHelper.DropoutOrder XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the MediaTransportControlsHelper.DropoutOrder XAML attached property in XAML and won't need this identifier.
See MediaTransportControlsHelper.DropoutOrder
Also Attached properties overview
MediaTransportControlsHelper.GetDropoutOrder Media
TransportControlsHelper.GetDropoutOrder Media
TransportControlsHelper.GetDropoutOrder
I n this Article
Edit
Gets the value of the MediaTransportControlsHelper.DropoutOrder XAML attached property for the target element.
public : static IReference<int> GetDropoutOrder(UIElement element)
static IReference<int32_t> GetDropoutOrder(UIElement element) const;
public static Nullable<int> GetDropoutOrder(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
Nullable<int>
The value to set. (The dropout priority of the control relative to other transport controls.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
MediaTransportControlsHelper.DropoutOrder XAML attached property in XAML and won't need this method. For
more info, see the MediaTransportControlsHelper.DropoutOrder attached property.
See MediaTransportControlsHelper.DropoutOrder
Also Attached properties overview
MediaTransportControlsHelper.SetDropoutOrder Media
TransportControlsHelper.SetDropoutOrder Media
TransportControlsHelper.SetDropoutOrder
I n this Article
Edit
Sets the value of the MediaTransportControlsHelper.DropoutOrder XAML attached property for a target element.
public : static void SetDropoutOrder(UIElement element, IReference<int> value)
static void SetDropoutOrder(UIElement element, IReference<int32_t> value) const;
public static void SetDropoutOrder(UIElement element, Nullable<Int32> value)

Parameters
element UIElement
The object to which the property value is written.
value Nullable<Int32>
The value to set. (The dropout priority of the control relative to other transport controls.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
MediaTransportControlsHelper.DropoutOrder XAML attached property in XAML and won't need this method. For
more info, see the MediaTransportControlsHelper.DropoutOrder attached property.
See MediaTransportControlsHelper.DropoutOrder
Also Attached properties overview
MenuBar MenuBar MenuBar Class
Represents a specialized container that presents a set of menus in a horizontal row, typically at the top of an app
window.

D eclaration
public : class MenuBar : Control, IMenuBar
struct winrt::Windows::UI::Xaml::Controls::MenuBar : Control, IMenuBar
public class MenuBar : Control, IMenuBar

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Constructors
MenuBar()
MenuBar()
MenuBar()

Initializes a new instance of the MenuBar class.

Properties
Items
Items
Items

Gets the collection of top-level menu items.

ItemsProperty
ItemsProperty
ItemsProperty

Identifies the Items dependency property.


MenuBar.Items MenuBar.Items MenuBar.Items
I n this Article
Edit
Gets the collection of top-level menu items.

public : IVector<MenuBarItem> Items { get; }


IVector<MenuBarItem> Items();
public IList<MenuBarItem> Items { get; }

Returns
IList<MenuBarItem>
The collection of top-level menu items.
MenuBar.ItemsProperty MenuBar.ItemsProperty Menu
Bar.ItemsProperty
I n this Article
Edit
Identifies the Items dependency property.
public : static DependencyProperty ItemsProperty { get; }
static DependencyProperty ItemsProperty();
public static DependencyProperty ItemsProperty { get; }

Returns
DependencyProperty
The identifier for the Items dependency property.
MenuBar MenuBar MenuBar
I n this Article
Edit
Initializes a new instance of the MenuBar class.

public : MenuBar()
MenuBar() const;
public MenuBar()
MenuBarItem MenuBarItem MenuBarItem Class
Represents a top-level menu in a MenuBar control.

D eclaration
public : class MenuBarItem : Control, IMenuBarItem
struct winrt::Windows::UI::Xaml::Controls::MenuBarItem : Control, IMenuBarItem
public class MenuBarItem : Control, IMenuBarItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Constructors
MenuBarItem()
MenuBarItem()
MenuBarItem()

Initializes a new instance of the MenuBarItem class.

Properties
Items
Items
Items

Gets the collection of commands in a MenuBar menu.

ItemsProperty
ItemsProperty
ItemsProperty

Identifies the Items dependency property.

Title
Title
Title

Gets or sets the text label for a MenuBar menu.

TitleProperty
TitleProperty
TitleProperty
Identifies the Title dependency property.
MenuBarItem.Items MenuBarItem.Items MenuBarItem.
Items
I n this Article
Edit
Gets the collection of commands in a MenuBar menu.
public : IVector<MenuFlyoutItemBase> Items { get; }
IVector<MenuFlyoutItemBase> Items();
public IList<MenuFlyoutItemBase> Items { get; }

Returns
IList<MenuFlyoutItemBase>
The collection of commands in a MenuBar menu.
MenuBarItem.ItemsProperty MenuBarItem.ItemsProperty
MenuBarItem.ItemsProperty
I n this Article
Edit
Identifies the Items dependency property.
public : static DependencyProperty ItemsProperty { get; }
static DependencyProperty ItemsProperty();
public static DependencyProperty ItemsProperty { get; }

Returns
DependencyProperty
The identifier for the Items dependency property.
MenuBarItem MenuBarItem MenuBarItem
I n this Article
Edit
Initializes a new instance of the MenuBarItem class.

public : MenuBarItem()
MenuBarItem() const;
public MenuBarItem()
MenuBarItem.Title MenuBarItem.Title MenuBarItem.Title
I n this Article
Edit
Gets or sets the text label for a MenuBar menu.

public : Platform::String Title { get; set; }


winrt::hstring Title();

void Title(winrt::hstring title);


public string Title { get; set; }

Returns
string
The text label for this menu. The default is an empty string.
MenuBarItem.TitleProperty MenuBarItem.TitleProperty
MenuBarItem.TitleProperty
I n this Article
Edit
Identifies the Title dependency property.
public : static DependencyProperty TitleProperty { get; }
static DependencyProperty TitleProperty();
public static DependencyProperty TitleProperty { get; }

Returns
DependencyProperty
The identifier for the Title dependency property.
MenuBarItemFlyout MenuBarItemFlyout MenuBarItem
Flyout Class
Represents the flyout of a MenuBar item.

D eclaration
public : class MenuBarItemFlyout : MenuFlyout, IMenuBarItemFlyout
struct winrt::Windows::UI::Xaml::Controls::MenuBarItemFlyout : MenuFlyout, IMenuBarItemFlyout
public class MenuBarItemFlyout : MenuFlyout, IMenuBarItemFlyout

I nheritance H ierarchy
DependencyObject
FlyoutBase
MenuFlyout

Constructors
MenuBarItemFlyout()
MenuBarItemFlyout()
MenuBarItemFlyout()

Initializes a new instance of the MenuBarItemFlyout class.


MenuBarItemFlyout MenuBarItemFlyout MenuBarItem
Flyout
I n this Article
Edit
Initializes a new instance of the MenuBarItemFlyout class.
public : MenuBarItemFlyout()
MenuBarItemFlyout() const;
public MenuBarItemFlyout()
MenuFlyout MenuFlyout MenuFlyout Class
Represents a flyout that displays a menu of commands.

D eclaration
public : class MenuFlyout : FlyoutBase, IMenuFlyout, IMenuFlyout2
struct winrt::Windows::UI::Xaml::Controls::MenuFlyout : FlyoutBase, IMenuFlyout, IMenuFlyout2
public class MenuFlyout : FlyoutBase, IMenuFlyout, IMenuFlyout2

I nheritance H ierarchy
DependencyObject
FlyoutBase

Remarks
 Tip

For more info, design guidance, and code examples, see Menus and context menus.
MenuFlyout temporarily displays a list of commands or options related to what the user is currently doing.

Use a Flyout control to display single items and a MenuFlyout control to show a menu of items. For more info, see
Menus and context menus.
A MenuFlyout control can be used as the value of the Button.Flyout property. This is usually set in XAML as part of a
UI definition of the page. Button is the only control that has a dedicated Flyout property. When set as Button.Flyout,
the MenuFlyout displays when the button is tapped or otherwise invoked.
To associate a MenuFlyout with other controls, use the ContextFlyout property that's available on any UIElement.
Notes for previous versions
Note

The ContextFlyout property is not available prior to the Windows 10 Anniversary Update (SDK version 14393). For
earlier versions, use the FlyoutBase.AttachedFlyout attached property.
You can use the FlyoutBase.AttachedFlyout attached property to associate a MenuFlyout with other controls. When a
MenuFlyout is assigned to other UI elements using FlyoutBase.AttachedFlyout, you must call either the ShowAt
method or the static ShowAttachedFlyout method to display the flyout.
In addition to the members listed above, there are other members of the base class FlyoutBase that are often used in
typical MenuFlyout scenarios:
FlyoutBase.AttachedFlyout: an attached property that associates a MenuFlyout with a particular UI element (this can
be any FrameworkElement derived class).
ShowAttachedFlyout: a static method that can determine whether a flyout is already associated with a UI element
through a FlyoutBase.AttachedFlyout usage. If so, the method calls ShowAt internally, using the FrameworkElement
that you specified.

Constructors
MenuFlyout()
MenuFlyout()
MenuFlyout()

Initializes a new instance of the MenuFlyout class.

Properties
Items
Items
Items

Gets the collection used to generate the content of the menu.

MenuFlyoutPresenterStyle
MenuFlyoutPresenterStyle
MenuFlyoutPresenterStyle

Gets or sets the style that is used when rendering the MenuFlyout.

MenuFlyoutPresenterStyleProperty
MenuFlyoutPresenterStyleProperty
MenuFlyoutPresenterStyleProperty

Identifies the MenuFlyoutPresenterStyle dependency property.

Methods
ShowAt(UIElement, Point)
ShowAt(UIElement, Point)
ShowAt(UIElement, Point)

Shows the flyout placed at the specified offset in relation to the specified target element.

See Also
FlyoutBase
MenuFlyout.Items MenuFlyout.Items MenuFlyout.Items
I n this Article
Edit
Gets the collection used to generate the content of the menu.

public : IVector<MenuFlyoutItemBase> Items { get; }


IVector<MenuFlyoutItemBase> Items();
public IList<MenuFlyoutItemBase> Items { get; }

<MenuFlyout>
oneOrMoreItems
</MenuFlyout>

Returns
IList<MenuFlyoutItemBase>
The collection that is used to generate the content of the menu, if it exists; otherwise, null. The default is an empty
collection.
MenuFlyout MenuFlyout MenuFlyout
I n this Article
Edit
Initializes a new instance of the MenuFlyout class.

public : MenuFlyout()
MenuFlyout() const;
public MenuFlyout()
MenuFlyout.MenuFlyoutPresenterStyle MenuFlyout.
MenuFlyoutPresenterStyle MenuFlyout.MenuFlyout
PresenterStyle
I n this Article
Edit
Gets or sets the style that is used when rendering the MenuFlyout.
public : Style MenuFlyoutPresenterStyle { get; set; }
Style MenuFlyoutPresenterStyle();

void MenuFlyoutPresenterStyle(Style menuflyoutpresenterstyle);


public Style MenuFlyoutPresenterStyle { get; set; }

<MenuFlyout MenuFlyoutPresenterStyle="resourceReferenceToStyle"/>

Returns
Style
The style that is used when rendering the MenuFlyout.

Remarks
The TargetType value to use for the Style must be MenuFlyoutPresenter (not MenuFlyout).
You can't style a MenuFlyout directly. Instead, you apply a style to the MenuFlyoutPresenter that provides the visuals
for the flyout. You can also style MenuFlyoutItem and ToggleMenuFlyoutItem (they are controls) and you can use
implicit styles to do so. Or, you can set UI-related properties on the MenuFlyoutItem and ToggleMenuFlyoutItem items
directly.
MenuFlyout.MenuFlyoutPresenterStyleProperty Menu
Flyout.MenuFlyoutPresenterStyleProperty MenuFlyout.
MenuFlyoutPresenterStyleProperty
I n this Article
Edit
Identifies the MenuFlyoutPresenterStyle dependency property.
public : static DependencyProperty MenuFlyoutPresenterStyleProperty { get; }
static DependencyProperty MenuFlyoutPresenterStyleProperty();
public static DependencyProperty MenuFlyoutPresenterStyleProperty { get; }

Returns
DependencyProperty
The identifier for the MenuFlyoutPresenterStyle dependency property.
MenuFlyout.ShowAt MenuFlyout.ShowAt MenuFlyout.
ShowAt
I n this Article
Edit
Shows the flyout placed at the specified offset in relation to the specified target element.
public : void ShowAt(UIElement targetElement, Point point)
void ShowAt(UIElement targetElement, Point point) const;
public void ShowAt(UIElement targetElement, Point point)

Parameters
targetElement UIElement
The element to use as the flyout's placement target.
point Point
The point at which to offset the flyout from the specified target element.

Examples
To position the menu relative to a UI element, specify the element and offset.
MenuFlyout.ShowAt(element, new Point(0,0));

To position the menu relative to the application window, set the targetElement parameter to null.
MenuFlyout.ShowAt(null, new Point(x, y));

Remarks
When you call this method to show a MenuFlyout, it automatically renders outside the application window if possible
and required.
Some properties might not flow as expected, such as FlowDirection. To ensure correct flow, you can set the flow
direction in the MenuFlyoutPresenter The MenuFlyoutPresenter must be set before the MenuFlyout is first shown.
See ShowAt(FrameworkElement)
Also
MenuFlyoutItem MenuFlyoutItem MenuFlyoutItem Class
Represents a command in a MenuFlyout control.

D eclaration
public : class MenuFlyoutItem : MenuFlyoutItemBase, IMenuFlyoutItem, IMenuFlyoutItem2,
IMenuFlyoutItem3
struct winrt::Windows::UI::Xaml::Controls::MenuFlyoutItem : MenuFlyoutItemBase, IMenuFlyoutItem,
IMenuFlyoutItem2, IMenuFlyoutItem3
public class MenuFlyoutItem : MenuFlyoutItemBase, IMenuFlyoutItem, IMenuFlyoutItem2,
IMenuFlyoutItem3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
MenuFlyoutItemBase

Remarks
Use a Flyout control to display single items and a MenuFlyout control to show a menu of items.
MenuFlyoutI tem derived classes
MenuFlyoutItem is the parent class for ToggleMenuFlyoutItem.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the MenuFlyoutItem control.

R ES O U R CE K EY D ES CR IPTIO N

MenuFlyoutItemBackground Background color of entire control bounds at rest

MenuFlyoutItemBackgroundPointerOver Background color on hover

MenuFlyoutItemBackgroundPressed Background color when pressed

MenuFlyoutItemBackgroundDisabled Background color when disabled


MenuFlyoutItemForeground Text color at rest

MenuFlyoutItemForegroundPointerOver Text color on hover

MenuFlyoutItemForegroundPressed Text color when pressed

MenuFlyoutItemForegroundDisabled Text color when disabled

Constructors
MenuFlyoutItem()
MenuFlyoutItem()
MenuFlyoutItem()

Initializes a new instance of the MenuFlyoutItem class.

Properties
Command
Command
Command

Gets or sets the command to invoke when the item is pressed.

CommandParameter
CommandParameter
CommandParameter

Gets or sets the parameter to pass to the Command property.

CommandParameterProperty
CommandParameterProperty
CommandParameterProperty

Identifies the CommandParameter dependency property.

CommandProperty
CommandProperty
CommandProperty

Identifies the Command dependency property.

Icon
Icon
Icon
Gets or sets the graphic content of the menu flyout item.

IconProperty
IconProperty
IconProperty

Identifies the Icon dependency property.

KeyboardAcceleratorTextOverride
KeyboardAcceleratorTextOverride
KeyboardAcceleratorTextOverride

Gets or sets a string that overrides the default key combination string associated with a keyboard accelerator.

Example of a menu showing keyboard accelerators for various menu items

KeyboardAcceleratorTextOverrideProperty
KeyboardAcceleratorTextOverrideProperty
KeyboardAcceleratorTextOverrideProperty

Identifies the MenuFlyoutItem.KeyboardAcceleratorTextOverride dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension
sources when defining templates for a MenuFlyoutItem control.

Text
Text
Text

Gets or sets the text content of a MenuFlyoutItem.

TextProperty
TextProperty
TextProperty

Identifies the Text dependency property.

Events
Click
Click
Click

Occurs when a menu item is clicked.

See Also
MenuFlyoutItemBase
MenuFlyoutItemBase
MenuFlyoutItem.Click MenuFlyoutItem.Click MenuFlyout
Item.Click
I n this Article
Edit
Occurs when a menu item is clicked.
public : event RoutedEventHandler Click
// Register
event_token Click(RoutedEventHandler const& handler) const;

// Revoke with event_token


void Click(event_token const& cookie) const;

// Revoke with event_revoker


Click_revoker Click(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler Click

<MenuFlyoutItem Click="eventhandler"/>

See Events and routed events overview


Also
MenuFlyoutItem.Command MenuFlyoutItem.Command
MenuFlyoutItem.Command
I n this Article
Edit
Gets or sets the command to invoke when the item is pressed.
public : ICommand Command { get; set; }
ICommand Command();

void Command(ICommand command);


public ICommand Command { get; set; }

<MenuFlyoutItem Command="commandReference"/>

Returns
ICommand
The command to invoke when the item is pressed. The default is null.

Remarks
The ICommand interface comes from a different source depending on whether the data source is implemented in
Visual C++ component extensions (C++/CX) or for Microsoft .NET. Visual C++ component extensions (C++/CX)
implements Windows::UI::Xaml::Input::ICommand. Microsoft .NET implements System.Windows.Input.ICommand.
Both interfaces have the same template. Which interface you call from your app code is analogous: use
Windows::UI::Xaml::Input::ICommand for Visual C++ component extensions (C++/CX) code and
System.Windows.Input.ICommand for Microsoft .NET code.
The XAML syntax shown for Microsoft .NET 's System.Windows.Input.ICommand type does not work for Windows
Runtime XAML. You should always use a Binding reference. Constructs such as named commands and x:Static are
not supported.
MenuFlyoutItem.CommandParameter MenuFlyoutItem.
CommandParameter MenuFlyoutItem.Command
Parameter
I n this Article
Edit
Gets or sets the parameter to pass to the Command property.
public : Platform::Object CommandParameter { get; set; }
winrt::Windows::Foundation::IInspectable CommandParameter();

void CommandParameter(winrt::Windows::Foundation::IInspectable commandparameter);


public object CommandParameter { get; set; }

<MenuFlyoutItem>
<MenuFlyoutItem.CommandParameter>
object
</MenuFlyoutItem.CommandParameter>
</MenuFlyoutItem>

Returns
object
The parameter to pass to the Command property. The default is null.
MenuFlyoutItem.CommandParameterProperty Menu
FlyoutItem.CommandParameterProperty MenuFlyout
Item.CommandParameterProperty
I n this Article
Edit
Identifies the CommandParameter dependency property.
public : static DependencyProperty CommandParameterProperty { get; }
static DependencyProperty CommandParameterProperty();
public static DependencyProperty CommandParameterProperty { get; }

Returns
DependencyProperty
The identifier for the CommandParameter dependency property.
MenuFlyoutItem.CommandProperty MenuFlyoutItem.
CommandProperty MenuFlyoutItem.CommandProperty
I n this Article
Edit
Identifies the Command dependency property.
public : static DependencyProperty CommandProperty { get; }
static DependencyProperty CommandProperty();
public static DependencyProperty CommandProperty { get; }

Returns
DependencyProperty
The identifier for the Command dependency property.
MenuFlyoutItem.Icon MenuFlyoutItem.Icon MenuFlyout
Item.Icon
I n this Article
Edit
Gets or sets the graphic content of the menu flyout item.
public : IconElement Icon { get; set; }
IconElement Icon();

void Icon(IconElement icon);


public IconElement Icon { get; set; }

<MenuFlyoutItem Icon="symbolName" .../>

Returns
IconElement
The graphic content of the menu flyout item.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


MenuFlyoutItem.IconProperty MenuFlyoutItem.Icon
Property MenuFlyoutItem.IconProperty
I n this Article
Edit
Identifies the Icon dependency property.
public : static DependencyProperty IconProperty { get; }
static DependencyProperty IconProperty();
public static DependencyProperty IconProperty { get; }

Returns
DependencyProperty
The identifier for the Icon dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


MenuFlyoutItem.KeyboardAcceleratorTextOverride Menu
FlyoutItem.KeyboardAcceleratorTextOverride Menu
FlyoutItem.KeyboardAcceleratorTextOverride
I n this Article
Edit
Gets or sets a string that overrides the default key combination string associated with a keyboard accelerator.

Example of a menu showing keyboard accelerators for various menu items


public : Platform::String KeyboardAcceleratorTextOverride { get; set; }
winrt::hstring KeyboardAcceleratorTextOverride();

void KeyboardAcceleratorTextOverride(winrt::hstring keyboardacceleratortextoverride);


public string KeyboardAcceleratorTextOverride { get; set; }

Returns
string
The string to replace the default key combination string. The default is null.
Use a single space for no text.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

Remarks
Windows 10, version 1703, introduced keyboard accelerator shortcuts. However, these shortcuts were not displayed
with the UI of their corresponding controls.
Starting with Windows 10, version 1803, when KeyboardAccelerators are declared, controls display the corresponding
key combinations by default.
The override text is not be presented if the system cannot detect an attached keyboard (you can check this yourself
through the KeyboardPresent property).
Version compatibility
The KeyboardAcceleratorTextOverride property is not available prior to Windows 10, version 1803. If your app’s
'minimum platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the
Requirements block later in this page, you must design and test your app to account for this. For more info, see Version
adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<CommandBar x:Name="commandBar1" Loaded="CommandBar_Loaded">
<AppBarToggleButton x:Name="appBarButtonShuffle" Icon="Shuffle" Label="Shuffle"/>
</CommandBar>

<Button Content="Button Flyout">


<Button.Flyout>
<MenuFlyout>
<MenuFlyoutItem x:Name="menuFlyoutItemExample" Text="Item 1" />
<MenuFlyoutItem Text="Item 2" />
<MenuFlyoutSeparator />
<MenuFlyoutSubItem Text="Item 3">
<MenuFlyoutItem Text="Item 4" />
<MenuFlyoutSubItem Text="Item 5">
<MenuFlyoutItem Text="Item 6" />
<MenuFlyoutItem Text="Item 7" />
</MenuFlyoutSubItem>
</MenuFlyoutSubItem>
<MenuFlyoutSeparator />
<ToggleMenuFlyoutItem Text="Toggle Menu Item 1" />
</MenuFlyout>
</Button.Flyout>
</Button>

private void Button_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.MenuFlyoutItem",
"KeyboardAcceleratorTextOverride"))
{
menuFlyoutItemExample.KeyboardAcceleratorTextOverride = "Ctrl+S";
}
}

See Keyboard Accelerators


Also
MenuFlyoutItem.KeyboardAcceleratorTextOverride
Property MenuFlyoutItem.KeyboardAcceleratorText
OverrideProperty MenuFlyoutItem.KeyboardAccelerator
TextOverrideProperty
I n this Article
Edit
Identifies the MenuFlyoutItem.KeyboardAcceleratorTextOverride dependency property.
public : static DependencyProperty KeyboardAcceleratorTextOverrideProperty { get; }
static DependencyProperty KeyboardAcceleratorTextOverrideProperty();
public static DependencyProperty KeyboardAcceleratorTextOverrideProperty { get; }

Returns
DependencyProperty
The identifier for the MenuFlyoutItem.KeyboardAcceleratorTextOverride dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

See Keyboard Accelerators


Also
MenuFlyoutItem MenuFlyoutItem MenuFlyoutItem
I n this Article
Edit
Initializes a new instance of the MenuFlyoutItem class.

public : MenuFlyoutItem()
MenuFlyoutItem() const;
public MenuFlyoutItem()
MenuFlyoutItem.TemplateSettings MenuFlyoutItem.
TemplateSettings MenuFlyoutItem.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension sources
when defining templates for a MenuFlyoutItem control.
public : MenuFlyoutItemTemplateSettings TemplateSettings { get; }
MenuFlyoutItemTemplateSettings TemplateSettings();
public MenuFlyoutItemTemplateSettings TemplateSettings { get; }

Returns
MenuFlyoutItemTemplateSettings
An object that provides calculated values for templates.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


MenuFlyoutItem.Text MenuFlyoutItem.Text MenuFlyout
Item.Text
I n this Article
Edit
Gets or sets the text content of a MenuFlyoutItem.
public : Platform::String Text { get; set; }
winrt::hstring Text();

void Text(winrt::hstring text);


public string Text { get; set; }

<MenuFlyoutItem Text="string"/>

Returns
string
A string that specifies the text content of this MenuFlyoutItem. The default is an empty string.
MenuFlyoutItem.TextProperty MenuFlyoutItem.Text
Property MenuFlyoutItem.TextProperty
I n this Article
Edit
Identifies the Text dependency property.
public : static DependencyProperty TextProperty { get; }
static DependencyProperty TextProperty();
public static DependencyProperty TextProperty { get; }

Returns
DependencyProperty
The identifier for the Text dependency property.
MenuFlyoutItemBase MenuFlyoutItemBase MenuFlyout
ItemBase Class
Represents the base class for items in a MenuFlyout control.

D eclaration
public : class MenuFlyoutItemBase : Control, IMenuFlyoutItemBase
struct winrt::Windows::UI::Xaml::Controls::MenuFlyoutItemBase : Control, IMenuFlyoutItemBase
public class MenuFlyoutItemBase : Control, IMenuFlyoutItemBase

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
There are three elements that you can use to compose the menu items in a MenuFlyout control: MenuFlyoutItem ,
ToggleMenuFlyoutItem, and MenuFlyoutSeparator. You can use these in any combination.
MenuFlyoutI temB ase derived classes
MenuFlyoutItemBase is the parent class for MenuFlyoutItem and MenuFlyoutSeparator.

See Also
Control
Control
MenuFlyoutPresenter MenuFlyoutPresenter MenuFlyout
Presenter Class
Displays the content of a MenuFlyout control.

D eclaration
public : class MenuFlyoutPresenter : ItemsControl, IMenuFlyoutPresenter, IMenuFlyoutPresenter2
struct winrt::Windows::UI::Xaml::Controls::MenuFlyoutPresenter : ItemsControl,
IMenuFlyoutPresenter, IMenuFlyoutPresenter2
public class MenuFlyoutPresenter : ItemsControl, IMenuFlyoutPresenter, IMenuFlyoutPresenter2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl

Remarks
You don't typically use a MenuFlyoutPresenter directly, either in XAML or code. Instead, you reference the
MenuFlyoutPresenter type as the TargetType of the style you use for the MenuFlyout.MenuFlyoutPresenterStyle
property. Then, you use style Setter elements to set the various Control properties that influence the appearance of the
MenuFlyout through this presenter. For example you can use a Setter to set the Width of the MenuFlyout:
<MenuFlyout x:Name="optionFlyout">
<MenuFlyout.MenuFlyoutPresenterStyle>
<Style TargetType="MenuFlyoutPresenter">
<Setter Property="Width" Value="300"/>
</Style>
</MenuFlyout.MenuFlyoutPresenterStyle>
<!--menu items go here-->
</MenuFlyout>

The MenuFlyoutPresenter class is not a ContentPresenter derived class, it's actually a control (derived from
ItemsControl ) that plays a special role when creating the visual tree for a MenuFlyout.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the MenuFlyoutPresenter control.
R ES O U R CE K EY D ES CR IPTIO N

MenuFlyoutPresenterBackground Background color of entire control bounds

MenuFlyoutPresenterBorderBrush Border color of entire control bounds

Constructors
MenuFlyoutPresenter()
MenuFlyoutPresenter()
MenuFlyoutPresenter()

Initializes a new instance of the MenuFlyoutPresenter class.

Properties
TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a MenuFlyoutPresenter control.

See Also
ItemsControl
ItemsControl
MenuFlyoutPresenter MenuFlyoutPresenter MenuFlyout
Presenter
I n this Article
Edit
Initializes a new instance of the MenuFlyoutPresenter class.
public : MenuFlyoutPresenter()
MenuFlyoutPresenter() const;
public MenuFlyoutPresenter()
MenuFlyoutPresenter.TemplateSettings MenuFlyout
Presenter.TemplateSettings MenuFlyoutPresenter.
TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a MenuFlyoutPresenter control.
public : MenuFlyoutPresenterTemplateSettings TemplateSettings { get; }
MenuFlyoutPresenterTemplateSettings TemplateSettings();
public MenuFlyoutPresenterTemplateSettings TemplateSettings { get; }

Returns
MenuFlyoutPresenterTemplateSettings
An object that provides calculated values for templates.
Additional features and requirements
Device family Windows 10 (introduced v10.0.10586.0)

API contract Windows.Foundation.UniversalApiContract (introduced v2)


MenuFlyoutSeparator MenuFlyoutSeparator MenuFlyout
Separator Class
Represents a horizontal line that separates items in an MenuFlyout.

D eclaration
public : class MenuFlyoutSeparator : MenuFlyoutItemBase, IMenuFlyoutSeparator
struct winrt::Windows::UI::Xaml::Controls::MenuFlyoutSeparator : MenuFlyoutItemBase,
IMenuFlyoutSeparator
public class MenuFlyoutSeparator : MenuFlyoutItemBase, IMenuFlyoutSeparator

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
MenuFlyoutItemBase

Remarks
There are three elements that you can use to compose the menu items in a MenuFlyout control: MenuFlyoutItem ,
ToggleMenuFlyoutItem, and MenuFlyoutSeparator. You can use these in any combination. MenuFlyoutSeparator is
typically placed between groups of items in a MenuFlyout. The MenuFlyoutSeparator has no other attributes when you
set it in XAML.

Constructors
MenuFlyoutSeparator()
MenuFlyoutSeparator()
MenuFlyoutSeparator()

Initializes a new instance of the MenuFlyoutSeparator class.

See Also
MenuFlyoutItemBase
MenuFlyoutItemBase
MenuFlyoutSeparator MenuFlyoutSeparator MenuFlyout
Separator
I n this Article
Edit
Initializes a new instance of the MenuFlyoutSeparator class.
public : MenuFlyoutSeparator()
MenuFlyoutSeparator() const;
public MenuFlyoutSeparator()
MenuFlyoutSubItem MenuFlyoutSubItem MenuFlyout
SubItem Class
Represents a menu item that displays a sub-menu in a MenuFlyout control.

D eclaration
public : sealed class MenuFlyoutSubItem : MenuFlyoutItemBase, IMenuFlyoutSubItem,
IMenuFlyoutSubItem2
struct winrt::Windows::UI::Xaml::Controls::MenuFlyoutSubItem : MenuFlyoutItemBase,
IMenuFlyoutSubItem, IMenuFlyoutSubItem2
public sealed class MenuFlyoutSubItem : MenuFlyoutItemBase, IMenuFlyoutSubItem,
IMenuFlyoutSubItem2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
MenuFlyoutItemBase

Remarks
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the MenuFlyoutSubItem control.

R ES O U R CE K EY D ES CR IPTIO N

MenuFlyoutSubItemBackground Background color of entire control bounds at rest

MenuFlyoutSubItemBackgroundPointerOver Background color on hover

MenuFlyoutSubItemBackgroundPressed Background color when pressed

MenuFlyoutSubItemBackgroundDisabled Background color when disabled

MenuFlyoutSubItemForeground Text color at rest


MenuFlyoutSubItemForegroundPointerOver Text color on hover

MenuFlyoutSubItemForegroundPressed Text color when pressed

MenuFlyoutSubItemForegroundDisabled Text color when disabled

MenuFlyoutSubItemChevron Chevron color at rest

MenuFlyoutSubItemChevronPointerOver Chevron color on hover

MenuFlyoutSubItemChevronPressed Chevron color when pressed

MenuFlyoutSubItemChevronDisabled Chevron color when disabled

MenuFlyoutSubItemChevronSubMenuOpened Chevron color when opened

Constructors
MenuFlyoutSubItem()
MenuFlyoutSubItem()
MenuFlyoutSubItem()

Initializes a new instance of the MenuFlyoutSubItem class.

Properties
Icon
Icon
Icon

Gets or sets the graphic content of the menu flyout subitem.

IconProperty
IconProperty
IconProperty

Identifies the Icon dependency property.

Items
Items
Items

Gets the collection used to generate the content of the sub-menu.

Text
Text
Text

Gets or sets the text content of a MenuFlyoutSubItem.


TextProperty
TextProperty
TextProperty

Identifies the Text dependency property.

See Also
MenuFlyoutItemBase
MenuFlyoutItemBase
MenuFlyoutItemBase
MenuFlyoutSubItem.Icon MenuFlyoutSubItem.Icon Menu
FlyoutSubItem.Icon
I n this Article
Edit
Gets or sets the graphic content of the menu flyout subitem.
public : IconElement Icon { get; set; }
IconElement Icon();

void Icon(IconElement icon);


public IconElement Icon { get; set; }

<MenuFlyoutSubItem Icon="symbolName" .../>

Returns
IconElement
The graphic content of the menu flyout subitem.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


MenuFlyoutSubItem.IconProperty MenuFlyoutSubItem.
IconProperty MenuFlyoutSubItem.IconProperty
I n this Article
Edit
Identifies the Icon dependency property.
public : static DependencyProperty IconProperty { get; }
static DependencyProperty IconProperty();
public static DependencyProperty IconProperty { get; }

Returns
DependencyProperty
The identifier for the Icon dependency property
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


MenuFlyoutSubItem.Items MenuFlyoutSubItem.Items
MenuFlyoutSubItem.Items
I n this Article
Edit
Gets the collection used to generate the content of the sub-menu.
public : IVector<MenuFlyoutItemBase> Items { get; }
IVector<MenuFlyoutItemBase> Items();
public IList<MenuFlyoutItemBase> Items { get; }

<MenuFlyoutSubItem>
oneOrMoreItems
</MenuFlyoutSubItem>

Returns
IList<MenuFlyoutItemBase>
The collection that is used to generate the content of the sub-menu, if it exists; otherwise, null. The default is an empty
collection.
MenuFlyoutSubItem MenuFlyoutSubItem MenuFlyout
SubItem
I n this Article
Edit
Initializes a new instance of the MenuFlyoutSubItem class.
public : MenuFlyoutSubItem()
MenuFlyoutSubItem() const;
public MenuFlyoutSubItem()
MenuFlyoutSubItem.Text MenuFlyoutSubItem.Text Menu
FlyoutSubItem.Text
I n this Article
Edit
Gets or sets the text content of a MenuFlyoutSubItem.
public : Platform::String Text { get; set; }
winrt::hstring Text();

void Text(winrt::hstring text);


public string Text { get; set; }

<MenuFlyoutSubItem Text="string"/>

Returns
string
A string that specifies the text content of this MenuFlyoutSubItem. The default is an empty string.
MenuFlyoutSubItem.TextProperty MenuFlyoutSubItem.
TextProperty MenuFlyoutSubItem.TextProperty
I n this Article
Edit
Identifies the Text dependency property.
public : static DependencyProperty TextProperty { get; }
static DependencyProperty TextProperty();
public static DependencyProperty TextProperty { get; }

Returns
DependencyProperty
The identifier for the Text dependency property.
NavigationView NavigationView NavigationView Class
Represents a container that enables navigation of app content. It has a header, a view for the main content, and a menu
pane for navigation commands.

D eclaration
public : class NavigationView : ContentControl, INavigationView, INavigationView2,
INavigationView3
struct winrt::Windows::UI::Xaml::Controls::NavigationView : ContentControl, INavigationView,
INavigationView2, INavigationView3
public class NavigationView : ContentControl, INavigationView, INavigationView2,
INavigationView3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Constructors
NavigationView()
NavigationView()
NavigationView()

Initializes a new instance of the NavigationView class.

Properties
AlwaysShowHeader
AlwaysShowHeader
AlwaysShowHeader

Gets or sets a value that indicates whether the header is always visible.

AlwaysShowHeaderProperty
AlwaysShowHeaderProperty
AlwaysShowHeaderProperty

Identifies the AlwaysShowHeader dependency property.

AutoSuggestBox
AutoSuggestBox
AutoSuggestBox

Gets or sets an AutoSuggestBox to be displayed in the NavigationView.


AutoSuggestBoxProperty
AutoSuggestBoxProperty
AutoSuggestBoxProperty

Identifies the AutoSuggestBox dependency property.

CompactModeThresholdWidth
CompactModeThresholdWidth
CompactModeThresholdWidth

Gets or sets the minimum window width at which the NavigationView enters Compact display mode.

CompactModeThresholdWidthProperty
CompactModeThresholdWidthProperty
CompactModeThresholdWidthProperty

Identifies the CompactModeThresholdWidth dependency property.

CompactPaneLength
CompactPaneLength
CompactPaneLength

Gets or sets the width of the NavigationView pane in its compact display mode.

CompactPaneLengthProperty
CompactPaneLengthProperty
CompactPaneLengthProperty

Identifies the CompactPaneLength dependency property.

ContentOverlay
ContentOverlay
ContentOverlay

Gets or sets a UI element that is shown at the top of the control, below the pane if PaneDisplayMode is Top.

ContentOverlayProperty
ContentOverlayProperty
ContentOverlayProperty

Identifies the ContentOverlay dependency property.

DisplayMode
DisplayMode
DisplayMode
Gets a value that specifies how the pane and content areas of a NavigationView are being shown.

DisplayModeProperty
DisplayModeProperty
DisplayModeProperty

Identifies the DisplayMode dependency property.

ExpandedModeThresholdWidth
ExpandedModeThresholdWidth
ExpandedModeThresholdWidth

Gets or sets the minimum window width at which the NavigationView enters Expanded display mode.

ExpandedModeThresholdWidthProperty
ExpandedModeThresholdWidthProperty
ExpandedModeThresholdWidthProperty

Identifies the ExpandedModeThresholdWidth dependency property.

Header
Header
Header

Gets or sets the header content.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the control's header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.


IsBackButtonVisible
IsBackButtonVisible
IsBackButtonVisible

Gets or sets a value that indicates whether the back button is enabled or disabled.

IsBackButtonVisibleProperty
IsBackButtonVisibleProperty
IsBackButtonVisibleProperty

Identifies the IsBackButtonVisible dependency property.

IsBackEnabled
IsBackEnabled
IsBackEnabled

Gets or sets a value that indicates whether the back button is enabled or disabled.

IsBackEnabledProperty
IsBackEnabledProperty
IsBackEnabledProperty

Identifies the IsBackEnabled dependency property.

IsPaneOpen
IsPaneOpen
IsPaneOpen

Gets or sets a value that specifies whether the NavigationView pane is expanded to its full width.

IsPaneOpenProperty
IsPaneOpenProperty
IsPaneOpenProperty

Identifies the IsPaneOpen dependency property.

IsPaneToggleButtonVisible
IsPaneToggleButtonVisible
IsPaneToggleButtonVisible

Gets or sets a value that indicates whether the menu toggle button is shown.

IsPaneToggleButtonVisibleProperty
IsPaneToggleButtonVisibleProperty
IsPaneToggleButtonVisibleProperty
Identifies the IsPaneToggleButtonVisible dependency property.

IsPaneVisible
IsPaneVisible
IsPaneVisible

Gets or sets a value that determines whether the pane is shown.

IsPaneVisibleProperty
IsPaneVisibleProperty
IsPaneVisibleProperty

Identifies the IsPaneVisible dependency property.

IsSettingsVisible
IsSettingsVisible
IsSettingsVisible

Gets or sets a value that indicates whether the settings button is shown.

IsSettingsVisibleProperty
IsSettingsVisibleProperty
IsSettingsVisibleProperty

Identifies the IsSettingsVisible dependency property.

MenuItemContainerStyle
MenuItemContainerStyle
MenuItemContainerStyle

Gets or sets the style that is used when rendering the menu item containers.

MenuItemContainerStyleProperty
MenuItemContainerStyleProperty
MenuItemContainerStyleProperty

Identifies the MenuItemContainerStyle dependency property.

MenuItemContainerStyleSelector
MenuItemContainerStyleSelector
MenuItemContainerStyleSelector

Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector returns different Style values to
use for the item container based on characteristics of the object being displayed.
MenuItemContainerStyleSelectorProperty
MenuItemContainerStyleSelectorProperty
MenuItemContainerStyleSelectorProperty

Identifies the MenuItemContainerStyleSelector dependency property.

MenuItems
MenuItems
MenuItems

Gets the collection of menu items displayed in the NavigationMenu.

MenuItemsProperty
MenuItemsProperty
MenuItemsProperty

Identifies the MenuItems dependency property.

MenuItemsSource
MenuItemsSource
MenuItemsSource

Gets or sets an object source used to generate the content of the NavigationView menu.

MenuItemsSourceProperty
MenuItemsSourceProperty
MenuItemsSourceProperty

Identifies the MenuItemsSource dependency property.

MenuItemTemplate
MenuItemTemplate
MenuItemTemplate

Gets or sets the DataTemplate used to display each menu item.

MenuItemTemplateProperty
MenuItemTemplateProperty
MenuItemTemplateProperty

Identifies the MenuItemTemplate dependency property.

MenuItemTemplateSelector
MenuItemTemplateSelector
MenuItemTemplateSelector
Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector referenced by
this property returns a template to apply to items.

MenuItemTemplateSelectorProperty
MenuItemTemplateSelectorProperty
MenuItemTemplateSelectorProperty

Identifies the MenuItemTemplateSelector dependency property.

OpenPaneLength
OpenPaneLength
OpenPaneLength

Gets or sets the width of the NavigationView pane when it's fully expanded.

OpenPaneLengthProperty
OpenPaneLengthProperty
OpenPaneLengthProperty

Identifies the OpenPaneLength dependency property.

OverflowLabelMode
OverflowLabelMode
OverflowLabelMode

Gets or sets a value that indicates what text label is shown for the overflow menu.

OverflowLabelModeProperty
OverflowLabelModeProperty
OverflowLabelModeProperty

Identifies the OverflowLabelMode dependency property.

PaneCustomContent
PaneCustomContent
PaneCustomContent

Gets or sets a UI element that is shown in the NavigationView pane.

PaneCustomContentProperty
PaneCustomContentProperty
PaneCustomContentProperty

Identifies the PaneCustomContent dependency property.


PaneDisplayMode
PaneDisplayMode
PaneDisplayMode

Gets or sets a value that indicates how and where the NavigationView pane is shown.

PaneDisplayModeProperty
PaneDisplayModeProperty
PaneDisplayModeProperty

Identifies the PaneDisplayMode dependency property.

PaneFooter
PaneFooter
PaneFooter

Gets or sets the content for the pane footer.

PaneFooterProperty
PaneFooterProperty
PaneFooterProperty

Identifies the PaneFooter dependency property.

PaneHeader
PaneHeader
PaneHeader

Gets or sets the content for the pane header.

PaneHeaderProperty
PaneHeaderProperty
PaneHeaderProperty

Identifies the PaneHeader dependency property.

PaneTitle
PaneTitle
PaneTitle

Gets or sets the label adjacent to the menu icon when the NavigationView pane is open.

PaneTitleProperty
PaneTitleProperty
PaneTitleProperty
Identifies the PaneTitle dependency property.

PaneToggleButtonStyle
PaneToggleButtonStyle
PaneToggleButtonStyle

Gets or sets the Style that defines the look of the menu toggle button.

PaneToggleButtonStyleProperty
PaneToggleButtonStyleProperty
PaneToggleButtonStyleProperty

Identifies the PaneToggleButtonStyle dependency property.

SelectedItem
SelectedItem
SelectedItem

Gets or sets the selected item.

SelectedItemProperty
SelectedItemProperty
SelectedItemProperty

Identifies the SelectedItem dependency property.

SelectionFollowsFocus
SelectionFollowsFocus
SelectionFollowsFocus

Gets or sets a value that indicates whether item selection changes when keyboard focus changes.

SelectionFollowsFocusProperty
SelectionFollowsFocusProperty
SelectionFollowsFocusProperty

Identifies the SelectionFollowsFocus dependency property.

SettingsItem
SettingsItem
SettingsItem

Gets the navigation item that represents the entry point to app settings.
SettingsItemProperty
SettingsItemProperty
SettingsItemProperty

Identifies the SettingsItem dependency property.

ShoulderNavigationEnabled
ShoulderNavigationEnabled
ShoulderNavigationEnabled

Gets or sets a value that indicates when gamepad bumpers can be used to navigate the top-level navigation items
in a NavigationView.

ShoulderNavigationEnabledProperty
ShoulderNavigationEnabledProperty
ShoulderNavigationEnabledProperty

Identifies the ShoulderNavigationEnabled dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a NavigationView control.

TemplateSettingsProperty
TemplateSettingsProperty
TemplateSettingsProperty

Identifies the TemplateSettings dependency property.

Methods
ContainerFromMenuItem(Object)
ContainerFromMenuItem(Object)
ContainerFromMenuItem(Object)

Returns the container corresponding to the specified menu item.

MenuItemFromContainer(DependencyObject)
MenuItemFromContainer(DependencyObject)
MenuItemFromContainer(DependencyObject)

Returns the item that corresponds to the specified, generated container.


Events
BackRequested
BackRequested
BackRequested

Occurs when the back button receives an interaction such as a click or tap.

DisplayModeChanged
DisplayModeChanged
DisplayModeChanged

Occurs when the DisplayMode property changes.

ItemInvoked
ItemInvoked
ItemInvoked

Occurs when an item in the menu receives an interaction such as a click or tap.

PaneClosed
PaneClosed
PaneClosed

Occurs when the NavigationView pane is closed.

PaneClosing
PaneClosing
PaneClosing

Occurs when the NavigationView pane is closing.

PaneOpened
PaneOpened
PaneOpened

Occurs when the NavigationView pane is opened.

PaneOpening
PaneOpening
PaneOpening

Occurs when the NavigationView pane is opening.

SelectionChanged
SelectionChanged
SelectionChanged

Occurs when the currently selected item changes.

See Also
NavigationView.AlwaysShowHeader NavigationView.
AlwaysShowHeader NavigationView.AlwaysShowHeader
I n this Article
Edit
Gets or sets a value that indicates whether the header is always visible.
public : Platform::Boolean AlwaysShowHeader { get; set; }
bool AlwaysShowHeader();

void AlwaysShowHeader(bool alwaysshowheader);


public bool AlwaysShowHeader { get; set; }

<NavigationView AlwaysShowHeader="bool" .../>

Returns
bool
true if the header is always visible; otherwise, false.
NavigationView.AlwaysShowHeaderProperty Navigation
View.AlwaysShowHeaderProperty NavigationView.
AlwaysShowHeaderProperty
I n this Article
Edit
Identifies the AlwaysShowHeader dependency property.
public : static DependencyProperty AlwaysShowHeaderProperty { get; }
static DependencyProperty AlwaysShowHeaderProperty();
public static DependencyProperty AlwaysShowHeaderProperty { get; }

Returns
DependencyProperty
The identifier for the AlwaysShowHeader dependency property.
NavigationView.AutoSuggestBox NavigationView.Auto
SuggestBox NavigationView.AutoSuggestBox
I n this Article
Edit
Gets or sets an AutoSuggestBox to be displayed in the NavigationView.
public : AutoSuggestBox AutoSuggestBox { get; set; }
AutoSuggestBox AutoSuggestBox();

void AutoSuggestBox(AutoSuggestBox autosuggestbox);


public AutoSuggestBox AutoSuggestBox { get; set; }

<NavigationView>
<NavigationView.AutoSuggestBox>
<AutoSuggestBox .../>
</NavigationView.AutoSuggestBox>
</NavigationView>

Returns
AutoSuggestBox
An AutoSuggestBox box to be displayed in the NavigationView.
NavigationView.AutoSuggestBoxProperty Navigation
View.AutoSuggestBoxProperty NavigationView.Auto
SuggestBoxProperty
I n this Article
Edit
Identifies the AutoSuggestBox dependency property.
public : static DependencyProperty AutoSuggestBoxProperty { get; }
static DependencyProperty AutoSuggestBoxProperty();
public static DependencyProperty AutoSuggestBoxProperty { get; }

Returns
DependencyProperty
The identifier for the AutoSuggestBox dependency property.
NavigationView.BackRequested NavigationView.Back
Requested NavigationView.BackRequested
I n this Article
Edit
Occurs when the back button receives an interaction such as a click or tap.
public : event TypedEventHandler<NavigationView, NavigationViewBackRequestedEventArgs> BackRequested
// Register
event_token BackRequested(TypedEventHandler<NavigationView, NavigationViewBackRequestedEventArgs>
const& handler) const;

// Revoke with event_token


void BackRequested(event_token const& cookie) const;

// Revoke with event_revoker


BackRequested_revoker BackRequested(auto_revoke_t, TypedEventHandler<NavigationView,
NavigationViewBackRequestedEventArgs> const& handler) const;
public event TypedEventHandler<NavigationView, NavigationViewBackRequestedEventArgs> BackRequested

<NavigationView BackRequested="eventhandler" />


NavigationView.CompactModeThresholdWidth
NavigationView.CompactModeThresholdWidth
NavigationView.CompactModeThresholdWidth
I n this Article
Edit
Gets or sets the minimum window width at which the NavigationView enters Compact display mode.
public : double CompactModeThresholdWidth { get; set; }
double CompactModeThresholdWidth();

void CompactModeThresholdWidth(double compactmodethresholdwidth);


public double CompactModeThresholdWidth { get; set; }

<NavigationView CompactModeThresholdWidth="double" .../>

Returns
double
The minimum window width at which the NavigationView enters Compact display mode. The default is 641 pixels.
NavigationView.CompactModeThresholdWidthProperty
NavigationView.CompactModeThresholdWidthProperty
NavigationView.CompactModeThresholdWidthProperty
I n this Article
Edit
Identifies the CompactModeThresholdWidth dependency property.
public : static DependencyProperty CompactModeThresholdWidthProperty { get; }
static DependencyProperty CompactModeThresholdWidthProperty();
public static DependencyProperty CompactModeThresholdWidthProperty { get; }

Returns
DependencyProperty
The identifier for the CompactModeThresholdWidth dependency property.
NavigationView.CompactPaneLength NavigationView.
CompactPaneLength NavigationView.CompactPane
Length
I n this Article
Edit
Gets or sets the width of the NavigationView pane in its compact display mode.
public : double CompactPaneLength { get; set; }
double CompactPaneLength();

void CompactPaneLength(double compactpanelength);


public double CompactPaneLength { get; set; }

<NavigationView CompactPaneLength="double" .../>

Returns
double
The width of the pane in its compact display mode. The default is 48 device-independent pixel (DIP ).

Remarks
This property specifies the width of the pane when DisplayMode is Compact and IsPaneOpen is false.
NavigationView.CompactPaneLengthProperty
NavigationView.CompactPaneLengthProperty
NavigationView.CompactPaneLengthProperty
I n this Article
Edit
Identifies the CompactPaneLength dependency property.
public : static DependencyProperty CompactPaneLengthProperty { get; }
static DependencyProperty CompactPaneLengthProperty();
public static DependencyProperty CompactPaneLengthProperty { get; }

Returns
DependencyProperty
The identifier for the CompactPaneLength dependency property.
NavigationView.ContainerFromMenuItem Navigation
View.ContainerFromMenuItem NavigationView.Container
FromMenuItem
I n this Article
Edit
Returns the container corresponding to the specified menu item.
public : DependencyObject ContainerFromMenuItem(Platform::Object item)
DependencyObject ContainerFromMenuItem(winrt::Windows::Foundation::IInspectable item) const;
public DependencyObject ContainerFromMenuItem(Object item)

Parameters
item Object
The menu item to retrieve the container for.
Returns
DependencyObject
A container that corresponds to the specified menu item, if the item has a container and exists in the collection;
otherwise, null.
NavigationView.ContentOverlay NavigationView.Content
Overlay NavigationView.ContentOverlay
I n this Article
Edit
Gets or sets a UI element that is shown at the top of the control, below the pane if PaneDisplayMode is Top.
public : UIElement ContentOverlay { get; set; }
UIElement ContentOverlay();

void ContentOverlay(UIElement contentoverlay);


public UIElement ContentOverlay { get; set; }

Returns
UIElement
The element that is shown at the top of the control.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
The ContentOverlay property takes a single UIElement. This is typically a layout panel, such as Grid or StackPanel, that
contains additional elements.
NavigationView.ContentOverlayProperty Navigation
View.ContentOverlayProperty NavigationView.Content
OverlayProperty
I n this Article
Edit
Identifies the ContentOverlay dependency property.
public : static DependencyProperty ContentOverlayProperty { get; }
static DependencyProperty ContentOverlayProperty();
public static DependencyProperty ContentOverlayProperty { get; }

Returns
DependencyProperty
The identifier for the ContentOverlay dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.DisplayMode NavigationView.Display
Mode NavigationView.DisplayMode
I n this Article
Edit
Gets a value that specifies how the pane and content areas of a NavigationView are being shown.
public : NavigationViewDisplayMode DisplayMode { get; }
NavigationViewDisplayMode DisplayMode();
public NavigationViewDisplayMode DisplayMode { get; }

<NavigationView DisplayMode="displayModeName" .../>

Returns
NavigationViewDisplayMode
A value of the enumeration that specifies how the pane and content areas of a NavigationView are being shown.
NavigationView.DisplayModeChanged NavigationView.
DisplayModeChanged NavigationView.DisplayMode
Changed
I n this Article
Edit
Occurs when the DisplayMode property changes.
public : event TypedEventHandler<NavigationView, NavigationViewDisplayModeChangedEventArgs>
DisplayModeChanged
// Register
event_token DisplayModeChanged(TypedEventHandler<NavigationView,
NavigationViewDisplayModeChangedEventArgs> const& handler) const;

// Revoke with event_token


void DisplayModeChanged(event_token const& cookie) const;

// Revoke with event_revoker


DisplayModeChanged_revoker DisplayModeChanged(auto_revoke_t, TypedEventHandler<NavigationView,
NavigationViewDisplayModeChangedEventArgs> const& handler) const;
public event TypedEventHandler<NavigationView, NavigationViewDisplayModeChangedEventArgs>
DisplayModeChanged

<NavigationView DisplayModeChanged="eventhandler" />


NavigationView.DisplayModeProperty NavigationView.
DisplayModeProperty NavigationView.DisplayMode
Property
I n this Article
Edit
Identifies the DisplayMode dependency property.
public : static DependencyProperty DisplayModeProperty { get; }
static DependencyProperty DisplayModeProperty();
public static DependencyProperty DisplayModeProperty { get; }

Returns
DependencyProperty
The identifier for the DisplayMode dependency property.
NavigationView.ExpandedModeThresholdWidth
NavigationView.ExpandedModeThresholdWidth
NavigationView.ExpandedModeThresholdWidth
I n this Article
Edit
Gets or sets the minimum window width at which the NavigationView enters Expanded display mode.
public : double ExpandedModeThresholdWidth { get; set; }
double ExpandedModeThresholdWidth();

void ExpandedModeThresholdWidth(double expandedmodethresholdwidth);


public double ExpandedModeThresholdWidth { get; set; }

<NavigationView ExpandedModeThresholdWidth="double" .../>

Returns
double
The minimum window width at which the NavigationView enters Expanded display mode. The default is 1008 pixels.
NavigationView.ExpandedModeThresholdWidthProperty
NavigationView.ExpandedModeThresholdWidthProperty
NavigationView.ExpandedModeThresholdWidthProperty
I n this Article
Edit
Identifies the ExpandedModeThresholdWidth dependency property.
public : static DependencyProperty ExpandedModeThresholdWidthProperty { get; }
static DependencyProperty ExpandedModeThresholdWidthProperty();
public static DependencyProperty ExpandedModeThresholdWidthProperty { get; }

Returns
DependencyProperty
The identifier for the ExpandedModeThresholdWidth dependency property.
NavigationView.Header NavigationView.Header
NavigationView.Header
I n this Article
Edit
Gets or sets the header content.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<NavigationView Header="headerString"/>

Returns
object
The header content for the NavigationView.
NavigationView.HeaderProperty NavigationView.Header
Property NavigationView.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
NavigationView.HeaderTemplate NavigationView.Header
Template NavigationView.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the control's header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<NavigationView HeaderTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The DataTemplate used to display the control's header.
NavigationView.HeaderTemplateProperty Navigation
View.HeaderTemplateProperty NavigationView.Header
TemplateProperty
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
NavigationView.IsBackButtonVisible NavigationView.Is
BackButtonVisible NavigationView.IsBackButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the back button is enabled or disabled.
public : NavigationViewBackButtonVisible IsBackButtonVisible { get; set; }
NavigationViewBackButtonVisible IsBackButtonVisible();

void IsBackButtonVisible(NavigationViewBackButtonVisible isbackbuttonvisible);


public NavigationViewBackButtonVisible IsBackButtonVisible { get; set; }

<NavigationView IsBackButtonVisible="backButtonVisibleEnumVal" .../>

Returns
NavigationViewBackButtonVisible
A value of the enumeration that specifies the visibility of the NavigationView back button. The default is "Auto".
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


NavigationView.IsBackButtonVisibleProperty Navigation
View.IsBackButtonVisibleProperty NavigationView.IsBack
ButtonVisibleProperty
I n this Article
Edit
Identifies the IsBackButtonVisible dependency property.
public : static DependencyProperty IsBackButtonVisibleProperty { get; }
static DependencyProperty IsBackButtonVisibleProperty();
public static DependencyProperty IsBackButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsBackButtonVisible dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


NavigationView.IsBackEnabled NavigationView.IsBack
Enabled NavigationView.IsBackEnabled
I n this Article
Edit
Gets or sets a value that indicates whether the back button is enabled or disabled.
public : Platform::Boolean IsBackEnabled { get; set; }
bool IsBackEnabled();

void IsBackEnabled(bool isbackenabled);


public bool IsBackEnabled { get; set; }

<NavigationView IsBackEnabled="bool" .../>

Returns
bool
true if the back button is enabled; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


NavigationView.IsBackEnabledProperty NavigationView.
IsBackEnabledProperty NavigationView.IsBackEnabled
Property
I n this Article
Edit
Identifies the IsBackEnabled dependency property.
public : static DependencyProperty IsBackEnabledProperty { get; }
static DependencyProperty IsBackEnabledProperty();
public static DependencyProperty IsBackEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsBackEnabled dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


NavigationView.IsPaneOpen NavigationView.IsPaneOpen
NavigationView.IsPaneOpen
I n this Article
Edit
Gets or sets a value that specifies whether the NavigationView pane is expanded to its full width.
public : Platform::Boolean IsPaneOpen { get; set; }
bool IsPaneOpen();

void IsPaneOpen(bool ispaneopen);


public bool IsPaneOpen { get; set; }

<NavigationView IsPaneOpen="bool" .../>

Returns
bool
true if the pane is expanded to its full width; otherwise, false.
NavigationView.IsPaneOpenProperty NavigationView.Is
PaneOpenProperty NavigationView.IsPaneOpenProperty
I n this Article
Edit
Identifies the IsPaneOpen dependency property.
public : static DependencyProperty IsPaneOpenProperty { get; }
static DependencyProperty IsPaneOpenProperty();
public static DependencyProperty IsPaneOpenProperty { get; }

Returns
DependencyProperty
The identifier for the IsPaneOpen dependency property.
NavigationView.IsPaneToggleButtonVisible Navigation
View.IsPaneToggleButtonVisible NavigationView.IsPane
ToggleButtonVisible
I n this Article
Edit
Gets or sets a value that indicates whether the menu toggle button is shown.
public : Platform::Boolean IsPaneToggleButtonVisible { get; set; }
bool IsPaneToggleButtonVisible();

void IsPaneToggleButtonVisible(bool ispanetogglebuttonvisible);


public bool IsPaneToggleButtonVisible { get; set; }

<NavigationView IsPaneToggleButtonVisible="bool" .../>

Returns
bool
true if the menu button is shown; otherwise, false. The default is true.
NavigationView.IsPaneToggleButtonVisibleProperty
NavigationView.IsPaneToggleButtonVisibleProperty
NavigationView.IsPaneToggleButtonVisibleProperty
I n this Article
Edit
Identifies the IsPaneToggleButtonVisible dependency property.
public : static DependencyProperty IsPaneToggleButtonVisibleProperty { get; }
static DependencyProperty IsPaneToggleButtonVisibleProperty();
public static DependencyProperty IsPaneToggleButtonVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsPaneToggleButtonVisible dependency property.
NavigationView.IsPaneVisible NavigationView.IsPane
Visible NavigationView.IsPaneVisible
I n this Article
Edit
Gets or sets a value that determines whether the pane is shown.
public : Platform::Boolean IsPaneVisible { get; set; }
bool IsPaneVisible();

void IsPaneVisible(bool ispanevisible);


public bool IsPaneVisible { get; set; }

Returns
bool
true is the pane is shown; otherwise, false. The default is true.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.IsPaneVisibleProperty NavigationView.Is
PaneVisibleProperty NavigationView.IsPaneVisible
Property
I n this Article
Edit
Identifies the IsPaneVisible dependency property.
public : static DependencyProperty IsPaneVisibleProperty { get; }
static DependencyProperty IsPaneVisibleProperty();
public static DependencyProperty IsPaneVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsPaneVisible dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.IsSettingsVisible NavigationView.Is
SettingsVisible NavigationView.IsSettingsVisible
I n this Article
Edit
Gets or sets a value that indicates whether the settings button is shown.
public : Platform::Boolean IsSettingsVisible { get; set; }
bool IsSettingsVisible();

void IsSettingsVisible(bool issettingsvisible);


public bool IsSettingsVisible { get; set; }

<NavigationView IsSettingsVisible="bool" .../>

Returns
bool
true if the settings button is shown; otherwise, false. The default is true.
NavigationView.IsSettingsVisibleProperty Navigation
View.IsSettingsVisibleProperty NavigationView.IsSettings
VisibleProperty
I n this Article
Edit
Identifies the IsSettingsVisible dependency property.
public : static DependencyProperty IsSettingsVisibleProperty { get; }
static DependencyProperty IsSettingsVisibleProperty();
public static DependencyProperty IsSettingsVisibleProperty { get; }

Returns
DependencyProperty
The identifier for the IsSettingsVisible dependency property.
NavigationView.ItemInvoked NavigationView.Item
Invoked NavigationView.ItemInvoked
I n this Article
Edit
Occurs when an item in the menu receives an interaction such as a click or tap.
public : event TypedEventHandler<NavigationView, NavigationViewItemInvokedEventArgs> ItemInvoked
// Register
event_token ItemInvoked(TypedEventHandler<NavigationView, NavigationViewItemInvokedEventArgs> const&
handler) const;

// Revoke with event_token


void ItemInvoked(event_token const& cookie) const;

// Revoke with event_revoker


ItemInvoked_revoker ItemInvoked(auto_revoke_t, TypedEventHandler<NavigationView,
NavigationViewItemInvokedEventArgs> const& handler) const;
public event TypedEventHandler<NavigationView, NavigationViewItemInvokedEventArgs> ItemInvoked

<NavigationView ItemInvoked="eventhandler" />


NavigationView.MenuItemContainerStyle Navigation
View.MenuItemContainerStyle NavigationView.MenuItem
ContainerStyle
I n this Article
Edit
Gets or sets the style that is used when rendering the menu item containers.
public : Style MenuItemContainerStyle { get; set; }
Style MenuItemContainerStyle();

void MenuItemContainerStyle(Style menuitemcontainerstyle);


public Style MenuItemContainerStyle { get; set; }

<NavigationView>
<NavigationView.MenuItemContainerStyle>
inlineStyle
</NavigationView.MenuItemContainerStyle>
</NavigationView>

Returns
Style
The style applied to the item containers. The default is null.
NavigationView.MenuItemContainerStyleProperty
NavigationView.MenuItemContainerStyleProperty
NavigationView.MenuItemContainerStyleProperty
I n this Article
Edit
Identifies the MenuItemContainerStyle dependency property.
public : static DependencyProperty MenuItemContainerStyleProperty { get; }
static DependencyProperty MenuItemContainerStyleProperty();
public static DependencyProperty MenuItemContainerStyleProperty { get; }

Returns
DependencyProperty
The identifier for the MenuItemContainerStyle dependency property.
NavigationView.MenuItemContainerStyleSelector
NavigationView.MenuItemContainerStyleSelector
NavigationView.MenuItemContainerStyleSelector
I n this Article
Edit
Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector returns different Style values to use for
the item container based on characteristics of the object being displayed.
public : StyleSelector MenuItemContainerStyleSelector { get; set; }
StyleSelector MenuItemContainerStyleSelector();

void MenuItemContainerStyleSelector(StyleSelector menuitemcontainerstyleselector);


public StyleSelector MenuItemContainerStyleSelector { get; set; }

<NavigationView MenuItemContainerStyleSelector="styleSelectorReference" />

Returns
StyleSelector
A custom StyleSelector logic class.
NavigationView.MenuItemContainerStyleSelector
Property NavigationView.MenuItemContainerStyle
SelectorProperty NavigationView.MenuItemContainer
StyleSelectorProperty
I n this Article
Edit
Identifies the MenuItemContainerStyleSelector dependency property.
public : static DependencyProperty MenuItemContainerStyleSelectorProperty { get; }
static DependencyProperty MenuItemContainerStyleSelectorProperty();
public static DependencyProperty MenuItemContainerStyleSelectorProperty { get; }

Returns
DependencyProperty
The identifier for the MenuItemContainerStyleSelector dependency property.
NavigationView.MenuItemFromContainer Navigation
View.MenuItemFromContainer NavigationView.Menu
ItemFromContainer
I n this Article
Edit
Returns the item that corresponds to the specified, generated container.
public : Platform::Object MenuItemFromContainer(DependencyObject container)
winrt::Windows::Foundation::IInspectable MenuItemFromContainer(DependencyObject container) const;
public object MenuItemFromContainer(DependencyObject container)

Parameters
container DependencyObject
The DependencyObject that corresponds to the item to be returned.
Returns
object
The contained item, or the container if it does not contain an item.
NavigationView.MenuItems NavigationView.MenuItems
NavigationView.MenuItems
I n this Article
Edit
Gets the collection of menu items displayed in the NavigationMenu.
public : IVector<Platform::Object> MenuItems { get; }
IVector<winrt::Windows::Foundation::IInspectable> MenuItems();
public IList<object> MenuItems { get; }

Returns
IList<object>
The collection of menu items displayed in the NavigationMenu. The default is an empty collection.
NavigationView.MenuItemsProperty NavigationView.
MenuItemsProperty NavigationView.MenuItemsProperty
I n this Article
Edit
Identifies the MenuItems dependency property.
public : static DependencyProperty MenuItemsProperty { get; }
static DependencyProperty MenuItemsProperty();
public static DependencyProperty MenuItemsProperty { get; }

Returns
DependencyProperty
The identifier for the MenuItems dependency property.
NavigationView.MenuItemsSource NavigationView.Menu
ItemsSource NavigationView.MenuItemsSource
I n this Article
Edit
Gets or sets an object source used to generate the content of the NavigationView menu.
public : Platform::Object MenuItemsSource { get; set; }
winrt::Windows::Foundation::IInspectable MenuItemsSource();

void MenuItemsSource(winrt::Windows::Foundation::IInspectable menuitemssource);


public object MenuItemsSource { get; set; }

<NavigationView MenuItemsSource="bindingDeclaration"/>
-or-
<NavigationView MenuItemsSource="resourceReferenceToSource"/>

Returns
object
The object that is used to generate the content of the NavigationView menu. The default is null.
NavigationView.MenuItemsSourceProperty Navigation
View.MenuItemsSourceProperty NavigationView.Menu
ItemsSourceProperty
I n this Article
Edit
Identifies the MenuItemsSource dependency property.
public : static DependencyProperty MenuItemsSourceProperty { get; }
static DependencyProperty MenuItemsSourceProperty();
public static DependencyProperty MenuItemsSourceProperty { get; }

Returns
DependencyProperty
The identifier for the MenuItemsSource dependency property.
NavigationView.MenuItemTemplate NavigationView.
MenuItemTemplate NavigationView.MenuItemTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display each menu item.
public : DataTemplate MenuItemTemplate { get; set; }
DataTemplate MenuItemTemplate();

void MenuItemTemplate(DataTemplate menuitemtemplate);


public DataTemplate MenuItemTemplate { get; set; }

<NavigationMenu>
<NavigationMenu.MenuItemTemplate>
singleDataTemplate
</NavigationMenu.MenuItemTemplate>
</NavigationMenu>

Returns
DataTemplate
The template that specifies the visualization of the menu data objects. The default is null.
NavigationView.MenuItemTemplateProperty Navigation
View.MenuItemTemplateProperty NavigationView.Menu
ItemTemplateProperty
I n this Article
Edit
Identifies the MenuItemTemplate dependency property.
public : static DependencyProperty MenuItemTemplateProperty { get; }
static DependencyProperty MenuItemTemplateProperty();
public static DependencyProperty MenuItemTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the MenuItemTemplate dependency property.
NavigationView.MenuItemTemplateSelector Navigation
View.MenuItemTemplateSelector NavigationView.Menu
ItemTemplateSelector
I n this Article
Edit
Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector referenced by this
property returns a template to apply to items.
public : DataTemplateSelector MenuItemTemplateSelector { get; set; }
DataTemplateSelector MenuItemTemplateSelector();

void MenuItemTemplateSelector(DataTemplateSelector menuitemtemplateselector);


public DataTemplateSelector MenuItemTemplateSelector { get; set; }

<NavigationView MenuItemTemplateSelector="dataTemplateSelectorReference" />

Returns
DataTemplateSelector
A reference to a custom DataTemplateSelector logic class.
NavigationView.MenuItemTemplateSelectorProperty
NavigationView.MenuItemTemplateSelectorProperty
NavigationView.MenuItemTemplateSelectorProperty
I n this Article
Edit
Identifies the MenuItemTemplateSelector dependency property.
public : static DependencyProperty MenuItemTemplateSelectorProperty { get; }
static DependencyProperty MenuItemTemplateSelectorProperty();
public static DependencyProperty MenuItemTemplateSelectorProperty { get; }

Returns
DependencyProperty
The identifier for the MenuItemTemplateSelector dependency property.
NavigationView NavigationView NavigationView
I n this Article
Edit
Initializes a new instance of the NavigationView class.

public : NavigationView()
NavigationView() const;
public NavigationView()
NavigationView.OpenPaneLength NavigationView.Open
PaneLength NavigationView.OpenPaneLength
I n this Article
Edit
Gets or sets the width of the NavigationView pane when it's fully expanded.
public : double OpenPaneLength { get; set; }
double OpenPaneLength();

void OpenPaneLength(double openpanelength);


public double OpenPaneLength { get; set; }

Returns
double
The width of the NavigationView pane when it's fully expanded. The default is 320 device-independent pixel (DIP ).
NavigationView.OpenPaneLengthProperty Navigation
View.OpenPaneLengthProperty NavigationView.Open
PaneLengthProperty
I n this Article
Edit
Identifies the OpenPaneLength dependency property.
public : static DependencyProperty OpenPaneLengthProperty { get; }
static DependencyProperty OpenPaneLengthProperty();
public static DependencyProperty OpenPaneLengthProperty { get; }

Returns
DependencyProperty
The identifier for the OpenPaneLength dependency property.
NavigationView.OverflowLabelMode NavigationView.
OverflowLabelMode NavigationView.OverflowLabel
Mode
I n this Article
Edit
Gets or sets a value that indicates what text label is shown for the overflow menu.
public : NavigationViewOverflowLabelMode OverflowLabelMode { get; set; }
NavigationViewOverflowLabelMode OverflowLabelMode();

void OverflowLabelMode(NavigationViewOverflowLabelMode overflowlabelmode);


public NavigationViewOverflowLabelMode OverflowLabelMode { get; set; }

Returns
NavigationViewOverflowLabelMode
A value of the enumeration that indicates what text label is shown for the overflow menu. The default is MoreLabel,
which shows the text "More".
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
The overflow menu is shown only when NavigationView.PaneDisplayMode is Top and the window is not wide enough
to show all navigation menu items.
NavigationView.OverflowLabelModeProperty Navigation
View.OverflowLabelModeProperty NavigationView.
OverflowLabelModeProperty
I n this Article
Edit
Identifies the OverflowLabelMode dependency property.
public : static DependencyProperty OverflowLabelModeProperty { get; }
static DependencyProperty OverflowLabelModeProperty();
public static DependencyProperty OverflowLabelModeProperty { get; }

Returns
DependencyProperty
The identifier for the OverflowLabelMode dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.PaneClosed NavigationView.PaneClosed
NavigationView.PaneClosed
I n this Article
Edit
Occurs when the NavigationView pane is closed.
public : event TypedEventHandler<NavigationView, object> PaneClosed
// Register
event_token PaneClosed(TypedEventHandler<NavigationView, object> const& handler) const;

// Revoke with event_token


void PaneClosed(event_token const& cookie) const;

// Revoke with event_revoker


PaneClosed_revoker PaneClosed(auto_revoke_t, TypedEventHandler<NavigationView, object> const&
handler) const;
public event TypedEventHandler<NavigationView, object> PaneClosed

<NavigationView PaneClosed="eventhandler" />


NavigationView.PaneClosing NavigationView.Pane
Closing NavigationView.PaneClosing
I n this Article
Edit
Occurs when the NavigationView pane is closing.
public : event TypedEventHandler<NavigationView, NavigationViewPaneClosingEventArgs> PaneClosing
// Register
event_token PaneClosing(TypedEventHandler<NavigationView, NavigationViewPaneClosingEventArgs> const&
handler) const;

// Revoke with event_token


void PaneClosing(event_token const& cookie) const;

// Revoke with event_revoker


PaneClosing_revoker PaneClosing(auto_revoke_t, TypedEventHandler<NavigationView,
NavigationViewPaneClosingEventArgs> const& handler) const;
public event TypedEventHandler<NavigationView, NavigationViewPaneClosingEventArgs> PaneClosing

<NavigationView PaneClosing="eventhandler" />


NavigationView.PaneCustomContent NavigationView.
PaneCustomContent NavigationView.PaneCustom
Content
I n this Article
Edit
Gets or sets a UI element that is shown in the NavigationView pane.
public : UIElement PaneCustomContent { get; set; }
UIElement PaneCustomContent();

void PaneCustomContent(UIElement panecustomcontent);


public UIElement PaneCustomContent { get; set; }

Returns
UIElement
The element that is shown in the NavigationView pane.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
The PaneCustomContent property takes a single UIElement. This is typically a layout panel, such as Grid or StackPanel,
that contains additional elements.
NavigationView.PaneCustomContentProperty Navigation
View.PaneCustomContentProperty NavigationView.Pane
CustomContentProperty
I n this Article
Edit
Identifies the PaneCustomContent dependency property.
public : static DependencyProperty PaneCustomContentProperty { get; }
static DependencyProperty PaneCustomContentProperty();
public static DependencyProperty PaneCustomContentProperty { get; }

Returns
DependencyProperty
The identifier for the PaneCustomContent dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.PaneDisplayMode NavigationView.Pane
DisplayMode NavigationView.PaneDisplayMode
I n this Article
Edit
Gets or sets a value that indicates how and where the NavigationView pane is shown.
public : NavigationViewPaneDisplayMode PaneDisplayMode { get; set; }
NavigationViewPaneDisplayMode PaneDisplayMode();

void PaneDisplayMode(NavigationViewPaneDisplayMode panedisplaymode);


public NavigationViewPaneDisplayMode PaneDisplayMode { get; set; }

Returns
NavigationViewPaneDisplayMode
A value of the enumeration that indicates how and where the NavigationView pane is shown. The default is Auto.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

See Navigation view - display modes


Also
NavigationView.PaneDisplayModeProperty Navigation
View.PaneDisplayModeProperty NavigationView.Pane
DisplayModeProperty
I n this Article
Edit
Identifies the PaneDisplayMode dependency property.
public : static DependencyProperty PaneDisplayModeProperty { get; }
static DependencyProperty PaneDisplayModeProperty();
public static DependencyProperty PaneDisplayModeProperty { get; }

Returns
DependencyProperty
The identifier for the PaneDisplayMode dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.PaneFooter NavigationView.PaneFooter
NavigationView.PaneFooter
I n this Article
Edit
Gets or sets the content for the pane footer.
public : UIElement PaneFooter { get; set; }
UIElement PaneFooter();

void PaneFooter(UIElement panefooter);


public UIElement PaneFooter { get; set; }

<NavigationView>
<NavigationView.PaneFooter>
footerElement
</NavigationView.PaneFooter>
</NavigationView>

Returns
UIElement
The content of the pane footer. The default is null.

Remarks
The PaneFooter property takes a single UIElement, which can be a layout panel that contains additional elements.
If you place a NavigationViewItem in the PaneFooter, it will not raise the NavigationView.ItemInvoked event. The
ItemInvoked event is raised only when the NavigationViewItem is in the NavigationView.MenuItems collection.
NavigationView.PaneFooterProperty NavigationView.
PaneFooterProperty NavigationView.PaneFooterProperty
I n this Article
Edit
Identifies the PaneFooter dependency property.
public : static DependencyProperty PaneFooterProperty { get; }
static DependencyProperty PaneFooterProperty();
public static DependencyProperty PaneFooterProperty { get; }

Returns
DependencyProperty
The identifier for the PaneFooter dependency property.
NavigationView.PaneHeader NavigationView.Pane
Header NavigationView.PaneHeader
I n this Article
Edit
Gets or sets the content for the pane header.
public : UIElement PaneHeader { get; set; }
UIElement PaneHeader();

void PaneHeader(UIElement paneheader);


public UIElement PaneHeader { get; set; }

<NavigationView>
<NavigationView.PaneHeader>
headerElement
</NavigationView.PaneHeader>
</NavigationView>

Returns
UIElement
The content of the pane header. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
The PaneHeader property takes a single UIElement, which can be a layout panel that contains additional elements.
NavigationView.PaneHeaderProperty NavigationView.
PaneHeaderProperty NavigationView.PaneHeader
Property
I n this Article
Edit
Identifies the PaneHeader dependency property.
public : static DependencyProperty PaneHeaderProperty { get; }
static DependencyProperty PaneHeaderProperty();
public static DependencyProperty PaneHeaderProperty { get; }

Returns
DependencyProperty
The identifier for the PaneHeader dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.PaneOpened NavigationView.Pane
Opened NavigationView.PaneOpened
I n this Article
Edit
Occurs when the NavigationView pane is opened.
public : event TypedEventHandler<NavigationView, object> PaneOpened
// Register
event_token PaneOpened(TypedEventHandler<NavigationView, object> const& handler) const;

// Revoke with event_token


void PaneOpened(event_token const& cookie) const;

// Revoke with event_revoker


PaneOpened_revoker PaneOpened(auto_revoke_t, TypedEventHandler<NavigationView, object> const&
handler) const;
public event TypedEventHandler<NavigationView, object> PaneOpened

<NavigationView PaneOpened="eventhandler" />


NavigationView.PaneOpening NavigationView.Pane
Opening NavigationView.PaneOpening
I n this Article
Edit
Occurs when the NavigationView pane is opening.
public : event TypedEventHandler<NavigationView, object> PaneOpening
// Register
event_token PaneOpening(TypedEventHandler<NavigationView, object> const& handler) const;

// Revoke with event_token


void PaneOpening(event_token const& cookie) const;

// Revoke with event_revoker


PaneOpening_revoker PaneOpening(auto_revoke_t, TypedEventHandler<NavigationView, object> const&
handler) const;
public event TypedEventHandler<NavigationView, object> PaneOpening

<NavigationView PaneOpening="eventhandler" />


NavigationView.PaneTitle NavigationView.PaneTitle
NavigationView.PaneTitle
I n this Article
Edit
Gets or sets the label adjacent to the menu icon when the NavigationView pane is open.
public : Platform::String PaneTitle { get; set; }
winrt::hstring PaneTitle();

void PaneTitle(winrt::hstring panetitle);


public string PaneTitle { get; set; }

<NavigationView PaneTitle="string" .../>

Returns
string
The label adjacent to the menu icon when the pane is open. The default is an empty string.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


NavigationView.PaneTitleProperty NavigationView.Pane
TitleProperty NavigationView.PaneTitleProperty
I n this Article
Edit
Identifies the PaneTitle dependency property.
public : static DependencyProperty PaneTitleProperty { get; }
static DependencyProperty PaneTitleProperty();
public static DependencyProperty PaneTitleProperty { get; }

Returns
DependencyProperty
The identifier for the PaneTitle dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


NavigationView.PaneToggleButtonStyle NavigationView.
PaneToggleButtonStyle NavigationView.PaneToggle
ButtonStyle
I n this Article
Edit
Gets or sets the Style that defines the look of the menu toggle button.
public : Style PaneToggleButtonStyle { get; set; }
Style PaneToggleButtonStyle();

void PaneToggleButtonStyle(Style panetogglebuttonstyle);


public Style PaneToggleButtonStyle { get; set; }

<NavigationView PaneToggleButtonStyle="{StaticResource styleResourceKey}"/>

Returns
Style
The Style that defines the look of the menu toggle button. The default is null.
NavigationView.PaneToggleButtonStyleProperty
NavigationView.PaneToggleButtonStyleProperty
NavigationView.PaneToggleButtonStyleProperty
I n this Article
Edit
Identifies the PaneToggleButtonStyle dependency property.
public : static DependencyProperty PaneToggleButtonStyleProperty { get; }
static DependencyProperty PaneToggleButtonStyleProperty();
public static DependencyProperty PaneToggleButtonStyleProperty { get; }

Returns
DependencyProperty
The identifier for the PaneToggleButtonStyle dependency property.
NavigationView.SelectedItem NavigationView.Selected
Item NavigationView.SelectedItem
I n this Article
Edit
Gets or sets the selected item.
public : Platform::Object SelectedItem { get; set; }
winrt::Windows::Foundation::IInspectable SelectedItem();

void SelectedItem(winrt::Windows::Foundation::IInspectable selecteditem);


public object SelectedItem { get; set; }

<NavigationView SelectedItem="bindingReference" .../>

Returns
object
The selected item. The default is null.
NavigationView.SelectedItemProperty NavigationView.
SelectedItemProperty NavigationView.SelectedItem
Property
I n this Article
Edit
Identifies the SelectedItem dependency property.
public : static DependencyProperty SelectedItemProperty { get; }
static DependencyProperty SelectedItemProperty();
public static DependencyProperty SelectedItemProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedItem dependency property.
NavigationView.SelectionChanged NavigationView.
SelectionChanged NavigationView.SelectionChanged
I n this Article
Edit
Occurs when the currently selected item changes.
public : event TypedEventHandler<NavigationView, NavigationViewSelectionChangedEventArgs>
SelectionChanged
// Register
event_token SelectionChanged(TypedEventHandler<NavigationView,
NavigationViewSelectionChangedEventArgs> const& handler) const;

// Revoke with event_token


void SelectionChanged(event_token const& cookie) const;

// Revoke with event_revoker


SelectionChanged_revoker SelectionChanged(auto_revoke_t, TypedEventHandler<NavigationView,
NavigationViewSelectionChangedEventArgs> const& handler) const;
public event TypedEventHandler<NavigationView, NavigationViewSelectionChangedEventArgs>
SelectionChanged

<NavigationView SelectionChanged="eventhandler" />


NavigationView.SelectionFollowsFocus NavigationView.
SelectionFollowsFocus NavigationView.SelectionFollows
Focus
I n this Article
Edit
Gets or sets a value that indicates whether item selection changes when keyboard focus changes.
public : NavigationViewSelectionFollowsFocus SelectionFollowsFocus { get; set; }
NavigationViewSelectionFollowsFocus SelectionFollowsFocus();

void SelectionFollowsFocus(NavigationViewSelectionFollowsFocus selectionfollowsfocus);


public NavigationViewSelectionFollowsFocus SelectionFollowsFocus { get; set; }

Returns
NavigationViewSelectionFollowsFocus
A value of the enumeration that indicates whether selection changes when keyboard focus changes. The default is
Disabled.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.SelectionFollowsFocusProperty
NavigationView.SelectionFollowsFocusProperty
NavigationView.SelectionFollowsFocusProperty
I n this Article
Edit
Identifies the SelectionFollowsFocus dependency property.
public : static DependencyProperty SelectionFollowsFocusProperty { get; }
static DependencyProperty SelectionFollowsFocusProperty();
public static DependencyProperty SelectionFollowsFocusProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionFollowsFocus dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.SettingsItem NavigationView.Settings
Item NavigationView.SettingsItem
I n this Article
Edit
Gets the navigation item that represents the entry point to app settings.
public : Platform::Object SettingsItem { get; }
winrt::Windows::Foundation::IInspectable SettingsItem();
public object SettingsItem { get; }

Returns
object
The item that represents the entry point to app settings.
NavigationView.SettingsItemProperty NavigationView.
SettingsItemProperty NavigationView.SettingsItem
Property
I n this Article
Edit
Identifies the SettingsItem dependency property.
public : static DependencyProperty SettingsItemProperty { get; }
static DependencyProperty SettingsItemProperty();
public static DependencyProperty SettingsItemProperty { get; }

Returns
DependencyProperty
The identifier for the SettingsItem dependency property.
NavigationView.ShoulderNavigationEnabled Navigation
View.ShoulderNavigationEnabled NavigationView.
ShoulderNavigationEnabled
I n this Article
Edit
Gets or sets a value that indicates when gamepad bumpers can be used to navigate the top-level navigation items in a
NavigationView.
public : NavigationViewShoulderNavigationEnabled ShoulderNavigationEnabled { get; set; }
NavigationViewShoulderNavigationEnabled ShoulderNavigationEnabled();

void ShoulderNavigationEnabled(NavigationViewShoulderNavigationEnabled shouldernavigationenabled);


public NavigationViewShoulderNavigationEnabled ShoulderNavigationEnabled { get; set; }

Returns
NavigationViewShoulderNavigationEnabled
A value of the enumeration that indicates when gamepad bumpers can be used to navigate the top-level navigation
items in a NavigationView. The default is Never.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.ShoulderNavigationEnabledProperty
NavigationView.ShoulderNavigationEnabledProperty
NavigationView.ShoulderNavigationEnabledProperty
I n this Article
Edit
Identifies the ShoulderNavigationEnabled dependency property.
public : static DependencyProperty ShoulderNavigationEnabledProperty { get; }
static DependencyProperty ShoulderNavigationEnabledProperty();
public static DependencyProperty ShoulderNavigationEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the ShoulderNavigationEnabled dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.TemplateSettings NavigationView.
TemplateSettings NavigationView.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a NavigationView control.
public : NavigationViewTemplateSettings TemplateSettings { get; }
NavigationViewTemplateSettings TemplateSettings();
public NavigationViewTemplateSettings TemplateSettings { get; }

Returns
NavigationViewTemplateSettings
An object that provides calculated values for templates.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationView.TemplateSettingsProperty Navigation
View.TemplateSettingsProperty NavigationView.Template
SettingsProperty
I n this Article
Edit
Identifies the TemplateSettings dependency property.
public : static DependencyProperty TemplateSettingsProperty { get; }
static DependencyProperty TemplateSettingsProperty();
public static DependencyProperty TemplateSettingsProperty { get; }

Returns
DependencyProperty
The identifier for the TemplateSettings dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationViewBackButtonVisible NavigationViewBack
ButtonVisible NavigationViewBackButtonVisible Enum
Defines constants that specify whether the back button is visible in NavigationView.

D eclaration
public : enum class NavigationViewBackButtonVisible
enum class winrt::Windows::UI::Xaml::Controls::NavigationViewBackButtonVisible : int32_t
public enum NavigationViewBackButtonVisible

I nheritance H ierarchy
None

Fields
Auto Auto The system chooses whether or not to display the back button, depending on the device/form factor. On
Auto phones, tablets, desktops, and hubs, the back button is visible. On Xbox/TV, the back button is collapsed.

Collapsed Do not display the back button in NavigationView, and do not reserve space for it in layout.
Collapsed
Collapsed

Visible Display the back button in NavigationView.


Visible
Visible
NavigationViewBackRequestedEventArgs Navigation
ViewBackRequestedEventArgs NavigationViewBack
RequestedEventArgs Class
Provides event data for the NavigationView.BackRequested event.

D eclaration
public : sealed class NavigationViewBackRequestedEventArgs :
INavigationViewBackRequestedEventArgs
struct winrt::Windows::UI::Xaml::Controls::NavigationViewBackRequestedEventArgs :
INavigationViewBackRequestedEventArgs
public sealed class NavigationViewBackRequestedEventArgs : INavigationViewBackRequestedEventArgs

I nheritance H ierarchy
None
NavigationViewDisplayMode NavigationViewDisplay
Mode NavigationViewDisplayMode Enum
Defines constants that specify how the pane is shown in a NavigationView.

D eclaration
public : enum class NavigationViewDisplayMode
enum class winrt::Windows::UI::Xaml::Controls::NavigationViewDisplayMode : int32_t
public enum NavigationViewDisplayMode

I nheritance H ierarchy
None

Fields
Compact Compact Compact The pane always shows as a narrow sliver which can be opened to full width.

Expanded Expanded Expanded The pane stays open alongside the content.

Minimal Minimal Minimal Only the menu button remains fixed. The pane shows and hides as needed.
NavigationViewDisplayModeChangedEventArgs
NavigationViewDisplayModeChangedEventArgs
NavigationViewDisplayModeChangedEventArgs Class
Provides data for the NavigationView.DisplayModeChanged event.

D eclaration
public : sealed class NavigationViewDisplayModeChangedEventArgs :
INavigationViewDisplayModeChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::NavigationViewDisplayModeChangedEventArgs :
INavigationViewDisplayModeChangedEventArgs
public sealed class NavigationViewDisplayModeChangedEventArgs :
INavigationViewDisplayModeChangedEventArgs

I nheritance H ierarchy
None

Properties
DisplayMode
DisplayMode
DisplayMode

Gets the new display mode.


NavigationViewDisplayModeChangedEventArgs.Display
Mode NavigationViewDisplayModeChangedEventArgs.
DisplayMode NavigationViewDisplayModeChanged
EventArgs.DisplayMode
I n this Article
Edit
Gets the new display mode.
public : NavigationViewDisplayMode DisplayMode { get; }
NavigationViewDisplayMode DisplayMode();
public NavigationViewDisplayMode DisplayMode { get; }

Returns
NavigationViewDisplayMode
The new display mode.
NavigationViewItem NavigationViewItem Navigation
ViewItem Class
Represents the container for an item in a NavigationView control.

D eclaration
public : class NavigationViewItem : NavigationViewItemBase, INavigationViewItem,
INavigationViewItem2
struct winrt::Windows::UI::Xaml::Controls::NavigationViewItem : NavigationViewItemBase,
INavigationViewItem, INavigationViewItem2
public class NavigationViewItem : NavigationViewItemBase, INavigationViewItem,
INavigationViewItem2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem
ListViewItem
NavigationViewItemBase

Remarks
Note that prior to Windows 10, version 1809 (10.0; Build 17763) you could only place NavigationViewItems in
NavigationView.MenuItems.

Constructors
NavigationViewItem()
NavigationViewItem()
NavigationViewItem()

Initializes a new instance of the NavigationViewItem class.

Properties
CompactPaneLength
CompactPaneLength
CompactPaneLength

Gets the CompactPaneLength of the NavigationView that hosts this item.

CompactPaneLengthProperty
CompactPaneLengthProperty
CompactPaneLengthProperty

Identifies the CompactPaneLength dependency property.


Icon
Icon
Icon

Gets or sets the icon to show next to the menu item text.

IconProperty
IconProperty
IconProperty

Identifies the Icon dependency property.

SelectsOnInvoked
SelectsOnInvoked
SelectsOnInvoked

Gets or sets a value that indicates whether invoking a navigation menu item also selects it.

SelectsOnInvokedProperty
SelectsOnInvokedProperty
SelectsOnInvokedProperty

Identifies the SelectsOnInvoked dependency property.


NavigationViewItem.CompactPaneLength Navigation
ViewItem.CompactPaneLength NavigationViewItem.
CompactPaneLength
I n this Article
Edit
Gets the CompactPaneLength of the NavigationView that hosts this item.
public : double CompactPaneLength { get; }
double CompactPaneLength();
public double CompactPaneLength { get; }

Returns
double
The CompactPaneLength of the NavigationView that hosts this item.
NavigationViewItem.CompactPaneLengthProperty
NavigationViewItem.CompactPaneLengthProperty
NavigationViewItem.CompactPaneLengthProperty
I n this Article
Edit
Identifies the CompactPaneLength dependency property.
public : static DependencyProperty CompactPaneLengthProperty { get; }
static DependencyProperty CompactPaneLengthProperty();
public static DependencyProperty CompactPaneLengthProperty { get; }

Returns
DependencyProperty
The identifier for the CompactPaneLength dependency property.
NavigationViewItem.Icon NavigationViewItem.Icon
NavigationViewItem.Icon
I n this Article
Edit
Gets or sets the icon to show next to the menu item text.
public : IconElement Icon { get; set; }
IconElement Icon();

void Icon(IconElement icon);


public IconElement Icon { get; set; }

<NavigationViewItem Icon="symbolName" .../>

Returns
IconElement
The icon to show next to the menu item text. The default in null.

Remarks
You can assign a value from the Symbol enumeration, or a Unicode string that references a glyph in the Segoe MDL2
Assets font.
You can use the Character Map application that comes with Windows to browse the font's glyphs and find their
Unicode values. Then, use the format "&#x/(UNICODE );" in XAML, or the format "\u/(UNICODE )" in code, where
(UNICODE ) is the value of the glyph that indicates the location in the font file.

The Segoe MDL2 Assets font ships with Windows 10, and new glyphs might be added in every release. You should
verify that the Unicode value you choose is available in the minimum SDK build version your project targets.
NavigationViewItem.IconProperty NavigationViewItem.
IconProperty NavigationViewItem.IconProperty
I n this Article
Edit
Identifies the Icon dependency property.
public : static DependencyProperty IconProperty { get; }
static DependencyProperty IconProperty();
public static DependencyProperty IconProperty { get; }

Returns
DependencyProperty
The identifier for the Icon dependency property.
NavigationViewItem NavigationViewItem Navigation
ViewItem
I n this Article
Edit
Initializes a new instance of the NavigationViewItem class.
public : NavigationViewItem()
NavigationViewItem() const;
public NavigationViewItem()
NavigationViewItem.SelectsOnInvoked NavigationView
Item.SelectsOnInvoked NavigationViewItem.SelectsOn
Invoked
I n this Article
Edit
Gets or sets a value that indicates whether invoking a navigation menu item also selects it.
public : Platform::Boolean SelectsOnInvoked { get; set; }
bool SelectsOnInvoked();

void SelectsOnInvoked(bool selectsoninvoked);


public bool SelectsOnInvoked { get; set; }

Returns
bool
true if invoking a navigation menu item also selects it; otherwise, false. The default is true.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationViewItem.SelectsOnInvokedProperty
NavigationViewItem.SelectsOnInvokedProperty
NavigationViewItem.SelectsOnInvokedProperty
I n this Article
Edit
Identifies the SelectsOnInvoked dependency property.
public : static DependencyProperty SelectsOnInvokedProperty { get; }
static DependencyProperty SelectsOnInvokedProperty();
public static DependencyProperty SelectsOnInvokedProperty { get; }

Returns
DependencyProperty
The identifier for the SelectsOnInvoked dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationViewItemBase NavigationViewItemBase
NavigationViewItemBase Class
Base class for NavigationView menu items.

D eclaration
public : class NavigationViewItemBase : ListViewItem, INavigationViewItemBase
struct winrt::Windows::UI::Xaml::Controls::NavigationViewItemBase : ListViewItem,
INavigationViewItemBase
public class NavigationViewItemBase : ListViewItem, INavigationViewItemBase

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem
ListViewItem
NavigationViewItemHeader NavigationViewItemHeader
NavigationViewItemHeader Class
Represents a header for a group of menu items in a NavigationMenu.

D eclaration
public : class NavigationViewItemHeader : NavigationViewItemBase, INavigationViewItemHeader
struct winrt::Windows::UI::Xaml::Controls::NavigationViewItemHeader : NavigationViewItemBase,
INavigationViewItemHeader
public class NavigationViewItemHeader : NavigationViewItemBase, INavigationViewItemHeader

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem
ListViewItem
NavigationViewItemBase

Constructors
NavigationViewItemHeader()
NavigationViewItemHeader()
NavigationViewItemHeader()

Initializes a new instance of the NavigationViewItemHeader class.


NavigationViewItemHeader NavigationViewItemHeader
NavigationViewItemHeader
I n this Article
Edit
Initializes a new instance of the NavigationViewItemHeader class.
public : NavigationViewItemHeader()
NavigationViewItemHeader() const;
public NavigationViewItemHeader()
NavigationViewItemInvokedEventArgs NavigationView
ItemInvokedEventArgs NavigationViewItemInvokedEvent
Args Class
Provides event data for the NavigationView.ItemInvoked event.

D eclaration
public : sealed class NavigationViewItemInvokedEventArgs : INavigationViewItemInvokedEventArgs,
INavigationViewItemInvokedEventArgs2
struct winrt::Windows::UI::Xaml::Controls::NavigationViewItemInvokedEventArgs :
INavigationViewItemInvokedEventArgs, INavigationViewItemInvokedEventArgs2
public sealed class NavigationViewItemInvokedEventArgs : INavigationViewItemInvokedEventArgs,
INavigationViewItemInvokedEventArgs2

I nheritance H ierarchy
None

Constructors
NavigationViewItemInvokedEventArgs()
NavigationViewItemInvokedEventArgs()
NavigationViewItemInvokedEventArgs()

Initializes a new instance of the NavigationViewItemInvokedEventArgs class.

Properties
InvokedItem
InvokedItem
InvokedItem

Gets a reference to the invoked item.

InvokedItemContainer
InvokedItemContainer
InvokedItemContainer

Gets the container for the invoked item.

IsSettingsInvoked
IsSettingsInvoked
IsSettingsInvoked

Gets a value that indicates whether the InvokedItem is the menu item for Settings.

RecommendedNavigationTransitionInfo
RecommendedNavigationTransitionInfo
RecommendedNavigationTransitionInfo

Gets the navigation transition recommended for the direction of the navigation.
NavigationViewItemInvokedEventArgs.InvokedItem
NavigationViewItemInvokedEventArgs.InvokedItem
NavigationViewItemInvokedEventArgs.InvokedItem
I n this Article
Edit
Gets a reference to the invoked item.
public : Platform::Object InvokedItem { get; }
winrt::Windows::Foundation::IInspectable InvokedItem();
public object InvokedItem { get; }

Returns
object
The invoked item.

Remarks
This property gets the data item that was invoked. To get the NavigationViewItem that is the container for the invoked
item, use the InvokedItemContainer property.
NavigationViewItemInvokedEventArgs.InvokedItem
Container NavigationViewItemInvokedEventArgs.Invoked
ItemContainer NavigationViewItemInvokedEventArgs.
InvokedItemContainer
I n this Article
Edit
Gets the container for the invoked item.
public : NavigationViewItemBase InvokedItemContainer { get; }
NavigationViewItemBase InvokedItemContainer();
public NavigationViewItemBase InvokedItemContainer { get; }

Returns
NavigationViewItemBase
The container for the invoked item.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
This property gets the NavigationViewItem that is the container for the invoked item. To get the data item that was
invoked, use the InvokedItem property.
NavigationViewItemInvokedEventArgs.IsSettingsInvoked
NavigationViewItemInvokedEventArgs.IsSettingsInvoked
NavigationViewItemInvokedEventArgs.IsSettingsInvoked
I n this Article
Edit
Gets a value that indicates whether the InvokedItem is the menu item for Settings.
public : Platform::Boolean IsSettingsInvoked { get; }
bool IsSettingsInvoked();
public bool IsSettingsInvoked { get; }

Returns
bool
true if the InvokedItem is the menu item for Settings; otherwise, false.
NavigationViewItemInvokedEventArgs NavigationView
ItemInvokedEventArgs NavigationViewItemInvokedEvent
Args
I n this Article
Edit
Initializes a new instance of the NavigationViewItemInvokedEventArgs class.
public : NavigationViewItemInvokedEventArgs()
NavigationViewItemInvokedEventArgs() const;
public NavigationViewItemInvokedEventArgs()
NavigationViewItemInvokedEventArgs.Recommended
NavigationTransitionInfo NavigationViewItemInvoked
EventArgs.RecommendedNavigationTransitionInfo
NavigationViewItemInvokedEventArgs.Recommended
NavigationTransitionInfo
I n this Article
Edit
Gets the navigation transition recommended for the direction of the navigation.
public : NavigationTransitionInfo RecommendedNavigationTransitionInfo { get; }
NavigationTransitionInfo RecommendedNavigationTransitionInfo();
public NavigationTransitionInfo RecommendedNavigationTransitionInfo { get; }

Returns
NavigationTransitionInfo
The navigation transition recommended for the direction of the navigation.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationViewItemSeparator NavigationViewItem
Separator NavigationViewItemSeparator Class
Represents a line that separates menu items in a NavigationMenu.

D eclaration
public : class NavigationViewItemSeparator : NavigationViewItemBase,
INavigationViewItemSeparator
struct winrt::Windows::UI::Xaml::Controls::NavigationViewItemSeparator : NavigationViewItemBase,
INavigationViewItemSeparator
public class NavigationViewItemSeparator : NavigationViewItemBase, INavigationViewItemSeparator

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem
ListViewItem
NavigationViewItemBase

Constructors
NavigationViewItemSeparator()
NavigationViewItemSeparator()
NavigationViewItemSeparator()

Initializes a new instance of the NavigationViewItemSeparator class.


NavigationViewItemSeparator NavigationViewItem
Separator NavigationViewItemSeparator
I n this Article
Edit
Initializes a new instance of the NavigationViewItemSeparator class.
public : NavigationViewItemSeparator()
NavigationViewItemSeparator() const;
public NavigationViewItemSeparator()
NavigationViewList NavigationViewList NavigationView
List Class
Represents a control that displays menu items in a NavigationView control.

D eclaration
public : class NavigationViewList : ListView, INavigationViewList
struct winrt::Windows::UI::Xaml::Controls::NavigationViewList : ListView, INavigationViewList
public class NavigationViewList : ListView, INavigationViewList

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Selector
ListViewBase
ListView

Constructors
NavigationViewList()
NavigationViewList()
NavigationViewList()

Initializes a new instance of the NavigationViewList class.


NavigationViewList NavigationViewList NavigationView
List
I n this Article
Edit
Initializes a new instance of the NavigationViewList class.
public : NavigationViewList()
NavigationViewList() const;
public NavigationViewList()
NavigationViewOverflowLabelMode NavigationView
OverflowLabelMode NavigationViewOverflowLabel
Mode Enum
Defines constants that specify the label for the overflow button in a NavigationView.

D eclaration
public : enum class NavigationViewOverflowLabelMode
enum class winrt::Windows::UI::Xaml::Controls::NavigationViewOverflowLabelMode : int32_t
public enum NavigationViewOverflowLabelMode

I nheritance H ierarchy
None

Remarks
The overflow menu is shown only when NavigationView.PaneDisplayMode is Top and the window is not wide enough
to show all navigation menu items.

Fields
MoreLabel MoreLabel MoreLabel The text label "More" is shown next to the chevron.

NoLabel NoLabel NoLabel No text label is shown, only a chevron.


NavigationViewPaneClosingEventArgs NavigationView
PaneClosingEventArgs NavigationViewPaneClosingEvent
Args Class
Provides data for the NavigationView.PaneClosing event.

D eclaration
public : sealed class NavigationViewPaneClosingEventArgs : INavigationViewPaneClosingEventArgs
struct winrt::Windows::UI::Xaml::Controls::NavigationViewPaneClosingEventArgs :
INavigationViewPaneClosingEventArgs
public sealed class NavigationViewPaneClosingEventArgs : INavigationViewPaneClosingEventArgs

I nheritance H ierarchy
None

Properties
Cancel
Cancel
Cancel

Gets or sets a value that indicates whether the event should be canceled.
NavigationViewPaneClosingEventArgs.Cancel Navigation
ViewPaneClosingEventArgs.Cancel NavigationViewPane
ClosingEventArgs.Cancel
I n this Article
Edit
Gets or sets a value that indicates whether the event should be canceled.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
true to cancel the event; otherwise, false. The default is false.
NavigationViewPaneDisplayMode NavigationViewPane
DisplayMode NavigationViewPaneDisplayMode Enum
Defines constants that specify how and where the NavigationView pane is shown.

D eclaration
public : enum class NavigationViewPaneDisplayMode
enum class winrt::Windows::UI::Xaml::Controls::NavigationViewPaneDisplayMode : int32_t
public enum NavigationViewPaneDisplayMode

I nheritance H ierarchy
None

Fields
Auto Auto Auto The pane is shown on the left side of the control, and changes between minimal, compact, and
full states depending on the width of the window.

Left Left Left The pane is shown on the left side of the control in its fully open state.

LeftCompact The pane is shown on the left side of the control. Only the pane icons are shown by default.
LeftCompact
LeftCompact

LeftMinimal The pane is shown on the left side of the control. Only the pane menu button is shown by
LeftMinimal default.
LeftMinimal

Top Top Top The pane is shown at the top of the control.

See Also
NavigationViewSelectionChangedEventArgs Navigation
ViewSelectionChangedEventArgs NavigationView
SelectionChangedEventArgs Class
Provides data for the NavigationView.SelectionChanged event.

D eclaration
public : sealed class NavigationViewSelectionChangedEventArgs :
INavigationViewSelectionChangedEventArgs, INavigationViewSelectionChangedEventArgs2
struct winrt::Windows::UI::Xaml::Controls::NavigationViewSelectionChangedEventArgs :
INavigationViewSelectionChangedEventArgs, INavigationViewSelectionChangedEventArgs2
public sealed class NavigationViewSelectionChangedEventArgs :
INavigationViewSelectionChangedEventArgs, INavigationViewSelectionChangedEventArgs2

I nheritance H ierarchy
None

Properties
IsSettingsSelected
IsSettingsSelected
IsSettingsSelected

Gets a value that indicates whether the SelectedItem is the menu item for Settings.

RecommendedNavigationTransitionInfo
RecommendedNavigationTransitionInfo
RecommendedNavigationTransitionInfo

Gets the navigation transition recommended for the direction of the navigation.

SelectedItem
SelectedItem
SelectedItem

Gets the newly selected menu item.

SelectedItemContainer
SelectedItemContainer
SelectedItemContainer

Gets the container for the selected item.


NavigationViewSelectionChangedEventArgs.IsSettings
Selected NavigationViewSelectionChangedEventArgs.Is
SettingsSelected NavigationViewSelectionChangedEvent
Args.IsSettingsSelected
I n this Article
Edit
Gets a value that indicates whether the SelectedItem is the menu item for Settings.
public : Platform::Boolean IsSettingsSelected { get; }
bool IsSettingsSelected();
public bool IsSettingsSelected { get; }

Returns
bool
true if the SelectedItem is the menu item for Settings; otherwise, false.
NavigationViewSelectionChangedEventArgs.
RecommendedNavigationTransitionInfo NavigationView
SelectionChangedEventArgs.RecommendedNavigation
TransitionInfo NavigationViewSelectionChangedEvent
Args.RecommendedNavigationTransitionInfo
I n this Article
Edit
Gets the navigation transition recommended for the direction of the navigation.
public : NavigationTransitionInfo RecommendedNavigationTransitionInfo { get; }
NavigationTransitionInfo RecommendedNavigationTransitionInfo();
public NavigationTransitionInfo RecommendedNavigationTransitionInfo { get; }

Returns
NavigationTransitionInfo
The navigation transition recommended for the direction of the navigation.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


NavigationViewSelectionChangedEventArgs.Selected
Item NavigationViewSelectionChangedEventArgs.
SelectedItem NavigationViewSelectionChangedEvent
Args.SelectedItem
I n this Article
Edit
Gets the newly selected menu item.
public : Platform::Object SelectedItem { get; }
winrt::Windows::Foundation::IInspectable SelectedItem();
public object SelectedItem { get; }

Returns
object
The newly selected menu item.

Remarks
This property gets the data item that was selected. To get the NavigationViewItem that is the container for the selected
item, use the SelectedItemContainer property.
NavigationViewSelectionChangedEventArgs.Selected
ItemContainer NavigationViewSelectionChangedEvent
Args.SelectedItemContainer NavigationViewSelection
ChangedEventArgs.SelectedItemContainer
I n this Article
Edit
Gets the container for the selected item.
public : NavigationViewItemBase SelectedItemContainer { get; }
NavigationViewItemBase SelectedItemContainer();
public NavigationViewItemBase SelectedItemContainer { get; }

Returns
NavigationViewItemBase
The container for the selected item.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
This property gets the NavigationViewItem that is the container for the selected item. To get the data item that was
selected, use the SelectedItem property.
NavigationViewSelectionFollowsFocus NavigationView
SelectionFollowsFocus NavigationViewSelectionFollows
Focus Enum
Defines constants that specify whether item selection changes when keyboard focus changes in a NavigationView.

D eclaration
public : enum class NavigationViewSelectionFollowsFocus
enum class winrt::Windows::UI::Xaml::Controls::NavigationViewSelectionFollowsFocus : int32_t
public enum NavigationViewSelectionFollowsFocus

I nheritance H ierarchy
None

Fields
Disabled Disabled Disabled Selection does not change when keyboard focus changes.

Enabled Enabled Enabled Selection changes when keyboard focus changes.


NavigationViewShoulderNavigationEnabled Navigation
ViewShoulderNavigationEnabled NavigationView
ShoulderNavigationEnabled Enum
Defines constants that specify when gamepad bumpers can be used to navigate the top-level navigation items in a
NavigationView.

D eclaration
public : enum class NavigationViewShoulderNavigationEnabled
enum class winrt::Windows::UI::Xaml::Controls::NavigationViewShoulderNavigationEnabled : int32_t
public enum NavigationViewShoulderNavigationEnabled

I nheritance H ierarchy
None

Fields
Always Always Always Gamepad bumpers always navigate the top-level navigation
items.

Never Never Never Gamepad bumpers never navigate the top-level navigation items.

WhenSelectionFollowsFocus Gamepad bumpers navigate the top-level navigation items when


WhenSelectionFollowsFocus the SelectionFollowsFocus property is Enabled.
WhenSelectionFollowsFocus

See Also
NavigationViewTemplateSettings NavigationView
TemplateSettings NavigationViewTemplateSettings Class
Provides calculated values that can be referenced as TemplatedParent sources when defining templates for a
NavigationView. Not intended for general use.

D eclaration
public : class NavigationViewTemplateSettings : DependencyObject,
INavigationViewTemplateSettings
struct winrt::Windows::UI::Xaml::Controls::NavigationViewTemplateSettings : DependencyObject,
INavigationViewTemplateSettings
public class NavigationViewTemplateSettings : DependencyObject, INavigationViewTemplateSettings

I nheritance H ierarchy
DependencyObject

Constructors
NavigationViewTemplateSettings()
NavigationViewTemplateSettings()
NavigationViewTemplateSettings()

Initializes a new instance of the NavigationViewTemplateSettings class.

Properties
BackButtonVisibility
BackButtonVisibility
BackButtonVisibility

Gets the visibility of the back button.

BackButtonVisibilityProperty
BackButtonVisibilityProperty
BackButtonVisibilityProperty

Identifies the BackButtonVisibility dependency property.

LeftPaneVisibility
LeftPaneVisibility
LeftPaneVisibility

Gets the visibility of the left pane.

LeftPaneVisibilityProperty
LeftPaneVisibilityProperty
LeftPaneVisibilityProperty

Identifies the LeftPaneVisibility dependency property.

OverflowButtonVisibility
OverflowButtonVisibility
OverflowButtonVisibility

Gets the visibility of the overflow button.

OverflowButtonVisibilityProperty
OverflowButtonVisibilityProperty
OverflowButtonVisibilityProperty

Identifies the OverflowButtonVisibility dependency property.

PaneToggleButtonVisibility
PaneToggleButtonVisibility
PaneToggleButtonVisibility

Gets the visibility of the pane toggle button.

PaneToggleButtonVisibilityProperty
PaneToggleButtonVisibilityProperty
PaneToggleButtonVisibilityProperty

Identifies the PaneToggleButtonVisibility dependency property.

SingleSelectionFollowsFocus
SingleSelectionFollowsFocus
SingleSelectionFollowsFocus

Gets the SelectionFollowsFocus value.

SingleSelectionFollowsFocusProperty
SingleSelectionFollowsFocusProperty
SingleSelectionFollowsFocusProperty

Identifies the SingleSelectionFollowsFocus dependency property.

TopPadding
TopPadding
TopPadding

Gets the padding value of the top pane.


TopPaddingProperty
TopPaddingProperty
TopPaddingProperty

Identifies the TopPadding dependency property.

TopPaneVisibility
TopPaneVisibility
TopPaneVisibility

Gets the visibility of the top pane.

TopPaneVisibilityProperty
TopPaneVisibilityProperty
TopPaneVisibilityProperty

Identifies the TopPaneVisibility dependency property.


NavigationViewTemplateSettings.BackButtonVisibility
NavigationViewTemplateSettings.BackButtonVisibility
NavigationViewTemplateSettings.BackButtonVisibility
I n this Article
Edit
Gets the visibility of the back button.
public : Visibility BackButtonVisibility { get; }
Visibility BackButtonVisibility();
public Visibility BackButtonVisibility { get; }

Returns
Visibility
The visibility of the back button.
NavigationViewTemplateSettings.BackButtonVisibility
Property NavigationViewTemplateSettings.BackButton
VisibilityProperty NavigationViewTemplateSettings.Back
ButtonVisibilityProperty
I n this Article
Edit
Identifies the BackButtonVisibility dependency property.
public : static DependencyProperty BackButtonVisibilityProperty { get; }
static DependencyProperty BackButtonVisibilityProperty();
public static DependencyProperty BackButtonVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the BackButtonVisibility dependency property.
NavigationViewTemplateSettings.LeftPaneVisibility
NavigationViewTemplateSettings.LeftPaneVisibility
NavigationViewTemplateSettings.LeftPaneVisibility
I n this Article
Edit
Gets the visibility of the left pane.
public : Visibility LeftPaneVisibility { get; }
Visibility LeftPaneVisibility();
public Visibility LeftPaneVisibility { get; }

Returns
Visibility
The visibility of the left pane.
NavigationViewTemplateSettings.LeftPaneVisibility
Property NavigationViewTemplateSettings.LeftPane
VisibilityProperty NavigationViewTemplateSettings.Left
PaneVisibilityProperty
I n this Article
Edit
Identifies the LeftPaneVisibility dependency property.
public : static DependencyProperty LeftPaneVisibilityProperty { get; }
static DependencyProperty LeftPaneVisibilityProperty();
public static DependencyProperty LeftPaneVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the LeftPaneVisibility dependency property.
NavigationViewTemplateSettings NavigationView
TemplateSettings NavigationViewTemplateSettings
I n this Article
Edit
Initializes a new instance of the NavigationViewTemplateSettings class.
public : NavigationViewTemplateSettings()
NavigationViewTemplateSettings() const;
public NavigationViewTemplateSettings()
NavigationViewTemplateSettings.OverflowButton
Visibility NavigationViewTemplateSettings.Overflow
ButtonVisibility NavigationViewTemplateSettings.
OverflowButtonVisibility
I n this Article
Edit
Gets the visibility of the overflow button.
public : Visibility OverflowButtonVisibility { get; }
Visibility OverflowButtonVisibility();
public Visibility OverflowButtonVisibility { get; }

Returns
Visibility
The visibility of the overflow button.
NavigationViewTemplateSettings.OverflowButton
VisibilityProperty NavigationViewTemplateSettings.
OverflowButtonVisibilityProperty NavigationView
TemplateSettings.OverflowButtonVisibilityProperty
I n this Article
Edit
Identifies the OverflowButtonVisibility dependency property.
public : static DependencyProperty OverflowButtonVisibilityProperty { get; }
static DependencyProperty OverflowButtonVisibilityProperty();
public static DependencyProperty OverflowButtonVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the OverflowButtonVisibility dependency property.
NavigationViewTemplateSettings.PaneToggleButton
Visibility NavigationViewTemplateSettings.PaneToggle
ButtonVisibility NavigationViewTemplateSettings.Pane
ToggleButtonVisibility
I n this Article
Edit
Gets the visibility of the pane toggle button.
public : Visibility PaneToggleButtonVisibility { get; }
Visibility PaneToggleButtonVisibility();
public Visibility PaneToggleButtonVisibility { get; }

Returns
Visibility
The visibility of the pane toggle button.
NavigationViewTemplateSettings.PaneToggleButton
VisibilityProperty NavigationViewTemplateSettings.Pane
ToggleButtonVisibilityProperty NavigationViewTemplate
Settings.PaneToggleButtonVisibilityProperty
I n this Article
Edit
Identifies the PaneToggleButtonVisibility dependency property.
public : static DependencyProperty PaneToggleButtonVisibilityProperty { get; }
static DependencyProperty PaneToggleButtonVisibilityProperty();
public static DependencyProperty PaneToggleButtonVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the PaneToggleButtonVisibility dependency property.
NavigationViewTemplateSettings.SingleSelectionFollows
Focus NavigationViewTemplateSettings.SingleSelection
FollowsFocus NavigationViewTemplateSettings.Single
SelectionFollowsFocus
I n this Article
Edit
Gets the SelectionFollowsFocus value.
public : Platform::Boolean SingleSelectionFollowsFocus { get; }
bool SingleSelectionFollowsFocus();
public bool SingleSelectionFollowsFocus { get; }

Returns
bool
The SelectionFollowsFocus value.
NavigationViewTemplateSettings.SingleSelectionFollows
FocusProperty NavigationViewTemplateSettings.Single
SelectionFollowsFocusProperty NavigationViewTemplate
Settings.SingleSelectionFollowsFocusProperty
I n this Article
Edit
Identifies the SingleSelectionFollowsFocus dependency property.
public : static DependencyProperty SingleSelectionFollowsFocusProperty { get; }
static DependencyProperty SingleSelectionFollowsFocusProperty();
public static DependencyProperty SingleSelectionFollowsFocusProperty { get; }

Returns
DependencyProperty
The identifier for the SingleSelectionFollowsFocus dependency property.
NavigationViewTemplateSettings.TopPadding Navigation
ViewTemplateSettings.TopPadding NavigationView
TemplateSettings.TopPadding
I n this Article
Edit
Gets the padding value of the top pane.
public : double TopPadding { get; }
double TopPadding();
public double TopPadding { get; }

Returns
double
The padding value of the top pane.
NavigationViewTemplateSettings.TopPaddingProperty
NavigationViewTemplateSettings.TopPaddingProperty
NavigationViewTemplateSettings.TopPaddingProperty
I n this Article
Edit
Identifies the TopPadding dependency property.
public : static DependencyProperty TopPaddingProperty { get; }
static DependencyProperty TopPaddingProperty();
public static DependencyProperty TopPaddingProperty { get; }

Returns
DependencyProperty
The identifier for the TopPadding dependency property.
NavigationViewTemplateSettings.TopPaneVisibility
NavigationViewTemplateSettings.TopPaneVisibility
NavigationViewTemplateSettings.TopPaneVisibility
I n this Article
Edit
Gets the visibility of the top pane.
public : Visibility TopPaneVisibility { get; }
Visibility TopPaneVisibility();
public Visibility TopPaneVisibility { get; }

Returns
Visibility
The visibility of the top pane.
NavigationViewTemplateSettings.TopPaneVisibility
Property NavigationViewTemplateSettings.TopPane
VisibilityProperty NavigationViewTemplateSettings.Top
PaneVisibilityProperty
I n this Article
Edit
Identifies the TopPaneVisibility dependency property.
public : static DependencyProperty TopPaneVisibilityProperty { get; }
static DependencyProperty TopPaneVisibilityProperty();
public static DependencyProperty TopPaneVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the TopPaneVisibility dependency property.
NotifyEventArgs NotifyEventArgs NotifyEventArgs Class
Provides data for the ScriptNotify event.

D eclaration
public : sealed class NotifyEventArgs : INotifyEventArgs, INotifyEventArgs2
struct winrt::Windows::UI::Xaml::Controls::NotifyEventArgs : INotifyEventArgs, INotifyEventArgs2
public sealed class NotifyEventArgs : INotifyEventArgs, INotifyEventArgs2

I nheritance H ierarchy
None

Properties
CallingUri
CallingUri
CallingUri

Gets the Uniform Resource Identifier (URI) of the page containing the script that raised the ScriptNotify event.

Value
Value
Value

Gets the method name as passed to the application.


NotifyEventArgs.CallingUri NotifyEventArgs.CallingUri
NotifyEventArgs.CallingUri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the page containing the script that raised the ScriptNotify event.
public : Uri CallingUri { get; }
Uri CallingUri();
public Uri CallingUri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the page that raised the event.
NotifyEventArgs.Value NotifyEventArgs.Value Notify
EventArgs.Value
I n this Article
Edit
Gets the method name as passed to the application.
public : Platform::String Value { get; }
winrt::hstring Value();
public string Value { get; }

Returns
string
The JavaScript method name.
NotifyEventHandler NotifyEventHandler NotifyEvent
Handler Delegate
Represents the method that will handle the ScriptNotify event.

D eclaration
public : delegate void NotifyEventHandler(Platform::Object sender, NotifyEventArgs e)
struct NotifyEventHandler : winrt::Windows::Foundation::IUnknown
{
NotifyEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> NotifyEventHandler(L lambda);
template <typename F> NotifyEventHandler(F* function);
template <typename O, typename M> NotifyEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::NotifyEventArgs const& e) const;
};
public delegate void NotifyEventHandler(Object sender, NotifyEventArgs e)

I nheritance H ierarchy
None
Orientation Orientation Orientation Enum
Defines constants that specify the different orientations that a control or layout can have.

D eclaration
public : enum class Orientation
enum class winrt::Windows::UI::Xaml::Controls::Orientation : int32_t
public enum Orientation

I nheritance H ierarchy
None

Fields
Horizontal Horizontal Horizontal The control or layout should be horizontally oriented.

Vertical Vertical Vertical The control or layout should be vertically oriented.


Page Page Page Class
Represents content that a Frame control can navigate to.

D eclaration
public : class Page : UserControl, IPage, IPageOverrides
struct winrt::Windows::UI::Xaml::Controls::Page : UserControl, IPage, IPageOverrides
public class Page : UserControl, IPage, IPageOverrides

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
UserControl

Remarks
The Page class encapsulates content that the Frame control can navigate to. You will generally create your own page
types that derive from the Page class, and use Page (or a custom type) as the root element for the XAML -declared
content.
Page is a UserControl, therefore you can declare a single XAML object element as Content for the Page. Most pages
contain more than one UI element in total. You typically use a panel or items control as the immediate child of a Page,
so that you can have the page contain and compose multiple elements of a UI.
You can also specify app bars, with the TopAppBar and BottomAppBar properties. You must use property element
syntax for these properties to contain the AppBar values in XAML.
You can create new pages using the Add | New Item menu option for your project in Microsoft Visual Studio. These
all create XAML files where the root is a Page class, and the code-behind class derives from Page. Some page item
templates add navigation support and additional features. For more info on the Microsoft Visual Studio item
templates, see C#, VB, and C++ item templates for .
Create as many pages as you need to present the content in your app, and then navigate to those pages by calling the
Frame.Navigate method and passing in a type reference for the page to navigate to. By type reference, we mean an
instance of a class that identifies a type in the type system, for the language you are using. For Microsoft .NET that type
is System.Type, and you can get a System.Type reference from a page class' name by using the operators typeof (C#)
or GetType (Visual Basic). For Visual C++ component extensions (C++/CX), use TypeName. Initialize a TypeName by
using the typeid of a class. typeid is a component extension that can be called for any runtime class.
Through Frame.Navigate, you can also pass in a parameter object to initialize the page to a particular state. The
parameter object is loosely typed but serialization of navigation history only works for basic types (see Remarks in
Frame.Navigate(Type, Object) ). Pages that are navigated to as part of an activation generally pass data from the
activation. Other navigation scenarios such as search result pages also have expectations of what info will be contained
in the parameter.
By default, each navigation creates a new instance of the specific Page (or subclass) requested, and disposes the
previous page instance. This happens even when navigating back to a previously visited page or when the new page
type is the same as the previous page type. Apps that involve frequent navigation to the same pages can cache and
reuse the page instances to make navigation more efficient. To do this, set the Frame.CacheSize property to specify
how many pages to cache. For each page type that you want to cache, you must also set the NavigationCacheMode
property to either Enabled or Required. Pages with a Required cache mode are cached regardless of the CacheSize
value, and do not count against the CacheSize total.
You can override the page OnNavigatedTo, OnNavigatingFrom, and OnNavigatedFrom methods to perform tasks
such as initializing and saving the page state. OnNavigatingFrom can be used to cancel a navigation by setting a
Cancel property in the event data from your handler.

Constructors
Page()
Page()
Page()

Initializes a new instance of the Page class.

Properties
BottomAppBar
BottomAppBar
BottomAppBar

Gets a reference to an AppBar displayed at the bottom of the page, if any.

BottomAppBarProperty
BottomAppBarProperty
BottomAppBarProperty

Identifies the BottomAppBar dependency property.

Frame
Frame
Frame

Gets the controlling Frame for the Page content.

FrameProperty
FrameProperty
FrameProperty

Identifies the Frame dependency property.

NavigationCacheMode
NavigationCacheMode
NavigationCacheMode

Gets or sets the navigation mode that indicates whether this Page is cached, and the period of time that the cache
entry should persist.
TopAppBar
TopAppBar
TopAppBar

Gets a reference to an AppBar displayed at the top of the page, if any.

TopAppBarProperty
TopAppBarProperty
TopAppBarProperty

Identifies the TopAppBar dependency property.

Methods
OnNavigatedFrom(NavigationEventArgs)
OnNavigatedFrom(NavigationEventArgs)
OnNavigatedFrom(NavigationEventArgs)

Invoked immediately after the Page is unloaded and is no longer the current source of a parent Frame.

OnNavigatedTo(NavigationEventArgs)
OnNavigatedTo(NavigationEventArgs)
OnNavigatedTo(NavigationEventArgs)

Invoked when the Page is loaded and becomes the current source of a parent Frame.

OnNavigatingFrom(NavigatingCancelEventArgs)
OnNavigatingFrom(NavigatingCancelEventArgs)
OnNavigatingFrom(NavigatingCancelEventArgs)

Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.

See Also
Frame
UserControl
Frame
Frame
Frame
Page.BottomAppBar Page.BottomAppBar Page.Bottom
AppBar
I n this Article
Edit
Gets a reference to an AppBar displayed at the bottom of the page, if any.
public : AppBar BottomAppBar { get; set; }
AppBar BottomAppBar();

void BottomAppBar(AppBar bottomappbar);


public AppBar BottomAppBar { get; set; }

<Page ...>
<Page.BottomAppBar>
<AppBar .../>
</Page.BottomAppBar>
</Page>

Returns
AppBar
A reference to an AppBar displayed at the bottom of the page, or null.

Examples
For example code that adds an AppBar to a page, see Quickstart: adding app bars or How to share an app bar across
pages. For a complete sample that uses many of the Page and Frame features together, see XAML Navigation sample.

Remarks
In XAML, make sure you specify the Page.BottomAppBar property element in the same area as other property
elements that may already be defined, like Page.TopAppBar or Page.Resources . The XAML language enforces that
you can't mix the property elements between the XAML content that is setting Content, such as the typical root Grid
element. For more info on XAML syntax, see XAML syntax guide.
See AppBar
Also Quickstart: adding app bars
Page.BottomAppBarProperty Page.BottomAppBar
Property Page.BottomAppBarProperty
I n this Article
Edit
Identifies the BottomAppBar dependency property.
public : static DependencyProperty BottomAppBarProperty { get; }
static DependencyProperty BottomAppBarProperty();
public static DependencyProperty BottomAppBarProperty { get; }

Returns
DependencyProperty
The identifier for the BottomAppBar dependency property.
Page.Frame Page.Frame Page.Frame
I n this Article
Edit
Gets the controlling Frame for the Page content.

public : Frame Frame { get; }


Frame Frame();
public Frame Frame { get; }

Returns
Frame
The controlling Frame for the Page content.
Page.FrameProperty Page.FrameProperty Page.Frame
Property
I n this Article
Edit
Identifies the Frame dependency property.
public : static DependencyProperty FrameProperty { get; }
static DependencyProperty FrameProperty();
public static DependencyProperty FrameProperty { get; }

Returns
DependencyProperty
The identifier for the Frame dependency property.
Page.NavigationCacheMode Page.NavigationCache
Mode Page.NavigationCacheMode
I n this Article
Edit
Gets or sets the navigation mode that indicates whether this Page is cached, and the period of time that the cache entry
should persist.
public : NavigationCacheMode NavigationCacheMode { get; set; }
NavigationCacheMode NavigationCacheMode();

void NavigationCacheMode(NavigationCacheMode navigationcachemode);


public NavigationCacheMode NavigationCacheMode { get; set; }

<page NavigationCacheMode="navigationCacheModeMemberName" />

Returns
NavigationCacheMode
A value of the enumeration. The default is Disabled.

Examples
For example code that uses NavigationCacheMode, see Navigation. For a complete sample that uses many of the Page
and Frame features together, see XAML Navigation sample.

Remarks
To enable a page to be cached, set NavigationCacheMode to either Enabled or Required. The difference in behavior is
that Enabled might not be cached if the frame's cache size limit (CacheSize ) is exceeded, whereas Required always
generates an entry no matter the size limit.
If you want to change the value of NavigationCacheMode programmatically to Enabled or Required, you can only set
these values in the constructor for the page.
If you change the value of NavigationCacheMode from Required or Enabled to Disabled, the page is flushed from
the cache. The page is not simply marked as available to be flushed when the configured CacheSize is exceeded.
See Frame
Also NavigationCacheMode
Navigation
XAML Navigation sample
Page.OnNavigatedFrom Page.OnNavigatedFrom Page.
OnNavigatedFrom
I n this Article
Edit
Invoked immediately after the Page is unloaded and is no longer the current source of a parent Frame.
protected : virtual void OnNavigatedFrom(NavigationEventArgs e)
virtual void OnNavigatedFrom(NavigationEventArgs e) const;
protected virtual void OnNavigatedFrom(NavigationEventArgs e)

Parameters
e NavigationEventArgs
Event data that can be examined by overriding code. The event data is representative of the navigation that has
unloaded the current Page.
Page.OnNavigatedTo Page.OnNavigatedTo Page.On
NavigatedTo
I n this Article
Edit
Invoked when the Page is loaded and becomes the current source of a parent Frame.
protected : virtual void OnNavigatedTo(NavigationEventArgs e)
virtual void OnNavigatedTo(NavigationEventArgs e) const;
protected virtual void OnNavigatedTo(NavigationEventArgs e)

Parameters
e NavigationEventArgs
Event data that can be examined by overriding code. The event data is representative of the pending navigation that
will load the current Page. Usually the most relevant property to examine is Parameter.

Remarks
Unlike in prior XAML platforms, the OnNavigated method is called before the visual tree is loaded. This has the
following implications:
You cannot access a valid Parent property value from an override of OnNavigated. If you need to access the Parent
property, do so in a Loaded event handler.
You cannot use OnNavigatedTo for element manipulation or state change of controls on the destination page. Instead,
attach a Loaded event handler at the root of the newly loaded page's content, and perform any element manipulations,
state changes, event wiring and so on in the Loaded event handler.
Page.OnNavigatingFrom Page.OnNavigatingFrom Page.
OnNavigatingFrom
I n this Article
Edit
Invoked immediately before the Page is unloaded and is no longer the current source of a parent Frame.
protected : virtual void OnNavigatingFrom(NavigatingCancelEventArgs e)
virtual void OnNavigatingFrom(NavigatingCancelEventArgs e) const;
protected virtual void OnNavigatingFrom(NavigatingCancelEventArgs e)

Parameters
e NavigatingCancelEventArgs
Event data that can be examined by overriding code. The event data is representative of the navigation that will unload
the current Page unless canceled. The navigation can potentially be canceled by setting Cancel.
Page Page Page
I n this Article
Edit
Initializes a new instance of the Page class.

public : Page()
Page() const;
public Page()
Page.TopAppBar Page.TopAppBar Page.TopAppBar
I n this Article
Edit
Gets a reference to an AppBar displayed at the top of the page, if any.

public : AppBar TopAppBar { get; set; }


AppBar TopAppBar();

void TopAppBar(AppBar topappbar);


public AppBar TopAppBar { get; set; }

<Page ...>
<Page.TopAppBar>
<AppBar .../>
</Page.TopAppBar>
</Page>

Returns
AppBar
A reference to an AppBar displayed at the top of the page, or null.

Examples
For example code that adds an AppBar to a page, see Quickstart: adding app bars or How to share an app bar across
pages. For a complete sample that uses many of the Page and Frame features together, see XAML Navigation sample.

Remarks
In XAML, make sure you specify the Page.TopAppBar property element in the same area as other property elements
that may already be defined, like Page.BottomAppBar or Page.Resources . The XAML language enforces that you can't
mix the property elements between the XAML content that is setting Content, such as the typical root Grid element.
For more info on XAML syntax, see XAML syntax guide.
See AppBar
Also Quickstart: adding app bars
Page.TopAppBarProperty Page.TopAppBarProperty
Page.TopAppBarProperty
I n this Article
Edit
Identifies the TopAppBar dependency property.
public : static DependencyProperty TopAppBarProperty { get; }
static DependencyProperty TopAppBarProperty();
public static DependencyProperty TopAppBarProperty { get; }

Returns
DependencyProperty
The identifier for the TopAppBar dependency property.
Panel Panel Panel Class
Provides a base class for all Panel elements. Use Panel elements to position and arrange child objects in a UI page.

D eclaration
public : class Panel : FrameworkElement, IPanel, IPanel2
struct winrt::Windows::UI::Xaml::Controls::Panel : FrameworkElement, IPanel, IPanel2
public class Panel : FrameworkElement, IPanel, IPanel2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
Panel derived classes
Panel is the parent class for several immediately derived classes. Some of these are practical layout containers/panels.
Others are intermediate base classes for specialized panels.
Canvas
Grid
ItemsStackPanel
ItemsWrapGrid
RelativePanel
StackPanel
VariableSizedWrapGrid
VirtualizingPanel

Constructors
Panel()
Panel()
Panel()

Provides base class initialization behavior for Panel derived classes.

Properties
Background
Background
Background

Gets or sets a Brush that fills the panel content area.

BackgroundProperty
BackgroundProperty
BackgroundProperty
Identifies the Background dependency property.

BackgroundTransition
BackgroundTransition
BackgroundTransition

Gets or sets an instance of BrushTransition to automatically animate changes to the Background property.

Children
Children
Children

Gets the collection of child elements of the panel.

ChildrenTransitions
ChildrenTransitions
ChildrenTransitions

Gets or sets the collection of Transition style elements that apply to child content of a Panel subclass.

ChildrenTransitionsProperty
ChildrenTransitionsProperty
ChildrenTransitionsProperty

Identifies the ChildrenTransitions dependency property.

IsItemsHost
IsItemsHost
IsItemsHost

Gets a value that indicates whether this Panel is a container for UI items that are generated by an ItemsControl.

IsItemsHostProperty
IsItemsHostProperty
IsItemsHostProperty

Identifies the IsItemsHost dependency property.

See Also
FrameworkElement
FrameworkElement
Panel.Background Panel.Background Panel.Background
I n this Article
Edit
Gets or sets a Brush that fills the panel content area.

public : Brush Background { get; set; }


Brush Background();

void Background(Brush background);


public Brush Background { get; set; }

<panel Background="{StaticResource resourceName}"/>

Returns
Brush
The brush that fills the panel content area. The default is null, (a null brush) which is evaluated as Transparent for
rendering.

Remarks
The Background value for a Panel -derived panel is visible underneath the inner area if the elements that are in the
Children collection have transparency or null brushes for any of their defining area. It displays in the child margin area
for any case where a child element has a nonzero Margin affecting its position. It is also visible between the layout
positions of any child elements regardless of margin, although that can depend on how the panel implements its layout
behavior. For example, in a Canvas, any pixel in the content area where there's not an absolutely positioned element
covering it will show the panel Background brush.
If you're using a Panel class such as Grid or StackPanel as the root element of a control template, it's a common
practice to use a {TemplateBinding} markup extension to bind the panel's background to the Control.Background
property of the template parent (the control class that uses your template).
See Use brushes
Also
Panel.BackgroundProperty Panel.BackgroundProperty
Panel.BackgroundProperty
I n this Article
Edit
Identifies the Background dependency property.
public : static DependencyProperty BackgroundProperty { get; }
static DependencyProperty BackgroundProperty();
public static DependencyProperty BackgroundProperty { get; }

Returns
DependencyProperty
The identifier for the Background dependency property.
Panel.BackgroundTransition Panel.BackgroundTransition
Panel.BackgroundTransition
I n this Article
Edit
Gets or sets an instance of BrushTransition to automatically animate changes to the Background property.
public : BrushTransition BackgroundTransition { get; set; }
BrushTransition BackgroundTransition();

void BackgroundTransition(BrushTransition backgroundtransition);


public BrushTransition BackgroundTransition { get; set; }

Returns
BrushTransition
An instance of BrushTransition to automatically animate changes to the Background; otherwise, null. The default is
null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Examples
This example shows how to apply a background transition to a Grid. Each time GridBackground is updated, the
background will animate from the old brush to the new brush.
<Grid Background="{x:Bind GridBackground}">
<Grid.BackgroundTransition>
<BrushTransition />
</Grid.BackgroundTransition>
</Grid>

Remarks
Use this property to animate any change to the Background property. When a new value is set from code or through
data binding, the change is animated from the old value to the new value, rather than happening instantaneously.
Even though the transition animation takes time, the change to the actual property value is instantaneous. For example,
if you change a property from code and then read it back, you’ll see the new value, even though the visual effect of the
property change is somewhere between the new and the old.
If a property value changes a second time while the first change is still animating, the animation will use the currently
animated value as the "starting" value for the next animation, and then animate to the new "final" value. The duration
will be reset.
See BrushTransition
Also
Panel.Children Panel.Children Panel.Children
I n this Article
Edit
Gets the collection of child elements of the panel.

public : UIElementCollection Children { get; }


UIElementCollection Children();
public UIElementCollection Children { get; }

<panel>
oneOrMoreUIElements
</panel>

Returns
UIElementCollection
The collection of child objects. The default is an empty collection.
Panel.ChildrenTransitions Panel.ChildrenTransitions Panel.
ChildrenTransitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to child content of a Panel subclass.
public : TransitionCollection ChildrenTransitions { get; set; }
TransitionCollection ChildrenTransitions();

void ChildrenTransitions(TransitionCollection childrentransitions);


public TransitionCollection ChildrenTransitions { get; set; }

<panel>
<panel.ChildTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</panel.ChildTransitions>
</panel>

Returns
TransitionCollection
The strongly typed collection of Transition style elements.

Remarks
Note

Prior to Windows 10, version 1809 (SDK 17763), the XAML syntax for properties that have a TransitionCollection
value requires that you declare an explicit TransitionCollection object element as the value, and then provide object
elements as child elements of TransitionCollection for each of the transition animations you want to use. In Windows
10, version 1809 (SDK 17763) or later, TransitionCollection supports the implicit collection usage, so you can omit the
collection object element. For more info on implicit collections and XAML, see XAML syntax guide.
Transition animations play a particular role in the UI design of your app. The basic idea is that when there is a change
or transition, the animation draws the attention of the user to the change.
See TransitionCollection
Also
Panel.ChildrenTransitionsProperty Panel.Children
TransitionsProperty Panel.ChildrenTransitionsProperty
I n this Article
Edit
Identifies the ChildrenTransitions dependency property.
public : static DependencyProperty ChildrenTransitionsProperty { get; }
static DependencyProperty ChildrenTransitionsProperty();
public static DependencyProperty ChildrenTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the ChildrenTransitions dependency property.
Panel.IsItemsHost Panel.IsItemsHost Panel.IsItemsHost
I n this Article
Edit
Gets a value that indicates whether this Panel is a container for UI items that are generated by an ItemsControl.

public : Platform::Boolean IsItemsHost { get; }


bool IsItemsHost();
public bool IsItemsHost { get; }

Returns
bool
true if this instance of Panel is an items host; otherwise, false. The default is false.

Remarks
IsItemsHost is a calculated property where the value results from the system checking the parents of the Panel for an
ItemsControl implementation. If one exists, then the value is true.
In previous frameworks this property was settable. It's not settable in the Windows Runtime, and there should be no
need to set it because the system has the calculation behavior. If you want a different relationship between a panel and
a parent items control, just create it that way in your XAML control compositing.
Panel.IsItemsHostProperty Panel.IsItemsHostProperty
Panel.IsItemsHostProperty
I n this Article
Edit
Identifies the IsItemsHost dependency property.
public : static DependencyProperty IsItemsHostProperty { get; }
static DependencyProperty IsItemsHostProperty();
public static DependencyProperty IsItemsHostProperty { get; }

Returns
DependencyProperty
The identifier for the IsItemsHost dependency property.
Panel Panel Panel
I n this Article
Edit
Provides base class initialization behavior for Panel derived classes.

protected : Panel()
Panel() const;
protected Panel()
PanelScrollingDirection PanelScrollingDirection Panel
ScrollingDirection Enum
Defines constants that specify the direction that a panel is scrolling.

D eclaration
public : enum class PanelScrollingDirection
enum class winrt::Windows::UI::Xaml::Controls::PanelScrollingDirection : int32_t
public enum PanelScrollingDirection

I nheritance H ierarchy
None

Fields
Backward Backward Backward The panel is scrolling backward.

Forward Forward Forward The panel is scrolling forward.

None None None The panel is not scrolling.


ParallaxSourceOffsetKind ParallaxSourceOffsetKind
ParallaxSourceOffsetKind Enum
Defines constants that specify how the source offset values of a ParallaxView are interpreted.

D eclaration
public : enum class ParallaxSourceOffsetKind
enum class winrt::Windows::UI::Xaml::Controls::ParallaxSourceOffsetKind : int32_t
public enum ParallaxSourceOffsetKind

I nheritance H ierarchy
None

Fields
Absolute Absolute Absolute The source start/end offset value is interpreted as an absolute value.

Relative Relative Relative The source start/end offset value is added to the auto-computed source offset.
ParallaxView ParallaxView ParallaxView Class
Represents a container that ties the scroll position of a foreground element, such as a list, to a background element,
such as an image. As you scroll through the foreground element, it animates the background element to create a
parallax effect.

D eclaration
public : class ParallaxView : FrameworkElement, IParallaxView
struct winrt::Windows::UI::Xaml::Controls::ParallaxView : FrameworkElement, IParallaxView
public class ParallaxView : FrameworkElement, IParallaxView

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Constructors
ParallaxView()
ParallaxView()
ParallaxView()

Initializes a new instance of the ParallaxView class.

Properties
Child
Child
Child

Gets or sets the background content of the ParallaxView.

ChildProperty
ChildProperty
ChildProperty

Identifies the Child dependency property.

HorizontalShift
HorizontalShift
HorizontalShift

Represents the horizontal range of motion of the child element.

HorizontalShiftProperty
HorizontalShiftProperty
HorizontalShiftProperty

Identifies the HorizontalShift dependency property.

HorizontalSourceEndOffset
HorizontalSourceEndOffset
HorizontalSourceEndOffset

Represents the horizontal scroll offset at which the parallax motion ends.

HorizontalSourceEndOffsetProperty
HorizontalSourceEndOffsetProperty
HorizontalSourceEndOffsetProperty

Identifies the HorizontalSourceEndOffset dependency property.

HorizontalSourceOffsetKind
HorizontalSourceOffsetKind
HorizontalSourceOffsetKind

Gets or sets a value that determines how the horizontal source offset values of a ParallaxView are interpreted.

HorizontalSourceOffsetKindProperty
HorizontalSourceOffsetKindProperty
HorizontalSourceOffsetKindProperty

Identifies the HorizontalSourceOffsetKind dependency property.

HorizontalSourceStartOffset
HorizontalSourceStartOffset
HorizontalSourceStartOffset

Represents the horizontal scroll offset at which parallax motion starts.

HorizontalSourceStartOffsetProperty
HorizontalSourceStartOffsetProperty
HorizontalSourceStartOffsetProperty

Identifies the HorizontalSourceStartOffset dependency property.

IsHorizontalShiftClamped
IsHorizontalShiftClamped
IsHorizontalShiftClamped

Gets or sets a value that indicates whether the horizontal parallax ratio is clampled to a specified percentage of the
source scroll velocity.
IsHorizontalShiftClampedProperty
IsHorizontalShiftClampedProperty
IsHorizontalShiftClampedProperty

Identifies the IsHorizontalShiftClamped dependency property.

IsVerticalShiftClamped
IsVerticalShiftClamped
IsVerticalShiftClamped

Gets or sets a value that indicates whether the vertical parallax ratio is clampled to a specified percentage of the
source scroll velocity.

IsVerticalShiftClampedProperty
IsVerticalShiftClampedProperty
IsVerticalShiftClampedProperty

Identifies the IsVerticalShiftClamped dependency property.

MaxHorizontalShiftRatio
MaxHorizontalShiftRatio
MaxHorizontalShiftRatio

Clamps the horizontal parallax ratio to the specified percentage of the source scroll velocity.

MaxHorizontalShiftRatioProperty
MaxHorizontalShiftRatioProperty
MaxHorizontalShiftRatioProperty

Identifies the MaxHorizontalShiftRatio dependency property.

MaxVerticalShiftRatio
MaxVerticalShiftRatio
MaxVerticalShiftRatio

Clamps the vertical parallax ratio to the specified percentage of the source scroll velocity.

MaxVerticalShiftRatioProperty
MaxVerticalShiftRatioProperty
MaxVerticalShiftRatioProperty

Identifies the MaxVerticalShiftRatio dependency property.

Source
Source
Source

The element that either is or contains the ScrollViewer that controls the parallax operation.

SourceProperty
SourceProperty
SourceProperty

Identifies the Source dependency property.

VerticalShift
VerticalShift
VerticalShift

Represents the vertical range of motion of the child element.

VerticalShiftProperty
VerticalShiftProperty
VerticalShiftProperty

Identifies the VerticalShift dependency property.

VerticalSourceEndOffset
VerticalSourceEndOffset
VerticalSourceEndOffset

Represents the vertical scroll offset at which the parallax motion ends.

VerticalSourceEndOffsetProperty
VerticalSourceEndOffsetProperty
VerticalSourceEndOffsetProperty

Identifies the VerticalSourceEndOffset dependency property.

VerticalSourceOffsetKind
VerticalSourceOffsetKind
VerticalSourceOffsetKind

Gets or sets a value that determines how the vertical source offset values of a ParallaxView are interpreted.

VerticalSourceOffsetKindProperty
VerticalSourceOffsetKindProperty
VerticalSourceOffsetKindProperty

Identifies the VerticalSourceOffsetKind dependency property.


VerticalSourceStartOffset
VerticalSourceStartOffset
VerticalSourceStartOffset

Represents the vertical scroll offset at which parallax motion starts.

VerticalSourceStartOffsetProperty
VerticalSourceStartOffsetProperty
VerticalSourceStartOffsetProperty

Identifies the VerticalSourceStartOffset dependency property.

Methods
RefreshAutomaticHorizontalOffsets()
RefreshAutomaticHorizontalOffsets()
RefreshAutomaticHorizontalOffsets()

Forces the automatically computed horizontal offsets to be recomputed.

RefreshAutomaticVerticalOffsets()
RefreshAutomaticVerticalOffsets()
RefreshAutomaticVerticalOffsets()

Forces the automatically computed vertical offsets to be recomputed.

See Also
ParallaxView.Child ParallaxView.Child ParallaxView.Child
I n this Article
Edit
Gets or sets the background content of the ParallaxView.

public : UIElement Child { get; set; }


UIElement Child();

void Child(UIElement child);


public UIElement Child { get; set; }

<ParallaxView Child="childElement" .../>

Returns
UIElement
The background content of the ParallaxView, typically an image. The default is null.
ParallaxView.ChildProperty ParallaxView.ChildProperty
ParallaxView.ChildProperty
I n this Article
Edit
Identifies the Child dependency property.
public : static DependencyProperty ChildProperty { get; }
static DependencyProperty ChildProperty();
public static DependencyProperty ChildProperty { get; }

Returns
DependencyProperty
The identifier for the Child dependency property.
ParallaxView.HorizontalShift ParallaxView.HorizontalShift
ParallaxView.HorizontalShift
I n this Article
Edit
Represents the horizontal range of motion of the child element.
public : double HorizontalShift { get; set; }
double HorizontalShift();

void HorizontalShift(double horizontalshift);


public double HorizontalShift { get; set; }

<ParallaxView HorizontalShift="double" .../>

Returns
double
The horizontal range of motion. The default is 0.

Remarks
The default value of 0 means there is no horizontal parallax motion. A value of 100 means the Child element is sized to
100px wider than the ParallaxView, so the range of the parallax motion is 100px.
ParallaxView.HorizontalShiftProperty ParallaxView.
HorizontalShiftProperty ParallaxView.HorizontalShift
Property
I n this Article
Edit
Identifies the HorizontalShift dependency property.
public : static DependencyProperty HorizontalShiftProperty { get; }
static DependencyProperty HorizontalShiftProperty();
public static DependencyProperty HorizontalShiftProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalShift dependency property.
ParallaxView.HorizontalSourceEndOffset ParallaxView.
HorizontalSourceEndOffset ParallaxView.Horizontal
SourceEndOffset
I n this Article
Edit
Represents the horizontal scroll offset at which the parallax motion ends.
public : double HorizontalSourceEndOffset { get; set; }
double HorizontalSourceEndOffset();

void HorizontalSourceEndOffset(double horizontalsourceendoffset);


public double HorizontalSourceEndOffset { get; set; }

<ParallaxView HorizontalSourceEndOffset="double" .../>

Returns
double
The horizontal scroll offset at which parallax motion ends. The default is 0.
ParallaxView.HorizontalSourceEndOffsetProperty Parallax
View.HorizontalSourceEndOffsetProperty ParallaxView.
HorizontalSourceEndOffsetProperty
I n this Article
Edit
Identifies the HorizontalSourceEndOffset dependency property.
public : static DependencyProperty HorizontalSourceEndOffsetProperty { get; }
static DependencyProperty HorizontalSourceEndOffsetProperty();
public static DependencyProperty HorizontalSourceEndOffsetProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalSourceEndOffset dependency property.
ParallaxView.HorizontalSourceOffsetKind ParallaxView.
HorizontalSourceOffsetKind ParallaxView.Horizontal
SourceOffsetKind
I n this Article
Edit
Gets or sets a value that determines how the horizontal source offset values of a ParallaxView are interpreted.
public : ParallaxSourceOffsetKind HorizontalSourceOffsetKind { get; set; }
ParallaxSourceOffsetKind HorizontalSourceOffsetKind();

void HorizontalSourceOffsetKind(ParallaxSourceOffsetKind horizontalsourceoffsetkind);


public ParallaxSourceOffsetKind HorizontalSourceOffsetKind { get; set; }

<ParallaxView HorizontalSourceOffsetKind="parallaxSourceOffsetKindName" .../>

Returns
ParallaxSourceOffsetKind
A value of the enumeration that determines how the horizontal source offset values of a ParallaxView are interpreted.
ParallaxView.HorizontalSourceOffsetKindProperty
ParallaxView.HorizontalSourceOffsetKindProperty
ParallaxView.HorizontalSourceOffsetKindProperty
I n this Article
Edit
Identifies the HorizontalSourceOffsetKind dependency property.
public : static DependencyProperty HorizontalSourceOffsetKindProperty { get; }
static DependencyProperty HorizontalSourceOffsetKindProperty();
public static DependencyProperty HorizontalSourceOffsetKindProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalSourceOffsetKind dependency property.
ParallaxView.HorizontalSourceStartOffset ParallaxView.
HorizontalSourceStartOffset ParallaxView.Horizontal
SourceStartOffset
I n this Article
Edit
Represents the horizontal scroll offset at which parallax motion starts.
public : double HorizontalSourceStartOffset { get; set; }
double HorizontalSourceStartOffset();

void HorizontalSourceStartOffset(double horizontalsourcestartoffset);


public double HorizontalSourceStartOffset { get; set; }

<ParallaxView HorizontalSourceStartOffset="double" .../>

Returns
double
The horizontal scroll offset at which parallax motion starts. The default is 0.
ParallaxView.HorizontalSourceStartOffsetProperty
ParallaxView.HorizontalSourceStartOffsetProperty
ParallaxView.HorizontalSourceStartOffsetProperty
I n this Article
Edit
Identifies the HorizontalSourceStartOffset dependency property.
public : static DependencyProperty HorizontalSourceStartOffsetProperty { get; }
static DependencyProperty HorizontalSourceStartOffsetProperty();
public static DependencyProperty HorizontalSourceStartOffsetProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalSourceStartOffset dependency property.
ParallaxView.IsHorizontalShiftClamped ParallaxView.Is
HorizontalShiftClamped ParallaxView.IsHorizontalShift
Clamped
I n this Article
Edit
Gets or sets a value that indicates whether the horizontal parallax ratio is clampled to a specified percentage of the
source scroll velocity.
public : Platform::Boolean IsHorizontalShiftClamped { get; set; }
bool IsHorizontalShiftClamped();

void IsHorizontalShiftClamped(bool ishorizontalshiftclamped);


public bool IsHorizontalShiftClamped { get; set; }

<ParallaxView IsHorizontalShiftClamped="bool" .../>

Returns
bool
true if the parallax ratio is clampled to a specified percentage of the source scroll velocity; otherwise, false. The default
is true.
ParallaxView.IsHorizontalShiftClampedProperty Parallax
View.IsHorizontalShiftClampedProperty ParallaxView.Is
HorizontalShiftClampedProperty
I n this Article
Edit
Identifies the IsHorizontalShiftClamped dependency property.
public : static DependencyProperty IsHorizontalShiftClampedProperty { get; }
static DependencyProperty IsHorizontalShiftClampedProperty();
public static DependencyProperty IsHorizontalShiftClampedProperty { get; }

Returns
DependencyProperty
The identifier for the IsHorizontalShiftClamped dependency property.
ParallaxView.IsVerticalShiftClamped ParallaxView.Is
VerticalShiftClamped ParallaxView.IsVerticalShiftClamped
I n this Article
Edit
Gets or sets a value that indicates whether the vertical parallax ratio is clampled to a specified percentage of the source
scroll velocity.
public : Platform::Boolean IsVerticalShiftClamped { get; set; }
bool IsVerticalShiftClamped();

void IsVerticalShiftClamped(bool isverticalshiftclamped);


public bool IsVerticalShiftClamped { get; set; }

<ParallaxView IsVerticalShiftClamped="bool" .../>

Returns
bool
true if the parallax ratio is clampled to a specified percentage of the source scroll velocity; otherwise, false. The default
is true.
ParallaxView.IsVerticalShiftClampedProperty Parallax
View.IsVerticalShiftClampedProperty ParallaxView.Is
VerticalShiftClampedProperty
I n this Article
Edit
Identifies the IsVerticalShiftClamped dependency property.
public : static DependencyProperty IsVerticalShiftClampedProperty { get; }
static DependencyProperty IsVerticalShiftClampedProperty();
public static DependencyProperty IsVerticalShiftClampedProperty { get; }

Returns
DependencyProperty
The identifier for the IsVerticalShiftClamped dependency property.
ParallaxView.MaxHorizontalShiftRatio ParallaxView.Max
HorizontalShiftRatio ParallaxView.MaxHorizontalShift
Ratio
I n this Article
Edit
Clamps the horizontal parallax ratio to the specified percentage of the source scroll velocity.
public : double MaxHorizontalShiftRatio { get; set; }
double MaxHorizontalShiftRatio();

void MaxHorizontalShiftRatio(double maxhorizontalshiftratio);


public double MaxHorizontalShiftRatio { get; set; }

<ParallaxView MaxHorizontalShiftRatio="double" .../>

Returns
double
The maximum percentage of the source scroll velocity. The default is 1.0.
ParallaxView.MaxHorizontalShiftRatioProperty Parallax
View.MaxHorizontalShiftRatioProperty ParallaxView.Max
HorizontalShiftRatioProperty
I n this Article
Edit
Identifies the MaxHorizontalShiftRatio dependency property.
public : static DependencyProperty MaxHorizontalShiftRatioProperty { get; }
static DependencyProperty MaxHorizontalShiftRatioProperty();
public static DependencyProperty MaxHorizontalShiftRatioProperty { get; }

Returns
DependencyProperty
The identifier for the MaxHorizontalShiftRatio dependency property.
ParallaxView.MaxVerticalShiftRatio ParallaxView.Max
VerticalShiftRatio ParallaxView.MaxVerticalShiftRatio
I n this Article
Edit
Clamps the vertical parallax ratio to the specified percentage of the source scroll velocity.
public : double MaxVerticalShiftRatio { get; set; }
double MaxVerticalShiftRatio();

void MaxVerticalShiftRatio(double maxverticalshiftratio);


public double MaxVerticalShiftRatio { get; set; }

<ParallaxView MaxVerticalShiftRatio="double" .../>

Returns
double
The maximum percentage of the source scroll velocity. The default is 1.0.
ParallaxView.MaxVerticalShiftRatioProperty ParallaxView.
MaxVerticalShiftRatioProperty ParallaxView.MaxVertical
ShiftRatioProperty
I n this Article
Edit
Identifies the MaxVerticalShiftRatio dependency property.
public : static DependencyProperty MaxVerticalShiftRatioProperty { get; }
static DependencyProperty MaxVerticalShiftRatioProperty();
public static DependencyProperty MaxVerticalShiftRatioProperty { get; }

Returns
DependencyProperty
The identifier for the MaxVerticalShiftRatio dependency property.
ParallaxView ParallaxView ParallaxView
I n this Article
Edit
Initializes a new instance of the ParallaxView class.

public : ParallaxView()
ParallaxView() const;
public ParallaxView()
ParallaxView.RefreshAutomaticHorizontalOffsets Parallax
View.RefreshAutomaticHorizontalOffsets ParallaxView.
RefreshAutomaticHorizontalOffsets
I n this Article
Edit
Forces the automatically computed horizontal offsets to be recomputed.
public : void RefreshAutomaticHorizontalOffsets()
void RefreshAutomaticHorizontalOffsets() const;
public void RefreshAutomaticHorizontalOffsets()
ParallaxView.RefreshAutomaticVerticalOffsets Parallax
View.RefreshAutomaticVerticalOffsets ParallaxView.
RefreshAutomaticVerticalOffsets
I n this Article
Edit
Forces the automatically computed vertical offsets to be recomputed.
public : void RefreshAutomaticVerticalOffsets()
void RefreshAutomaticVerticalOffsets() const;
public void RefreshAutomaticVerticalOffsets()
ParallaxView.Source ParallaxView.Source ParallaxView.
Source
I n this Article
Edit
The element that either is or contains the ScrollViewer that controls the parallax operation.
public : UIElement Source { get; set; }
UIElement Source();

void Source(UIElement source);


public UIElement Source { get; set; }

<ParallaxView Source="sourceElement" .../>

Returns
UIElement

Remarks
If the source element is not a ScrollViewer, the XAML tree is walked starting at the source element to find an
embedded ScrollViewer.
ParallaxView.SourceProperty ParallaxView.Source
Property ParallaxView.SourceProperty
I n this Article
Edit
Identifies the Source dependency property.
public : static DependencyProperty SourceProperty { get; }
static DependencyProperty SourceProperty();
public static DependencyProperty SourceProperty { get; }

Returns
DependencyProperty
The identifier for the Source dependency property.
ParallaxView.VerticalShift ParallaxView.VerticalShift
ParallaxView.VerticalShift
I n this Article
Edit
Represents the vertical range of motion of the child element.
public : double VerticalShift { get; set; }
double VerticalShift();

void VerticalShift(double verticalshift);


public double VerticalShift { get; set; }

<ParallaxView VerticalShift="double" .../>

Returns
double
The vertical range of motion. The default is 0.

Remarks
The default value of 0 means there is no vertical parallax motion. A value of 100 means the Child element is sized to
100px taller than the ParallaxView, so the range of the parallax motion is 100px.
ParallaxView.VerticalShiftProperty ParallaxView.Vertical
ShiftProperty ParallaxView.VerticalShiftProperty
I n this Article
Edit
Identifies the VerticalShift dependency property.
public : static DependencyProperty VerticalShiftProperty { get; }
static DependencyProperty VerticalShiftProperty();
public static DependencyProperty VerticalShiftProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalShift dependency property.
ParallaxView.VerticalSourceEndOffset ParallaxView.
VerticalSourceEndOffset ParallaxView.VerticalSourceEnd
Offset
I n this Article
Edit
Represents the vertical scroll offset at which the parallax motion ends.
public : double VerticalSourceEndOffset { get; set; }
double VerticalSourceEndOffset();

void VerticalSourceEndOffset(double verticalsourceendoffset);


public double VerticalSourceEndOffset { get; set; }

<ParallaxView VerticalSourceEndOffset="double" .../>

Returns
double
The vertical scroll offset at which parallax motion ends. The default is 0.
ParallaxView.VerticalSourceEndOffsetProperty Parallax
View.VerticalSourceEndOffsetProperty ParallaxView.
VerticalSourceEndOffsetProperty
I n this Article
Edit
Identifies the VerticalSourceEndOffset dependency property.
public : static DependencyProperty VerticalSourceEndOffsetProperty { get; }
static DependencyProperty VerticalSourceEndOffsetProperty();
public static DependencyProperty VerticalSourceEndOffsetProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalSourceEndOffset dependency property.
ParallaxView.VerticalSourceOffsetKind ParallaxView.
VerticalSourceOffsetKind ParallaxView.VerticalSource
OffsetKind
I n this Article
Edit
Gets or sets a value that determines how the vertical source offset values of a ParallaxView are interpreted.
public : ParallaxSourceOffsetKind VerticalSourceOffsetKind { get; set; }
ParallaxSourceOffsetKind VerticalSourceOffsetKind();

void VerticalSourceOffsetKind(ParallaxSourceOffsetKind verticalsourceoffsetkind);


public ParallaxSourceOffsetKind VerticalSourceOffsetKind { get; set; }

<ParallaxView VerticalSourceOffsetKind="parallaxSourceOffsetKindName" .../>

Returns
ParallaxSourceOffsetKind
A value of the enumeration that determines how the vertical source offset values of a ParallaxView are interpreted.
ParallaxView.VerticalSourceOffsetKindProperty Parallax
View.VerticalSourceOffsetKindProperty ParallaxView.
VerticalSourceOffsetKindProperty
I n this Article
Edit
Identifies the VerticalSourceOffsetKind dependency property.
public : static DependencyProperty VerticalSourceOffsetKindProperty { get; }
static DependencyProperty VerticalSourceOffsetKindProperty();
public static DependencyProperty VerticalSourceOffsetKindProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalSourceOffsetKind dependency property.
ParallaxView.VerticalSourceStartOffset ParallaxView.
VerticalSourceStartOffset ParallaxView.VerticalSource
StartOffset
I n this Article
Edit
Represents the vertical scroll offset at which parallax motion starts.
public : double VerticalSourceStartOffset { get; set; }
double VerticalSourceStartOffset();

void VerticalSourceStartOffset(double verticalsourcestartoffset);


public double VerticalSourceStartOffset { get; set; }

<ParallaxView VerticalSourceStartOffset="double" .../>

Returns
double
The vertical scroll offset at which parallax motion starts. The default is 0.
ParallaxView.VerticalSourceStartOffsetProperty Parallax
View.VerticalSourceStartOffsetProperty ParallaxView.
VerticalSourceStartOffsetProperty
I n this Article
Edit
Identifies the VerticalSourceStartOffset dependency property.
public : static DependencyProperty VerticalSourceStartOffsetProperty { get; }
static DependencyProperty VerticalSourceStartOffsetProperty();
public static DependencyProperty VerticalSourceStartOffsetProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalSourceStartOffset dependency property.
PasswordBox PasswordBox PasswordBox Class
Represents a control for entering passwords.

D eclaration
public : sealed class PasswordBox : Control, IPasswordBox, IPasswordBox2, IPasswordBox3,
IPasswordBox4, IPasswordBox5
struct winrt::Windows::UI::Xaml::Controls::PasswordBox : Control, IPasswordBox, IPasswordBox2,
IPasswordBox3, IPasswordBox4, IPasswordBox5
public sealed class PasswordBox : Control, IPasswordBox, IPasswordBox2, IPasswordBox3,
IPasswordBox4, IPasswordBox5

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Password box.
PasswordBox lets a user enter a masked password.

The user can enter a single line of non-wrapping text in a PasswordBox control. The text is not displayed while it is
entered; only password characters that mask the text are displayed. You can specify this password character by setting
the PasswordChar property.
Use the Password property to get or set the content of the PasswordBox. Handle the PasswordChanged event to get
the Password value while the user enters it.
For more info, see PasswordBox control guide.
Password reveal mode
The PasswordRevealMode property lets you customize the password viewing experience. By default, the PasswordBox
has a built-in button that the user can press to display the password text. When the user releases it, the password is
automatically hidden again.
Windows 10, version 1607, introduces a new keyboard shortcut for accessibility. When the focus is in the PasswordBox
and the password reveal button is visible, the user can press and hold Alt+F8 to reveal their password. When they let
go of either key press, the password is hidden again.

You can hide the password reveal button, or provide a custom UI to let the user reveal the password. For more info and
examples, see PasswordRevealMode and PasswordBox control guide.
Note

Use the PasswordRevealMode property instead of the IsPasswordRevealButtonEnabled property.


IsPasswordRevealButtonEnabled is deprecated in Windows 10 and any value is ignored.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the PasswordBox control. Resources that start with "TextControl" are shared by
TextBox, PasswordBox, RichEditBox, and AutoSuggestBox.

R ES O U R CE K EY D ES CR IPTIO N

TextControlForeground Text color at rest and not focused

TextControlForegroundPointerOver Text color on hover

TextControlForegroundFocused Text color when focused

TextControlForegroundDisabled Text color when disabled

TextControlBackground Background color at rest and not focused

TextControlBackgroundPointerOver Background color on hover

TextControlBackgroundFocused Background color when focused

TextControlBackgroundDisabled Background color when disabled

TextControlBorderBrush Border color at rest and not focused

TextControlBorderBrushPointerOver Border color on hover

TextControlBorderBrushFocused Border color when focused

TextControlBorderBrushDisabled Border color when disabled

TextControlPlaceholderForeground Placeholder text color at rest and not focused

TextControlPlaceholderForegroundPointerOver Placeholder text color on hover

TextControlPlaceholderForegroundFocused Placeholder text color when focused


TextControlPlaceholderForegroundDisabled Placeholder text color when disabled

TextControlHeaderForeground Header text color

TextControlHeaderForegroundDisabled Header text color when disabled

TextControlSelectionHighlightColor Highlight color of selected text

TextControlButtonBackground Background color of reveal button at rest

TextControlButtonBackgroundPointerOver Background color of reveal button on hover

TextControlButtonBackgroundPressed Background color of reveal button when pressed

TextControlButtonBorderBrush Border color of reveal button at rest

TextControlButtonBorderBrushPointerOver Border color of reveal button on hover

TextControlButtonBorderBrushPressed Border color of reveal button when pressed

TextControlButtonForeground Foreground color of reveal button at rest

TextControlButtonForegroundPointerOver Foreground color of reveal button on hover

TextControlButtonForegroundPressed Foreground color of reveal button when pressed

Notes for previous versions


Windows 8.x Use the IsPasswordRevealButtonEnabled property to specify whether the user can see the
password, or see only the masking characters.

In Windows, the user reveals the password by pressing and holding a button in the text entry box. The password is
automatically hidden when the user stops pressing the button.
In Windows Phone, the user reveals the password by checking a checkbox, so the password can stay shown while the
user in entering it. (For more info on implementing this behavior in Universal Windows Platform (UWP ) apps, see
PasswordRevealMode.)

Constructors
PasswordBox()
PasswordBox()
PasswordBox()

Initializes a new instance of the PasswordBox class

Properties
CanPasteClipboardContent
CanPasteClipboardContent
CanPasteClipboardContent
Gets a value that indicates whether clipboard content can be pasted into the control.

CanPasteClipboardContentProperty
CanPasteClipboardContentProperty
CanPasteClipboardContentProperty

Identifies the CanPasteClipboardContent dependency property.

Description
Description
Description

Gets or sets content that is shown below the control. The content should provide guidance about the input
expected by the control.

DescriptionProperty
DescriptionProperty
DescriptionProperty

Identifies the Description dependency property.

Header
Header
Header

Gets or sets the content for the control's header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the control's header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.


InputScope
InputScope
InputScope

Gets or sets the context for input used by this PasswordBox.

InputScopeProperty
InputScopeProperty
InputScopeProperty

Identifies the InputScope dependency property.

IsPasswordRevealButtonEnabled
IsPasswordRevealButtonEnabled
IsPasswordRevealButtonEnabled

Gets or sets a value that specifies whether the visual UI of the PasswordBox includes a button element that toggles
showing or hiding the typed characters. In Windows 10 and later, use PasswordRevealMode instead.

IsPasswordRevealButtonEnabledProperty
IsPasswordRevealButtonEnabledProperty
IsPasswordRevealButtonEnabledProperty

Identifies the IsPasswordRevealButtonEnabled dependency property.

MaxLength
MaxLength
MaxLength

Gets or sets the maximum length for passwords to be handled by this PasswordBox.

MaxLengthProperty
MaxLengthProperty
MaxLengthProperty

Identifies the MaxLength dependency property.

Password
Password
Password

Gets or sets the password currently held by the PasswordBox.

PasswordChar
PasswordChar
PasswordChar

Gets or sets the masking character for the PasswordBox.

PasswordCharProperty
PasswordCharProperty
PasswordCharProperty

Identifies the PasswordChar dependency property.

PasswordProperty
PasswordProperty
PasswordProperty

Identifies the Password dependency property.

PasswordRevealMode
PasswordRevealMode
PasswordRevealMode

Gets or sets a value that specifies whether the password is always, never, or optionally obscured.

PasswordRevealModeProperty
PasswordRevealModeProperty
PasswordRevealModeProperty

Identifies the PasswordRevealMode dependency property.

PlaceholderText
PlaceholderText
PlaceholderText

Gets or sets the text that is displayed in the control until the value is changed by a user action or some other
operation.

PlaceholderTextProperty
PlaceholderTextProperty
PlaceholderTextProperty

Identifies the PlaceholderText dependency property.

PreventKeyboardDisplayOnProgrammaticFocus
PreventKeyboardDisplayOnProgrammaticFocus
PreventKeyboardDisplayOnProgrammaticFocus

Gets or sets a value that indicates whether the on-screen keyboard is shown when the control receives focus
programmatically.

PreventKeyboardDisplayOnProgrammaticFocusProperty
PreventKeyboardDisplayOnProgrammaticFocusProperty
PreventKeyboardDisplayOnProgrammaticFocusProperty

Identifies the PreventKeyboardDisplayOnProgrammaticFocus dependency property.

SelectionFlyout
SelectionFlyout
SelectionFlyout

Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.

SelectionFlyoutProperty
SelectionFlyoutProperty
SelectionFlyoutProperty

Identifies the SelectionFlyout dependency property.

SelectionHighlightColor
SelectionHighlightColor
SelectionHighlightColor

Gets or sets the brush used to highlight the selected text.

SelectionHighlightColorProperty
SelectionHighlightColorProperty
SelectionHighlightColorProperty

Identifies the SelectionHighlightColor dependency property.

TextReadingOrder
TextReadingOrder
TextReadingOrder

Gets or sets a value that indicates how the reading order is determined for the PasswordBox.

TextReadingOrderProperty
TextReadingOrderProperty
TextReadingOrderProperty

Identifies the TextReadingOrder dependency property.


Methods
PasteFromClipboard()
PasteFromClipboard()
PasteFromClipboard()

Copies content from the Windows clipboard into the text control.

SelectAll()
SelectAll()
SelectAll()

Selects all the characters in the PasswordBox.

Events
ContextMenuOpening
ContextMenuOpening
ContextMenuOpening

Occurs when the system processes an interaction that displays a context menu.

PasswordChanged
PasswordChanged
PasswordChanged

Occurs when the value of the Password property changes.

PasswordChanging
PasswordChanging
PasswordChanging

Occurs synchronously when the text in the password box starts to change, but before it is rendered.

Paste
Paste
Paste

Occurs when text is pasted into the control.

See Also
PasswordBox.CanPasteClipboardContent PasswordBox.
CanPasteClipboardContent PasswordBox.CanPaste
ClipboardContent
I n this Article
Edit
Gets a value that indicates whether clipboard content can be pasted into the control.
public : Platform::Boolean CanPasteClipboardContent { get; }
bool CanPasteClipboardContent();
public bool CanPasteClipboardContent { get; }

Returns
bool
true if clipboard content can be pasted into the control; otherwise, false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


PasswordBox.CanPasteClipboardContentProperty
PasswordBox.CanPasteClipboardContentProperty
PasswordBox.CanPasteClipboardContentProperty
I n this Article
Edit
Identifies the CanPasteClipboardContent dependency property.
public : static DependencyProperty CanPasteClipboardContentProperty { get; }
static DependencyProperty CanPasteClipboardContentProperty();
public static DependencyProperty CanPasteClipboardContentProperty { get; }

Returns
DependencyProperty
The identifier for the CanPasteClipboardContent dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


PasswordBox.ContextMenuOpening PasswordBox.
ContextMenuOpening PasswordBox.ContextMenu
Opening
I n this Article
Edit
Occurs when the system processes an interaction that displays a context menu.
public : event ContextMenuOpeningEventHandler ContextMenuOpening
// Register
event_token ContextMenuOpening(ContextMenuOpeningEventHandler const& handler) const;

// Revoke with event_token


void ContextMenuOpening(event_token const& cookie) const;

// Revoke with event_revoker


ContextMenuOpening_revoker ContextMenuOpening(auto_revoke_t, ContextMenuOpeningEventHandler const&
handler) const;
public event ContextMenuOpeningEventHandler ContextMenuOpening

<PasswordBox ContextMenuOpening="eventhandler" />


PasswordBox.Description PasswordBox.Description
PasswordBox.Description
I n this Article
Edit
Gets or sets content that is shown below the control. The content should provide guidance about the input expected by
the control.
public : Platform::Object Description { get; set; }
winrt::Windows::Foundation::IInspectable Description();

void Description(winrt::Windows::Foundation::IInspectable description);


public object Description { get; set; }

Returns
object
The content to be displayed below the control. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


PasswordBox.DescriptionProperty PasswordBox.
DescriptionProperty PasswordBox.DescriptionProperty
I n this Article
Edit
Identifies the Description dependency property.
public : static DependencyProperty DescriptionProperty { get; }
static DependencyProperty DescriptionProperty();
public static DependencyProperty DescriptionProperty { get; }

Returns
DependencyProperty
The identifier for the Description dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


PasswordBox.Header PasswordBox.Header PasswordBox.
Header
I n this Article
Edit
Gets or sets the content for the control's header.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<PasswordBox Header="headerString"/>

Returns
object
The content of the control's header. The default is null.

Remarks
You can set a data template for the Header value by using the HeaderTemplate property.
See PasswordBox styles and templates
Also
PasswordBox.HeaderProperty PasswordBox.Header
Property PasswordBox.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
PasswordBox.HeaderTemplate PasswordBox.Header
Template PasswordBox.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the control's header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<PasswordBox>
<PasswordBox.HeaderTemplate>
singleDataTemplate
</PasswordBox.HeaderTemplate>
</PasswordBox>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
PasswordBox.HeaderTemplateProperty PasswordBox.
HeaderTemplateProperty PasswordBox.HeaderTemplate
Property
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
PasswordBox.InputScope PasswordBox.InputScope
PasswordBox.InputScope
I n this Article
Edit
Gets or sets the context for input used by this PasswordBox.
public : InputScope InputScope { get; set; }
InputScope InputScope();

void InputScope(InputScope inputscope);


public InputScope InputScope { get; set; }

<PasswordBox>
<PasswordBox.InputScope>
<InputScope>
<InputScope.Names>
<InputScopeName NameValue="inputScopeName"/>
</InputScope.Names>
</InputScope>
</PasswordBox.InputScope>
</PasswordBox>

Returns
InputScope
The input scope, which provides a hint at the type of text input expected by the control. The default is null.

Examples
Here's how to set the InputScope in XAML and in code.
<PasswordBox x:Name="pinBox" Header="Enter PIN">
<PasswordBox.InputScope>
<InputScope>
<InputScope.Names>
<InputScopeName NameValue="NumericPin"/>
</InputScope.Names>
</InputScope>
</PasswordBox.InputScope>
</PasswordBox>

PasswordBox passwordBox = new PasswordBox();


passwordBox.Header = "Enter password";

InputScope scope = new InputScope();


InputScopeName scopeName = new InputScopeName();
scopeName.NameValue = InputScopeNameValue.Password;
scope.Names.Add(scopeName);
passwordBox.InputScope = scope;

Remarks
The InputScope property on PasswordBox supports only the Password and NumericPin values. Any other value is
ignored.
The input scope provides a hint at the type of text input expected by the control. Various elements of the system can
respond to the hint provided by the input scope and provide a specialized UI for the input type. For example, the soft
keyboard might show a number pad for text input when the control has its InputScope set to NumericPin.
The input scope does not perform any validation, and does not prevent the user from providing any input through a
hardware keyboard or other input device.
PasswordBox.InputScopeProperty PasswordBox.Input
ScopeProperty PasswordBox.InputScopeProperty
I n this Article
Edit
Identifies the InputScope dependency property.
public : static DependencyProperty InputScopeProperty { get; }
static DependencyProperty InputScopeProperty();
public static DependencyProperty InputScopeProperty { get; }

Returns
DependencyProperty
The identifier for the InputScope dependency property.
See Dependency properties overview
Also
PasswordBox.IsPasswordRevealButtonEnabled Password
Box.IsPasswordRevealButtonEnabled PasswordBox.Is
PasswordRevealButtonEnabled
I n this Article
Edit
Gets or sets a value that specifies whether the visual UI of the PasswordBox includes a button element that toggles
showing or hiding the typed characters. In Windows 10 and later, use PasswordRevealMode instead.
public : Platform::Boolean IsPasswordRevealButtonEnabled { get; set; }
bool IsPasswordRevealButtonEnabled();

void IsPasswordRevealButtonEnabled(bool ispasswordrevealbuttonenabled);


public bool IsPasswordRevealButtonEnabled { get; set; }

<PasswordBox IsPasswordRevealButtonEnabled="bool" />

Returns
bool
True to show a password reveal button; false to not show a password reveal button. The default is false.

Remarks
Windows 10 PasswordRevealMode replaces IsPasswordRevealButtonEnabled to give you more options for how
the user is able to view their password. The IsPasswordRevealButtonEnabled property is ignored.

The value of this property is not the only factor that determines whether a password reveal button is visible to the user.
Other factors include whether the control is displayed above a minimum width, whether the PasswordBox has focus,
and whether the text entry field contains at least one character.
PasswordBox.IsPasswordRevealButtonEnabledProperty
PasswordBox.IsPasswordRevealButtonEnabledProperty
PasswordBox.IsPasswordRevealButtonEnabledProperty
I n this Article
Edit
Identifies the IsPasswordRevealButtonEnabled dependency property.
public : static DependencyProperty IsPasswordRevealButtonEnabledProperty { get; }
static DependencyProperty IsPasswordRevealButtonEnabledProperty();
public static DependencyProperty IsPasswordRevealButtonEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsPasswordRevealButtonEnabled dependency property.
PasswordBox.MaxLength PasswordBox.MaxLength
PasswordBox.MaxLength
I n this Article
Edit
Gets or sets the maximum length for passwords to be handled by this PasswordBox.
public : int MaxLength { get; set; }
int32_t MaxLength();

void MaxLength(int32_t maxlength);


public int MaxLength { get; set; }

<PasswordBox MaxLength="int"/>

Returns
int
An integer that specifies the maximum number of characters for passwords to be handled by this PasswordBox. A
value of zero (0) means no limit. The default is 0 (no length limit).
PasswordBox.MaxLengthProperty PasswordBox.Max
LengthProperty PasswordBox.MaxLengthProperty
I n this Article
Edit
Identifies the MaxLength dependency property.
public : static DependencyProperty MaxLengthProperty { get; }
static DependencyProperty MaxLengthProperty();
public static DependencyProperty MaxLengthProperty { get; }

Returns
DependencyProperty
The identifier for the MaxLength dependency property.
PasswordBox.Password PasswordBox.Password Password
Box.Password
I n this Article
Edit
Gets or sets the password currently held by the PasswordBox.
public : Platform::String Password { get; set; }
winrt::hstring Password();

void Password(winrt::hstring password);


public string Password { get; set; }

<PasswordBox Password="string"/>

Returns
string
A string that represents the password currently held by the PasswordBox. The default is an empty string.
PasswordBox PasswordBox PasswordBox
I n this Article
Edit
Initializes a new instance of the PasswordBox class

public : PasswordBox()
PasswordBox() const;
public PasswordBox()
PasswordBox.PasswordChanged PasswordBox.Password
Changed PasswordBox.PasswordChanged
I n this Article
Edit
Occurs when the value of the Password property changes.
public : event RoutedEventHandler PasswordChanged
// Register
event_token PasswordChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void PasswordChanged(event_token const& cookie) const;

// Revoke with event_revoker


PasswordChanged_revoker PasswordChanged(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler PasswordChanged

<PasswordBox PasswordChanged="eventhandler"/>
PasswordBox.PasswordChanging PasswordBox.Password
Changing PasswordBox.PasswordChanging
I n this Article
Edit
Occurs synchronously when the text in the password box starts to change, but before it is rendered.
public : event TypedEventHandler<PasswordBox, PasswordBoxPasswordChangingEventArgs> PasswordChanging
// Register
event_token PasswordChanging(TypedEventHandler<PasswordBox, PasswordBoxPasswordChangingEventArgs>
const& handler) const;

// Revoke with event_token


void PasswordChanging(event_token const& cookie) const;

// Revoke with event_revoker


PasswordChanging_revoker PasswordChanging(auto_revoke_t, TypedEventHandler<PasswordBox,
PasswordBoxPasswordChangingEventArgs> const& handler) const;
public event TypedEventHandler<PasswordBox, PasswordBoxPasswordChangingEventArgs> PasswordChanging

<PasswordBox PasswordChanging="eventhandler"/>
PasswordBox.PasswordChar PasswordBox.PasswordChar
PasswordBox.PasswordChar
I n this Article
Edit
Gets or sets the masking character for the PasswordBox.
public : Platform::String PasswordChar { get; set; }
winrt::hstring PasswordChar();

void PasswordChar(winrt::hstring passwordchar);


public string PasswordChar { get; set; }

<PasswordBox PasswordChar="char"/>

Returns
string
A masking character to echo when the user enters text into the PasswordBox. The default value is a bullet character (●).
PasswordBox.PasswordCharProperty PasswordBox.
PasswordCharProperty PasswordBox.PasswordChar
Property
I n this Article
Edit
Identifies the PasswordChar dependency property.
public : static DependencyProperty PasswordCharProperty { get; }
static DependencyProperty PasswordCharProperty();
public static DependencyProperty PasswordCharProperty { get; }

Returns
DependencyProperty
The identifier for the PasswordChar dependency property.
PasswordBox.PasswordProperty PasswordBox.Password
Property PasswordBox.PasswordProperty
I n this Article
Edit
Identifies the Password dependency property.
public : static DependencyProperty PasswordProperty { get; }
static DependencyProperty PasswordProperty();
public static DependencyProperty PasswordProperty { get; }

Returns
DependencyProperty
The identifier for the Password dependency property.
PasswordBox.PasswordRevealMode PasswordBox.
PasswordRevealMode PasswordBox.PasswordReveal
Mode
I n this Article
Edit
Gets or sets a value that specifies whether the password is always, never, or optionally obscured.
public : PasswordRevealMode PasswordRevealMode { get; set; }
PasswordRevealMode PasswordRevealMode();

void PasswordRevealMode(PasswordRevealMode passwordrevealmode);


public PasswordRevealMode PasswordRevealMode { get; set; }

Returns
PasswordRevealMode
A value of the enumeration that specifies whether the password is always, never, or optionally obscured. The default is
Peek.

Examples
This example shows how to use a CheckBox to let a user switch the reveal mode of a PasswordBox.
<StackPanel Width="200">
<PasswordBox Name="passwordBox1"
PasswordRevealMode="Hidden"/>
<CheckBox Name="revealModeCheckBox" Content="Show password"
IsChecked="False"
Checked="CheckBox_Changed" Unchecked="CheckBox_Changed"/>
</StackPanel>

private void CheckBox_Changed(object sender, RoutedEventArgs e)


{
if (revealModeCheckBox.IsChecked == true)
{
passwordBox1.PasswordRevealMode = PasswordRevealMode.Visible;
}
else
{
passwordBox1.PasswordRevealMode = PasswordRevealMode.Hidden;
}
}

Private Sub CheckBox_Changed(sender As Object, e As RoutedEventArgs)


If revealModeCheckBox.IsChecked = True Then
passwordBox1.PasswordRevealMode = PasswordRevealMode.Visible
Else
passwordBox1.PasswordRevealMode = PasswordRevealMode.Hidden
End If
End Sub

Remarks
PasswordRevealMode replaces IsPasswordRevealButtonEnabled to give you more options for how the user is able to
view their password. The IsPasswordRevealButtonEnabled property is ignored.
To change the character used to obscure the password, set the PasswordChar property.
Peek mode
By default, the password reveal button (or "peek" button) is shown. The user must continuously press the button to
view the password, so that a high level of security is maintained.

The value of this property is not the only factor that determines whether a password reveal button is visible to the user.
Other factors include whether the control is displayed above a minimum width, whether the PasswordBox has focus,
and whether the text entry field contains at least one character. The password reveal button is shown only when the
PasswordBox receives focus for the first time and a character is entered. If the PasswordBox loses focus and then
regains focus, the reveal button is not shown again unless the password is cleared and character entry starts over.
Note

Prior to Windows 10, the password reveal button was not shown by default. If the security of your app requires that
the password is always obscured, be sure to set PasswordRevealMode to Hidden.
H idden and V isible modes
The other PasswordRevealMode enumeration values, Hidden and Visible, hide the password reveal button and let
you programmatically manage whether the password is obscured.
To always obscure the password, set PasswordRevealMode to Hidden. Unless you need the password to be always
obscured, you can provide a custom UI to let the user toggle the PasswordRevealMode between Hidden and Visible.
In previous versions of Windows Phone, PasswordBox used a CheckBox to toggle whether the password was
obscured. You can create a similar UI for your app, as shown in the example. You can also use other controls, like
ToggleButton, to let the user switch modes.

See PasswordRevealMode
Also
PasswordBox.PasswordRevealModeProperty Password
Box.PasswordRevealModeProperty PasswordBox.
PasswordRevealModeProperty
I n this Article
Edit
Identifies the PasswordRevealMode dependency property.
public : static DependencyProperty PasswordRevealModeProperty { get; }
static DependencyProperty PasswordRevealModeProperty();
public static DependencyProperty PasswordRevealModeProperty { get; }

Returns
DependencyProperty
The identifier for the PasswordRevealMode dependency property.
See Dependency properties overview
Also
PasswordBox.Paste PasswordBox.Paste PasswordBox.Paste
I n this Article
Edit
Occurs when text is pasted into the control.

public : event TextControlPasteEventHandler Paste


// Register
event_token Paste(TextControlPasteEventHandler const& handler) const;

// Revoke with event_token


void Paste(event_token const& cookie) const;

// Revoke with event_revoker


Paste_revoker Paste(auto_revoke_t, TextControlPasteEventHandler const& handler) const;
public event TextControlPasteEventHandler Paste

<PasswordBox Paste="eventhandler"/>

Remarks
The Paste event occurs before any content is inserted into the control. You can handle this event to check the contents
of the clipboard and perform any actions on the content before it's inserted. If you perform any action, set the handled
property to true; otherwise, the default paste action is performed. If you set the handled property to true, then it's
assumed the app has handled the insertion, and no default action is performed. You are responsible for determining
the insertion point and clipboard content to insert, and inserting the content.
PasswordBox.PasteFromClipboard PasswordBox.Paste
FromClipboard PasswordBox.PasteFromClipboard
I n this Article
Edit
Copies content from the Windows clipboard into the text control.
public : void PasteFromClipboard()
void PasteFromClipboard() const;
public void PasteFromClipboard()

Additional features and requirements


Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


PasswordBox.PlaceholderText PasswordBox.Placeholder
Text PasswordBox.PlaceholderText
I n this Article
Edit
Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation.
public : Platform::String PlaceholderText { get; set; }
winrt::hstring PlaceholderText();

void PlaceholderText(winrt::hstring placeholdertext);


public string PlaceholderText { get; set; }

<PasswordBox PlaceholderText="placeholderString"/>

Returns
string
The text that is displayed in the control when no value is entered. The default is an empty string ("").
PasswordBox.PlaceholderTextProperty PasswordBox.
PlaceholderTextProperty PasswordBox.PlaceholderText
Property
I n this Article
Edit
Identifies the PlaceholderText dependency property.
public : static DependencyProperty PlaceholderTextProperty { get; }
static DependencyProperty PlaceholderTextProperty();
public static DependencyProperty PlaceholderTextProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderText dependency property.
PasswordBox.PreventKeyboardDisplayOnProgrammatic
Focus PasswordBox.PreventKeyboardDisplayOn
ProgrammaticFocus PasswordBox.PreventKeyboard
DisplayOnProgrammaticFocus
I n this Article
Edit
Gets or sets a value that indicates whether the on-screen keyboard is shown when the control receives focus
programmatically.
public : Platform::Boolean PreventKeyboardDisplayOnProgrammaticFocus { get; set; }
bool PreventKeyboardDisplayOnProgrammaticFocus();

void PreventKeyboardDisplayOnProgrammaticFocus(bool preventkeyboarddisplayonprogrammaticfocus);


public bool PreventKeyboardDisplayOnProgrammaticFocus { get; set; }

<PasswordBox PreventKeyboardDisplayOnProgrammaticFocus="bool"/>

Returns
bool
true if the on-screen keyboard is not shown when the control receives focus programmatically; otherwise, false. The
default is false.

Remarks
Set this property to true to prevent the onscreen touch keyboard from showing when focus is programmatically set on
a text box. By default, the onscreen touch keyboard is displayed whenever focus moves to an editable text box and the
most recent input was generated by touch. This happens whether focus is set programmatically or by user interaction.
In some situations, you might not want the keyboard to show when focus is set programmatically. For example, you
might want to prevent the keyboard from covering part of your UI until the user is ready to continue their interaction.
PasswordBox.PreventKeyboardDisplayOnProgrammatic
FocusProperty PasswordBox.PreventKeyboardDisplayOn
ProgrammaticFocusProperty PasswordBox.Prevent
KeyboardDisplayOnProgrammaticFocusProperty
I n this Article
Edit
Identifies the PreventKeyboardDisplayOnProgrammaticFocus dependency property.
public : static DependencyProperty PreventKeyboardDisplayOnProgrammaticFocusProperty { get; }
static DependencyProperty PreventKeyboardDisplayOnProgrammaticFocusProperty();
public static DependencyProperty PreventKeyboardDisplayOnProgrammaticFocusProperty { get; }

Returns
DependencyProperty
The identifier for the PreventKeyboardDisplayOnProgrammaticFocus dependency property.
PasswordBox.SelectAll PasswordBox.SelectAll Password
Box.SelectAll
I n this Article
Edit
Selects all the characters in the PasswordBox.
public : void SelectAll()
void SelectAll() const;
public void SelectAll()
PasswordBox.SelectionFlyout PasswordBox.Selection
Flyout PasswordBox.SelectionFlyout
I n this Article
Edit
Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.
public : FlyoutBase SelectionFlyout { get; set; }
FlyoutBase SelectionFlyout();

void SelectionFlyout(FlyoutBase selectionflyout);


public FlyoutBase SelectionFlyout { get; set; }

Returns
FlyoutBase
The flyout that is shown when text is selected, or null if no flyout is shown. The default is an instance of
TextCommandBarFlyout.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


PasswordBox.SelectionFlyoutProperty PasswordBox.
SelectionFlyoutProperty PasswordBox.SelectionFlyout
Property
I n this Article
Edit
Identifies the SelectionFlyout dependency property.
public : static DependencyProperty SelectionFlyoutProperty { get; }
static DependencyProperty SelectionFlyoutProperty();
public static DependencyProperty SelectionFlyoutProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionFlyout dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


PasswordBox.SelectionHighlightColor PasswordBox.
SelectionHighlightColor PasswordBox.SelectionHighlight
Color
I n this Article
Edit
Gets or sets the brush used to highlight the selected text.
public : SolidColorBrush SelectionHighlightColor { get; set; }
SolidColorBrush SelectionHighlightColor();

void SelectionHighlightColor(SolidColorBrush selectionhighlightcolor);


public SolidColorBrush SelectionHighlightColor { get; set; }

<PasswordBox SelectionHighlightColor="{StaticResource resourceName}"/>

Returns
SolidColorBrush
The brush used to highlight the selected text. The default is a null brush from a pure code perspective, but the default
control template for PasswordBox applies a theme resource brush for this in a runtime instance of a PasswordBox
control.

Remarks
The control template sets the default selection highlight color to the system resource
TextSelectionHighlightColorThemeBrush. To change the selection highlight color for all editable text controls in
your app, you can override the TextSelectionHighlightColorThemeBrush system resource in App.xaml. This will
affect PasswordBox, TextBox, and RichEditBox controls. For more info, see XAML theme resources or PasswordBox
styles and templates.
See Use brushes
Also
PasswordBox.SelectionHighlightColorProperty Password
Box.SelectionHighlightColorProperty PasswordBox.
SelectionHighlightColorProperty
I n this Article
Edit
Identifies the SelectionHighlightColor dependency property.
public : static DependencyProperty SelectionHighlightColorProperty { get; }
static DependencyProperty SelectionHighlightColorProperty();
public static DependencyProperty SelectionHighlightColorProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionHighlightColor dependency property.
PasswordBox.TextReadingOrder PasswordBox.Text
ReadingOrder PasswordBox.TextReadingOrder
I n this Article
Edit
Gets or sets a value that indicates how the reading order is determined for the PasswordBox.
public : TextReadingOrder TextReadingOrder { get; set; }
TextReadingOrder TextReadingOrder();

void TextReadingOrder(TextReadingOrder textreadingorder);


public TextReadingOrder TextReadingOrder { get; set; }

<PasswordBox TextReadingOrder="textReadingOrderValue"/>

Returns
TextReadingOrder
A value that indicates how the reading order is determined for the PasswordBox. The default is DetectFromContent.

Remarks
This property can be useful when the base direction of the text is unknown, and may not match the user's language or
direction. For more info, see the Remarks section of the TextReadingOrder enumeration or How to support
bidirectional UI.
See TextReadingOrder
Also How to support bidirectional UI
PasswordBox.TextReadingOrderProperty PasswordBox.
TextReadingOrderProperty PasswordBox.TextReading
OrderProperty
I n this Article
Edit
Identifies the TextReadingOrder dependency property.
public : static DependencyProperty TextReadingOrderProperty { get; }
static DependencyProperty TextReadingOrderProperty();
public static DependencyProperty TextReadingOrderProperty { get; }

Returns
DependencyProperty
The identifier for the TextReadingOrder dependency property.
See Dependency properties overview
Also
PasswordBoxPasswordChangingEventArgs PasswordBox
PasswordChangingEventArgs PasswordBoxPassword
ChangingEventArgs Class
Provides event data for the PasswordBox.PasswordChanging event.

D eclaration
public : sealed class PasswordBoxPasswordChangingEventArgs :
IPasswordBoxPasswordChangingEventArgs
struct winrt::Windows::UI::Xaml::Controls::PasswordBoxPasswordChangingEventArgs :
IPasswordBoxPasswordChangingEventArgs
public sealed class PasswordBoxPasswordChangingEventArgs : IPasswordBoxPasswordChangingEventArgs

I nheritance H ierarchy
None

Remarks
An instance of this class is passed as a parameter to the PasswordBox.PasswordChanging event handler.

Properties
IsContentChanging
IsContentChanging
IsContentChanging

Gets a value that indicates whether the event occured due to a change in the text content.
PasswordBoxPasswordChangingEventArgs.IsContent
Changing PasswordBoxPasswordChangingEventArgs.Is
ContentChanging PasswordBoxPasswordChangingEvent
Args.IsContentChanging
I n this Article
Edit
Gets a value that indicates whether the event occured due to a change in the text content.
public : Platform::Boolean IsContentChanging { get; }
bool IsContentChanging();
public bool IsContentChanging { get; }

Returns
bool
true if a change to the text content caused the event; otherwise, false.

Remarks
This event occurs for a format or content change. The IsContentChanging property helps to distinguish when text
content is changing.
PasswordRevealMode PasswordRevealMode Password
RevealMode Enum
Defines constants that specify the password reveal behavior of a PasswordBox.

D eclaration
public : enum class PasswordRevealMode
enum class winrt::Windows::UI::Xaml::Controls::PasswordRevealMode : int32_t
public enum PasswordRevealMode

I nheritance H ierarchy
None

Remarks
See the PasswordBox.PasswordRevealMode property for more info and examples.

Fields
Hidden Hidden Hidden The password reveal button is not visible. The password is always obscured.

Peek Peek Peek The password reveal button is visible. The password is not obscured while the button is
pressed.

Visible Visible The password reveal button is not visible. The password is not obscured.
Visible
PathIcon PathIcon PathIcon Class
Represents an icon that uses a vector path as its content.

D eclaration
public : class PathIcon : IconElement, IPathIcon
struct winrt::Windows::UI::Xaml::Controls::PathIcon : IconElement, IPathIcon
public class PathIcon : IconElement, IPathIcon

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
IconElement

Remarks
Note

You can set the Foreground property on the AppBarButton or on the PathIcon. If you set the Foreground on the
AppBarButton, it's applied only to the default visual state. It's not applied to the other visual states defined in the
AppBarButton template, like MouseOver . If you set the Foreground on the PathIcon, the color is applied to all visual
states.

Constructors
PathIcon()
PathIcon()
PathIcon()

Initializes a new instance of the PathIcon class.

Properties
Data
Data
Data

Gets or sets a Geometry that specifies the shape to be drawn. In XAML. this can also be set using a string that
describes Move and draw commands syntax.

DataProperty
DataProperty
DataProperty

Identifies the Data dependency property.

See Also
IconElement
IconElement
IconElement
PathIcon.Data PathIcon.Data PathIcon.Data
I n this Article
Edit
Gets or sets a Geometry that specifies the shape to be drawn. In XAML. this can also be set using a string that
describes Move and draw commands syntax.
public : Geometry Data { get; set; }
Geometry Data();

void Data(Geometry data);


public Geometry Data { get; set; }

<PathIcon>
<PathIcon.Data>
singleGeometry
</PathIcon.Data>
</PathIcon>

Returns
Geometry
A description of the shape to be drawn.

Examples
This example shows an AppBarButton with a PathIcon.
<!-- App bar button with path icon. -->
<AppBarButton Label="PathIcon" Click="AppBarButton_Click">
<AppBarButton.Icon>
<PathIcon Data="F1 M 16,12 20,2L 20,16 1,16" HorizontalAlignment="Center"/>
</AppBarButton.Icon>
</AppBarButton>

See Move and draw commands syntax


Also
PathIcon.DataProperty PathIcon.DataProperty PathIcon.
DataProperty
I n this Article
Edit
Identifies the Data dependency property.
public : static DependencyProperty DataProperty { get; }
static DependencyProperty DataProperty();
public static DependencyProperty DataProperty { get; }

Returns
DependencyProperty
The identifier for the Data dependency property.
PathIcon PathIcon PathIcon
I n this Article
Edit
Initializes a new instance of the PathIcon class.

public : PathIcon()
PathIcon() const;
public PathIcon()
PathIconSource PathIconSource PathIconSource Class
Represents an icon source that uses a vector path as its content.

D eclaration
public : class PathIconSource : IconSource, IPathIconSource
struct winrt::Windows::UI::Xaml::Controls::PathIconSource : IconSource, IPathIconSource
public class PathIconSource : IconSource, IPathIconSource

I nheritance H ierarchy
DependencyObject
IconSource

Remarks
PathIconSource is similar to PathIcon. However, because it is not a FrameworkElement, it can be shared.

Constructors
PathIconSource()
PathIconSource()
PathIconSource()

Initializes a new instance of the PathIconSource class.

Properties
Data
Data
Data

Gets or sets a Geometry that specifies the shape to be drawn. In XAML. this can also be set using a string that
describes Move and draw commands syntax.

DataProperty
DataProperty
DataProperty

Identifies the Data dependency property.


PathIconSource.Data PathIconSource.Data PathIcon
Source.Data
I n this Article
Edit
Gets or sets a Geometry that specifies the shape to be drawn. In XAML. this can also be set using a string that
describes Move and draw commands syntax.
public : Geometry Data { get; set; }
Geometry Data();

void Data(Geometry data);


public Geometry Data { get; set; }

<PathIconSource>
<PathIconSource.Data>
singleGeometry
</PathIconSource.Data>
</PathIconSource>

Returns
Geometry
A description of the shape to be drawn.
PathIconSource.DataProperty PathIconSource.Data
Property PathIconSource.DataProperty
I n this Article
Edit
Identifies the Data dependency property.
public : static DependencyProperty DataProperty { get; }
static DependencyProperty DataProperty();
public static DependencyProperty DataProperty { get; }

Returns
DependencyProperty
The identifier for the Data dependency property.
PathIconSource PathIconSource PathIconSource
I n this Article
Edit
Initializes a new instance of the PathIconSource class.

public : PathIconSource()
PathIconSource() const;
public PathIconSource()
PersonPicture PersonPicture PersonPicture Class
Represents a control that displays the avatar image for a person, if one is available; if not, it displays the person's initials
or a generic glyph.

D eclaration
public : class PersonPicture : Control, IPersonPicture
struct winrt::Windows::UI::Xaml::Controls::PersonPicture : Control, IPersonPicture
public class PersonPicture : Control, IPersonPicture

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Constructors
PersonPicture()
PersonPicture()
PersonPicture()

Initializes a new instance of the PersonPicture class.

Properties
BadgeGlyph
BadgeGlyph
BadgeGlyph

Gets or sets a Segoe MDL2 Assets font glyph to display on the badge.

BadgeGlyphProperty
BadgeGlyphProperty
BadgeGlyphProperty

Identifies the BadgeGlyph dependency property.

BadgeImageSource
BadgeImageSource
BadgeImageSource

Gets or sets the source of an image to display on the badge.

BadgeImageSourceProperty
BadgeImageSourceProperty
BadgeImageSourceProperty

Identifies the BadgeImageSource dependency property.

BadgeNumber
BadgeNumber
BadgeNumber

Gets or sets the contact number to display on the badge.

BadgeNumberProperty
BadgeNumberProperty
BadgeNumberProperty

Identifies the BadgeNumber dependency property.

BadgeText
BadgeText
BadgeText

Gets or sets the contact text to display on the badge.

BadgeTextProperty
BadgeTextProperty
BadgeTextProperty

Identifies the BadgeText dependency property.

Contact
Contact
Contact

Gets or sets a Contact object that contains information about the person.

ContactProperty
ContactProperty
ContactProperty

Identifies the Contact dependency property.

DisplayName
DisplayName
DisplayName

Gets or sets the contact's display name.


DisplayNameProperty
DisplayNameProperty
DisplayNameProperty

Identifies the DisplayName dependency property.

Initials
Initials
Initials

Gets or sets the contact's initials.

InitialsProperty
InitialsProperty
InitialsProperty

Identifies the Initials dependency property.

IsGroup
IsGroup
IsGroup

Gets or sets a value that indicates whether the PersonPicture represents a group or an individual.

IsGroupProperty
IsGroupProperty
IsGroupProperty

Identifies the IsGroup dependency property.

PreferSmallImage
PreferSmallImage
PreferSmallImage

Gets or sets a value that indicates whether a small image is displayed rather than a large image when both are
available.

PreferSmallImageProperty
PreferSmallImageProperty
PreferSmallImageProperty

Identifies the PreferSmallImage dependency property.

ProfilePicture
ProfilePicture
ProfilePicture

Gets or sets the source of the contact's profile picture.

ProfilePictureProperty
ProfilePictureProperty
ProfilePictureProperty

Identifies the ProfilePicture dependency property.

See Also
PersonPicture.BadgeGlyph PersonPicture.BadgeGlyph
PersonPicture.BadgeGlyph
I n this Article
Edit
Gets or sets a Segoe MDL2 Assets font glyph to display on the badge.
public : Platform::String BadgeGlyph { get; set; }
winrt::hstring BadgeGlyph();

void BadgeGlyph(winrt::hstring badgeglyph);


public string BadgeGlyph { get; set; }

<PersonPicture BadgeGlyph="characterCode"/>

Returns
string
The hexadecimal character code for the badge glyph.
PersonPicture.BadgeGlyphProperty PersonPicture.Badge
GlyphProperty PersonPicture.BadgeGlyphProperty
I n this Article
Edit
Identifies the BadgeGlyph dependency property.
public : static DependencyProperty BadgeGlyphProperty { get; }
static DependencyProperty BadgeGlyphProperty();
public static DependencyProperty BadgeGlyphProperty { get; }

Returns
DependencyProperty
The identifier for the BadgeGlyph dependency property.
PersonPicture.BadgeImageSource PersonPicture.Badge
ImageSource PersonPicture.BadgeImageSource
I n this Article
Edit
Gets or sets the source of an image to display on the badge.
public : ImageSource BadgeImageSource { get; set; }
ImageSource BadgeImageSource();

void BadgeImageSource(ImageSource badgeimagesource);


public ImageSource BadgeImageSource { get; set; }

<PersonPicture BadgeImageSource="uri"/>

Returns
ImageSource
An object that represents the image source file for the drawn image. Typically you set this with a BitmapImage object,
constructed with the Uniform Resource Identifier (URI) that describes the path to a valid image source file. Or, you can
initialize a BitmapSource with a stream, perhaps a stream from a storage file.
PersonPicture.BadgeImageSourceProperty PersonPicture.
BadgeImageSourceProperty PersonPicture.BadgeImage
SourceProperty
I n this Article
Edit
Identifies the BadgeImageSource dependency property.
public : static DependencyProperty BadgeImageSourceProperty { get; }
static DependencyProperty BadgeImageSourceProperty();
public static DependencyProperty BadgeImageSourceProperty { get; }

Returns
DependencyProperty
The identifier for the BadgeImageSource dependency property.
PersonPicture.BadgeNumber PersonPicture.Badge
Number PersonPicture.BadgeNumber
I n this Article
Edit
Gets or sets the contact number to display on the badge.
public : int BadgeNumber { get; set; }
int32_t BadgeNumber();

void BadgeNumber(int32_t badgenumber);


public int BadgeNumber { get; set; }

<PersonPicture BadgeNumber="int"/>

Returns
int
The contact number to display on the badge.
PersonPicture.BadgeNumberProperty PersonPicture.
BadgeNumberProperty PersonPicture.BadgeNumber
Property
I n this Article
Edit
Identifies the BadgeNumber dependency property.
public : static DependencyProperty BadgeNumberProperty { get; }
static DependencyProperty BadgeNumberProperty();
public static DependencyProperty BadgeNumberProperty { get; }

Returns
DependencyProperty
The identifier for the BadgeNumber dependency property.
PersonPicture.BadgeText PersonPicture.BadgeText Person
Picture.BadgeText
I n this Article
Edit
Gets or sets the contact text to display on the badge.
public : Platform::String BadgeText { get; set; }
winrt::hstring BadgeText();

void BadgeText(winrt::hstring badgetext);


public string BadgeText { get; set; }

<PersonPicture BadgeText="string"/>

Returns
string
The contact text to display on the badge.
PersonPicture.BadgeTextProperty PersonPicture.Badge
TextProperty PersonPicture.BadgeTextProperty
I n this Article
Edit
Identifies the BadgeText dependency property.
public : static DependencyProperty BadgeTextProperty { get; }
static DependencyProperty BadgeTextProperty();
public static DependencyProperty BadgeTextProperty { get; }

Returns
DependencyProperty
The identifier for the BadgeText dependency property.
PersonPicture.Contact PersonPicture.Contact Person
Picture.Contact
I n this Article
Edit
Gets or sets a Contact object that contains information about the person.
public : Contact Contact { get; set; }
Contact Contact();

void Contact(Contact contact);


public Contact Contact { get; set; }

<PersonPicture Contact="{x:Bind contactObject}"/>

Returns
Contact
A Contact object that contains information about the person.
PersonPicture.ContactProperty PersonPicture.Contact
Property PersonPicture.ContactProperty
I n this Article
Edit
Identifies the Contact dependency property.
public : static DependencyProperty ContactProperty { get; }
static DependencyProperty ContactProperty();
public static DependencyProperty ContactProperty { get; }

Returns
DependencyProperty
The identifier for the Contact dependency property.
PersonPicture.DisplayName PersonPicture.DisplayName
PersonPicture.DisplayName
I n this Article
Edit
Gets or sets the contact's display name.
public : Platform::String DisplayName { get; set; }
winrt::hstring DisplayName();

void DisplayName(winrt::hstring displayname);


public string DisplayName { get; set; }

<PersonPicture DisplayName="string"/>

Returns
string
The contact's display name.
PersonPicture.DisplayNameProperty PersonPicture.
DisplayNameProperty PersonPicture.DisplayName
Property
I n this Article
Edit
Identifies the DisplayName dependency property.
public : static DependencyProperty DisplayNameProperty { get; }
static DependencyProperty DisplayNameProperty();
public static DependencyProperty DisplayNameProperty { get; }

Returns
DependencyProperty
The identifier for the DisplayName dependency property.
PersonPicture.Initials PersonPicture.Initials PersonPicture.
Initials
I n this Article
Edit
Gets or sets the contact's initials.
public : Platform::String Initials { get; set; }
winrt::hstring Initials();

void Initials(winrt::hstring initials);


public string Initials { get; set; }

<PersonPicture Initials="string"/>

Returns
string
The contact's initials.
PersonPicture.InitialsProperty PersonPicture.Initials
Property PersonPicture.InitialsProperty
I n this Article
Edit
Identifies the Initials dependency property.
public : static DependencyProperty InitialsProperty { get; }
static DependencyProperty InitialsProperty();
public static DependencyProperty InitialsProperty { get; }

Returns
DependencyProperty
The identifier for the Initials dependency property.
PersonPicture.IsGroup PersonPicture.IsGroup Person
Picture.IsGroup
I n this Article
Edit
Gets or sets a value that indicates whether the PersonPicture represents a group or an individual.
public : Platform::Boolean IsGroup { get; set; }
bool IsGroup();

void IsGroup(bool isgroup);


public bool IsGroup { get; set; }

<PersonPicture IsGroup="bool"/>

Returns
bool
true if the PersonPicture represents a group; otherwise, false.
PersonPicture.IsGroupProperty PersonPicture.IsGroup
Property PersonPicture.IsGroupProperty
I n this Article
Edit
Identifies the IsGroup dependency property.
public : static DependencyProperty IsGroupProperty { get; }
static DependencyProperty IsGroupProperty();
public static DependencyProperty IsGroupProperty { get; }

Returns
DependencyProperty
The identifier for the IsGroup dependency property.
PersonPicture PersonPicture PersonPicture
I n this Article
Edit
Initializes a new instance of the PersonPicture class.

public : PersonPicture()
PersonPicture() const;
public PersonPicture()
PersonPicture.PreferSmallImage PersonPicture.Prefer
SmallImage PersonPicture.PreferSmallImage
I n this Article
Edit
Gets or sets a value that indicates whether a small image is displayed rather than a large image when both are
available.
public : Platform::Boolean PreferSmallImage { get; set; }
bool PreferSmallImage();

void PreferSmallImage(bool prefersmallimage);


public bool PreferSmallImage { get; set; }

<PersonPicture PreferSmallImage="bool"/>

Returns
bool
true to display a small image even when a large image is available; otherwise, false. The default is false.

Remarks
If an image is available, the control displays the first image it finds, in this order:
1. LargeDisplayPicture
2. SmallDisplayPicture
3. Thumbnail
You can change which image is chosen by setting the PreferSmallImage property to true. This gives the
SmallDisplayPicture a higher priority than LargeDisplayPicture.
PersonPicture.PreferSmallImageProperty PersonPicture.
PreferSmallImageProperty PersonPicture.PreferSmall
ImageProperty
I n this Article
Edit
Identifies the PreferSmallImage dependency property.
public : static DependencyProperty PreferSmallImageProperty { get; }
static DependencyProperty PreferSmallImageProperty();
public static DependencyProperty PreferSmallImageProperty { get; }

Returns
DependencyProperty
The identifier for the PreferSmallImage dependency property.
PersonPicture.ProfilePicture PersonPicture.ProfilePicture
PersonPicture.ProfilePicture
I n this Article
Edit
Gets or sets the source of the contact's profile picture.
public : ImageSource ProfilePicture { get; set; }
ImageSource ProfilePicture();

void ProfilePicture(ImageSource profilepicture);


public ImageSource ProfilePicture { get; set; }

<PersonPicture ProfilePicture="uri"/>

Returns
ImageSource
An object that represents the image source file for the drawn image. Typically you set this with a BitmapImage object,
constructed with the Uniform Resource Identifier (URI) that describes the path to a valid image source file. Or, you can
initialize a BitmapSource with a stream, perhaps a stream from a storage file.
PersonPicture.ProfilePictureProperty PersonPicture.Profile
PictureProperty PersonPicture.ProfilePictureProperty
I n this Article
Edit
Identifies the ProfilePicture dependency property.
public : static DependencyProperty ProfilePictureProperty { get; }
static DependencyProperty ProfilePictureProperty();
public static DependencyProperty ProfilePictureProperty { get; }

Returns
DependencyProperty
The identifier for the ProfilePicture dependency property.
PickerConfirmedEventArgs PickerConfirmedEventArgs
PickerConfirmedEventArgs Class
Provides data for the PickerConfirmed event.

D eclaration
public : sealed class PickerConfirmedEventArgs : DependencyObject, IPickerConfirmedEventArgs
struct winrt::Windows::UI::Xaml::Controls::PickerConfirmedEventArgs : DependencyObject,
IPickerConfirmedEventArgs
public sealed class PickerConfirmedEventArgs : DependencyObject, IPickerConfirmedEventArgs

I nheritance H ierarchy
DependencyObject

Constructors
PickerConfirmedEventArgs()
PickerConfirmedEventArgs()
PickerConfirmedEventArgs()

Initializes a new instance of the PickerConfirmedEventArgs class.

See Also
DependencyObject
PickerConfirmedEventArgs PickerConfirmedEventArgs
PickerConfirmedEventArgs
I n this Article
Edit
Initializes a new instance of the PickerConfirmedEventArgs class.
public : PickerConfirmedEventArgs()
PickerConfirmedEventArgs() const;
public PickerConfirmedEventArgs()
PickerFlyout PickerFlyout PickerFlyout Class
Represents a custom picker control. (Not recommended for Universal Windows Platform (UWP ) app. See Flyout.)

D eclaration
public : sealed class PickerFlyout : PickerFlyoutBase, IPickerFlyout
struct winrt::Windows::UI::Xaml::Controls::PickerFlyout : PickerFlyoutBase, IPickerFlyout
public sealed class PickerFlyout : PickerFlyoutBase, IPickerFlyout

I nheritance H ierarchy
DependencyObject
FlyoutBase
PickerFlyoutBase

Remarks
Note

PickerFlyout is not supported for use in Universal Windows Platform (UWP ) app for Windows 10. Instead, use a
Flyout with a custom UI to present a custom picker control.

Constructors
PickerFlyout()
PickerFlyout()
PickerFlyout()

Initializes a new instance of the PickerFlyout class.

Properties
ConfirmationButtonsVisible
ConfirmationButtonsVisible
ConfirmationButtonsVisible

Gets or sets whether the confirmation buttons are visible.

ConfirmationButtonsVisibleProperty
ConfirmationButtonsVisibleProperty
ConfirmationButtonsVisibleProperty

Identifies the ConfirmationButtonsVisible dependency property.

Content
Content
Content

Gets or sets the content that is contained within the picker.


ContentProperty
ContentProperty
ContentProperty

Gets the identifier for the Content dependency property.

Methods
ShowAtAsync(FrameworkElement)
ShowAtAsync(FrameworkElement)
ShowAtAsync(FrameworkElement)

Begins an asynchronous operation to show the flyout placed in relation to the specified element.

Events
Confirmed
Confirmed
Confirmed

Occurs when the user has tapped a confirmation button to confirm the selection.

See Also
PickerFlyoutBase
PickerFlyout.ConfirmationButtonsVisible PickerFlyout.
ConfirmationButtonsVisible PickerFlyout.Confirmation
ButtonsVisible
I n this Article
Edit
Gets or sets whether the confirmation buttons are visible.
public : Platform::Boolean ConfirmationButtonsVisible { get; set; }
bool ConfirmationButtonsVisible();

void ConfirmationButtonsVisible(bool confirmationbuttonsvisible);


public bool ConfirmationButtonsVisible { get; set; }

Returns
bool
True of the confirmation buttons are visible; Otherwise, false.
PickerFlyout.ConfirmationButtonsVisibleProperty Picker
Flyout.ConfirmationButtonsVisibleProperty PickerFlyout.
ConfirmationButtonsVisibleProperty
I n this Article
Edit
Identifies the ConfirmationButtonsVisible dependency property.
public : static DependencyProperty ConfirmationButtonsVisibleProperty { get; }
static DependencyProperty ConfirmationButtonsVisibleProperty();
public static DependencyProperty ConfirmationButtonsVisibleProperty { get; }

Returns
DependencyProperty
The identifier of the ConfirmationButtonsVisible dependency property.
PickerFlyout.Confirmed PickerFlyout.Confirmed Picker
Flyout.Confirmed
I n this Article
Edit
Occurs when the user has tapped a confirmation button to confirm the selection.
public : event TypedEventHandler<PickerFlyout, PickerConfirmedEventArgs> Confirmed
// Register
event_token Confirmed(TypedEventHandler<PickerFlyout, PickerConfirmedEventArgs> const& handler)
const;

// Revoke with event_token


void Confirmed(event_token const& cookie) const;

// Revoke with event_revoker


Confirmed_revoker Confirmed(auto_revoke_t, TypedEventHandler<PickerFlyout, PickerConfirmedEventArgs>
const& handler) const;
public event TypedEventHandler<PickerFlyout, PickerConfirmedEventArgs> Confirmed
PickerFlyout.Content PickerFlyout.Content PickerFlyout.
Content
I n this Article
Edit
Gets or sets the content that is contained within the picker.
public : UIElement Content { get; set; }
UIElement Content();

void Content(UIElement content);


public UIElement Content { get; set; }

Returns
UIElement
The content of the user control.
PickerFlyout.ContentProperty PickerFlyout.Content
Property PickerFlyout.ContentProperty
I n this Article
Edit
Gets the identifier for the Content dependency property.
public : static DependencyProperty ContentProperty { get; }
static DependencyProperty ContentProperty();
public static DependencyProperty ContentProperty { get; }

Returns
DependencyProperty
The identifier for the Content dependency property.
PickerFlyout PickerFlyout PickerFlyout
I n this Article
Edit
Initializes a new instance of the PickerFlyout class.

public : PickerFlyout()
PickerFlyout() const;
public PickerFlyout()
PickerFlyout.ShowAtAsync PickerFlyout.ShowAtAsync
PickerFlyout.ShowAtAsync
I n this Article
Edit
Begins an asynchronous operation to show the flyout placed in relation to the specified element.
public : IAsyncOperation<Platform::Boolean> ShowAtAsync(FrameworkElement target)
IAsyncOperation<bool> ShowAtAsync(FrameworkElement target) const;
public IAsyncOperation<bool> ShowAtAsync(FrameworkElement target)

Parameters
target FrameworkElement
The element to use as the flyout's placement target.
Returns
IAsyncOperation<bool>
An asynchronous operation.
Attributes RemoteAsyncAttribute
PickerFlyoutPresenter PickerFlyoutPresenter PickerFlyout
Presenter Class
Represents a custom picker. (Not recommended for Universal Windows Platform (UWP ) app. See Flyout.)

D eclaration
public : sealed class PickerFlyoutPresenter : ContentControl, IPickerFlyoutPresenter
struct winrt::Windows::UI::Xaml::Controls::PickerFlyoutPresenter : ContentControl,
IPickerFlyoutPresenter
public sealed class PickerFlyoutPresenter : ContentControl, IPickerFlyoutPresenter

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

See Also
ContentControl
Pivot Pivot Pivot Class
Represents a control that provides quick navigation of views within an app.

D eclaration
public : class Pivot : ItemsControl, IPivot, IPivot2, IPivot3
struct winrt::Windows::UI::Xaml::Controls::Pivot : ItemsControl, IPivot, IPivot2, IPivot3
public class Pivot : ItemsControl, IPivot, IPivot2, IPivot3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl

Remarks
 Tip

For more info, design guidance, and code examples, see Pivot.
Use a Pivot to present groups of content that a user can swipe through. You typically use a Pivot as the top level control
on a page.
Pivot is an ItemsControl, so it can contain a collection of items of any type. Any item you add to the Pivot that is not
explicitly a PivotItem is implicitly wrapped in a PivotItem. Because a Pivot is often used to navigate between pages of
content, it's common to populate the Items collection directly with XAML UI elements. Or, you can set the ItemsSource
property to a data source. Items bound in the ItemsSource can be of any type, but if they aren't explicitly PivotItem s,
you must define an ItemTemplate and HeaderTemplate to specify how the items are displayed.
You can use the SelectedItem property to get or set the Pivot 's active item. Use the SelectedIndex property to get or
set the index of the active item.
You can use the LeftHeader and RightHeader properties to add other controls to the Pivot header.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the Pivot control.
R ES O U R CE K EY D ES CR IPTIO N

PivotBackground Control background color

PivotHeaderBackground Header background color

PivotNextButtonForeground Button icon color at rest

PivotNextButtonForegroundPointerOver Button icon color on hover

PivotNextButtonForegroundPressed Button icon color when pressed

PivotNextButtonBackground Button background color at rest

PivotNextButtonBackgroundPointerOver Button background color on hover

PivotNextButtonBackgroundPressed Button background color when pressed

PivotNextButtonBorderBrush Button border color at rest

PivotNextButtonBorderBrushPointerOver Button border color on hover

PivotNextButtonBorderBrushPressed Button border color when pressed

PivotPreviousButtonForeground Button icon color at rest

PivotPreviousButtonForegroundPointerOver Button icon color on hover

PivotPreviousButtonForegroundPressed Button icon color when pressed

PivotPreviousButtonBackground Button background color at rest

PivotPreviousButtonBackgroundPointerOver Button background color on hover

PivotPreviousButtonBackgroundPressed Button background color when pressed

PivotPreviousButtonBorderBrush Button border color at rest

PivotPreviousButtonBorderBrushPointerOver Button border color on hover

PivotPreviousButtonBorderBrushPressed Button border color when pressed

Constructors
Pivot()
Pivot()
Pivot()

Initializes a new instance of the Pivot type.

Properties
HeaderFocusVisualPlacement
HeaderFocusVisualPlacement
HeaderFocusVisualPlacement

Gets or sets a value that specifies the style of focus visual used for pivot header items.

HeaderFocusVisualPlacementProperty
HeaderFocusVisualPlacementProperty
HeaderFocusVisualPlacementProperty

Identifies the HeaderFocusVisualPlacement dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the template for the Header property of PivotItem children.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

IsHeaderItemsCarouselEnabled
IsHeaderItemsCarouselEnabled
IsHeaderItemsCarouselEnabled

Gets or sets a value that indicates whether the selected header moves to the first position.

IsHeaderItemsCarouselEnabledProperty
IsHeaderItemsCarouselEnabledProperty
IsHeaderItemsCarouselEnabledProperty

Identifies the IsHeaderItemsCarouselEnabled dependency property.

IsLocked
IsLocked
IsLocked

Gets or sets whether the Pivot is locked to show only the current PivotItem. While the Pivot is locked, all other
PivotItems are removed, and the user cannot navigate to them. An example of locking is when the email list is put
into a multi-select mode.

IsLockedProperty
IsLockedProperty
IsLockedProperty

Identifies the IsLocked dependency property.

LeftHeader
LeftHeader
LeftHeader

Gets or sets the content for the header on the control's left side.

LeftHeaderProperty
LeftHeaderProperty
LeftHeaderProperty

Identifies the LeftHeader dependency property.

LeftHeaderTemplate
LeftHeaderTemplate
LeftHeaderTemplate

Gets or sets the template for the header on the control's left side.

LeftHeaderTemplateProperty
LeftHeaderTemplateProperty
LeftHeaderTemplateProperty

Identifies the LeftHeaderTemplate dependency property.

RightHeader
RightHeader
RightHeader

Gets or sets the content for the header on the control's right side.

RightHeaderProperty
RightHeaderProperty
RightHeaderProperty

Identifies the RightHeader dependency property.

RightHeaderTemplate
RightHeaderTemplate
RightHeaderTemplate

Gets or sets the template for the header on the control's right side.
RightHeaderTemplateProperty
RightHeaderTemplateProperty
RightHeaderTemplateProperty

Identifies the RightHeaderTemplate dependency property.

SelectedIndex
SelectedIndex
SelectedIndex

Gets or sets the zero-based index of the currently selected item in the Pivot.

SelectedIndexProperty
SelectedIndexProperty
SelectedIndexProperty

Identifies the SelectedIndex dependency property.

SelectedItem
SelectedItem
SelectedItem

Gets or sets the currently selected item in the Pivot.

SelectedItemProperty
SelectedItemProperty
SelectedItemProperty

Identifies the SelectedItem dependency property.

SlideInAnimationGroupProperty
SlideInAnimationGroupProperty
SlideInAnimationGroupProperty

Identifies the SlideInAnimationGroup XAML attached property.

Title
Title
Title

Gets or sets the title to be optionally set above the headers.

TitleProperty
TitleProperty
TitleProperty
Identifies the Title dependency property.

TitleTemplate
TitleTemplate
TitleTemplate

Gets or sets the title template used for displaying the title above the headers area.

TitleTemplateProperty
TitleTemplateProperty
TitleTemplateProperty

Identifies the TitleTemplate dependency property.

Methods
GetSlideInAnimationGroup(FrameworkElement)
GetSlideInAnimationGroup(FrameworkElement)
GetSlideInAnimationGroup(FrameworkElement)

Retrieves the animation group that a FrameworkElement belongs to.

SetSlideInAnimationGroup(FrameworkElement, PivotSlideInAnimationGroup)
SetSlideInAnimationGroup(FrameworkElement, PivotSlideInAnimationGroup)
SetSlideInAnimationGroup(FrameworkElement, PivotSlideInAnimationGroup)

Assigns a FrameworkElement to a slide-in animation group so that element is animated at the same time as the
other members of that group.

Events
PivotItemLoaded
PivotItemLoaded
PivotItemLoaded

Event for indicating that an item has fully loaded.

PivotItemLoading
PivotItemLoading
PivotItemLoading

Event for offering an opportunity to dynamically load or change the content of a pivot item before it is displayed.

PivotItemUnloaded
PivotItemUnloaded
PivotItemUnloaded

Event for notifying that the pivot item has been completely unloaded from the visual pivot.

PivotItemUnloading
PivotItemUnloading
PivotItemUnloading

Event for offering an opportunity to dynamically load, change, or remove the content of a pivot item as it is
removed.

SelectionChanged
SelectionChanged
SelectionChanged

Occurs when the currently selected item changes.

See Also
Pivot.GetSlideInAnimationGroup Pivot.GetSlideIn
AnimationGroup Pivot.GetSlideInAnimationGroup
I n this Article
Edit
Retrieves the animation group that a FrameworkElement belongs to.
public : static PivotSlideInAnimationGroup GetSlideInAnimationGroup(FrameworkElement element)
static PivotSlideInAnimationGroup GetSlideInAnimationGroup(FrameworkElement element) const;
public static PivotSlideInAnimationGroup GetSlideInAnimationGroup(FrameworkElement element)

Parameters
element FrameworkElement
The FrameworkElement within the Pivot (such as a TextBlock ) that is to be animated.
Returns
PivotSlideInAnimationGroup
The slide-in animation group that this FrameworkElement belongs to.
Pivot.HeaderFocusVisualPlacement Pivot.HeaderFocus
VisualPlacement Pivot.HeaderFocusVisualPlacement
I n this Article
Edit
Gets or sets a value that specifies the style of focus visual used for pivot header items.
public : PivotHeaderFocusVisualPlacement HeaderFocusVisualPlacement { get; set; }
PivotHeaderFocusVisualPlacement HeaderFocusVisualPlacement();

void HeaderFocusVisualPlacement(PivotHeaderFocusVisualPlacement headerfocusvisualplacement);


public PivotHeaderFocusVisualPlacement HeaderFocusVisualPlacement { get; set; }

<Pivot HeaderFocusVisualPlacement="pivotHeaderFocusVisualPlacementMemberName" />

Returns
PivotHeaderFocusVisualPlacement
A value of the enumeration that specifies the style of focus visual used for pivot header items. The default is
SelectedItemHeader.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Use this property to specify how the focus visual is drawn around the Pivot header.
Version compatibility
The HeaderFocusVisualPlacement property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<Pivot x:Name="pivot1" Loaded="Pivot_Loaded">
...
</Pivot>

private void Pivot_Loaded(object sender, RoutedEventArgs e)


{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Pivot",
"HeaderFocusVisualPlacement"))
{
pivot1.HeaderFocusVisualPlacement = PivotHeaderFocusVisualPlacement.SelectedItemHeader;
}
}
Pivot.HeaderFocusVisualPlacementProperty Pivot.
HeaderFocusVisualPlacementProperty Pivot.Header
FocusVisualPlacementProperty
I n this Article
Edit
Identifies the HeaderFocusVisualPlacement dependency property.
public : static DependencyProperty HeaderFocusVisualPlacementProperty { get; }
static DependencyProperty HeaderFocusVisualPlacementProperty();
public static DependencyProperty HeaderFocusVisualPlacementProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderFocusVisualPlacement dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


Pivot.HeaderTemplate Pivot.HeaderTemplate Pivot.
HeaderTemplate
I n this Article
Edit
Gets or sets the template for the Header property of PivotItem children.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<Pivot HeaderTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The template for the Header property of PivotItem children.
See DataTemplate
Also
Pivot.HeaderTemplateProperty Pivot.HeaderTemplate
Property Pivot.HeaderTemplateProperty
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
Pivot.IsHeaderItemsCarouselEnabled Pivot.IsHeaderItems
CarouselEnabled Pivot.IsHeaderItemsCarouselEnabled
I n this Article
Edit
Gets or sets a value that indicates whether the selected header moves to the first position.
public : Platform::Boolean IsHeaderItemsCarouselEnabled { get; set; }
bool IsHeaderItemsCarouselEnabled();

void IsHeaderItemsCarouselEnabled(bool isheaderitemscarouselenabled);


public bool IsHeaderItemsCarouselEnabled { get; set; }

<Pivot IsHeaderItemsCarouselEnabled="bool" />

Returns
bool
true if the selected header moves to the first position; false if headers always keep the same position. The default is
true.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
This property has an effect only when the Pivot doesn't have enough space to show all the headers. If space is
available, all headers are shown regardless of this property setting.
By default, the selected Pivot header always moves to the first position (far left), and the headers carousel. The user can
pan infinitely and the content just wraps around from front to back.
When this property is false, the Pivot headers always keep the same position. Scrolling is enabled to show headers
that don't fit in the viewport.
Version compatibility
The IsHeaderItemsCarouselEnabled property is not available prior to Windows 10, version 1607. If your app’s
'minimum platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the
Requirements block later in this page, you must design and test your app to account for this. For more info, see Version
adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
<Pivot x:Name="pivot1" Loaded="Pivot_Loaded">
...
</Pivot>
private void Pivot_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.Pivot",
"IsHeaderItemsCarouselEnabled"))
{
pivot1.IsHeaderItemsCarouselEnabled = false;
}
}
Pivot.IsHeaderItemsCarouselEnabledProperty Pivot.Is
HeaderItemsCarouselEnabledProperty Pivot.IsHeader
ItemsCarouselEnabledProperty
I n this Article
Edit
Identifies the IsHeaderItemsCarouselEnabled dependency property.
public : static DependencyProperty IsHeaderItemsCarouselEnabledProperty { get; }
static DependencyProperty IsHeaderItemsCarouselEnabledProperty();
public static DependencyProperty IsHeaderItemsCarouselEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsHeaderItemsCarouselEnabled dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


Pivot.IsLocked Pivot.IsLocked Pivot.IsLocked
I n this Article
Edit
Gets or sets whether the Pivot is locked to show only the current PivotItem. While the Pivot is locked, all other
PivotItems are removed, and the user cannot navigate to them. An example of locking is when the email list is put into
a multi-select mode.
public : Platform::Boolean IsLocked { get; set; }
bool IsLocked();

void IsLocked(bool islocked);


public bool IsLocked { get; set; }

<Pivot IsLocked="bool" />

Returns
bool
true if the Pivot is locked; false if it is unlocked. The default is false.
Pivot.IsLockedProperty Pivot.IsLockedProperty Pivot.Is
LockedProperty
I n this Article
Edit
Identifies the IsLocked dependency property.
public : static DependencyProperty IsLockedProperty { get; }
static DependencyProperty IsLockedProperty();
public static DependencyProperty IsLockedProperty { get; }

Returns
DependencyProperty
The identifier for the IsLocked dependency property.
Pivot.LeftHeader Pivot.LeftHeader Pivot.LeftHeader
I n this Article
Edit
Gets or sets the content for the header on the control's left side.

public : Platform::Object LeftHeader { get; set; }


winrt::Windows::Foundation::IInspectable LeftHeader();

void LeftHeader(winrt::Windows::Foundation::IInspectable leftheader);


public object LeftHeader { get; set; }

<Pivot LeftHeader="headerString"/>

Returns
object
The content of the header on the control's left side. The default is null.

Remarks
You can set a data template for the LeftHeader value by using the LeftHeaderTemplate property.
Pivot.LeftHeaderProperty Pivot.LeftHeaderProperty
Pivot.LeftHeaderProperty
I n this Article
Edit
Identifies the LeftHeader dependency property.
public : static DependencyProperty LeftHeaderProperty { get; }
static DependencyProperty LeftHeaderProperty();
public static DependencyProperty LeftHeaderProperty { get; }

Returns
DependencyProperty
The identifier for the LeftHeader dependency property.
See Dependency properties overview
Also
Pivot.LeftHeaderTemplate Pivot.LeftHeaderTemplate
Pivot.LeftHeaderTemplate
I n this Article
Edit
Gets or sets the template for the header on the control's left side.
public : DataTemplate LeftHeaderTemplate { get; set; }
DataTemplate LeftHeaderTemplate();

void LeftHeaderTemplate(DataTemplate leftheadertemplate);


public DataTemplate LeftHeaderTemplate { get; set; }

<Pivot LeftHeaderTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The template for the header on the control's left side.
Pivot.LeftHeaderTemplateProperty Pivot.LeftHeader
TemplateProperty Pivot.LeftHeaderTemplateProperty
I n this Article
Edit
Identifies the LeftHeaderTemplate dependency property.
public : static DependencyProperty LeftHeaderTemplateProperty { get; }
static DependencyProperty LeftHeaderTemplateProperty();
public static DependencyProperty LeftHeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the LeftHeaderTemplate dependency property.
See Dependency properties overview
Also
Pivot Pivot Pivot
I n this Article
Edit
Initializes a new instance of the Pivot type.

public : Pivot()
Pivot() const;
public Pivot()
Pivot.PivotItemLoaded Pivot.PivotItemLoaded Pivot.
PivotItemLoaded
I n this Article
Edit
Event for indicating that an item has fully loaded.
public : event TypedEventHandler<Pivot, PivotItemEventArgs> PivotItemLoaded
// Register
event_token PivotItemLoaded(TypedEventHandler<Pivot, PivotItemEventArgs> const& handler) const;

// Revoke with event_token


void PivotItemLoaded(event_token const& cookie) const;

// Revoke with event_revoker


PivotItemLoaded_revoker PivotItemLoaded(auto_revoke_t, TypedEventHandler<Pivot, PivotItemEventArgs>
const& handler) const;
public event TypedEventHandler<Pivot, PivotItemEventArgs> PivotItemLoaded

<Pivot PivotItemLoaded="eventhandler" />


Pivot.PivotItemLoading Pivot.PivotItemLoading Pivot.
PivotItemLoading
I n this Article
Edit
Event for offering an opportunity to dynamically load or change the content of a pivot item before it is displayed.
public : event TypedEventHandler<Pivot, PivotItemEventArgs> PivotItemLoading
// Register
event_token PivotItemLoading(TypedEventHandler<Pivot, PivotItemEventArgs> const& handler) const;

// Revoke with event_token


void PivotItemLoading(event_token const& cookie) const;

// Revoke with event_revoker


PivotItemLoading_revoker PivotItemLoading(auto_revoke_t, TypedEventHandler<Pivot,
PivotItemEventArgs> const& handler) const;
public event TypedEventHandler<Pivot, PivotItemEventArgs> PivotItemLoading

<Pivot PivotItemLoading="eventhandler" />


Pivot.PivotItemUnloaded Pivot.PivotItemUnloaded Pivot.
PivotItemUnloaded
I n this Article
Edit
Event for notifying that the pivot item has been completely unloaded from the visual pivot.
public : event TypedEventHandler<Pivot, PivotItemEventArgs> PivotItemUnloaded
// Register
event_token PivotItemUnloaded(TypedEventHandler<Pivot, PivotItemEventArgs> const& handler) const;

// Revoke with event_token


void PivotItemUnloaded(event_token const& cookie) const;

// Revoke with event_revoker


PivotItemUnloaded_revoker PivotItemUnloaded(auto_revoke_t, TypedEventHandler<Pivot,
PivotItemEventArgs> const& handler) const;
public event TypedEventHandler<Pivot, PivotItemEventArgs> PivotItemUnloaded

<Pivot PivotItemUnloaded="eventhandler" />


Pivot.PivotItemUnloading Pivot.PivotItemUnloading
Pivot.PivotItemUnloading
I n this Article
Edit
Event for offering an opportunity to dynamically load, change, or remove the content of a pivot item as it is removed.
public : event TypedEventHandler<Pivot, PivotItemEventArgs> PivotItemUnloading
// Register
event_token PivotItemUnloading(TypedEventHandler<Pivot, PivotItemEventArgs> const& handler) const;

// Revoke with event_token


void PivotItemUnloading(event_token const& cookie) const;

// Revoke with event_revoker


PivotItemUnloading_revoker PivotItemUnloading(auto_revoke_t, TypedEventHandler<Pivot,
PivotItemEventArgs> const& handler) const;
public event TypedEventHandler<Pivot, PivotItemEventArgs> PivotItemUnloading

<Pivot PivotItemUnloading="eventhandler" />


Pivot.RightHeader Pivot.RightHeader Pivot.RightHeader
I n this Article
Edit
Gets or sets the content for the header on the control's right side.

public : Platform::Object RightHeader { get; set; }


winrt::Windows::Foundation::IInspectable RightHeader();

void RightHeader(winrt::Windows::Foundation::IInspectable rightheader);


public object RightHeader { get; set; }

<Pivot RightHeader="headerString"/>

Returns
object
The content of the header on the control's right side. The default is null.

Remarks
You can set a data template for the RightHeader value by using the RightHeaderTemplate property.
Pivot.RightHeaderProperty Pivot.RightHeaderProperty
Pivot.RightHeaderProperty
I n this Article
Edit
Identifies the RightHeader dependency property.
public : static DependencyProperty RightHeaderProperty { get; }
static DependencyProperty RightHeaderProperty();
public static DependencyProperty RightHeaderProperty { get; }

Returns
DependencyProperty
The identifier for the RightHeader dependency property.
See Dependency properties overview
Also
Pivot.RightHeaderTemplate Pivot.RightHeaderTemplate
Pivot.RightHeaderTemplate
I n this Article
Edit
Gets or sets the template for the header on the control's right side.
public : DataTemplate RightHeaderTemplate { get; set; }
DataTemplate RightHeaderTemplate();

void RightHeaderTemplate(DataTemplate rightheadertemplate);


public DataTemplate RightHeaderTemplate { get; set; }

<Pivot RightHeaderTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The template for the header on the control's right side.
Pivot.RightHeaderTemplateProperty Pivot.RightHeader
TemplateProperty Pivot.RightHeaderTemplateProperty
I n this Article
Edit
Identifies the RightHeaderTemplate dependency property.
public : static DependencyProperty RightHeaderTemplateProperty { get; }
static DependencyProperty RightHeaderTemplateProperty();
public static DependencyProperty RightHeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the RightHeaderTemplate dependency property.
See Dependency properties overview
Also
Pivot.SelectedIndex Pivot.SelectedIndex Pivot.Selected
Index
I n this Article
Edit
Gets or sets the zero-based index of the currently selected item in the Pivot.
public : int SelectedIndex { get; set; }
int32_t SelectedIndex();

void SelectedIndex(int32_t selectedindex);


public int SelectedIndex { get; set; }

Returns
int
The zero-based index of the currently selected item.
Pivot.SelectedIndexProperty Pivot.SelectedIndexProperty
Pivot.SelectedIndexProperty
I n this Article
Edit
Identifies the SelectedIndex dependency property.
public : static DependencyProperty SelectedIndexProperty { get; }
static DependencyProperty SelectedIndexProperty();
public static DependencyProperty SelectedIndexProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedIndex dependency property.
Pivot.SelectedItem Pivot.SelectedItem Pivot.SelectedItem
I n this Article
Edit
Gets or sets the currently selected item in the Pivot.

public : Platform::Object SelectedItem { get; set; }


winrt::Windows::Foundation::IInspectable SelectedItem();

void SelectedItem(winrt::Windows::Foundation::IInspectable selecteditem);


public object SelectedItem { get; set; }

Returns
object
The currently selected PivotItem or, if the Pivot is bound to data, the data item set as the Content of the currently
selected PivotItem.
Pivot.SelectedItemProperty Pivot.SelectedItemProperty
Pivot.SelectedItemProperty
I n this Article
Edit
Identifies the SelectedItem dependency property.
public : static DependencyProperty SelectedItemProperty { get; }
static DependencyProperty SelectedItemProperty();
public static DependencyProperty SelectedItemProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedItem dependency property.
Pivot.SelectionChanged Pivot.SelectionChanged Pivot.
SelectionChanged
I n this Article
Edit
Occurs when the currently selected item changes.
public : event SelectionChangedEventHandler SelectionChanged
// Register
event_token SelectionChanged(SelectionChangedEventHandler const& handler) const;

// Revoke with event_token


void SelectionChanged(event_token const& cookie) const;

// Revoke with event_revoker


SelectionChanged_revoker SelectionChanged(auto_revoke_t, SelectionChangedEventHandler const&
handler) const;
public event SelectionChangedEventHandler SelectionChanged

<Pivot SelectionChanged="eventhandler" />


Pivot.SetSlideInAnimationGroup Pivot.SetSlideIn
AnimationGroup Pivot.SetSlideInAnimationGroup
I n this Article
Edit
Assigns a FrameworkElement to a slide-in animation group so that element is animated at the same time as the other
members of that group.
public : static void SetSlideInAnimationGroup(FrameworkElement element, PivotSlideInAnimationGroup
value)
static void SetSlideInAnimationGroup(FrameworkElement element, PivotSlideInAnimationGroup value)
const;
public static void SetSlideInAnimationGroup(FrameworkElement element, PivotSlideInAnimationGroup
value)

Parameters
element FrameworkElement
The FrameworkElement within the Pivot (such as a TextBlock ) that is to be animated.
value PivotSlideInAnimationGroup
The slide-in animation group that this FrameworkElement belongs to. This element will be animated with all other
elements that share the same group number.
Pivot.SlideInAnimationGroupProperty Pivot.SlideIn
AnimationGroupProperty Pivot.SlideInAnimationGroup
Property
I n this Article
Edit
Identifies the SlideInAnimationGroup XAML attached property.
public : static DependencyProperty SlideInAnimationGroupProperty { get; }
static DependencyProperty SlideInAnimationGroupProperty();
public static DependencyProperty SlideInAnimationGroupProperty { get; }

Returns
DependencyProperty
The identifier for the SlideInAnimationGroup XAML attached property.
Pivot.Title Pivot.Title Pivot.Title
I n this Article
Edit
Gets or sets the title to be optionally set above the headers.

public : Platform::Object Title { get; set; }


winrt::Windows::Foundation::IInspectable Title();

void Title(winrt::Windows::Foundation::IInspectable title);


public object Title { get; set; }

<Pivot Title="string" />

Returns
object
Returns String.
Pivot.TitleProperty Pivot.TitleProperty Pivot.TitleProperty
I n this Article
Edit
Identifies the Title dependency property.

public : static DependencyProperty TitleProperty { get; }


static DependencyProperty TitleProperty();
public static DependencyProperty TitleProperty { get; }

Returns
DependencyProperty
The identifier for the Title dependency property.
Pivot.TitleTemplate Pivot.TitleTemplate Pivot.Title
Template
I n this Article
Edit
Gets or sets the title template used for displaying the title above the headers area.
public : DataTemplate TitleTemplate { get; set; }
DataTemplate TitleTemplate();

void TitleTemplate(DataTemplate titletemplate);


public DataTemplate TitleTemplate { get; set; }

<Pivot TitleTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The template that specifies the visualization of the title object.
See DataTemplate
Also
Pivot.TitleTemplateProperty Pivot.TitleTemplateProperty
Pivot.TitleTemplateProperty
I n this Article
Edit
Identifies the TitleTemplate dependency property.
public : static DependencyProperty TitleTemplateProperty { get; }
static DependencyProperty TitleTemplateProperty();
public static DependencyProperty TitleTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the TitleTemplate dependency property.
PivotHeaderFocusVisualPlacement PivotHeaderFocus
VisualPlacement PivotHeaderFocusVisualPlacement
Enum
Defines constants that specify the style of focus visual used for pivot header items.

D eclaration
public : enum class PivotHeaderFocusVisualPlacement
enum class winrt::Windows::UI::Xaml::Controls::PivotHeaderFocusVisualPlacement : int32_t
public enum PivotHeaderFocusVisualPlacement

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the Pivot.HeaderFocusVisualPlacement property.

Fields
ItemHeaders ItemHeaders ItemHeaders A single focus visual (rectangle) is drawn around all visible
item headers.

SelectedItemHeader SelectedItemHeader The focus visual (underline) is drawn under the selected item
SelectedItemHeader header.
PivotItem PivotItem PivotItem Class
Represents the container for an item in a Pivot control.

D eclaration
public : class PivotItem : ContentControl, IPivotItem
struct winrt::Windows::UI::Xaml::Controls::PivotItem : ContentControl, IPivotItem
public class PivotItem : ContentControl, IPivotItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the PivotItem control.

R ES O U R CE K EY D ES CR IPTIO N

PivotItemBackground Item background color

Constructors
PivotItem()
PivotItem()
PivotItem()

Initializes a new instance of the PivotItem type.

Properties
Header
Header
Header

Gets or sets the header for the PivotItem.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

See Also
ContentControl
ContentControl
PivotItem.Header PivotItem.Header PivotItem.Header
I n this Article
Edit
Gets or sets the header for the PivotItem.

public : Platform::Object Header { get; set; }


winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<PivotItem Header="headerString"/>

Returns
object
Returns Object.
PivotItem.HeaderProperty PivotItem.HeaderProperty
PivotItem.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
PivotItem PivotItem PivotItem
I n this Article
Edit
Initializes a new instance of the PivotItem type.

public : PivotItem()
PivotItem() const;
public PivotItem()
PivotItemEventArgs PivotItemEventArgs PivotItemEvent
Args Class
Event arguments for dynamically interacting with the PivotItem before use, allowing for delay load scenarios.

D eclaration
public : sealed class PivotItemEventArgs : IPivotItemEventArgs
struct winrt::Windows::UI::Xaml::Controls::PivotItemEventArgs : IPivotItemEventArgs
public sealed class PivotItemEventArgs : IPivotItemEventArgs

I nheritance H ierarchy
None

Constructors
PivotItemEventArgs()
PivotItemEventArgs()
PivotItemEventArgs()

Initializes a new instance of the PivotItemEventArgs type

Properties
Item
Item
Item

Gets the pivot item instance.


PivotItemEventArgs.Item PivotItemEventArgs.Item Pivot
ItemEventArgs.Item
I n this Article
Edit
Gets the pivot item instance.
public : PivotItem Item { get; set; }
PivotItem Item();

void Item(PivotItem item);


public PivotItem Item { get; set; }

Returns
PivotItem
Returns PivotItem.
PivotItemEventArgs PivotItemEventArgs PivotItemEvent
Args
I n this Article
Edit
Initializes a new instance of the PivotItemEventArgs type
public : PivotItemEventArgs()
PivotItemEventArgs() const;
public PivotItemEventArgs()
PivotSlideInAnimationGroup PivotSlideInAnimation
Group PivotSlideInAnimationGroup Enum
Defines constants that specify the different slide-in animation groups that Pivot elements can belong to.

D eclaration
public : enum class PivotSlideInAnimationGroup
enum class winrt::Windows::UI::Xaml::Controls::PivotSlideInAnimationGroup : int32_t
public enum PivotSlideInAnimationGroup

I nheritance H ierarchy
None

Remarks
These values are used by the Pivot.SlideInAnimationGroup attached property.

Fields
Default Default Default The element belongs to the default animation group. It slides in after the Pivot header.

GroupOne GroupOne GroupOne The element belongs to the first animation group. It slides in after elements in the
default group.

GroupThree GroupThree The element belongs to the third animation group. It slides in after elements in the
GroupThree second group.

GroupTwo GroupTwo GroupTwo The element belongs to the second animation group. It slides in after elements in the
first group.

See Also
ProgressBar ProgressBar ProgressBar Class
Represents a control that indicates the progress of an operation, where the typical visual appearance is a bar that
animates a filled area as progress continues.

D eclaration
public : class ProgressBar : RangeBase, IProgressBar
struct winrt::Windows::UI::Xaml::Controls::ProgressBar : RangeBase, IProgressBar
public class ProgressBar : RangeBase, IProgressBar

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
RangeBase

Remarks
 Tip

For more info, design guidance, and code examples, see [Progress controls.
A ProgressBar control visually indicates progress of an operation with one of two styles: a bar that displays a repeating
pattern, or a bar that fills based on a value.

The IsIndeterminate property determines the appearance of a ProgressBar.


Set IsIndeterminate to true to display a repeating pattern. An alternative control to use for indeterminate progress is a
ProgressRing.
Set IsIndeterminate to false to fill the bar based on a value. When IsIndeterminate is false, you specify the range with
the Minimum and Maximum properties. By default Minimum is 0 and Maximum is 1. To specify the progress value,
you set the Value property.
Notes for Windows 8.x
Windows 8.x In an app compiled for Windows 8, when the ProgressBar is indeterminate, the progress animation
continues even if it's not visible on the screen, such as when the ProgressBar Visibility is Collapsed. This can keep
the UI thread awake, use resources, and impair app performance. When the ProgressBar is not visible, you should
disable the animation by setting IsIndeterminate to false.

Constructors
ProgressBar()
ProgressBar()
ProgressBar()

Initializes a new instance of the ProgressBar class.


Properties
IsIndeterminate
IsIndeterminate
IsIndeterminate

Gets or sets a value that indicates whether the progress bar reports generic progress with a repeating pattern or
reports progress based on the Value property.

IsIndeterminateProperty
IsIndeterminateProperty
IsIndeterminateProperty

Identifies the IsIndeterminate dependency property.

ShowError
ShowError
ShowError

Gets or sets a value that indicates whether the progress bar should use visual states that communicate an Error
state to the user.

ShowErrorProperty
ShowErrorProperty
ShowErrorProperty

Identifies the ShowError dependency property.

ShowPaused
ShowPaused
ShowPaused

Gets or sets a value that indicates whether the progress bar should use visual states that communicate a Paused
state to the user.

ShowPausedProperty
ShowPausedProperty
ShowPausedProperty

Identifies the ShowPaused dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ProgressBar control.
See Also
ProgressBar.IsIndeterminate ProgressBar.IsIndeterminate
ProgressBar.IsIndeterminate
I n this Article
Edit
Gets or sets a value that indicates whether the progress bar reports generic progress with a repeating pattern or
reports progress based on the Value property.
public : Platform::Boolean IsIndeterminate { get; set; }
bool IsIndeterminate();

void IsIndeterminate(bool isindeterminate);


public bool IsIndeterminate { get; set; }

<ProgressBar IsIndeterminate="bool"/>

Returns
bool
True if the progress bar reports generic progress with a repeating pattern; false if the progress bar reports progress
based on the Value property. The default is false.

Remarks
Notes for Windows 8.x
Windows 8.x In an app compiled for Windows 8, when the ProgressBar is indeterminate, the progress animation
continues even if it's not visible on the screen, such as when the ProgressBar Visibility is collapsed. This can keep
the UI thread awake, use resources, and impair app performance. When the ProgressBar is not visible, you should
disable the animation by setting IsIndeterminate to false.
ProgressBar.IsIndeterminateProperty ProgressBar.Is
IndeterminateProperty ProgressBar.IsIndeterminate
Property
I n this Article
Edit
Identifies the IsIndeterminate dependency property.
public : static DependencyProperty IsIndeterminateProperty { get; }
static DependencyProperty IsIndeterminateProperty();
public static DependencyProperty IsIndeterminateProperty { get; }

Returns
DependencyProperty
The identifier for the IsIndeterminate dependency property.
ProgressBar ProgressBar ProgressBar
I n this Article
Edit
Initializes a new instance of the ProgressBar class.

public : ProgressBar()
ProgressBar() const;
public ProgressBar()
ProgressBar.ShowError ProgressBar.ShowError Progress
Bar.ShowError
I n this Article
Edit
Gets or sets a value that indicates whether the progress bar should use visual states that communicate an Error state to
the user.
public : Platform::Boolean ShowError { get; set; }
bool ShowError();

void ShowError(bool showerror);


public bool ShowError { get; set; }

<ProgressBar ShowError="bool"/>

Returns
bool
True if the progress bar should use visual states that communicate an Error state to the user; otherwise, false. The
default is false.
ProgressBar.ShowErrorProperty ProgressBar.ShowError
Property ProgressBar.ShowErrorProperty
I n this Article
Edit
Identifies the ShowError dependency property.
public : static DependencyProperty ShowErrorProperty { get; }
static DependencyProperty ShowErrorProperty();
public static DependencyProperty ShowErrorProperty { get; }

Returns
DependencyProperty
The identifier for the ShowError dependency property.
ProgressBar.ShowPaused ProgressBar.ShowPaused
ProgressBar.ShowPaused
I n this Article
Edit
Gets or sets a value that indicates whether the progress bar should use visual states that communicate a Paused state
to the user.
public : Platform::Boolean ShowPaused { get; set; }
bool ShowPaused();

void ShowPaused(bool showpaused);


public bool ShowPaused { get; set; }

<ProgressBar ShowPaused="bool"/>

Returns
bool
True if the progress bar should use visual states that communicate a Paused state to the user; otherwise, false. The
default is false.
ProgressBar.ShowPausedProperty ProgressBar.Show
PausedProperty ProgressBar.ShowPausedProperty
I n this Article
Edit
Identifies the ShowPaused dependency property.
public : static DependencyProperty ShowPausedProperty { get; }
static DependencyProperty ShowPausedProperty();
public static DependencyProperty ShowPausedProperty { get; }

Returns
DependencyProperty
The identifier for the ShowPaused dependency property.
ProgressBar.TemplateSettings ProgressBar.Template
Settings ProgressBar.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ProgressBar control.
public : ProgressBarTemplateSettings TemplateSettings { get; }
ProgressBarTemplateSettings TemplateSettings();
public ProgressBarTemplateSettings TemplateSettings { get; }

Returns
ProgressBarTemplateSettings
An object that provides calculated values for templates.
ProgressRing ProgressRing ProgressRing Class
Represents a control that indicates that an operation is ongoing. The typical visual appearance is a ring-shaped
"spinner" that cycles an animation as progress continues.

D eclaration
public : sealed class ProgressRing : Control, IProgressRing
struct winrt::Windows::UI::Xaml::Controls::ProgressRing : Control, IProgressRing
public sealed class ProgressRing : Control, IProgressRing

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see [Progress controls.
ProgressRing is a control that indicates indeterminate progress by displaying an animated ring.

Use a ProgressRing to visually indicate that an operation is in progress. Set the IsActive property to turn the
ProgressRing on or off. If IsActive is false, the ProgressRing is not shown, but space is reserved for it in the UI layout.
To not reserve space for the ProgressRing, set its Visibility property to Collapsed.
Notes for Windows 8.x
Windows 8.x In an app compiled for Windows 8, when the ProgressRing is active, the progress animation
continues even if its not visible on the screen, such as when it's Visibility is Collapsed. This can keep the UI thread
awake, use resources, and impair app performance. When the ProgressRing is not visible, you should disable the
animation by setting IsActive to false.

Constructors
ProgressRing()
ProgressRing()
ProgressRing()

Initializes a new instance of the ProgressRing class.

Properties
IsActive
IsActive
IsActive

Gets or sets a value that indicates whether the ProgressRing is showing progress.
IsActiveProperty
IsActiveProperty
IsActiveProperty

Identifies the IsActive dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ProgressRing control.

See Also
ProgressRing.IsActive ProgressRing.IsActive Progress
Ring.IsActive
I n this Article
Edit
Gets or sets a value that indicates whether the ProgressRing is showing progress.
public : Platform::Boolean IsActive { get; set; }
bool IsActive();

void IsActive(bool isactive);


public bool IsActive { get; set; }

<ProgressRing IsActive="bool" />

Returns
bool
True if the ProgressRing is showing progress; otherwise, false. The default is false.

Remarks
Set the IsActive property to turn the ProgressRing on or off. If IsActive is false, the ProgressRing is not shown, but
space is reserved for it in the UI layout. To not reserve space for the ProgressRing, set it's Visibility property to
Collapsed.
Notes for Windows 8.x
Windows 8.x In an app compiled for Windows 8, when the ProgressRing is active, the progress animation
continues even if its not visible on the screen, such as when it's Visibility is Collapsed. This can keep the UI thread
awake, use resources, and impair app performance. When the ProgressRing is not visible, you should disable the
animation by setting IsActive to false.
ProgressRing.IsActiveProperty ProgressRing.IsActive
Property ProgressRing.IsActiveProperty
I n this Article
Edit
Identifies the IsActive dependency property.
public : static DependencyProperty IsActiveProperty { get; }
static DependencyProperty IsActiveProperty();
public static DependencyProperty IsActiveProperty { get; }

Returns
DependencyProperty
The identifier for the IsActive dependency property.
ProgressRing ProgressRing ProgressRing
I n this Article
Edit
Initializes a new instance of the ProgressRing class.

public : ProgressRing()
ProgressRing() const;
public ProgressRing()
ProgressRing.TemplateSettings ProgressRing.Template
Settings ProgressRing.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ProgressRing control.
public : ProgressRingTemplateSettings TemplateSettings { get; }
ProgressRingTemplateSettings TemplateSettings();
public ProgressRingTemplateSettings TemplateSettings { get; }

Returns
ProgressRingTemplateSettings
An object that provides calculated values for templates.
RadioButton RadioButton RadioButton Class
Represents a button that allows a user to select a single option from a group of options.

D eclaration
public : class RadioButton : ToggleButton, IRadioButton
struct winrt::Windows::UI::Xaml::Controls::RadioButton : ToggleButton, IRadioButton
public class RadioButton : ToggleButton, IRadioButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
ButtonBase
ToggleButton

Remarks
 Tip

For more info, design guidance, and code examples, see Radio buttons.
Use RadioButton controls to limit a user's selection to a single choice within a set of related, but mutually exclusive,
choices. You group RadioButton controls by putting them inside the same parent container or by setting the
GroupName property on each RadioButton to the same value.

A RadioButton has two states: selected or cleared. When a RadioButton is selected, its IsChecked property is true.
When a RadioButton is cleared, its IsChecked property is false. A RadioButton can be cleared by clicking another
RadioButton in the same group, but it cannot be cleared by clicking it again. However, a RadioButton can be cleared
programmatically by setting its IsChecked property to false.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the RadioButton control.

R ES O U R CE K EY D ES CR IPTIO N

RadioButtonBackground Background color of entire control bounds at rest

RadioButtonBackgroundPointerOver Background color on hover

RadioButtonBackgroundPressed Background color when pressed

RadioButtonBackgroundDisabled Background color when disabled

RadioButtonForeground Label color at rest

RadioButtonForegroundPointerOver Label color on hover

RadioButtonForegroundPressed Label color when pressed

RadioButtonForegroundDisabled Label color when disabled

RadioButtonBorderBrush Border color of entire control bounds at rest

RadioButtonBorderBrushPointerOver Border color on hover

RadioButtonBorderBrushPressed Border color when pressed

RadioButtonBorderBrushDisabled Border color when disabled

RadioButtonOuterEllipseStroke Border color of unselected circular button

RadioButtonOuterEllipseStrokePointerOver Border color of unselected circular button on hover

RadioButtonOuterEllipseStrokePressed Border color of unselected circular button when pressed

RadioButtonOuterEllipseStrokeDisabled Border color of unselected circular button when disabled

RadioButtonOuterEllipseFill Background color of unselected circular button

RadioButtonOuterEllipseFillPointerOver Background color of unselected circular button on hover

RadioButtonOuterEllipseFillPressed Background color of unselected circular button when pressed

RadioButtonOuterEllipseFillDisabled Background color of unselected circular button when disabled

RadioButtonOuterEllipseCheckedStroke Border color of selected circular button

RadioButtonOuterEllipseCheckedStrokePointerOver Border color of selected circular button on hover

RadioButtonOuterEllipseCheckedStrokePressed Border color of selected circular button when pressed

RadioButtonOuterEllipseCheckedStrokeDisabled Border color of selected circular button when disabled

RadioButtonOuterEllipseCheckedFill Background color of selected circular button


RadioButtonOuterEllipseCheckedFillPointerOver Background color selected circular button on hover

RadioButtonOuterEllipseCheckedFillPressed Background color selected circular button when pressed

RadioButtonOuterEllipseCheckedFillDisabled Background color selected circular button when disabled

RadioButtonCheckGlyphStroke Border color of the selected button's 'dot'

RadioButtonCheckGlyphStrokePointerOver Border color of the selected button's 'dot' on hover

RadioButtonCheckGlyphStrokePressed Border color of the selected button's 'dot' when pressed

RadioButtonCheckGlyphStrokeDisabled Border color of the selected button's 'dot' when disabled

RadioButtonCheckGlyphFill Color of the selected button's 'dot'

RadioButtonCheckGlyphFillPointerOver Color of the selected button's 'dot' on hover

RadioButtonCheckGlyphFillPressed Color of the selected button's 'dot' when pressed

RadioButtonCheckGlyphFillDisabled Color of the selected button's 'dot' when disabled

Constructors
RadioButton()
RadioButton()
RadioButton()

Initializes a new instance of the RadioButton class.

Properties
GroupName
GroupName
GroupName

Gets or sets the name that specifies which RadioButton controls are mutually exclusive.

GroupNameProperty
GroupNameProperty
GroupNameProperty

Identifies the GroupName dependency property.

See Also
ToggleButton
RadioButton.GroupName RadioButton.GroupName
RadioButton.GroupName
I n this Article
Edit
Gets or sets the name that specifies which RadioButton controls are mutually exclusive.
public : Platform::String GroupName { get; set; }
winrt::hstring GroupName();

void GroupName(winrt::hstring groupname);


public string GroupName { get; set; }

<RadioButton GroupName="nameString"/>

Returns
string
The name that specifies which RadioButton controls are mutually exclusive. The default is null.
RadioButton.GroupNameProperty RadioButton.Group
NameProperty RadioButton.GroupNameProperty
I n this Article
Edit
Identifies the GroupName dependency property.
public : static DependencyProperty GroupNameProperty { get; }
static DependencyProperty GroupNameProperty();
public static DependencyProperty GroupNameProperty { get; }

Returns
DependencyProperty
The identifier for GroupName dependency property.
RadioButton RadioButton RadioButton
I n this Article
Edit
Initializes a new instance of the RadioButton class.

public : RadioButton()
RadioButton() const;
public RadioButton()
RatingControl RatingControl RatingControl Class
Represents a control that lets a user enter a star rating.

D eclaration
public : class RatingControl : Control, IRatingControl
struct winrt::Windows::UI::Xaml::Controls::RatingControl : Control, IRatingControl
public class RatingControl : Control, IRatingControl

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Constructors
RatingControl()
RatingControl()
RatingControl()

Initializes a new instance of the RatingControl class.

Properties
Caption
Caption
Caption

Gets or sets the text label for the control.

CaptionProperty
CaptionProperty
CaptionProperty

Identifies the Caption dependency property.

InitialSetValue
InitialSetValue
InitialSetValue

Gets or sets the initial set rating value.

InitialSetValueProperty
InitialSetValueProperty
InitialSetValueProperty
Identifies the InitialSetValue dependency property.

IsClearEnabled
IsClearEnabled
IsClearEnabled

Gets or sets the value that determines if the user can remove the rating.

IsClearEnabledProperty
IsClearEnabledProperty
IsClearEnabledProperty

Identifies the IsClearEnabled dependency property.

IsReadOnly
IsReadOnly
IsReadOnly

Gets or sets the value that determines if the user can change the rating.

IsReadOnlyProperty
IsReadOnlyProperty
IsReadOnlyProperty

Identifies the IsReadOnly dependency property.

ItemInfo
ItemInfo
ItemInfo

Gets or sets info about the visual states of the items that represent a rating.

ItemInfoProperty
ItemInfoProperty
ItemInfoProperty

Identifies the ItemInfo dependency property.

MaxRating
MaxRating
MaxRating

Gets or sets the maximum allowed rating value.


MaxRatingProperty
MaxRatingProperty
MaxRatingProperty

Identifies the MaxRating dependency property.

PlaceholderValue
PlaceholderValue
PlaceholderValue

Gets or sets the rating that is displayed in the control until the value is changed by a user action or some other
operation.

PlaceholderValueProperty
PlaceholderValueProperty
PlaceholderValueProperty

Identifies the PlaceholderValue dependency property.

Value
Value
Value

Gets or sets the rating value.

ValueProperty
ValueProperty
ValueProperty

Identifies the Value dependency property.

Events
ValueChanged
ValueChanged
ValueChanged

Occurs when the Value property has changed.

See Also
RatingControl.Caption RatingControl.Caption Rating
Control.Caption
I n this Article
Edit
Gets or sets the text label for the control.
public : Platform::String Caption { get; set; }
winrt::hstring Caption();

void Caption(winrt::hstring caption);


public string Caption { get; set; }

<RatingControl Caption="string"/>

Returns
string
The text label for the control. The default is an empty string.
RatingControl.CaptionProperty RatingControl.Caption
Property RatingControl.CaptionProperty
I n this Article
Edit
Identifies the Caption dependency property.
public : static DependencyProperty CaptionProperty { get; }
static DependencyProperty CaptionProperty();
public static DependencyProperty CaptionProperty { get; }

Returns
DependencyProperty
The identifier for Caption dependency property.
RatingControl.InitialSetValue RatingControl.InitialSet
Value RatingControl.InitialSetValue
I n this Article
Edit
Gets or sets the initial set rating value.
public : int InitialSetValue { get; set; }
int32_t InitialSetValue();

void InitialSetValue(int32_t initialsetvalue);


public int InitialSetValue { get; set; }

<RatingControl InitialSetValue="int"/>

Returns
int
The initial set rating value. The default is 1.
RatingControl.InitialSetValueProperty RatingControl.
InitialSetValueProperty RatingControl.InitialSetValue
Property
I n this Article
Edit
Identifies the InitialSetValue dependency property.
public : static DependencyProperty InitialSetValueProperty { get; }
static DependencyProperty InitialSetValueProperty();
public static DependencyProperty InitialSetValueProperty { get; }

Returns
DependencyProperty
The identifier for InitialSetValue dependency property.
RatingControl.IsClearEnabled RatingControl.IsClear
Enabled RatingControl.IsClearEnabled
I n this Article
Edit
Gets or sets the value that determines if the user can remove the rating.
public : Platform::Boolean IsClearEnabled { get; set; }
bool IsClearEnabled();

void IsClearEnabled(bool isclearenabled);


public bool IsClearEnabled { get; set; }

<RatingControl IsClearEnabled="bool"/>

Returns
bool
true if the user can remove the rating; otherwise, false. The default is true.
RatingControl.IsClearEnabledProperty RatingControl.Is
ClearEnabledProperty RatingControl.IsClearEnabled
Property
I n this Article
Edit
Identifies the IsClearEnabled dependency property.
public : static DependencyProperty IsClearEnabledProperty { get; }
static DependencyProperty IsClearEnabledProperty();
public static DependencyProperty IsClearEnabledProperty { get; }

Returns
DependencyProperty
The identifier for IsClearEnabled dependency property.
RatingControl.IsReadOnly RatingControl.IsReadOnly
RatingControl.IsReadOnly
I n this Article
Edit
Gets or sets the value that determines if the user can change the rating.
public : Platform::Boolean IsReadOnly { get; set; }
bool IsReadOnly();

void IsReadOnly(bool isreadonly);


public bool IsReadOnly { get; set; }

<RatingControl IsReadOnly="bool"/>

Returns
bool
true if the rating is read-only; otherwise, false. The default is false.
RatingControl.IsReadOnlyProperty RatingControl.IsRead
OnlyProperty RatingControl.IsReadOnlyProperty
I n this Article
Edit
Identifies the IsReadOnly dependency property.
public : static DependencyProperty IsReadOnlyProperty { get; }
static DependencyProperty IsReadOnlyProperty();
public static DependencyProperty IsReadOnlyProperty { get; }

Returns
DependencyProperty
The identifier for IsReadOnly dependency property.
RatingControl.ItemInfo RatingControl.ItemInfo Rating
Control.ItemInfo
I n this Article
Edit
Gets or sets info about the visual states of the items that represent a rating.
public : RatingItemInfo ItemInfo { get; set; }
RatingItemInfo ItemInfo();

void ItemInfo(RatingItemInfo iteminfo);


public RatingItemInfo ItemInfo { get; set; }

<RatingControl ItemInfo="resourceReferenceToRatingItemInfo"/>

Returns
RatingItemInfo
A RatingItemInfo-derived object that contains details about the visual states of the items that represent a rating.

Remarks
You can set the ItemInfo property to replace the default stars with other glyphs or images that represent a rating.
RatingControl.ItemInfoProperty RatingControl.ItemInfo
Property RatingControl.ItemInfoProperty
I n this Article
Edit
Identifies the ItemInfo dependency property.
public : static DependencyProperty ItemInfoProperty { get; }
static DependencyProperty ItemInfoProperty();
public static DependencyProperty ItemInfoProperty { get; }

Returns
DependencyProperty
The identifier for ItemInfo dependency property.
RatingControl.MaxRating RatingControl.MaxRating
RatingControl.MaxRating
I n this Article
Edit
Gets or sets the maximum allowed rating value.
public : int MaxRating { get; set; }
int32_t MaxRating();

void MaxRating(int32_t maxrating);


public int MaxRating { get; set; }

<RatingControl MaxRating="int"/>

Returns
int
The maximum allowed rating value. The default is 5.
RatingControl.MaxRatingProperty RatingControl.Max
RatingProperty RatingControl.MaxRatingProperty
I n this Article
Edit
Identifies the MaxRating dependency property.
public : static DependencyProperty MaxRatingProperty { get; }
static DependencyProperty MaxRatingProperty();
public static DependencyProperty MaxRatingProperty { get; }

Returns
DependencyProperty
The identifier for MaxRating dependency property.
RatingControl.PlaceholderValue RatingControl.
PlaceholderValue RatingControl.PlaceholderValue
I n this Article
Edit
Gets or sets the rating that is displayed in the control until the value is changed by a user action or some other
operation.
public : double PlaceholderValue { get; set; }
double PlaceholderValue();

void PlaceholderValue(double placeholdervalue);


public double PlaceholderValue { get; set; }

<RatingControl PlaceholderValue="double"/>

Returns
double
The rating that is displayed in the control when no value is entered. The default is null.
RatingControl.PlaceholderValueProperty RatingControl.
PlaceholderValueProperty RatingControl.Placeholder
ValueProperty
I n this Article
Edit
Identifies the PlaceholderValue dependency property.
public : static DependencyProperty PlaceholderValueProperty { get; }
static DependencyProperty PlaceholderValueProperty();
public static DependencyProperty PlaceholderValueProperty { get; }

Returns
DependencyProperty
The identifier for PlaceholderValue dependency property.
RatingControl RatingControl RatingControl
I n this Article
Edit
Initializes a new instance of the RatingControl class.

public : RatingControl()
RatingControl() const;
public RatingControl()
RatingControl.Value RatingControl.Value RatingControl.
Value
I n this Article
Edit
Gets or sets the rating value.
public : double Value { get; set; }
double Value();

void Value(double value);


public double Value { get; set; }

<RatingControl Value="double"/>

Returns
double
The rating value. The default is null.
RatingControl.ValueChanged RatingControl.Value
Changed RatingControl.ValueChanged
I n this Article
Edit
Occurs when the Value property has changed.
public : event TypedEventHandler<RatingControl, object> ValueChanged
// Register
event_token ValueChanged(TypedEventHandler<RatingControl, object> const& handler) const;

// Revoke with event_token


void ValueChanged(event_token const& cookie) const;

// Revoke with event_revoker


ValueChanged_revoker ValueChanged(auto_revoke_t, TypedEventHandler<RatingControl, object> const&
handler) const;
public event TypedEventHandler<RatingControl, object> ValueChanged

<RatingControl ValueChanged="eventhandler"/>
RatingControl.ValueProperty RatingControl.Value
Property RatingControl.ValueProperty
I n this Article
Edit
Identifies the Value dependency property.
public : static DependencyProperty ValueProperty { get; }
static DependencyProperty ValueProperty();
public static DependencyProperty ValueProperty { get; }

Returns
DependencyProperty
The identifier for Value dependency property.
RatingItemFontInfo RatingItemFontInfo RatingItemFont
Info Class
Represents information about the visual states of font elements that represent a rating.

D eclaration
public : class RatingItemFontInfo : RatingItemInfo, IRatingItemFontInfo
struct winrt::Windows::UI::Xaml::Controls::RatingItemFontInfo : RatingItemInfo,
IRatingItemFontInfo
public class RatingItemFontInfo : RatingItemInfo, IRatingItemFontInfo

I nheritance H ierarchy
DependencyObject
RatingItemInfo

Constructors
RatingItemFontInfo()
RatingItemFontInfo()
RatingItemFontInfo()

Initializes a new instance of the RatingItemFontInfo class.

Properties
DisabledGlyph
DisabledGlyph
DisabledGlyph

Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that is disabled.

DisabledGlyphProperty
DisabledGlyphProperty
DisabledGlyphProperty

Identifies the DisabledGlyph dependency property.

Glyph
Glyph
Glyph

Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that has been set by the user.

GlyphProperty
GlyphProperty
GlyphProperty
Identifies the Glyph dependency property.

PlaceholderGlyph
PlaceholderGlyph
PlaceholderGlyph

Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that is showing a placeholder value.

PlaceholderGlyphProperty
PlaceholderGlyphProperty
PlaceholderGlyphProperty

Identifies the PlaceholderGlyph dependency property.

PointerOverGlyph
PointerOverGlyph
PointerOverGlyph

Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that has the pointer over it.

PointerOverGlyphProperty
PointerOverGlyphProperty
PointerOverGlyphProperty

Identifies the PointerOverGlyph dependency property.

PointerOverPlaceholderGlyph
PointerOverPlaceholderGlyph
PointerOverPlaceholderGlyph

Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element showing a placeholder value with
the pointer over it.

PointerOverPlaceholderGlyphProperty
PointerOverPlaceholderGlyphProperty
PointerOverPlaceholderGlyphProperty

Identifies the PointerOverPlaceholderGlyph dependency property.

UnsetGlyph
UnsetGlyph
UnsetGlyph

Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that has not been set.
UnsetGlyphProperty
UnsetGlyphProperty
UnsetGlyphProperty

Identifies the UnsetGlyph dependency property.


RatingItemFontInfo.DisabledGlyph RatingItemFontInfo.
DisabledGlyph RatingItemFontInfo.DisabledGlyph
I n this Article
Edit
Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that is disabled.
public : Platform::String DisabledGlyph { get; set; }
winrt::hstring DisabledGlyph();

void DisabledGlyph(winrt::hstring disabledglyph);


public string DisabledGlyph { get; set; }

<RatingItemFontInfo DisabledGlyph="characterCode"/>

Returns
string
The hexadecimal character code for the rating element glyph.
RatingItemFontInfo.DisabledGlyphProperty RatingItem
FontInfo.DisabledGlyphProperty RatingItemFontInfo.
DisabledGlyphProperty
I n this Article
Edit
Identifies the DisabledGlyph dependency property.
public : static DependencyProperty DisabledGlyphProperty { get; }
static DependencyProperty DisabledGlyphProperty();
public static DependencyProperty DisabledGlyphProperty { get; }

Returns
DependencyProperty
The identifier for DisabledGlyph dependency property.
RatingItemFontInfo.Glyph RatingItemFontInfo.Glyph
RatingItemFontInfo.Glyph
I n this Article
Edit
Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that has been set by the user.
public : Platform::String Glyph { get; set; }
winrt::hstring Glyph();

void Glyph(winrt::hstring glyph);


public string Glyph { get; set; }

<RatingItemFontInfo Glyph="characterCode"/>

Returns
string
The hexadecimal character code for the rating element glyph.
RatingItemFontInfo.GlyphProperty RatingItemFontInfo.
GlyphProperty RatingItemFontInfo.GlyphProperty
I n this Article
Edit
Identifies the Glyph dependency property.
public : static DependencyProperty GlyphProperty { get; }
static DependencyProperty GlyphProperty();
public static DependencyProperty GlyphProperty { get; }

Returns
DependencyProperty
The identifier for Glyph dependency property.
RatingItemFontInfo.PlaceholderGlyph RatingItemFont
Info.PlaceholderGlyph RatingItemFontInfo.Placeholder
Glyph
I n this Article
Edit
Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that is showing a placeholder value.
public : Platform::String PlaceholderGlyph { get; set; }
winrt::hstring PlaceholderGlyph();

void PlaceholderGlyph(winrt::hstring placeholderglyph);


public string PlaceholderGlyph { get; set; }

<RatingItemFontInfo PlaceholderGlyph="characterCode"/>

Returns
string
The hexadecimal character code for the rating element glyph.
RatingItemFontInfo.PlaceholderGlyphProperty Rating
ItemFontInfo.PlaceholderGlyphProperty RatingItemFont
Info.PlaceholderGlyphProperty
I n this Article
Edit
Identifies the PlaceholderGlyph dependency property.
public : static DependencyProperty PlaceholderGlyphProperty { get; }
static DependencyProperty PlaceholderGlyphProperty();
public static DependencyProperty PlaceholderGlyphProperty { get; }

Returns
DependencyProperty
The identifier for PlaceholderGlyph dependency property.
RatingItemFontInfo.PointerOverGlyph RatingItemFont
Info.PointerOverGlyph RatingItemFontInfo.PointerOver
Glyph
I n this Article
Edit
Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that has the pointer over it.
public : Platform::String PointerOverGlyph { get; set; }
winrt::hstring PointerOverGlyph();

void PointerOverGlyph(winrt::hstring pointeroverglyph);


public string PointerOverGlyph { get; set; }

<RatingItemFontInfo PointerOverGlyph="characterCode"/>

Returns
string
The hexadecimal character code for the rating element glyph.
RatingItemFontInfo.PointerOverGlyphProperty Rating
ItemFontInfo.PointerOverGlyphProperty RatingItemFont
Info.PointerOverGlyphProperty
I n this Article
Edit
Identifies the PointerOverGlyph dependency property.
public : static DependencyProperty PointerOverGlyphProperty { get; }
static DependencyProperty PointerOverGlyphProperty();
public static DependencyProperty PointerOverGlyphProperty { get; }

Returns
DependencyProperty
The identifier for PointerOverGlyph dependency property.
RatingItemFontInfo.PointerOverPlaceholderGlyph Rating
ItemFontInfo.PointerOverPlaceholderGlyph RatingItem
FontInfo.PointerOverPlaceholderGlyph
I n this Article
Edit
Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element showing a placeholder value with the
pointer over it.
public : Platform::String PointerOverPlaceholderGlyph { get; set; }
winrt::hstring PointerOverPlaceholderGlyph();

void PointerOverPlaceholderGlyph(winrt::hstring pointeroverplaceholderglyph);


public string PointerOverPlaceholderGlyph { get; set; }

<RatingItemFontInfo PointerOverPlaceholderGlyph="characterCode"/>

Returns
string
The hexadecimal character code for the rating element glyph.
RatingItemFontInfo.PointerOverPlaceholderGlyph
Property RatingItemFontInfo.PointerOverPlaceholder
GlyphProperty RatingItemFontInfo.PointerOver
PlaceholderGlyphProperty
I n this Article
Edit
Identifies the PointerOverPlaceholderGlyph dependency property.
public : static DependencyProperty PointerOverPlaceholderGlyphProperty { get; }
static DependencyProperty PointerOverPlaceholderGlyphProperty();
public static DependencyProperty PointerOverPlaceholderGlyphProperty { get; }

Returns
DependencyProperty
The identifier for PointerOverPlaceholderGlyph dependency property.
RatingItemFontInfo RatingItemFontInfo RatingItemFont
Info
I n this Article
Edit
Initializes a new instance of the RatingItemFontInfo class.
public : RatingItemFontInfo()
RatingItemFontInfo() const;
public RatingItemFontInfo()
RatingItemFontInfo.UnsetGlyph RatingItemFontInfo.
UnsetGlyph RatingItemFontInfo.UnsetGlyph
I n this Article
Edit
Gets or sets a Segoe MDL2 Assets font glyph that represents a rating element that has not been set.
public : Platform::String UnsetGlyph { get; set; }
winrt::hstring UnsetGlyph();

void UnsetGlyph(winrt::hstring unsetglyph);


public string UnsetGlyph { get; set; }

<RatingItemFontInfo UnsetGlyph="characterCode"/>

Returns
string
The hexadecimal character code for the rating element glyph.
RatingItemFontInfo.UnsetGlyphProperty RatingItemFont
Info.UnsetGlyphProperty RatingItemFontInfo.UnsetGlyph
Property
I n this Article
Edit
Identifies the UnsetGlyph dependency property.
public : static DependencyProperty UnsetGlyphProperty { get; }
static DependencyProperty UnsetGlyphProperty();
public static DependencyProperty UnsetGlyphProperty { get; }

Returns
DependencyProperty
The identifier for UnsetGlyph dependency property.
RatingItemImageInfo RatingItemImageInfo RatingItem
ImageInfo Class
Represents information about the visual states of image elements that represent a rating.

D eclaration
public : class RatingItemImageInfo : RatingItemInfo, IRatingItemImageInfo
struct winrt::Windows::UI::Xaml::Controls::RatingItemImageInfo : RatingItemInfo,
IRatingItemImageInfo
public class RatingItemImageInfo : RatingItemInfo, IRatingItemImageInfo

I nheritance H ierarchy
DependencyObject
RatingItemInfo

Constructors
RatingItemImageInfo()
RatingItemImageInfo()
RatingItemImageInfo()

Initializes a new instance of the RatingItemImageInfo class.

Properties
DisabledImage
DisabledImage
DisabledImage

Gets or sets an image that represents a rating element that is disabled.

DisabledImageProperty
DisabledImageProperty
DisabledImageProperty

Identifies the DisabledImage dependency property.

Image
Image
Image

Gets or sets an image that represents a rating element that has been set by the user.

ImageProperty
ImageProperty
ImageProperty
Identifies the Image dependency property.

PlaceholderImage
PlaceholderImage
PlaceholderImage

Gets or sets an image that represents a rating element that is showing a placeholder value.

PlaceholderImageProperty
PlaceholderImageProperty
PlaceholderImageProperty

Identifies the PlaceholderImage dependency property.

PointerOverImage
PointerOverImage
PointerOverImage

Gets or sets an image that represents a rating element that has the pointer over it.

PointerOverImageProperty
PointerOverImageProperty
PointerOverImageProperty

Identifies the PointerOverImage dependency property.

PointerOverPlaceholderImage
PointerOverPlaceholderImage
PointerOverPlaceholderImage

Gets or sets an image that represents a rating element showing a placeholder value with the pointer over it.

PointerOverPlaceholderImageProperty
PointerOverPlaceholderImageProperty
PointerOverPlaceholderImageProperty

Identifies the PointerOverPlaceholderImage dependency property.

UnsetImage
UnsetImage
UnsetImage

Gets or sets an image that represents a rating element that has not been set.
UnsetImageProperty
UnsetImageProperty
UnsetImageProperty

Identifies the UnsetImage dependency property.


RatingItemImageInfo.DisabledImage RatingItemImage
Info.DisabledImage RatingItemImageInfo.DisabledImage
I n this Article
Edit
Gets or sets an image that represents a rating element that is disabled.
public : ImageSource DisabledImage { get; set; }
ImageSource DisabledImage();

void DisabledImage(ImageSource disabledimage);


public ImageSource DisabledImage { get; set; }

<RatingItemImageInfo DisabledImage="uri"/>

Returns
ImageSource
An object that represents the image source file for the drawn image. Typically you set this with a BitmapImage object,
constructed with the Uniform Resource Identifier (URI) that describes the path to a valid image source file. Or, you can
initialize a BitmapSource with a stream, perhaps a stream from a storage file.
RatingItemImageInfo.DisabledImageProperty RatingItem
ImageInfo.DisabledImageProperty RatingItemImageInfo.
DisabledImageProperty
I n this Article
Edit
Identifies the DisabledImage dependency property.
public : static DependencyProperty DisabledImageProperty { get; }
static DependencyProperty DisabledImageProperty();
public static DependencyProperty DisabledImageProperty { get; }

Returns
DependencyProperty
The identifier for DisabledImage dependency property.
RatingItemImageInfo.Image RatingItemImageInfo.Image
RatingItemImageInfo.Image
I n this Article
Edit
Gets or sets an image that represents a rating element that has been set by the user.
public : ImageSource Image { get; set; }
ImageSource Image();

void Image(ImageSource image);


public ImageSource Image { get; set; }

<RatingItemImageInfo Image="uri"/>

Returns
ImageSource
An object that represents the image source file for the drawn image. Typically you set this with a BitmapImage object,
constructed with the Uniform Resource Identifier (URI) that describes the path to a valid image source file. Or, you can
initialize a BitmapSource with a stream, perhaps a stream from a storage file.
RatingItemImageInfo.ImageProperty RatingItemImage
Info.ImageProperty RatingItemImageInfo.ImageProperty
I n this Article
Edit
Identifies the Image dependency property.
public : static DependencyProperty ImageProperty { get; }
static DependencyProperty ImageProperty();
public static DependencyProperty ImageProperty { get; }

Returns
DependencyProperty
The identifier for Image dependency property.
RatingItemImageInfo.PlaceholderImage RatingItemImage
Info.PlaceholderImage RatingItemImageInfo.Placeholder
Image
I n this Article
Edit
Gets or sets an image that represents a rating element that is showing a placeholder value.
public : ImageSource PlaceholderImage { get; set; }
ImageSource PlaceholderImage();

void PlaceholderImage(ImageSource placeholderimage);


public ImageSource PlaceholderImage { get; set; }

<RatingItemImageInfo PlaceholderImage="uri"/>

Returns
ImageSource
An object that represents the image source file for the drawn image. Typically you set this with a BitmapImage object,
constructed with the Uniform Resource Identifier (URI) that describes the path to a valid image source file. Or, you can
initialize a BitmapSource with a stream, perhaps a stream from a storage file.
RatingItemImageInfo.PlaceholderImageProperty Rating
ItemImageInfo.PlaceholderImageProperty RatingItem
ImageInfo.PlaceholderImageProperty
I n this Article
Edit
Identifies the PlaceholderImage dependency property.
public : static DependencyProperty PlaceholderImageProperty { get; }
static DependencyProperty PlaceholderImageProperty();
public static DependencyProperty PlaceholderImageProperty { get; }

Returns
DependencyProperty
The identifier for PlaceholderImage dependency property.
RatingItemImageInfo.PointerOverImage RatingItem
ImageInfo.PointerOverImage RatingItemImageInfo.
PointerOverImage
I n this Article
Edit
Gets or sets an image that represents a rating element that has the pointer over it.
public : ImageSource PointerOverImage { get; set; }
ImageSource PointerOverImage();

void PointerOverImage(ImageSource pointeroverimage);


public ImageSource PointerOverImage { get; set; }

<RatingItemImageInfo PointerOverImage="uri"/>

Returns
ImageSource
An object that represents the image source file for the drawn image. Typically you set this with a BitmapImage object,
constructed with the Uniform Resource Identifier (URI) that describes the path to a valid image source file. Or, you can
initialize a BitmapSource with a stream, perhaps a stream from a storage file.
RatingItemImageInfo.PointerOverImageProperty Rating
ItemImageInfo.PointerOverImageProperty RatingItem
ImageInfo.PointerOverImageProperty
I n this Article
Edit
Identifies the PointerOverImage dependency property.
public : static DependencyProperty PointerOverImageProperty { get; }
static DependencyProperty PointerOverImageProperty();
public static DependencyProperty PointerOverImageProperty { get; }

Returns
DependencyProperty
The identifier for PointerOverImage dependency property.
RatingItemImageInfo.PointerOverPlaceholderImage
RatingItemImageInfo.PointerOverPlaceholderImage
RatingItemImageInfo.PointerOverPlaceholderImage
I n this Article
Edit
Gets or sets an image that represents a rating element showing a placeholder value with the pointer over it.
public : ImageSource PointerOverPlaceholderImage { get; set; }
ImageSource PointerOverPlaceholderImage();

void PointerOverPlaceholderImage(ImageSource pointeroverplaceholderimage);


public ImageSource PointerOverPlaceholderImage { get; set; }

<RatingItemImageInfo PointerOverPlaceholderImage="uri"/>

Returns
ImageSource
An object that represents the image source file for the drawn image. Typically you set this with a BitmapImage object,
constructed with the Uniform Resource Identifier (URI) that describes the path to a valid image source file. Or, you can
initialize a BitmapSource with a stream, perhaps a stream from a storage file.
RatingItemImageInfo.PointerOverPlaceholderImage
Property RatingItemImageInfo.PointerOverPlaceholder
ImageProperty RatingItemImageInfo.PointerOver
PlaceholderImageProperty
I n this Article
Edit
Identifies the PointerOverPlaceholderImage dependency property.
public : static DependencyProperty PointerOverPlaceholderImageProperty { get; }
static DependencyProperty PointerOverPlaceholderImageProperty();
public static DependencyProperty PointerOverPlaceholderImageProperty { get; }

Returns
DependencyProperty
The identifier for PointerOverPlaceholderImage dependency property.
RatingItemImageInfo RatingItemImageInfo RatingItem
ImageInfo
I n this Article
Edit
Initializes a new instance of the RatingItemImageInfo class.
public : RatingItemImageInfo()
RatingItemImageInfo() const;
public RatingItemImageInfo()
RatingItemImageInfo.UnsetImage RatingItemImageInfo.
UnsetImage RatingItemImageInfo.UnsetImage
I n this Article
Edit
Gets or sets an image that represents a rating element that has not been set.
public : ImageSource UnsetImage { get; set; }
ImageSource UnsetImage();

void UnsetImage(ImageSource unsetimage);


public ImageSource UnsetImage { get; set; }

<RatingItemImageInfo UnsetImage="uri"/>

Returns
ImageSource
An object that represents the image source file for the drawn image. Typically you set this with a BitmapImage object,
constructed with the Uniform Resource Identifier (URI) that describes the path to a valid image source file. Or, you can
initialize a BitmapSource with a stream, perhaps a stream from a storage file.
RatingItemImageInfo.UnsetImageProperty RatingItem
ImageInfo.UnsetImageProperty RatingItemImageInfo.
UnsetImageProperty
I n this Article
Edit
Identifies the UnsetImage dependency property.
public : static DependencyProperty UnsetImageProperty { get; }
static DependencyProperty UnsetImageProperty();
public static DependencyProperty UnsetImageProperty { get; }

Returns
DependencyProperty
The identifier for UnsetImage dependency property.
RatingItemInfo RatingItemInfo RatingItemInfo Class
Represents information about the visual states of the elements that represent a rating.

D eclaration
public : class RatingItemInfo : DependencyObject, IRatingItemInfo
struct winrt::Windows::UI::Xaml::Controls::RatingItemInfo : DependencyObject, IRatingItemInfo
public class RatingItemInfo : DependencyObject, IRatingItemInfo

I nheritance H ierarchy
DependencyObject

Constructors
RatingItemInfo()
RatingItemInfo()
RatingItemInfo()

Initializes a new instance of the RatingItemInfo class.


RatingItemInfo RatingItemInfo RatingItemInfo
I n this Article
Edit
Initializes a new instance of the RatingItemInfo class.

public : RatingItemInfo()
RatingItemInfo() const;
public RatingItemInfo()
RefreshContainer RefreshContainer RefreshContainer
Class
Represents a container control that provides a RefreshVisualizer and pull-to-refresh functionality for scrollable content.

D eclaration
public : class RefreshContainer : ContentControl, IRefreshContainer
struct winrt::Windows::UI::Xaml::Controls::RefreshContainer : ContentControl, IRefreshContainer
public class RefreshContainer : ContentControl, IRefreshContainer

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Constructors
RefreshContainer()
RefreshContainer()
RefreshContainer()

Initializes a new instance of the RefreshContainer control.

Properties
PullDirection
PullDirection
PullDirection

Gets or sets a value that specifies the direction to pull to initiate a refresh.

PullDirectionProperty
PullDirectionProperty
PullDirectionProperty

Identifies the PullDirection dependency property.

Visualizer
Visualizer
Visualizer

Gets or sets the RefreshVisualizer for this container.


VisualizerProperty
VisualizerProperty
VisualizerProperty

Identifies the Visualizer dependency property.

Methods
RequestRefresh()
RequestRefresh()
RequestRefresh()

Initiates an update of the content.

Events
RefreshRequested
RefreshRequested
RefreshRequested

Occurs when an update of the content has been initiated.

See Also
RefreshContainer.PullDirection RefreshContainer.Pull
Direction RefreshContainer.PullDirection
I n this Article
Edit
Gets or sets a value that specifies the direction to pull to initiate a refresh.
public : RefreshPullDirection PullDirection { get; set; }
RefreshPullDirection PullDirection();

void PullDirection(RefreshPullDirection pulldirection);


public RefreshPullDirection PullDirection { get; set; }

Returns
RefreshPullDirection
An enumeration value that specifies the direction to pull to initiate a refresh.
RefreshContainer.PullDirectionProperty RefreshContainer.
PullDirectionProperty RefreshContainer.PullDirection
Property
I n this Article
Edit
Identifies the PullDirection dependency property.
public : static DependencyProperty PullDirectionProperty { get; }
static DependencyProperty PullDirectionProperty();
public static DependencyProperty PullDirectionProperty { get; }

Returns
DependencyProperty
The identifier for the PullDirection dependency property.
RefreshContainer RefreshContainer RefreshContainer
I n this Article
Edit
Initializes a new instance of the RefreshContainer control.

public : RefreshContainer()
RefreshContainer() const;
public RefreshContainer()
RefreshContainer.RefreshRequested RefreshContainer.
RefreshRequested RefreshContainer.RefreshRequested
I n this Article
Edit
Occurs when an update of the content has been initiated.
public : event TypedEventHandler<RefreshContainer, RefreshRequestedEventArgs> RefreshRequested
// Register
event_token RefreshRequested(TypedEventHandler<RefreshContainer, RefreshRequestedEventArgs> const&
handler) const;

// Revoke with event_token


void RefreshRequested(event_token const& cookie) const;

// Revoke with event_revoker


RefreshRequested_revoker RefreshRequested(auto_revoke_t, TypedEventHandler<RefreshContainer,
RefreshRequestedEventArgs> const& handler) const;
public event TypedEventHandler<RefreshContainer, RefreshRequestedEventArgs> RefreshRequested
RefreshContainer.RequestRefresh RefreshContainer.
RequestRefresh RefreshContainer.RequestRefresh
I n this Article
Edit
Initiates an update of the content.
public : void RequestRefresh()
void RequestRefresh() const;
public void RequestRefresh()
RefreshContainer.Visualizer RefreshContainer.Visualizer
RefreshContainer.Visualizer
I n this Article
Edit
Gets or sets the RefreshVisualizer for this container.
public : RefreshVisualizer Visualizer { get; set; }
RefreshVisualizer Visualizer();

void Visualizer(RefreshVisualizer visualizer);


public RefreshVisualizer Visualizer { get; set; }

Returns
RefreshVisualizer
The RefreshVisualizer for this container.
RefreshContainer.VisualizerProperty RefreshContainer.
VisualizerProperty RefreshContainer.VisualizerProperty
I n this Article
Edit
Identifies the Visualizer dependency property.
public : static DependencyProperty VisualizerProperty { get; }
static DependencyProperty VisualizerProperty();
public static DependencyProperty VisualizerProperty { get; }

Returns
DependencyProperty
The identifier for the Visualizer dependency property.
RefreshInteractionRatioChangedEventArgs Refresh
InteractionRatioChangedEventArgs RefreshInteraction
RatioChangedEventArgs Class
Provides event data.

D eclaration
public : sealed class RefreshInteractionRatioChangedEventArgs :
IRefreshInteractionRatioChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::RefreshInteractionRatioChangedEventArgs :
IRefreshInteractionRatioChangedEventArgs
public sealed class RefreshInteractionRatioChangedEventArgs :
IRefreshInteractionRatioChangedEventArgs

I nheritance H ierarchy
None

Properties
InteractionRatio
InteractionRatio
InteractionRatio

Gets the interaction ratio value.


RefreshInteractionRatioChangedEventArgs.Interaction
Ratio RefreshInteractionRatioChangedEventArgs.
InteractionRatio RefreshInteractionRatioChangedEvent
Args.InteractionRatio
I n this Article
Edit
Gets the interaction ratio value.
public : double InteractionRatio { get; }
double InteractionRatio();
public double InteractionRatio { get; }

Returns
double
The interaction ratio value.
RefreshPullDirection RefreshPullDirection RefreshPull
Direction Enum
Defines constants that specify the direction to pull a RefreshContainer to initiate a refresh.

D eclaration
public : enum class RefreshPullDirection
enum class winrt::Windows::UI::Xaml::Controls::RefreshPullDirection : int32_t
public enum RefreshPullDirection

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the RefreshContainer.PullDirection property.

Fields
BottomToTop BottomToTop BottomToTop Pull from bottom to top to initiate a refresh.

LeftToRight LeftToRight LeftToRight Pull from left to right to initiate a refresh.

RightToLeft RightToLeft RightToLeft Pull from right to left to initiate a refresh.

TopToBottom TopToBottom TopToBottom Pull from top to bottom to initiate a refresh.


RefreshRequestedEventArgs RefreshRequestedEventArgs
RefreshRequestedEventArgs Class
Provides event data for RefreshRequested events.

D eclaration
public : sealed class RefreshRequestedEventArgs : IRefreshRequestedEventArgs
struct winrt::Windows::UI::Xaml::Controls::RefreshRequestedEventArgs :
IRefreshRequestedEventArgs
public sealed class RefreshRequestedEventArgs : IRefreshRequestedEventArgs

I nheritance H ierarchy
None

Methods
GetDeferral()
GetDeferral()
GetDeferral()

Gets a deferral object for managing the work done in the RefreshRequested event handler.
RefreshRequestedEventArgs.GetDeferral Refresh
RequestedEventArgs.GetDeferral RefreshRequestedEvent
Args.GetDeferral
I n this Article
Edit
Gets a deferral object for managing the work done in the RefreshRequested event handler.
public : Deferral GetDeferral()
Deferral GetDeferral() const;
public Deferral GetDeferral()

Returns
Deferral
A deferral object.

Remarks
A deferral should be used if any asynchronous work is being done in the RefreshRequested event handler, so that the
next event in the sequence isn't raised until this work is completed.
RefreshStateChangedEventArgs RefreshStateChanged
EventArgs RefreshStateChangedEventArgs Class
Provides event data for the RefreshVisualizer.RefreshStateChanged event.

D eclaration
public : sealed class RefreshStateChangedEventArgs : IRefreshStateChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::RefreshStateChangedEventArgs :
IRefreshStateChangedEventArgs
public sealed class RefreshStateChangedEventArgs : IRefreshStateChangedEventArgs

I nheritance H ierarchy
None

Properties
NewState
NewState
NewState

Gets a value that indicates the new state of the RefreshVisualizer.

OldState
OldState
OldState

Gets a value that indicates the previous state of the RefreshVisualizer.


RefreshStateChangedEventArgs.NewState RefreshState
ChangedEventArgs.NewState RefreshStateChangedEvent
Args.NewState
I n this Article
Edit
Gets a value that indicates the new state of the RefreshVisualizer.
public : RefreshVisualizerState NewState { get; }
RefreshVisualizerState NewState();
public RefreshVisualizerState NewState { get; }

Returns
RefreshVisualizerState
An enumeration value that indicates the new state of the RefreshVisualizer.
RefreshStateChangedEventArgs.OldState RefreshState
ChangedEventArgs.OldState RefreshStateChangedEvent
Args.OldState
I n this Article
Edit
Gets a value that indicates the previous state of the RefreshVisualizer.
public : RefreshVisualizerState OldState { get; }
RefreshVisualizerState OldState();
public RefreshVisualizerState OldState { get; }

Returns
RefreshVisualizerState
An enumeration value that indicates the previous state of the RefreshVisualizer.
RefreshVisualizer RefreshVisualizer RefreshVisualizer
Class
Represents a control that provides animated state indicators for content refresh.

D eclaration
public : class RefreshVisualizer : Control, IRefreshVisualizer
struct winrt::Windows::UI::Xaml::Controls::RefreshVisualizer : Control, IRefreshVisualizer
public class RefreshVisualizer : Control, IRefreshVisualizer

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Constructors
RefreshVisualizer()
RefreshVisualizer()
RefreshVisualizer()

Initializes a new instance of the RefreshVisualizer class.

Properties
Content
Content
Content

Gets or sets the content of the visualizer.

ContentProperty
ContentProperty
ContentProperty

Identifies the Content dependency property.

InfoProviderProperty
InfoProviderProperty
InfoProviderProperty

Identifies the InfoProvider dependency property.

Orientation
Orientation
Orientation

Gets or sets a value that indicates the orientation of the visualizer.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the Orientation dependency property.

State
State
State

Gets a value that indicates the state of the visualizer.

StateProperty
StateProperty
StateProperty

Identifies the State dependency property.

Methods
RequestRefresh()
RequestRefresh()
RequestRefresh()

Initiates an update of the content.

Events
RefreshRequested
RefreshRequested
RefreshRequested

Occurs when an update of the content has been initiated.

RefreshStateChanged
RefreshStateChanged
RefreshStateChanged

Occurs when the state of the visualizer changes.


See Also
RefreshVisualizer.Content RefreshVisualizer.Content
RefreshVisualizer.Content
I n this Article
Edit
Gets or sets the content of the visualizer.
public : UIElement Content { get; set; }
UIElement Content();

void Content(UIElement content);


public UIElement Content { get; set; }

Returns
UIElement
The content of the visualizer.
RefreshVisualizer.ContentProperty RefreshVisualizer.
ContentProperty RefreshVisualizer.ContentProperty
I n this Article
Edit
Identifies the Content dependency property.
public : static DependencyProperty ContentProperty { get; }
static DependencyProperty ContentProperty();
public static DependencyProperty ContentProperty { get; }

Returns
DependencyProperty
The identifier for the Content dependency property.
RefreshVisualizer.InfoProviderProperty RefreshVisualizer.
InfoProviderProperty RefreshVisualizer.InfoProvider
Property
I n this Article
Edit
Identifies the InfoProvider dependency property.
public : static DependencyProperty InfoProviderProperty { get; }
static DependencyProperty InfoProviderProperty();
public static DependencyProperty InfoProviderProperty { get; }

Returns
DependencyProperty
The identifier for the InfoProvider dependency property.
RefreshVisualizer.Orientation RefreshVisualizer.
Orientation RefreshVisualizer.Orientation
I n this Article
Edit
Gets or sets a value that indicates the orientation of the visualizer.
public : RefreshVisualizerOrientation Orientation { get; set; }
RefreshVisualizerOrientation Orientation();

void Orientation(RefreshVisualizerOrientation orientation);


public RefreshVisualizerOrientation Orientation { get; set; }

Returns
RefreshVisualizerOrientation
A value of the enumeration that indicates the orientation of the visualizer. The default is Top.
RefreshVisualizer.OrientationProperty RefreshVisualizer.
OrientationProperty RefreshVisualizer.Orientation
Property
I n this Article
Edit
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
RefreshVisualizer.RefreshRequested RefreshVisualizer.
RefreshRequested RefreshVisualizer.RefreshRequested
I n this Article
Edit
Occurs when an update of the content has been initiated.
public : event TypedEventHandler<RefreshVisualizer, RefreshRequestedEventArgs> RefreshRequested
// Register
event_token RefreshRequested(TypedEventHandler<RefreshVisualizer, RefreshRequestedEventArgs> const&
handler) const;

// Revoke with event_token


void RefreshRequested(event_token const& cookie) const;

// Revoke with event_revoker


RefreshRequested_revoker RefreshRequested(auto_revoke_t, TypedEventHandler<RefreshVisualizer,
RefreshRequestedEventArgs> const& handler) const;
public event TypedEventHandler<RefreshVisualizer, RefreshRequestedEventArgs> RefreshRequested
RefreshVisualizer.RefreshStateChanged RefreshVisualizer.
RefreshStateChanged RefreshVisualizer.RefreshState
Changed
I n this Article
Edit
Occurs when the state of the visualizer changes.
public : event TypedEventHandler<RefreshVisualizer, RefreshStateChangedEventArgs>
RefreshStateChanged
// Register
event_token RefreshStateChanged(TypedEventHandler<RefreshVisualizer, RefreshStateChangedEventArgs>
const& handler) const;

// Revoke with event_token


void RefreshStateChanged(event_token const& cookie) const;

// Revoke with event_revoker


RefreshStateChanged_revoker RefreshStateChanged(auto_revoke_t, TypedEventHandler<RefreshVisualizer,
RefreshStateChangedEventArgs> const& handler) const;
public event TypedEventHandler<RefreshVisualizer, RefreshStateChangedEventArgs> RefreshStateChanged
RefreshVisualizer RefreshVisualizer RefreshVisualizer
I n this Article
Edit
Initializes a new instance of the RefreshVisualizer class.

public : RefreshVisualizer()
RefreshVisualizer() const;
public RefreshVisualizer()
RefreshVisualizer.RequestRefresh RefreshVisualizer.
RequestRefresh RefreshVisualizer.RequestRefresh
I n this Article
Edit
Initiates an update of the content.
public : void RequestRefresh()
void RequestRefresh() const;
public void RequestRefresh()
RefreshVisualizer.State RefreshVisualizer.State Refresh
Visualizer.State
I n this Article
Edit
Gets a value that indicates the state of the visualizer.
public : RefreshVisualizerState State { get; }
RefreshVisualizerState State();
public RefreshVisualizerState State { get; }

Returns
RefreshVisualizerState
A value of the enumeration that indicates the state of the visualizer.
RefreshVisualizer.StateProperty RefreshVisualizer.State
Property RefreshVisualizer.StateProperty
I n this Article
Edit
Identifies the State dependency property.
public : static DependencyProperty StateProperty { get; }
static DependencyProperty StateProperty();
public static DependencyProperty StateProperty { get; }

Returns
DependencyProperty
The identifier for the State dependency property.
RefreshVisualizerOrientation RefreshVisualizer
Orientation RefreshVisualizerOrientation Enum
Defines constants that specify the orientation of a RefreshVisualizer.

D eclaration
public : enum class RefreshVisualizerOrientation
enum class winrt::Windows::UI::Xaml::Controls::RefreshVisualizerOrientation : int32_t
public enum RefreshVisualizerOrientation

I nheritance H ierarchy
None

Fields
Auto Auto Auto

Normal Normal Normal

Rotate270DegreesCounterclockwise Rotate270DegreesCounterclockwise
Rotate270DegreesCounterclockwise

Rotate90DegreesCounterclockwise Rotate90DegreesCounterclockwise
Rotate90DegreesCounterclockwise
RefreshVisualizerState RefreshVisualizerState Refresh
VisualizerState Enum
Defines constants that specify the state of a RefreshVisualizer

D eclaration
public : enum class RefreshVisualizerState
enum class winrt::Windows::UI::Xaml::Controls::RefreshVisualizerState : int32_t
public enum RefreshVisualizerState

I nheritance H ierarchy
None

Fields
Idle Idle Idle The visualizer is idle.

Interacting The user is interacting with the visualizer.


Interacting
Interacting

Peeking Peeking The visualizer was pulled in the refresh direction from a position where a refresh is not allowed.
Peeking Typically, the ScrollViewer was not at position 0 at the start of the pull.

Pending Pending The visualizer is pending.


Pending

Refreshing The visualizer is being refreshed.


Refreshing
Refreshing
RelativePanel RelativePanel RelativePanel Class
Defines an area within which you can position and align child objects in relation to each other or the parent panel.

D eclaration
public : class RelativePanel : Panel, IRelativePanel, IRelativePanel2
struct winrt::Windows::UI::Xaml::Controls::RelativePanel : Panel, IRelativePanel,
IRelativePanel2
public class RelativePanel : Panel, IRelativePanel, IRelativePanel2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel

Remarks
 Tip

For more info, design guidance, and code examples, see Layout panels.
RelativePanel is a layout container that is useful for creating UI that do not have a clear linear pattern; that is, layouts
that are not fundamentally stacked, wrapped, or tabular, where you might naturally use a StackPanel or Grid.
If your UI consists of multiple nested panels, RelativePanel is a good option to consider.
Here's an example of a UI using a RelativePanel for its layout:

```xaml ```
RelativePanel, used in conjunction with AdaptiveTrigger s, can be a powerful tool to create responsive UI that scales
well across different screen sizes. For more examples, see the XAML Responsive Techniques sample.
D efault position
By default, any unconstrained element declared as a child of the RelativePanel is given the entire available space and
positioned at the (0, 0) coordinates (upper left corner) of the panel. So, if you are positioning a second element relative
to an unconstrained element, keep in mind that the second element might get pushed out of the panel.
In this example, RectA doesn't have any constraints, so it's positioned at (0,0). RectB is not shown on the screen
because it is declared to be Above RectA and is therefore pushed out of the panel.
<RelativePanel>
<Rectangle Name="RectA" Fill="Red" Height="40" Width="40"/>
<Rectangle Name="RectB" Fill="Blue" Height="40" Width="40"
RelativePanel.Above="RectA"/>
</RelativePanel>

Circular dependency
A circular dependency occurs when two elements inside a RelativePanel declare relationships with each other in any
direction. For example, this XAML results in a design-time exception, "RelativePanel error: Circular dependency
detected. Layout could not complete."
<RelativePanel>
<Rectangle Name="RectA" Fill="Red" Height="40" Width="40"
RelativePanel.Above="RectB"/>
<Rectangle Name="RectB" Fill="Blue" Height="40" Width="40"
RelativePanel.Below="RectA"/>
</RelativePanel>

Conflicting relationships
If you set multiple relationships that target the same edge of an element, you might have conflicting relationships in
your layout as a result. When this happens, the relationships are applied in the following order of priority:
Panel alignment relationships (AlignTopWithPanel, AlignLeftWithPanel, …) are applied first.
Sibling alignment relationships (AlignTopWith, AlignLeftWith, …) are applied second.
Sibling positional relationships (Above, Below, RightOf, LeftOf) are applied last.
The panel-center alignment properties ( AlignVerticalCenterWith, AlignHorizontalCenterWithPanel, ...) are typically
used independently of other constraints and are applied if there is no conflict.
The HorizontalAlignment and VerticalAlignment properties on UI elements are applied after relationship properties
are evaluated and applied. These properties control the placement of the element within the available size for the
element, if the desired size is smaller than the available size.
B order properties
RelativePanel defines border properties that let you draw a border around the RelativePanel without using an
additional Border element. The properties are RelativePanel.BorderBrush, RelativePanel.BorderThickness,
RelativePanel.CornerRadius, and RelativePanel.Padding.

<RelativePanel BorderBrush="Red" BorderThickness="2" CornerRadius="10" Padding="12">


<TextBox x:Name="textBox1" RelativePanel.AlignLeftWithPanel="True"/>
<Button Content="Submit" RelativePanel.Below="textBox1"/>
</RelativePanel>

Constructors
RelativePanel()
RelativePanel()
RelativePanel()

Initializes a new instance of the RelativePanel class.

Properties
AboveProperty
AboveProperty
AboveProperty

Identifies the RelativePanel.Above XAML attached property.

AlignBottomWithPanelProperty
AlignBottomWithPanelProperty
AlignBottomWithPanelProperty

Identifies the RelativePanel.AlignBottomWithPanel XAML attached property.

AlignBottomWithProperty
AlignBottomWithProperty
AlignBottomWithProperty

Identifies the RelativePanel.AlignBottomWith XAML attached property.

AlignHorizontalCenterWithPanelProperty
AlignHorizontalCenterWithPanelProperty
AlignHorizontalCenterWithPanelProperty

Identifies the RelativePanel.AlignHorizontalCenterWithPanel XAML attached property.

AlignHorizontalCenterWithProperty
AlignHorizontalCenterWithProperty
AlignHorizontalCenterWithProperty

Gets the value of the RelativePanel.AlignHorizontalCenterWith XAML attached property for the target element.

AlignLeftWithPanelProperty
AlignLeftWithPanelProperty
AlignLeftWithPanelProperty

Identifies the RelativePanel.AlignLeftWithPanel XAML attached property.

AlignLeftWithProperty
AlignLeftWithProperty
AlignLeftWithProperty

Identifies the RelativePanel.AlignLeftWith XAML attached property.

AlignRightWithPanelProperty
AlignRightWithPanelProperty
AlignRightWithPanelProperty

Identifies the RelativePanel.AlignRightWithPanel XAML attached property.


AlignRightWithProperty
AlignRightWithProperty
AlignRightWithProperty

Identifies the RelativePanel.AlignRightWith XAML attached property.

AlignTopWithPanelProperty
AlignTopWithPanelProperty
AlignTopWithPanelProperty

Identifies the RelativePanel.AlignTopWithPanel XAML attached property.

AlignTopWithProperty
AlignTopWithProperty
AlignTopWithProperty

Identifies the RelativePanel.AlignTopWith XAML attached property.

AlignVerticalCenterWithPanelProperty
AlignVerticalCenterWithPanelProperty
AlignVerticalCenterWithPanelProperty

Identifies the RelativePanel.AlignVerticalCenterWithPanel XAML attached property.

AlignVerticalCenterWithProperty
AlignVerticalCenterWithProperty
AlignVerticalCenterWithProperty

Gets the value of the RelativePanel.AlignVerticalCenterWith XAML attached property for the target element.

BackgroundSizing
BackgroundSizing
BackgroundSizing

Gets or sets a value that indicates how far the background extends in relation to this element's border.

BackgroundSizingProperty
BackgroundSizingProperty
BackgroundSizingProperty

Identifies the BackgroundSizing dependency property.

BelowProperty
BelowProperty
BelowProperty
Identifies the RelativePanel.Below XAML attached property.

BorderBrush
BorderBrush
BorderBrush

Gets or sets a brush that describes the border fill of the panel.

BorderBrushProperty
BorderBrushProperty
BorderBrushProperty

Identifies the BorderBrush dependency property.

BorderThickness
BorderThickness
BorderThickness

Gets or sets the border thickness of the panel.

BorderThicknessProperty
BorderThicknessProperty
BorderThicknessProperty

Identifies the BorderThickness dependency property.

CornerRadius
CornerRadius
CornerRadius

Gets or sets the radius for the corners of the panel's border.

CornerRadiusProperty
CornerRadiusProperty
CornerRadiusProperty

Identifies the CornerRadius dependency property.

LeftOfProperty
LeftOfProperty
LeftOfProperty

Identifies the RelativePanel.LeftOf XAML attached property.


Padding
Padding
Padding

Gets or sets the distance between the border and its child object.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.

RightOfProperty
RightOfProperty
RightOfProperty

Identifies the RelativePanel.RightOf XAML attached property.

Methods
GetAbove(UIElement)
GetAbove(UIElement)
GetAbove(UIElement)

Gets the value of the RelativePanel.Above XAML attached property for the target element.

GetAlignBottomWith(UIElement)
GetAlignBottomWith(UIElement)
GetAlignBottomWith(UIElement)

Gets the value of the RelativePanel.AlignBottomWith XAML attached property for the target element.

GetAlignBottomWithPanel(UIElement)
GetAlignBottomWithPanel(UIElement)
GetAlignBottomWithPanel(UIElement)

Gets the value of the RelativePanel.AlignBottomWithPanel XAML attached property for the target element.

GetAlignHorizontalCenterWith(UIElement)
GetAlignHorizontalCenterWith(UIElement)
GetAlignHorizontalCenterWith(UIElement)

Gets the value of the RelativePanel.AlignHorizontalCenterWith XAML attached property for the target element.

GetAlignHorizontalCenterWithPanel(UIElement)
GetAlignHorizontalCenterWithPanel(UIElement)
GetAlignHorizontalCenterWithPanel(UIElement)

Gets the value of the RelativePanel.AlignHorizontalCenterWithPanel XAML attached property for the target
element.

GetAlignLeftWith(UIElement)
GetAlignLeftWith(UIElement)
GetAlignLeftWith(UIElement)

Gets the value of the RelativePanel.AlignLeftWith XAML attached property for the target element.

GetAlignLeftWithPanel(UIElement)
GetAlignLeftWithPanel(UIElement)
GetAlignLeftWithPanel(UIElement)

Gets the value of the RelativePanel.AlignLeftWithPanel XAML attached property for the target element.

GetAlignRightWith(UIElement)
GetAlignRightWith(UIElement)
GetAlignRightWith(UIElement)

Gets the value of the RelativePanel.AlignRightWith XAML attached property for the target element.

GetAlignRightWithPanel(UIElement)
GetAlignRightWithPanel(UIElement)
GetAlignRightWithPanel(UIElement)

Gets the value of the RelativePanel.AlignRightWithPanel XAML attached property for the target element.

GetAlignTopWith(UIElement)
GetAlignTopWith(UIElement)
GetAlignTopWith(UIElement)

Gets the value of the RelativePanel.AlignTopWith XAML attached property for the target element.

GetAlignTopWithPanel(UIElement)
GetAlignTopWithPanel(UIElement)
GetAlignTopWithPanel(UIElement)

Gets the value of the RelativePanel.AlignTopWithPanel XAML attached property for the target element.

GetAlignVerticalCenterWith(UIElement)
GetAlignVerticalCenterWith(UIElement)
GetAlignVerticalCenterWith(UIElement)

Gets the value of the RelativePanel.AlignVerticalCenterWith XAML attached property for the target element.
GetAlignVerticalCenterWithPanel(UIElement)
GetAlignVerticalCenterWithPanel(UIElement)
GetAlignVerticalCenterWithPanel(UIElement)

Gets the value of the RelativePanel.AlignVerticalCenterWithPanel XAML attached property for the target element.

GetBelow(UIElement)
GetBelow(UIElement)
GetBelow(UIElement)

Gets the value of the RelativePanel.Below XAML attached property for the target element.

GetLeftOf(UIElement)
GetLeftOf(UIElement)
GetLeftOf(UIElement)

Gets the value of the RelativePanel.LeftOf XAML attached property for the target element.

GetRightOf(UIElement)
GetRightOf(UIElement)
GetRightOf(UIElement)

Gets the value of the RelativePanel.RightOf XAML attached property for the target element.

SetAbove(UIElement, Object)
SetAbove(UIElement, Object)
SetAbove(UIElement, Object)

Sets the value of the RelativePanel.Above XAML attached property for a target element.

SetAlignBottomWith(UIElement, Object)
SetAlignBottomWith(UIElement, Object)
SetAlignBottomWith(UIElement, Object)

Sets the value of the RelativePanel.AlignBottomWith XAML attached property for the target element.

SetAlignBottomWithPanel(UIElement, Boolean)
SetAlignBottomWithPanel(UIElement, Boolean)
SetAlignBottomWithPanel(UIElement, Boolean)

Sets the value of the RelativePanel.AlignBottomWithPanel XAML attached property for a target element.

SetAlignHorizontalCenterWith(UIElement, Object)
SetAlignHorizontalCenterWith(UIElement, Object)
SetAlignHorizontalCenterWith(UIElement, Object)
Sets the value of the RelativePanel.AlignHorizontalCenterWith XAML attached property for a target element.

SetAlignHorizontalCenterWithPanel(UIElement, Boolean)
SetAlignHorizontalCenterWithPanel(UIElement, Boolean)
SetAlignHorizontalCenterWithPanel(UIElement, Boolean)

Sets the value of the RelativePanel.AlignHorizontalCenterWithPanel XAML attached property for a target
element.

SetAlignLeftWith(UIElement, Object)
SetAlignLeftWith(UIElement, Object)
SetAlignLeftWith(UIElement, Object)

Sets the value of the RelativePanel.AlignLeftWith XAML attached property for a target element.

SetAlignLeftWithPanel(UIElement, Boolean)
SetAlignLeftWithPanel(UIElement, Boolean)
SetAlignLeftWithPanel(UIElement, Boolean)

Sets the value of the RelativePanel.AlignLeftWithPanel XAML attached property for a target element.

SetAlignRightWith(UIElement, Object)
SetAlignRightWith(UIElement, Object)
SetAlignRightWith(UIElement, Object)

Sets the value of the RelativePanel.AlignRightWith XAML attached property for a target element.

SetAlignRightWithPanel(UIElement, Boolean)
SetAlignRightWithPanel(UIElement, Boolean)
SetAlignRightWithPanel(UIElement, Boolean)

Sets the value of the RelativePanel.AlignRightWithPanel XAML attached property for a target element.

SetAlignTopWith(UIElement, Object)
SetAlignTopWith(UIElement, Object)
SetAlignTopWith(UIElement, Object)

Sets the value of the RelativePanel.AlignTopWith XAML attached property for a target element.

SetAlignTopWithPanel(UIElement, Boolean)
SetAlignTopWithPanel(UIElement, Boolean)
SetAlignTopWithPanel(UIElement, Boolean)

Sets the value of the RelativePanel.AlignTopWithPanel XAML attached property for a target element.
SetAlignVerticalCenterWith(UIElement, Object)
SetAlignVerticalCenterWith(UIElement, Object)
SetAlignVerticalCenterWith(UIElement, Object)

Sets the value of the RelativePanel.AlignVerticalCenterWith XAML attached property for a target element.

SetAlignVerticalCenterWithPanel(UIElement, Boolean)
SetAlignVerticalCenterWithPanel(UIElement, Boolean)
SetAlignVerticalCenterWithPanel(UIElement, Boolean)

Sets the value of the RelativePanel.AlignVerticalCenterWithPanel XAML attached property for a target element.

SetBelow(UIElement, Object)
SetBelow(UIElement, Object)
SetBelow(UIElement, Object)

Sets the value of the RelativePanel.Below XAML attached property for a target element.

SetLeftOf(UIElement, Object)
SetLeftOf(UIElement, Object)
SetLeftOf(UIElement, Object)

Sets the value of the RelativePanel.LeftOf XAML attached property for a target element.

SetRightOf(UIElement, Object)
SetRightOf(UIElement, Object)
SetRightOf(UIElement, Object)

Sets the value of the RelativePanel.RightOf XAML attached property for a target element.

See Also
Panel
Panel
Panel
Panel
Panel
Panel
RelativePanel.AboveProperty RelativePanel.Above
Property RelativePanel.AboveProperty
I n this Article
Edit
Identifies the RelativePanel.Above XAML attached property.
public : static DependencyProperty AboveProperty { get; }
static DependencyProperty AboveProperty();
public static DependencyProperty AboveProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.Above XAML attached property.

Examples
// To remove a value, pass null.
Button1.SetValue(RelativePanel.AboveProperty, null);

// To set a value. (Sets Button1 above Button2.)


Button1.SetValue(RelativePanel.AboveProperty, Button2);

// To get a value. (elementName == "Button2" when set as shown previously.)


string elementName = (string)Button1.GetValue(RelativePanel.AboveProperty);

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.Above XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.Above attached property in code, you can use the dependency property system, calling
either GetValue or SetValue and passing RelativePanel.AboveProperty as the dependency property identifier. Another
way to get or set the value in code is to use GetAbove and SetAbove.
See RelativePanel.Above
Also Attached properties overview
RelativePanel.AlignBottomWithPanelProperty Relative
Panel.AlignBottomWithPanelProperty RelativePanel.Align
BottomWithPanelProperty
I n this Article
Edit
Identifies the RelativePanel.AlignBottomWithPanel XAML attached property.
public : static DependencyProperty AlignBottomWithPanelProperty { get; }
static DependencyProperty AlignBottomWithPanelProperty();
public static DependencyProperty AlignBottomWithPanelProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignBottomWithPanel XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignBottomWithPanel XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignBottomWithPanel attached property in code, you can use the dependency property
system, calling either GetValue or SetValue and passing RelativePanel.AlignBottomWithPanelProperty as the
dependency property identifier. Another way to get or set the value in code is to use GetAlignBottomWithPanel and
SetAlignBottomWithPanel.
See RelativePanel.AlignBottomWithPanel
Also Attached properties overview
RelativePanel.AlignBottomWithProperty RelativePanel.
AlignBottomWithProperty RelativePanel.AlignBottom
WithProperty
I n this Article
Edit
Identifies the RelativePanel.AlignBottomWith XAML attached property.
public : static DependencyProperty AlignBottomWithProperty { get; }
static DependencyProperty AlignBottomWithProperty();
public static DependencyProperty AlignBottomWithProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignBottomWith XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignBottomWith XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignBottomWith attached property in code, you can use the dependency property system,
calling either GetValue or SetValue and passing RelativePanel.AlignBottomWithProperty as the dependency property
identifier. Another way to get or set the value in code is to use GetAlignBottomWith and SetAlignBottomWith.
See RelativePanel.AlignBottomWith
Also Attached properties overview
RelativePanel.AlignHorizontalCenterWithPanelProperty
RelativePanel.AlignHorizontalCenterWithPanelProperty
RelativePanel.AlignHorizontalCenterWithPanelProperty
I n this Article
Edit
Identifies the RelativePanel.AlignHorizontalCenterWithPanel XAML attached property.
public : static DependencyProperty AlignHorizontalCenterWithPanelProperty { get; }
static DependencyProperty AlignHorizontalCenterWithPanelProperty();
public static DependencyProperty AlignHorizontalCenterWithPanelProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignHorizontalCenterWithPanel XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignHorizontalCenterWithPanel XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignHorizontalCenterWithPanel attached property in code, you can use the dependency
property system, calling either GetValue or SetValue and passing
RelativePanel.AlignHorizontalCenterWithPanelProperty as the dependency property identifier. Another way to get or
set the value in code is to use GetAlignHorizontalCenterWithPanel and SetAlignHorizontalCenterWithPanel.
See RelativePanel.AlignHorizontalCenterWithPanel
Also Attached properties overview
RelativePanel.AlignHorizontalCenterWithProperty
RelativePanel.AlignHorizontalCenterWithProperty
RelativePanel.AlignHorizontalCenterWithProperty
I n this Article
Edit
Gets the value of the RelativePanel.AlignHorizontalCenterWith XAML attached property for the target element.
public : static DependencyProperty AlignHorizontalCenterWithProperty { get; }
static DependencyProperty AlignHorizontalCenterWithProperty();
public static DependencyProperty AlignHorizontalCenterWithProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignHorizontalCenterWith XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignHorizontalCenterWith XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignHorizontalCenterWith attached property in code, you can use the dependency
property system, calling either GetValue or SetValue and passing RelativePanel.AlignHorizontalCenterWithProperty as
the dependency property identifier. Another way to get or set the value in code is to use GetAlignHorizontalCenterWith
and SetAlignHorizontalCenterWith.
See RelativePanel.AlignHorizontalCenterWith
Also Attached properties overview
RelativePanel.AlignLeftWithPanelProperty RelativePanel.
AlignLeftWithPanelProperty RelativePanel.AlignLeftWith
PanelProperty
I n this Article
Edit
Identifies the RelativePanel.AlignLeftWithPanel XAML attached property.
public : static DependencyProperty AlignLeftWithPanelProperty { get; }
static DependencyProperty AlignLeftWithPanelProperty();
public static DependencyProperty AlignLeftWithPanelProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignLeftWithPanel XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignLeftWithPanel XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignLeftWithPanel attached property in code, you can use the dependency property
system, calling either GetValue or SetValue and passing RelativePanel.AlignLeftWithPanelProperty as the dependency
property identifier. Another way to get or set the value in code is to use GetAlignLeftWithPanel and
SetAlignLeftWithPanel.
See RelativePanel.AlignLeftWithPanel
Also Attached properties overview
RelativePanel.AlignLeftWithProperty RelativePanel.Align
LeftWithProperty RelativePanel.AlignLeftWithProperty
I n this Article
Edit
Identifies the RelativePanel.AlignLeftWith XAML attached property.
public : static DependencyProperty AlignLeftWithProperty { get; }
static DependencyProperty AlignLeftWithProperty();
public static DependencyProperty AlignLeftWithProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignLeftWith XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignBottomWith XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignLeftWith attached property in code, you can use the dependency property system,
calling either GetValue or SetValue and passing RelativePanel.AlignLeftWithProperty as the dependency property
identifier. Another way to get or set the value in code is to use GetAlignLeftWith and SetAlignLeftWith.
See RelativePanel.AlignLeftWith
Also Attached properties overview
RelativePanel.AlignRightWithPanelProperty Relative
Panel.AlignRightWithPanelProperty RelativePanel.Align
RightWithPanelProperty
I n this Article
Edit
Identifies the RelativePanel.AlignRightWithPanel XAML attached property.
public : static DependencyProperty AlignRightWithPanelProperty { get; }
static DependencyProperty AlignRightWithPanelProperty();
public static DependencyProperty AlignRightWithPanelProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignRightWithPanel XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignRightWithPanel XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignRightWithPanel attached property in code, you can use the dependency property
system, calling either GetValue or SetValue and passing RelativePanel.AlignRightWithPanelProperty as the dependency
property identifier. Another way to get or set the value in code is to use GetAlignRightWithPanel and
SetAlignRightWithPanel.
See RelativePanel.AlignRightWithPanel
Also Attached properties overview
RelativePanel.AlignRightWithProperty RelativePanel.
AlignRightWithProperty RelativePanel.AlignRightWith
Property
I n this Article
Edit
Identifies the RelativePanel.AlignRightWith XAML attached property.
public : static DependencyProperty AlignRightWithProperty { get; }
static DependencyProperty AlignRightWithProperty();
public static DependencyProperty AlignRightWithProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignRightWith XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignRightWith XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignRightWith attached property in code, you can use the dependency property system,
calling either GetValue or SetValue and passing RelativePanel.AlignRightWithProperty as the dependency property
identifier. Another way to get or set the value in code is to use GetAlignRightWith and SetAlignRightWith.
See RelativePanel.AlignRightWith
Also Attached properties overview
RelativePanel.AlignTopWithPanelProperty RelativePanel.
AlignTopWithPanelProperty RelativePanel.AlignTopWith
PanelProperty
I n this Article
Edit
Identifies the RelativePanel.AlignTopWithPanel XAML attached property.
public : static DependencyProperty AlignTopWithPanelProperty { get; }
static DependencyProperty AlignTopWithPanelProperty();
public static DependencyProperty AlignTopWithPanelProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignTopWithPanel XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignTopWithPanel XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.Above attached property in code, you can use the dependency property system, calling
either GetValue or SetValue and passing RelativePanel.AlignTopWithPanelProperty as the dependency property
identifier. Another way to get or set the value in code is to use GetAlignTopWithPanel and SetAlignTopWithPanel.
See RelativePanel.AlignTopWithPanel
Also Attached properties overview
RelativePanel.AlignTopWithProperty RelativePanel.Align
TopWithProperty RelativePanel.AlignTopWithProperty
I n this Article
Edit
Identifies the RelativePanel.AlignTopWith XAML attached property.
public : static DependencyProperty AlignTopWithProperty { get; }
static DependencyProperty AlignTopWithProperty();
public static DependencyProperty AlignTopWithProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignTopWith XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignTopWith XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignTopWith attached property in code, you can use the dependency property system,
calling either GetValue or SetValue and passing RelativePanel.AlignTopWithProperty as the dependency property
identifier. Another way to get or set the value in code is to use GetAlignTopWith and SetAlignTopWith.
See RelativePanel.AlignTopWith
Also Attached properties overview
RelativePanel.AlignVerticalCenterWithPanelProperty
RelativePanel.AlignVerticalCenterWithPanelProperty
RelativePanel.AlignVerticalCenterWithPanelProperty
I n this Article
Edit
Identifies the RelativePanel.AlignVerticalCenterWithPanel XAML attached property.
public : static DependencyProperty AlignVerticalCenterWithPanelProperty { get; }
static DependencyProperty AlignVerticalCenterWithPanelProperty();
public static DependencyProperty AlignVerticalCenterWithPanelProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignVerticalCenterWithPanel XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignVerticalCenterWithPanel XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignVerticalCenterWithPanel attached property in code, you can use the dependency
property system, calling either GetValue or SetValue and passing RelativePanel.AlignVerticalCenterWithPanelProperty
as the dependency property identifier. Another way to get or set the value in code is to use
GetAlignVerticalCenterWithPanel and SetAlignVerticalCenterWithPanel.
See RelativePanel.AlignVerticalCenterWithPanel
Also Attached properties overview
RelativePanel.AlignVerticalCenterWithProperty Relative
Panel.AlignVerticalCenterWithProperty RelativePanel.
AlignVerticalCenterWithProperty
I n this Article
Edit
Gets the value of the RelativePanel.AlignVerticalCenterWith XAML attached property for the target element.
public : static DependencyProperty AlignVerticalCenterWithProperty { get; }
static DependencyProperty AlignVerticalCenterWithProperty();
public static DependencyProperty AlignVerticalCenterWithProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.AlignVerticalCenterWith XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.AlignVerticalCenterWith XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.AlignVerticalCenterWith attached property in code, you can use the dependency property
system, calling either GetValue or SetValue and passing RelativePanel.AlignVerticalCenterWithProperty as the
dependency property identifier. Another way to get or set the value in code is to use GetAlignVerticalCenterWith and
SetAlignVerticalCenterWith.
See RelativePanel.AlignVerticalCenterWith
Also Attached properties overview
RelativePanel.BackgroundSizing RelativePanel.
BackgroundSizing RelativePanel.BackgroundSizing
I n this Article
Edit
Gets or sets a value that indicates how far the background extends in relation to this element's border.
public : BackgroundSizing BackgroundSizing { get; set; }
BackgroundSizing BackgroundSizing();

void BackgroundSizing(BackgroundSizing backgroundsizing);


public BackgroundSizing BackgroundSizing { get; set; }

Returns
BackgroundSizing
A value of the enumeration that indicates how far the background extends. The default is InnerBorderEdge.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
You can set this property to OuterBorderEdge to make the element's background extend under the border. If the
border is transparent, the background will show through it.
See BackgroundSizing
Also BackgroundSizing
RelativePanel.BackgroundSizingProperty RelativePanel.
BackgroundSizingProperty RelativePanel.Background
SizingProperty
I n this Article
Edit
Identifies the BackgroundSizing dependency property.
public : static DependencyProperty BackgroundSizingProperty { get; }
static DependencyProperty BackgroundSizingProperty();
public static DependencyProperty BackgroundSizingProperty { get; }

Returns
DependencyProperty
The identifier for the BackgroundSizing dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RelativePanel.BelowProperty RelativePanel.Below
Property RelativePanel.BelowProperty
I n this Article
Edit
Identifies the RelativePanel.Below XAML attached property.
public : static DependencyProperty BelowProperty { get; }
static DependencyProperty BelowProperty();
public static DependencyProperty BelowProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.Below XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.Below XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.Below attached property in code, you can use the dependency property system, calling
either GetValue or SetValue and passing RelativePanel.BelowProperty as the dependency property identifier. Another
way to get or set the value in code is to use GetBelow and SetBelow.
See RelativePanel.Below
Also Attached properties overview
RelativePanel.BorderBrush RelativePanel.BorderBrush
RelativePanel.BorderBrush
I n this Article
Edit
Gets or sets a brush that describes the border fill of the panel.
public : Brush BorderBrush { get; set; }
Brush BorderBrush();

void BorderBrush(Brush borderbrush);


public Brush BorderBrush { get; set; }

<RelativePanel BorderBrush="{StaticResource resourceName}"/>

Returns
Brush
The brush that is used to fill the panel's border. The default is null, (a null brush) which is evaluated as Transparent for
rendering.

Remarks
The BorderThickness value must be greater than 0 in order to see the BorderBrush value take effect.
RelativePanel.BorderBrushProperty RelativePanel.Border
BrushProperty RelativePanel.BorderBrushProperty
I n this Article
Edit
Identifies the BorderBrush dependency property.
public : static DependencyProperty BorderBrushProperty { get; }
static DependencyProperty BorderBrushProperty();
public static DependencyProperty BorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the BorderBrush dependency property.
See Dependency properties overview
Also
RelativePanel.BorderThickness RelativePanel.Border
Thickness RelativePanel.BorderThickness
I n this Article
Edit
Gets or sets the border thickness of the panel.
public : Thickness BorderThickness { get; set; }
Thickness BorderThickness();

void BorderThickness(Thickness borderthickness);


public Thickness BorderThickness { get; set; }

<RelativePanel BorderThickness="uniform"/>
- or -
<RelativePanel BorderThickness="left&right,top&bottom"/>
- or -
<RelativePanel BorderThickness="left,top,right,bottom"/>

Returns
Thickness
The border thickness of the panel, as a Thickness value.
RelativePanel.BorderThicknessProperty RelativePanel.
BorderThicknessProperty RelativePanel.BorderThickness
Property
I n this Article
Edit
Identifies the BorderThickness dependency property.
public : static DependencyProperty BorderThicknessProperty { get; }
static DependencyProperty BorderThicknessProperty();
public static DependencyProperty BorderThicknessProperty { get; }

Returns
DependencyProperty
The identifier for the BorderThickness dependency property.
See Dependency properties overview
Also
RelativePanel.CornerRadius RelativePanel.CornerRadius
RelativePanel.CornerRadius
I n this Article
Edit
Gets or sets the radius for the corners of the panel's border.
public : CornerRadius CornerRadius { get; set; }
CornerRadius CornerRadius();

void CornerRadius(CornerRadius cornerradius);


public CornerRadius CornerRadius { get; set; }

<RelativePanel CornerRadius="uniformRadius"/>
- or -
<RelativePanel CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>

Returns
CornerRadius
The degree to which the corners are rounded, expressed as values of the CornerRadius structure.

Remarks
Member components of a CornerRadius value cannot be negative.
RelativePanel.CornerRadiusProperty RelativePanel.
CornerRadiusProperty RelativePanel.CornerRadius
Property
I n this Article
Edit
Identifies the CornerRadius dependency property.
public : static DependencyProperty CornerRadiusProperty { get; }
static DependencyProperty CornerRadiusProperty();
public static DependencyProperty CornerRadiusProperty { get; }

Returns
DependencyProperty
The identifier for the CornerRadius dependency property.
See Dependency properties overview
Also
RelativePanel.GetAbove RelativePanel.GetAbove Relative
Panel.GetAbove
I n this Article
Edit
Gets the value of the RelativePanel.Above XAML attached property for the target element.
public : static Platform::Object GetAbove(UIElement element)
static winrt::Windows::Foundation::IInspectable GetAbove(UIElement element) const;
public static object GetAbove(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.Above XAML attached property value of the specified object. (The element to position this element
above.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.Above XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.Above attached property.
See GetAbove(UIElement)GetAbove(UIElement)GetAbove(UIElement)
Also
RelativePanel.GetAlignBottomWith RelativePanel.Get
AlignBottomWith RelativePanel.GetAlignBottomWith
I n this Article
Edit
Gets the value of the RelativePanel.AlignBottomWith XAML attached property for the target element.
public : static Platform::Object GetAlignBottomWith(UIElement element)
static winrt::Windows::Foundation::IInspectable GetAlignBottomWith(UIElement element) const;
public static object GetAlignBottomWith(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.AlignBottomWith XAML attached property value of the specified object. (The element to align this
element's bottom edge with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignBottomWith XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.AlignBottomWith attached property.
See RelativePanel.AlignBottomWith
Also
RelativePanel.GetAlignBottomWithPanel RelativePanel.
GetAlignBottomWithPanel RelativePanel.GetAlignBottom
WithPanel
I n this Article
Edit
Gets the value of the RelativePanel.AlignBottomWithPanel XAML attached property for the target element.
public : static Platform::Boolean GetAlignBottomWithPanel(UIElement element)
static bool GetAlignBottomWithPanel(UIElement element) const;
public static bool GetAlignBottomWithPanel(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
bool
The RelativePanel.AlignBottomWithPanel XAML attached property value of the specified object. ( true to align this
element's bottom edge with the panel's bottom edge; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignBottomWithPanel XAML attached property in XAML and won't need this method. For more info,
see the RelativePanel.AlignBottomWithPanel attached property.
See RelativePanel.AlignBottomWithPanel
Also
RelativePanel.GetAlignHorizontalCenterWith Relative
Panel.GetAlignHorizontalCenterWith RelativePanel.Get
AlignHorizontalCenterWith
I n this Article
Edit
Gets the value of the RelativePanel.AlignHorizontalCenterWith XAML attached property for the target element.
public : static Platform::Object GetAlignHorizontalCenterWith(UIElement element)
static winrt::Windows::Foundation::IInspectable GetAlignHorizontalCenterWith(UIElement element)
const;
public static object GetAlignHorizontalCenterWith(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.AlignHorizontalCenterWith XAML attached property value of the specified object. (The element to
align this element's horizontal center with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignHorizontalCenterWith XAML attached property in XAML and won't need this method. For more
info, see the RelativePanel.AlignHorizontalCenterWith attached property.
See RelativePanel.AlignHorizontalCenterWith
Also
RelativePanel.GetAlignHorizontalCenterWithPanel
RelativePanel.GetAlignHorizontalCenterWithPanel
RelativePanel.GetAlignHorizontalCenterWithPanel
I n this Article
Edit
Gets the value of the RelativePanel.AlignHorizontalCenterWithPanel XAML attached property for the target element.
public : static Platform::Boolean GetAlignHorizontalCenterWithPanel(UIElement element)
static bool GetAlignHorizontalCenterWithPanel(UIElement element) const;
public static bool GetAlignHorizontalCenterWithPanel(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
bool
The RelativePanel.AlignHorizontalCenterWithPanel XAML attached property value of the specified object. ( true to
horizontally center this element in the panel; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignHorizontalCenterWithPanel XAML attached property in XAML and won't need this method. For
more info, see the RelativePanel.AlignHorizontalCenterWithPanel attached property.
See RelativePanel.AlignHorizontalCenterWithPanel
Also
RelativePanel.GetAlignLeftWith RelativePanel.GetAlign
LeftWith RelativePanel.GetAlignLeftWith
I n this Article
Edit
Gets the value of the RelativePanel.AlignLeftWith XAML attached property for the target element.
public : static Platform::Object GetAlignLeftWith(UIElement element)
static winrt::Windows::Foundation::IInspectable GetAlignLeftWith(UIElement element) const;
public static object GetAlignLeftWith(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.AlignLeftWith XAML attached property value of the specified object. (The element to align this
element's left edge with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignLeftWith XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.AlignLeftWith attached property.
See RelativePanel.AlignLeftWith
Also
RelativePanel.GetAlignLeftWithPanel RelativePanel.Get
AlignLeftWithPanel RelativePanel.GetAlignLeftWithPanel
I n this Article
Edit
Gets the value of the RelativePanel.AlignLeftWithPanel XAML attached property for the target element.
public : static Platform::Boolean GetAlignLeftWithPanel(UIElement element)
static bool GetAlignLeftWithPanel(UIElement element) const;
public static bool GetAlignLeftWithPanel(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
bool
The RelativePanel.AlignLeftWithPanel XAML attached property value of the specified object. ( true to align this
element's left edge with the panel's left edge; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignLeftWithPanel XAML attached property in XAML and won't need this method. For more info, see
the RelativePanel.AlignLeftWithPanel attached property.
See RelativePanel.AlignLeftWithPanel
Also
RelativePanel.GetAlignRightWith RelativePanel.GetAlign
RightWith RelativePanel.GetAlignRightWith
I n this Article
Edit
Gets the value of the RelativePanel.AlignRightWith XAML attached property for the target element.
public : static Platform::Object GetAlignRightWith(UIElement element)
static winrt::Windows::Foundation::IInspectable GetAlignRightWith(UIElement element) const;
public static object GetAlignRightWith(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.AlignRightWith XAML attached property value of the specified object. (The element to align this
element's right edge with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignRightWith XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.AlignRightWith attached property.
See RelativePanel.AlignRightWith
Also
RelativePanel.GetAlignRightWithPanel RelativePanel.Get
AlignRightWithPanel RelativePanel.GetAlignRightWith
Panel
I n this Article
Edit
Gets the value of the RelativePanel.AlignRightWithPanel XAML attached property for the target element.
public : static Platform::Boolean GetAlignRightWithPanel(UIElement element)
static bool GetAlignRightWithPanel(UIElement element) const;
public static bool GetAlignRightWithPanel(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
bool
The RelativePanel.AlignRightWithPanel XAML attached property value of the specified object. ( true to align this
element's right edge with the panel's right edge; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignRightWithPanel XAML attached property in XAML and won't need this method. For more info, see
the RelativePanel.AlignRightWithPanel attached property.
See RelativePanel.AlignRightWithPanel
Also
RelativePanel.GetAlignTopWith RelativePanel.GetAlign
TopWith RelativePanel.GetAlignTopWith
I n this Article
Edit
Gets the value of the RelativePanel.AlignTopWith XAML attached property for the target element.
public : static Platform::Object GetAlignTopWith(UIElement element)
static winrt::Windows::Foundation::IInspectable GetAlignTopWith(UIElement element) const;
public static object GetAlignTopWith(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.AlignTopWith XAML attached property value of the specified object. (The element to align this
element's top edge with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignTopWith XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.AlignTopWith attached property.
See RelativePanel.AlignTopWith
Also
RelativePanel.GetAlignTopWithPanel RelativePanel.Get
AlignTopWithPanel RelativePanel.GetAlignTopWithPanel
I n this Article
Edit
Gets the value of the RelativePanel.AlignTopWithPanel XAML attached property for the target element.
public : static Platform::Boolean GetAlignTopWithPanel(UIElement element)
static bool GetAlignTopWithPanel(UIElement element) const;
public static bool GetAlignTopWithPanel(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
bool
The RelativePanel.AlignTopWithPanel XAML attached property value of the specified object. ( true to align this
element's top edge with the panel's top edge; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignTopWithPanel XAML attached property in XAML and won't need this method. For more info, see
the RelativePanel.AlignTopWithPanel attached property.
See RelativePanel.AlignTopWithPanel
Also
RelativePanel.GetAlignVerticalCenterWith RelativePanel.
GetAlignVerticalCenterWith RelativePanel.GetAlign
VerticalCenterWith
I n this Article
Edit
Gets the value of the RelativePanel.AlignVerticalCenterWith XAML attached property for the target element.
public : static Platform::Object GetAlignVerticalCenterWith(UIElement element)
static winrt::Windows::Foundation::IInspectable GetAlignVerticalCenterWith(UIElement element) const;
public static object GetAlignVerticalCenterWith(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.AlignVerticalCenterWith XAML attached property value of the specified object. (The element to
align this element's vertical center with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignVerticalCenterWith XAML attached property in XAML and won't need this method. For more info,
see the RelativePanel.AlignVerticalCenterWith attached property.
See RelativePanel.AlignVerticalCenterWith
Also
RelativePanel.GetAlignVerticalCenterWithPanel Relative
Panel.GetAlignVerticalCenterWithPanel RelativePanel.Get
AlignVerticalCenterWithPanel
I n this Article
Edit
Gets the value of the RelativePanel.AlignVerticalCenterWithPanel XAML attached property for the target element.
public : static Platform::Boolean GetAlignVerticalCenterWithPanel(UIElement element)
static bool GetAlignVerticalCenterWithPanel(UIElement element) const;
public static bool GetAlignVerticalCenterWithPanel(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
bool
The RelativePanel.AlignVerticalCenterWithPanel XAML attached property value of the specified object. ( true to
vertically center this element in the panel; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignVerticalCenterWithPanel XAML attached property in XAML and won't need this method. For more
info, see the RelativePanel.AlignVerticalCenterWithPanel attached property.
See RelativePanel.AlignVerticalCenterWithPanel
Also
RelativePanel.GetBelow RelativePanel.GetBelow Relative
Panel.GetBelow
I n this Article
Edit
Gets the value of the RelativePanel.Below XAML attached property for the target element.
public : static Platform::Object GetBelow(UIElement element)
static winrt::Windows::Foundation::IInspectable GetBelow(UIElement element) const;
public static object GetBelow(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.Below XAML attached property value of the specified object. (The element to position this element
below.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.Below XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.Below attached property.
See RelativePanel.Below
Also
RelativePanel.GetLeftOf RelativePanel.GetLeftOf Relative
Panel.GetLeftOf
I n this Article
Edit
Gets the value of the RelativePanel.LeftOf XAML attached property for the target element.
public : static Platform::Object GetLeftOf(UIElement element)
static winrt::Windows::Foundation::IInspectable GetLeftOf(UIElement element) const;
public static object GetLeftOf(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.LeftOf XAML attached property value of the specified object. (The element to position this element
to the left of.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.LeftOf XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.LeftOf attached property.
See RelativePanel.LeftOf
Also
RelativePanel.GetRightOf RelativePanel.GetRightOf
RelativePanel.GetRightOf
I n this Article
Edit
Gets the value of the RelativePanel.RightOf XAML attached property for the target element.
public : static Platform::Object GetRightOf(UIElement element)
static winrt::Windows::Foundation::IInspectable GetRightOf(UIElement element) const;
public static object GetRightOf(UIElement element)

Parameters
element UIElement
The object from which the property value is read.
Returns
object
The RelativePanel.RightOf XAML attached property value of the specified object. (The element to position this element
to the right of.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.RightOf XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.RightOf attached property.
See RelativePanel.RightOf
Also
RelativePanel.LeftOfProperty RelativePanel.LeftOf
Property RelativePanel.LeftOfProperty
I n this Article
Edit
Identifies the RelativePanel.LeftOf XAML attached property.
public : static DependencyProperty LeftOfProperty { get; }
static DependencyProperty LeftOfProperty();
public static DependencyProperty LeftOfProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.LeftOf XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.LeftOf XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.LeftOf attached property in code, you can use the dependency property system, calling
either GetValue or SetValue and passing RelativePanel.LeftOfProperty as the dependency property identifier. Another
way to get or set the value in code is to use GetLeftOf and SetLeftOf.
See RelativePanel.LeftOf
Also Attached properties overview
RelativePanel.Padding RelativePanel.Padding Relative
Panel.Padding
I n this Article
Edit
Gets or sets the distance between the border and its child object.
public : Thickness Padding { get; set; }
Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<RelativePanel Padding="uniform"/>
- or -
<RelativePanel Padding="left&right,top&bottom"/>
- or -
<RelativePanel Padding="left,top,right,bottom"/>

Returns
Thickness
The dimensions of the space between the border and its child as a Thickness value. Thickness is a structure that stores
dimension values using pixel measures.

Remarks
A related property is Margin (a property of FrameworkElement ). For more info about the relationship between margin
and padding, see Alignment, margin, and padding or Define layouts with XAML.
RelativePanel.PaddingProperty RelativePanel.Padding
Property RelativePanel.PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
See Dependency properties overview
Also
RelativePanel RelativePanel RelativePanel
I n this Article
Edit
Initializes a new instance of the RelativePanel class.

public : RelativePanel()
RelativePanel() const;
public RelativePanel()
RelativePanel.RightOfProperty RelativePanel.RightOf
Property RelativePanel.RightOfProperty
I n this Article
Edit
Identifies the RelativePanel.RightOf XAML attached property.
public : static DependencyProperty RightOfProperty { get; }
static DependencyProperty RightOfProperty();
public static DependencyProperty RightOfProperty { get; }

Returns
DependencyProperty
The identifier for the RelativePanel.RightOf XAML attached property.

Remarks
This property is only an identifier for the property system, and isn't used in most app scenarios. In most cases you set
the RelativePanel.RightOf XAML attached property in XAML and won't need this identifier.
To access the RelativePanel.RightOf attached property in code, you can use the dependency property system, calling
either GetValue or SetValue and passing RelativePanel.RightOfProperty as the dependency property identifier. Another
way to get or set the value in code is to use GetRightOf and SetRightOf.
See RelativePanel.RightOf
Also Attached properties overview
RelativePanel.SetAbove RelativePanel.SetAbove Relative
Panel.SetAbove
I n this Article
Edit
Sets the value of the RelativePanel.Above XAML attached property for a target element.
public : static void SetAbove(UIElement element, Platform::Object value)
static void SetAbove(UIElement element, winrt::Windows::Foundation::IInspectable value) const;
public static void SetAbove(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to position this element above.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.Above XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.Above attached property.
See RelativePanel.Above
Also
RelativePanel.SetAlignBottomWith RelativePanel.Set
AlignBottomWith RelativePanel.SetAlignBottomWith
I n this Article
Edit
Sets the value of the RelativePanel.AlignBottomWith XAML attached property for the target element.
public : static void SetAlignBottomWith(UIElement element, Platform::Object value)
static void SetAlignBottomWith(UIElement element, winrt::Windows::Foundation::IInspectable value)
const;
public static void SetAlignBottomWith(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to align this element's bottom edge with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignBottomWith XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.AlignBottomWith attached property.
See RelativePanel.AlignBottomWith
Also
RelativePanel.SetAlignBottomWithPanel RelativePanel.
SetAlignBottomWithPanel RelativePanel.SetAlignBottom
WithPanel
I n this Article
Edit
Sets the value of the RelativePanel.AlignBottomWithPanel XAML attached property for a target element.
public : static void SetAlignBottomWithPanel(UIElement element, bool value)
static void SetAlignBottomWithPanel(UIElement element, bool value) const;
public static void SetAlignBottomWithPanel(UIElement element, Boolean value)

Parameters
element UIElement
The object to which the property value is written.
value Boolean
The value to set. (true to align this element's bottom edge with the panel's bottom edge; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignBottomWithPanel XAML attached property in XAML and won't need this method. For more info,
see the RelativePanel.AlignBottomWithPanel attached property.
See RelativePanel.AlignBottomWithPanel
Also
RelativePanel.SetAlignHorizontalCenterWith Relative
Panel.SetAlignHorizontalCenterWith RelativePanel.Set
AlignHorizontalCenterWith
I n this Article
Edit
Sets the value of the RelativePanel.AlignHorizontalCenterWith XAML attached property for a target element.
public : static void SetAlignHorizontalCenterWith(UIElement element, Platform::Object value)
static void SetAlignHorizontalCenterWith(UIElement element, winrt::Windows::Foundation::IInspectable
value) const;
public static void SetAlignHorizontalCenterWith(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to align this element's horizontal center with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignHorizontalCenterWith XAML attached property in XAML and won't need this method. For more
info, see the RelativePanel.AlignHorizontalCenterWith attached property.
See RelativePanel.AlignHorizontalCenterWith
Also
RelativePanel.SetAlignHorizontalCenterWithPanel
RelativePanel.SetAlignHorizontalCenterWithPanel
RelativePanel.SetAlignHorizontalCenterWithPanel
I n this Article
Edit
Sets the value of the RelativePanel.AlignHorizontalCenterWithPanel XAML attached property for a target element.
public : static void SetAlignHorizontalCenterWithPanel(UIElement element, bool value)
static void SetAlignHorizontalCenterWithPanel(UIElement element, bool value) const;
public static void SetAlignHorizontalCenterWithPanel(UIElement element, Boolean value)

Parameters
element UIElement
The object to which the property value is written.
value Boolean
The value to set. (true to horizontally center this element in the panel; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignHorizontalCenterWithPanel XAML attached property in XAML and won't need this method. For
more info, see the RelativePanel.AlignHorizontalCenterWithPanel attached property.
See RelativePanel.AlignHorizontalCenterWithPanel
Also
RelativePanel.SetAlignLeftWith RelativePanel.SetAlign
LeftWith RelativePanel.SetAlignLeftWith
I n this Article
Edit
Sets the value of the RelativePanel.AlignLeftWith XAML attached property for a target element.
public : static void SetAlignLeftWith(UIElement element, Platform::Object value)
static void SetAlignLeftWith(UIElement element, winrt::Windows::Foundation::IInspectable value)
const;
public static void SetAlignLeftWith(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to align this element's left edge with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignLeftWith XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.AlignLeftWith attached property.
See RelativePanel.AlignLeftWith
Also
RelativePanel.SetAlignLeftWithPanel RelativePanel.Set
AlignLeftWithPanel RelativePanel.SetAlignLeftWithPanel
I n this Article
Edit
Sets the value of the RelativePanel.AlignLeftWithPanel XAML attached property for a target element.
public : static void SetAlignLeftWithPanel(UIElement element, bool value)
static void SetAlignLeftWithPanel(UIElement element, bool value) const;
public static void SetAlignLeftWithPanel(UIElement element, Boolean value)

Parameters
element UIElement
The object to which the property value is written.
value Boolean
The value to set. (true to align this element's left edge with the panel's left edge; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignLeftWithPanel XAML attached property in XAML and won't need this method. For more info, see
the RelativePanel.AlignLeftWithPanel attached property.
See RelativePanel.AlignLeftWithPanel
Also
RelativePanel.SetAlignRightWith RelativePanel.SetAlign
RightWith RelativePanel.SetAlignRightWith
I n this Article
Edit
Sets the value of the RelativePanel.AlignRightWith XAML attached property for a target element.
public : static void SetAlignRightWith(UIElement element, Platform::Object value)
static void SetAlignRightWith(UIElement element, winrt::Windows::Foundation::IInspectable value)
const;
public static void SetAlignRightWith(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to align this element's right edge with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignRightWith XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.AlignRightWith attached property.
See RelativePanel.AlignRightWith
Also
RelativePanel.SetAlignRightWithPanel RelativePanel.Set
AlignRightWithPanel RelativePanel.SetAlignRightWith
Panel
I n this Article
Edit
Sets the value of the RelativePanel.AlignRightWithPanel XAML attached property for a target element.
public : static void SetAlignRightWithPanel(UIElement element, bool value)
static void SetAlignRightWithPanel(UIElement element, bool value) const;
public static void SetAlignRightWithPanel(UIElement element, Boolean value)

Parameters
element UIElement
The object to which the property value is written.
value Boolean
The value to set. (true to align this element's right edge with the panel's right edge; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignRightWithPanel XAML attached property in XAML and won't need this method. For more info, see
the RelativePanel.AlignRightWithPanel attached property.
See RelativePanel.AlignRightWithPanel
Also
RelativePanel.SetAlignTopWith RelativePanel.SetAlignTop
With RelativePanel.SetAlignTopWith
I n this Article
Edit
Sets the value of the RelativePanel.AlignTopWith XAML attached property for a target element.
public : static void SetAlignTopWith(UIElement element, Platform::Object value)
static void SetAlignTopWith(UIElement element, winrt::Windows::Foundation::IInspectable value)
const;
public static void SetAlignTopWith(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to align this element's top edge with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignTopWith XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.AlignTopWith attached property.
See RelativePanel.AlignTopWith
Also
RelativePanel.SetAlignTopWithPanel RelativePanel.Set
AlignTopWithPanel RelativePanel.SetAlignTopWithPanel
I n this Article
Edit
Sets the value of the RelativePanel.AlignTopWithPanel XAML attached property for a target element.
public : static void SetAlignTopWithPanel(UIElement element, bool value)
static void SetAlignTopWithPanel(UIElement element, bool value) const;
public static void SetAlignTopWithPanel(UIElement element, Boolean value)

Parameters
element UIElement
The object to which the property value is written.
value Boolean
The value to set. (true to align this element's top edge with the panel's top edge; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignTopWithPanel XAML attached property in XAML and won't need this method. For more info, see
the RelativePanel.AlignTopWithPanel attached property.
See RelativePanel.AlignTopWithPanel
Also
RelativePanel.SetAlignVerticalCenterWith RelativePanel.
SetAlignVerticalCenterWith RelativePanel.SetAlign
VerticalCenterWith
I n this Article
Edit
Sets the value of the RelativePanel.AlignVerticalCenterWith XAML attached property for a target element.
public : static void SetAlignVerticalCenterWith(UIElement element, Platform::Object value)
static void SetAlignVerticalCenterWith(UIElement element, winrt::Windows::Foundation::IInspectable
value) const;
public static void SetAlignVerticalCenterWith(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to align this element's horizontal center with.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignVerticalCenterWith XAML attached property in XAML and won't need this method. For more info,
see the RelativePanel.AlignVerticalCenterWith attached property.
See RelativePanel.AlignVerticalCenterWith
Also
RelativePanel.SetAlignVerticalCenterWithPanel Relative
Panel.SetAlignVerticalCenterWithPanel RelativePanel.Set
AlignVerticalCenterWithPanel
I n this Article
Edit
Sets the value of the RelativePanel.AlignVerticalCenterWithPanel XAML attached property for a target element.
public : static void SetAlignVerticalCenterWithPanel(UIElement element, bool value)
static void SetAlignVerticalCenterWithPanel(UIElement element, bool value) const;
public static void SetAlignVerticalCenterWithPanel(UIElement element, Boolean value)

Parameters
element UIElement
The object to which the property value is written.
value Boolean
The value to set. (true to vertically center this element in the panel; otherwise, false.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.AlignVerticalCenterWithPanel XAML attached property in XAML and won't need this method. For more
info, see the RelativePanel.AlignVerticalCenterWithPanel attached property.
See RelativePanel.AlignVerticalCenterWithPanel
Also
RelativePanel.SetBelow RelativePanel.SetBelow Relative
Panel.SetBelow
I n this Article
Edit
Sets the value of the RelativePanel.Below XAML attached property for a target element.
public : static void SetBelow(UIElement element, Platform::Object value)
static void SetBelow(UIElement element, winrt::Windows::Foundation::IInspectable value) const;
public static void SetBelow(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to position this element below.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.Below XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.Below attached property.
See RelativePanel.Below
Also
RelativePanel.SetLeftOf RelativePanel.SetLeftOf Relative
Panel.SetLeftOf
I n this Article
Edit
Sets the value of the RelativePanel.LeftOf XAML attached property for a target element.
public : static void SetLeftOf(UIElement element, Platform::Object value)
static void SetLeftOf(UIElement element, winrt::Windows::Foundation::IInspectable value) const;
public static void SetLeftOf(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to position this element to the left of.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.LeftOf XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.LeftOf attached property.
See RelativePanel.LeftOf
Also
RelativePanel.SetRightOf RelativePanel.SetRightOf
RelativePanel.SetRightOf
I n this Article
Edit
Sets the value of the RelativePanel.RightOf XAML attached property for a target element.
public : static void SetRightOf(UIElement element, Platform::Object value)
static void SetRightOf(UIElement element, winrt::Windows::Foundation::IInspectable value) const;
public static void SetRightOf(UIElement element, Object value)

Parameters
element UIElement
The object to which the property value is written.
value Object
The value to set. (The element to position this element to the right of.)

Remarks
This method is a utility method for the property system, and isn't used in most app scenarios. In most cases you set the
RelativePanel.RightOf XAML attached property in XAML and won't need this method. For more info, see the
RelativePanel.RightOf attached property.
See RelativePanel.RightOf
Also
RequiresPointer RequiresPointer RequiresPointer Enum
Defines constants that specify when an element requires a mouse-like pointer behavior from a game pad.

D eclaration
public : enum class RequiresPointer
enum class winrt::Windows::UI::Xaml::Controls::RequiresPointer : int32_t
public enum RequiresPointer

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the Control.RequiresPointer property.
RequiresPointer is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.

Fields
Never Never Never The pointer never acts as a mouse.

WhenEngaged WhenEngaged The pointer acts as a mouse when the user engages mouse-mode.
WhenEngaged

WhenFocused WhenFocused The pointer acts as a mouse when the page gets focus. Supported on Page
WhenFocused elements only.
RichEditBox RichEditBox RichEditBox Class
Represents a rich text editing control that supports formatted text, hyperlinks, and other rich content.

D eclaration
public : class RichEditBox : Control, IRichEditBox, IRichEditBox2, IRichEditBox3, IRichEditBox4,
IRichEditBox5, IRichEditBox6, IRichEditBox7, IRichEditBox8
struct winrt::Windows::UI::Xaml::Controls::RichEditBox : Control, IRichEditBox, IRichEditBox2,
IRichEditBox3, IRichEditBox4, IRichEditBox5, IRichEditBox6, IRichEditBox7, IRichEditBox8
public class RichEditBox : Control, IRichEditBox, IRichEditBox2, IRichEditBox3, IRichEditBox4,
IRichEditBox5, IRichEditBox6, IRichEditBox7, IRichEditBox8

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Rich edit box.
RichEditBox is a control that lets a user enter formatted text such as bold, italic, and underlined. RichEditBox can also
display Rich Text Format (.rtf) documents including hyperlinks and images (.jpg, .png, etc). This control is designed for
advanced text editing scenarios. For simple plain text input, like on a form, consider using TextBox.
You use the Document property of the RichEditBox to get its content. The content of a RichEditBox is a
Windows.UI.Text.ITextDocument object, which gives you access to the underlying Text Object Model APIs. See the
Windows.UI.Text namespace for APIs that you can use to work with the text document.
For more info and examples, see the RichEditBox control guide.
Pen input
Starting with Windows 10, version 1803, XAML text input boxes feature embedded support for pen input using
Windows Ink. When a user taps into a text input box using a Windows pen, the text box transforms to let the user write
directly into it with a pen, rather than opening a separate input panel.

For more info, see Text input with the handwriting view.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the RichEditBox control. Resources that start with "TextControl" are shared by
TextBox, PasswordBox, RichEditBox, and AutoSuggestBox.

R ES O U R CE K EY D ES CR IPTIO N

TextControlForeground Text color at rest and not focused

TextControlForegroundPointerOver Text color on hover

TextControlForegroundFocused Text color when focused

TextControlForegroundDisabled Text color when disabled

TextControlBackground Background color at rest and not focused

TextControlBackgroundPointerOver Background color on hover

TextControlBackgroundFocused Background color when focused

TextControlBackgroundDisabled Background color when disabled

TextControlBorderBrush Border color at rest and not focused

TextControlBorderBrushPointerOver Border color on hover

TextControlBorderBrushFocused Border color when focused

TextControlBorderBrushDisabled Border color when disabled

TextControlPlaceholderForeground Placeholder text color at rest and not focused

TextControlPlaceholderForegroundPointerOver Placeholder text color on hover

TextControlPlaceholderForegroundFocused Placeholder text color when focused

TextControlPlaceholderForegroundDisabled Placeholder text color when disabled

TextControlHeaderForeground Header text color

TextControlHeaderForegroundDisabled Header text color when disabled

TextControlSelectionHighlightColor Highlight color of selected text


TextControlButtonBackground Background color of delete button at rest

TextControlButtonBackgroundPointerOver Background color of delete button on hover

TextControlButtonBackgroundPressed Background color of delete button when pressed

TextControlButtonBorderBrush Border color of delete button at rest

TextControlButtonBorderBrushPointerOver Border color of delete button on hover

TextControlButtonBorderBrushPressed Border color of delete button when pressed

TextControlButtonForeground Foreground color of delete button at rest

TextControlButtonForegroundPointerOver Foreground color of delete button on hover

TextControlButtonForegroundPressed Foreground color of delete button when pressed

Constructors
RichEditBox()
RichEditBox()
RichEditBox()

Initializes a new instance of the RichEditBox class.

Properties
AcceptsReturn
AcceptsReturn
AcceptsReturn

Gets or sets a value that indicates whether the RichEditBox allows and displays the newline or return characters
when the ENTER or RETURN keys are pressed.

AcceptsReturnProperty
AcceptsReturnProperty
AcceptsReturnProperty

Identifies the AcceptsReturn dependency property.

CharacterCasing
CharacterCasing
CharacterCasing

Gets or sets a value that indicates how the control modifies the case of characters as they are typed.

CharacterCasingProperty
CharacterCasingProperty
CharacterCasingProperty

Identifies the CharacterCasing dependency property.

ClipboardCopyFormat
ClipboardCopyFormat
ClipboardCopyFormat

Gets or sets a value that specifies whether text is copied with all formats, or as plain text only.

ClipboardCopyFormatProperty
ClipboardCopyFormatProperty
ClipboardCopyFormatProperty

Identifies the ClipboardCopyFormat dependency property.

ContentLinkBackgroundColor
ContentLinkBackgroundColor
ContentLinkBackgroundColor

Get or sets the brush used to color the link background.

ContentLinkBackgroundColorProperty
ContentLinkBackgroundColorProperty
ContentLinkBackgroundColorProperty

Identifies the ContentLinkBackgroundColor dependency property.

ContentLinkForegroundColor
ContentLinkForegroundColor
ContentLinkForegroundColor

Get or sets the brush used to color the link text.

ContentLinkForegroundColorProperty
ContentLinkForegroundColorProperty
ContentLinkForegroundColorProperty

Identifies the ContentLinkForegroundColor dependency property.

ContentLinkProviders
ContentLinkProviders
ContentLinkProviders

Get or sets the collection of ContentLinkProvider s that define the types of ContentLinks used in this RichEditBox.
ContentLinkProvidersProperty
ContentLinkProvidersProperty
ContentLinkProvidersProperty

Identifies the ContentLinkProviders dependency property.

Description
Description
Description

Gets or sets content that is shown below the control. The content should provide guidance about the input
expected by the control.

DescriptionProperty
DescriptionProperty
DescriptionProperty

Identifies the Description dependency property.

DesiredCandidateWindowAlignment
DesiredCandidateWindowAlignment
DesiredCandidateWindowAlignment

Gets or sets a value that indicates the preferred alignment of the Input Method Editor (IME ).

DesiredCandidateWindowAlignmentProperty
DesiredCandidateWindowAlignmentProperty
DesiredCandidateWindowAlignmentProperty

Identifies the DesiredCandidateWindowAlignment dependency property.

DisabledFormattingAccelerators
DisabledFormattingAccelerators
DisabledFormattingAccelerators

Gets or sets a value that indicates which keyboard shortcuts for formatting are disabled.

DisabledFormattingAcceleratorsProperty
DisabledFormattingAcceleratorsProperty
DisabledFormattingAcceleratorsProperty

Identifies the DisabledFormattingAccelerators dependency property.

Document
Document
Document

Gets an object that enables access to the text object model for the text contained in a RichEditBox.

HandwritingView
HandwritingView
HandwritingView

Gets or sets the HandwritingView associated with this text control.

HandwritingViewProperty
HandwritingViewProperty
HandwritingViewProperty

Identifies the HandwritingView dependency property.

Header
Header
Header

Gets or sets the content for the control's header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the control's header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

HorizontalTextAlignment
HorizontalTextAlignment
HorizontalTextAlignment

Gets or sets a value that indicates how text is aligned in the RichEditBox.
HorizontalTextAlignmentProperty
HorizontalTextAlignmentProperty
HorizontalTextAlignmentProperty

Identifies the HorizontalTextAlignment dependency property.

InputScope
InputScope
InputScope

Gets or sets the context for input used by this RichEditBox.

InputScopeProperty
InputScopeProperty
InputScopeProperty

Identifies the InputScope dependency property.

IsColorFontEnabled
IsColorFontEnabled
IsColorFontEnabled

Gets or sets a value that determines whether font glyphs that contain color layers, such as Segoe UI Emoji, are
rendered in color.

IsColorFontEnabledProperty
IsColorFontEnabledProperty
IsColorFontEnabledProperty

Identifies the IsColorFontEnabled dependency property.

IsHandwritingViewEnabled
IsHandwritingViewEnabled
IsHandwritingViewEnabled

Gets or sets a value that indicates whether a user can enter text in the handwriting view.

IsHandwritingViewEnabledProperty
IsHandwritingViewEnabledProperty
IsHandwritingViewEnabledProperty

Identifies the IsHandwritingViewEnabled dependency property.

IsReadOnly
IsReadOnly
IsReadOnly

Gets or sets a value that indicates whether the user can change the text in the RichEditBox.

IsReadOnlyProperty
IsReadOnlyProperty
IsReadOnlyProperty

Identifies the IsReadOnly dependency property.

IsSpellCheckEnabled
IsSpellCheckEnabled
IsSpellCheckEnabled

Gets or sets a value that indicates whether the text input should interact with a spell check engine.

IsSpellCheckEnabledProperty
IsSpellCheckEnabledProperty
IsSpellCheckEnabledProperty

Identifies the IsSpellCheckEnabled dependency property.

IsTextPredictionEnabled
IsTextPredictionEnabled
IsTextPredictionEnabled

Gets or sets a value that indicates whether text prediction features ("autocomplete") are enabled for this
RichEditBox.

IsTextPredictionEnabledProperty
IsTextPredictionEnabledProperty
IsTextPredictionEnabledProperty

Identifies the IsTextPredictionEnabled dependency property.

MaxLength
MaxLength
MaxLength

Gets or sets the value that specifies the maximum number of characters allowed for user input.

MaxLengthProperty
MaxLengthProperty
MaxLengthProperty

Identifies the MaxLength dependency property.


PlaceholderText
PlaceholderText
PlaceholderText

Gets or sets the text that is displayed in the control until the value is changed by a user action or some other
operation.

PlaceholderTextProperty
PlaceholderTextProperty
PlaceholderTextProperty

Identifies the PlaceholderText dependency property.

PreventKeyboardDisplayOnProgrammaticFocus
PreventKeyboardDisplayOnProgrammaticFocus
PreventKeyboardDisplayOnProgrammaticFocus

Gets or sets a value that indicates whether the on-screen keyboard is shown when the control receives focus
programmatically.

PreventKeyboardDisplayOnProgrammaticFocusProperty
PreventKeyboardDisplayOnProgrammaticFocusProperty
PreventKeyboardDisplayOnProgrammaticFocusProperty

Identifies the PreventKeyboardDisplayOnProgrammaticFocus dependency property.

ProofingMenuFlyout
ProofingMenuFlyout
ProofingMenuFlyout

Gets the flyout that shows proofing commands.

ProofingMenuFlyoutProperty
ProofingMenuFlyoutProperty
ProofingMenuFlyoutProperty

Identifies the ProofingMenuFlyout dependency property.

SelectionFlyout
SelectionFlyout
SelectionFlyout

Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.

SelectionFlyoutProperty
SelectionFlyoutProperty
SelectionFlyoutProperty

Identifies the SelectionFlyout dependency property.

SelectionHighlightColor
SelectionHighlightColor
SelectionHighlightColor

Gets or sets the brush used to highlight the selected text.

SelectionHighlightColorProperty
SelectionHighlightColorProperty
SelectionHighlightColorProperty

Identifies the SelectionHighlightColor dependency property.

SelectionHighlightColorWhenNotFocused
SelectionHighlightColorWhenNotFocused
SelectionHighlightColorWhenNotFocused

Gets or sets the brush used to highlight the selected text when the RichEditBox does not have focus.

SelectionHighlightColorWhenNotFocusedProperty
SelectionHighlightColorWhenNotFocusedProperty
SelectionHighlightColorWhenNotFocusedProperty

Identifies the SelectionHighlightColorWhenNotFocused dependency property.

TextAlignment
TextAlignment
TextAlignment

Gets or sets a value that indicates how text is aligned in the RichEditBox.

TextAlignmentProperty
TextAlignmentProperty
TextAlignmentProperty

Identifies the TextAlignment dependency property.

TextDocument
TextDocument
TextDocument

Gets an object that enables access to the text object model for the text contained in a RichEditBox.
TextReadingOrder
TextReadingOrder
TextReadingOrder

Gets or sets a value that indicates how the reading order is determined for the RichEditBox.

TextReadingOrderProperty
TextReadingOrderProperty
TextReadingOrderProperty

Identifies the TextReadingOrder dependency property.

TextWrapping
TextWrapping
TextWrapping

Gets or sets a value that indicates how text wrapping occurs if a line of text extends beyond the available width of
the RichEditBox.

TextWrappingProperty
TextWrappingProperty
TextWrappingProperty

Identifies the TextWrapping dependency property.

Methods
GetLinguisticAlternativesAsync()
GetLinguisticAlternativesAsync()
GetLinguisticAlternativesAsync()

Asynchronously gets a list of candidate words based on the provided phonetic characters in an Input Method
Editor (IME ).

Events
CandidateWindowBoundsChanged
CandidateWindowBoundsChanged
CandidateWindowBoundsChanged

Occurs when the Input Method Editor (IME ) window open, updates, or closes.

ContentLinkChanged
ContentLinkChanged
ContentLinkChanged

Occurs when a content link is added, removed, or edited.


ContentLinkInvoked
ContentLinkInvoked
ContentLinkInvoked

Occurs when the link is activated by user interaction.

ContextMenuOpening
ContextMenuOpening
ContextMenuOpening

Occurs when the system processes an interaction that displays a context menu.

CopyingToClipboard
CopyingToClipboard
CopyingToClipboard

Occurs before copied text is moved to the clipboard.

CuttingToClipboard
CuttingToClipboard
CuttingToClipboard

Occurs before cut text is moved to the clipboard.

Paste
Paste
Paste

Occurs when text is pasted into the control.

SelectionChanged
SelectionChanged
SelectionChanged

Occurs when the text selection has changed.

SelectionChanging
SelectionChanging
SelectionChanging

Occurs when the text selection starts to change.

TextChanged
TextChanged
TextChanged
Occurs when content changes in the RichEditBox.

TextChanging
TextChanging
TextChanging

Occurs synchronously when the text in the edit box starts to change, but before it is rendered.

TextCompositionChanged
TextCompositionChanged
TextCompositionChanged

Occurs when text being composed through an Input Method Editor (IME ) changes.

TextCompositionEnded
TextCompositionEnded
TextCompositionEnded

Occurs when a user stops composing text through an Input Method Editor (IME ).

TextCompositionStarted
TextCompositionStarted
TextCompositionStarted

Occurs when a user starts composing text through an Input Method Editor (IME ).

See Also
Control
Control
Control
Control
RichEditBox.AcceptsReturn RichEditBox.AcceptsReturn
RichEditBox.AcceptsReturn
I n this Article
Edit
Gets or sets a value that indicates whether the RichEditBox allows and displays the newline or return characters when
the ENTER or RETURN keys are pressed.
public : Platform::Boolean AcceptsReturn { get; set; }
bool AcceptsReturn();

void AcceptsReturn(bool acceptsreturn);


public bool AcceptsReturn { get; set; }

<RichEditBox AcceptsReturn="bool"/>

Returns
bool
True if the RichEditBox allows newline characters; otherwise, false. The default is true.
RichEditBox.AcceptsReturnProperty RichEditBox.Accepts
ReturnProperty RichEditBox.AcceptsReturnProperty
I n this Article
Edit
Identifies the AcceptsReturn dependency property.
public : static DependencyProperty AcceptsReturnProperty { get; }
static DependencyProperty AcceptsReturnProperty();
public static DependencyProperty AcceptsReturnProperty { get; }

Returns
DependencyProperty
The identifier for the AcceptsReturn dependency property.
RichEditBox.CandidateWindowBoundsChanged RichEdit
Box.CandidateWindowBoundsChanged RichEditBox.
CandidateWindowBoundsChanged
I n this Article
Edit
Occurs when the Input Method Editor (IME ) window open, updates, or closes.
public : event TypedEventHandler<RichEditBox, CandidateWindowBoundsChangedEventArgs>
CandidateWindowBoundsChanged
// Register
event_token CandidateWindowBoundsChanged(TypedEventHandler<RichEditBox,
CandidateWindowBoundsChangedEventArgs> const& handler) const;

// Revoke with event_token


void CandidateWindowBoundsChanged(event_token const& cookie) const;

// Revoke with event_revoker


CandidateWindowBoundsChanged_revoker CandidateWindowBoundsChanged(auto_revoke_t,
TypedEventHandler<RichEditBox, CandidateWindowBoundsChangedEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, CandidateWindowBoundsChangedEventArgs>
CandidateWindowBoundsChanged

<RichEditBox CandidateWindowBoundsChanged="eventhandler" />

Examples
Here, a rectangle is placed below a RichEditBox. When the Input Method Editor (IME ) window bounds change, the
bottom Margin of the RichEditBox is increased by the height of the Input Method Editor (IME ) candidate window. As a
result, the rectangle is pushed down by that amount and is not covered by the candidate window.
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel>
<RichEditBox x:Name="editBox1" Width="300" HorizontalAlignment="Left"
DesiredCandidateWindowAlignment="BottomEdge"
CandidateWindowBoundsChanged="OnCandidateWindowBoundsChanged"/>
<Rectangle Height="100" Width="100" Fill="Red"
HorizontalAlignment="Left"/>
</StackPanel>
</Grid>

private void OnCandidateWindowBoundsChanged(RichEditBox sender,


CandidateWindowBoundsChangedEventArgs args)
{
editBox1.Margin = new Thickness
{
Left = 0,
Top = 0,
Right = 0,
Bottom = Math.Max(0, args.Bounds.Bottom - editBox1.ActualHeight)
};
}
Remarks
For event data, see CandidateWindowBoundsChangedEventArgs.
Users sometimes enter text through an Input Method Editor (IME ) that shows in a window just below a text input box
(typically for East Asian languages). The Input Method Editor (IME ) window can cover important parts of your app UI
that the user might need to see while entering text. This event notifies your app of the coordinates where the Input
Method Editor (IME ) window is currently displayed. You can use this info to draw your UI in a location that doesn't
conflict with the Input Method Editor (IME ) window.
You can also use the DesiredCandidateWindowAlignment property to specify a preferred placement of the Input
Method Editor (IME ) window in relation to the text input box.
RichEditBox.CharacterCasing RichEditBox.Character
Casing RichEditBox.CharacterCasing
I n this Article
Edit
Gets or sets a value that indicates how the control modifies the case of characters as they are typed.
public : CharacterCasing CharacterCasing { get; set; }
CharacterCasing CharacterCasing();

void CharacterCasing(CharacterCasing charactercasing);


public CharacterCasing CharacterCasing { get; set; }

<RichEditBox CharacterCasing="characterCasingValue"/>

Returns
CharacterCasing
A value of the enumeration that indicates how the control modifies the case of characters as they are typed. The default
is Normal, which indicates that the charcters are not changed.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
Note

This property modifies the case of characters as they are typed. It doesn’t modify characters that are entered in other
ways, like paste or ink.
RichEditBox.CharacterCasingProperty RichEditBox.
CharacterCasingProperty RichEditBox.CharacterCasing
Property
I n this Article
Edit
Identifies the CharacterCasing dependency property.
public : static DependencyProperty CharacterCasingProperty { get; }
static DependencyProperty CharacterCasingProperty();
public static DependencyProperty CharacterCasingProperty { get; }

Returns
DependencyProperty
The identifier for the CharacterCasing dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


RichEditBox.ClipboardCopyFormat RichEditBox.
ClipboardCopyFormat RichEditBox.ClipboardCopy
Format
I n this Article
Edit
Gets or sets a value that specifies whether text is copied with all formats, or as plain text only.
public : RichEditClipboardFormat ClipboardCopyFormat { get; set; }
RichEditClipboardFormat ClipboardCopyFormat();

void ClipboardCopyFormat(RichEditClipboardFormat clipboardcopyformat);


public RichEditClipboardFormat ClipboardCopyFormat { get; set; }

Returns
RichEditClipboardFormat
An enumeration value that specifies whether text is copied with all formats, or as plain text only. The default is
AllFormats.
Additional features and requirements
Device family Windows 10 (introduced v10.0.10586.0)

API contract Windows.Foundation.UniversalApiContract (introduced v2)

Examples
<RichEditBox ClipboardCopyFormat="PlainText"/>

RichEditBox editBox1 = new RichEditBox();


editBox1.ClipboardCopyFormat = RichEditClipboardFormat.PlainText;

Remarks
By default, text copied from a RichEditBox is copied as both plain text and rich text. When the text is pasted into another
app, the receiving app determines whether the plain text or rich text is used. To ensure that only plain text is pasted into
a receiving app, set this property to PlainText to copy only plain text from the RichEditBox.
RichEditBox.ClipboardCopyFormatProperty RichEditBox.
ClipboardCopyFormatProperty RichEditBox.Clipboard
CopyFormatProperty
I n this Article
Edit
Identifies the ClipboardCopyFormat dependency property.
public : static DependencyProperty ClipboardCopyFormatProperty { get; }
static DependencyProperty ClipboardCopyFormatProperty();
public static DependencyProperty ClipboardCopyFormatProperty { get; }

Returns
DependencyProperty
The identifier for the ClipboardCopyFormat dependency property.
Additional features and requirements
Device family Windows 10 (introduced v10.0.10586.0)

API contract Windows.Foundation.UniversalApiContract (introduced v2)


RichEditBox.ContentLinkBackgroundColor RichEditBox.
ContentLinkBackgroundColor RichEditBox.ContentLink
BackgroundColor
I n this Article
Edit
Get or sets the brush used to color the link background.
public : SolidColorBrush ContentLinkBackgroundColor { get; set; }
SolidColorBrush ContentLinkBackgroundColor();

void ContentLinkBackgroundColor(SolidColorBrush contentlinkbackgroundcolor);


public SolidColorBrush ContentLinkBackgroundColor { get; set; }

Returns
SolidColorBrush
The brush used to color the link background.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


RichEditBox.ContentLinkBackgroundColorProperty Rich
EditBox.ContentLinkBackgroundColorProperty RichEdit
Box.ContentLinkBackgroundColorProperty
I n this Article
Edit
Identifies the ContentLinkBackgroundColor dependency property.
public : static DependencyProperty ContentLinkBackgroundColorProperty { get; }
static DependencyProperty ContentLinkBackgroundColorProperty();
public static DependencyProperty ContentLinkBackgroundColorProperty { get; }

Returns
DependencyProperty
The identifier for the ContentLinkBackgroundColor dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


RichEditBox.ContentLinkChanged RichEditBox.Content
LinkChanged RichEditBox.ContentLinkChanged
I n this Article
Edit
Occurs when a content link is added, removed, or edited.
public : event TypedEventHandler<RichEditBox, ContentLinkChangedEventArgs> ContentLinkChanged
// Register
event_token ContentLinkChanged(TypedEventHandler<RichEditBox, ContentLinkChangedEventArgs> const&
handler) const;

// Revoke with event_token


void ContentLinkChanged(event_token const& cookie) const;

// Revoke with event_revoker


ContentLinkChanged_revoker ContentLinkChanged(auto_revoke_t, TypedEventHandler<RichEditBox,
ContentLinkChangedEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, ContentLinkChangedEventArgs> ContentLinkChanged

Remarks
This event occurs after the TextChanging event and before the TextChanged event.
RichEditBox.ContentLinkForegroundColor RichEditBox.
ContentLinkForegroundColor RichEditBox.ContentLink
ForegroundColor
I n this Article
Edit
Get or sets the brush used to color the link text.
public : SolidColorBrush ContentLinkForegroundColor { get; set; }
SolidColorBrush ContentLinkForegroundColor();

void ContentLinkForegroundColor(SolidColorBrush contentlinkforegroundcolor);


public SolidColorBrush ContentLinkForegroundColor { get; set; }

Returns
SolidColorBrush
The brush used to color the link text.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


RichEditBox.ContentLinkForegroundColorProperty Rich
EditBox.ContentLinkForegroundColorProperty RichEdit
Box.ContentLinkForegroundColorProperty
I n this Article
Edit
Identifies the ContentLinkForegroundColor dependency property.
public : static DependencyProperty ContentLinkForegroundColorProperty { get; }
static DependencyProperty ContentLinkForegroundColorProperty();
public static DependencyProperty ContentLinkForegroundColorProperty { get; }

Returns
DependencyProperty
The identifier for the ContentLinkForegroundColor dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


RichEditBox.ContentLinkInvoked RichEditBox.ContentLink
Invoked RichEditBox.ContentLinkInvoked
I n this Article
Edit
Occurs when the link is activated by user interaction.
public : event TypedEventHandler<RichEditBox, ContentLinkInvokedEventArgs> ContentLinkInvoked
// Register
event_token ContentLinkInvoked(TypedEventHandler<RichEditBox, ContentLinkInvokedEventArgs> const&
handler) const;

// Revoke with event_token


void ContentLinkInvoked(event_token const& cookie) const;

// Revoke with event_revoker


ContentLinkInvoked_revoker ContentLinkInvoked(auto_revoke_t, TypedEventHandler<RichEditBox,
ContentLinkInvokedEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, ContentLinkInvokedEventArgs> ContentLinkInvoked
RichEditBox.ContentLinkProviders RichEditBox.Content
LinkProviders RichEditBox.ContentLinkProviders
I n this Article
Edit
Get or sets the collection of ContentLinkProvider s that define the types of ContentLinks used in this RichEditBox.
public : ContentLinkProviderCollection ContentLinkProviders { get; set; }
ContentLinkProviderCollection ContentLinkProviders();

void ContentLinkProviders(ContentLinkProviderCollection contentlinkproviders);


public ContentLinkProviderCollection ContentLinkProviders { get; set; }

Returns
ContentLinkProviderCollection
The collection of ContentLinkProvider s that define the types of ContentLinks used in this RichEditBox.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


RichEditBox.ContentLinkProvidersProperty RichEditBox.
ContentLinkProvidersProperty RichEditBox.ContentLink
ProvidersProperty
I n this Article
Edit
Identifies the ContentLinkProviders dependency property.
public : static DependencyProperty ContentLinkProvidersProperty { get; }
static DependencyProperty ContentLinkProvidersProperty();
public static DependencyProperty ContentLinkProvidersProperty { get; }

Returns
DependencyProperty
The identifier for the ContentLinkProviders dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


RichEditBox.ContextMenuOpening RichEditBox.Context
MenuOpening RichEditBox.ContextMenuOpening
I n this Article
Edit
Occurs when the system processes an interaction that displays a context menu.
public : event ContextMenuOpeningEventHandler ContextMenuOpening
// Register
event_token ContextMenuOpening(ContextMenuOpeningEventHandler const& handler) const;

// Revoke with event_token


void ContextMenuOpening(event_token const& cookie) const;

// Revoke with event_revoker


ContextMenuOpening_revoker ContextMenuOpening(auto_revoke_t, ContextMenuOpeningEventHandler const&
handler) const;
public event ContextMenuOpeningEventHandler ContextMenuOpening

<RichEditBox ContextMenuOpening="eventhandler" />


RichEditBox.CopyingToClipboard RichEditBox.CopyingTo
Clipboard RichEditBox.CopyingToClipboard
I n this Article
Edit
Occurs before copied text is moved to the clipboard.
public : event TypedEventHandler<RichEditBox, TextControlCopyingToClipboardEventArgs>
CopyingToClipboard
// Register
event_token CopyingToClipboard(TypedEventHandler<RichEditBox,
TextControlCopyingToClipboardEventArgs> const& handler) const;

// Revoke with event_token


void CopyingToClipboard(event_token const& cookie) const;

// Revoke with event_revoker


CopyingToClipboard_revoker CopyingToClipboard(auto_revoke_t, TypedEventHandler<RichEditBox,
TextControlCopyingToClipboardEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, TextControlCopyingToClipboardEventArgs>
CopyingToClipboard

<RichEditBox CopyingToClipboard="eventhandler" />


RichEditBox.CuttingToClipboard RichEditBox.CuttingTo
Clipboard RichEditBox.CuttingToClipboard
I n this Article
Edit
Occurs before cut text is moved to the clipboard.
public : event TypedEventHandler<RichEditBox, TextControlCuttingToClipboardEventArgs>
CuttingToClipboard
// Register
event_token CuttingToClipboard(TypedEventHandler<RichEditBox,
TextControlCuttingToClipboardEventArgs> const& handler) const;

// Revoke with event_token


void CuttingToClipboard(event_token const& cookie) const;

// Revoke with event_revoker


CuttingToClipboard_revoker CuttingToClipboard(auto_revoke_t, TypedEventHandler<RichEditBox,
TextControlCuttingToClipboardEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, TextControlCuttingToClipboardEventArgs>
CuttingToClipboard

<RichEditBox CuttingToClipboard="eventhandler" />


RichEditBox.Description RichEditBox.Description RichEdit
Box.Description
I n this Article
Edit
Gets or sets content that is shown below the control. The content should provide guidance about the input expected by
the control.
public : Platform::Object Description { get; set; }
winrt::Windows::Foundation::IInspectable Description();

void Description(winrt::Windows::Foundation::IInspectable description);


public object Description { get; set; }

Returns
object
The content to be displayed below the control. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RichEditBox.DescriptionProperty RichEditBox.Description
Property RichEditBox.DescriptionProperty
I n this Article
Edit
Identifies the Description dependency property.
public : static DependencyProperty DescriptionProperty { get; }
static DependencyProperty DescriptionProperty();
public static DependencyProperty DescriptionProperty { get; }

Returns
DependencyProperty
The identifier for the Description dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RichEditBox.DesiredCandidateWindowAlignment Rich
EditBox.DesiredCandidateWindowAlignment RichEditBox.
DesiredCandidateWindowAlignment
I n this Article
Edit
Gets or sets a value that indicates the preferred alignment of the Input Method Editor (IME ).
public : CandidateWindowAlignment DesiredCandidateWindowAlignment { get; set; }
CandidateWindowAlignment DesiredCandidateWindowAlignment();

void DesiredCandidateWindowAlignment(CandidateWindowAlignment desiredcandidatewindowalignment);


public CandidateWindowAlignment DesiredCandidateWindowAlignment { get; set; }

<RichEditBox DesiredCandidateWindowAlignment="candidateWindowAlignmentMemberName"/>

Returns
CandidateWindowAlignment
A value of the enumeration that indicates the preferred alignment of the Input Method Editor (IME ). The default is
Default.

Remarks
Users sometimes enter text through an Input Method Editor (IME ) that shows in a window just below a text input box
(typically for East Asian languages). The Input Method Editor (IME ) window can cover important parts of your app UI
that the user might need to see while entering text. Use the DesiredCandidateWindowAlignment property to specify a
preferred placement of the Input Method Editor (IME ) window in relation to the text input box.
By default, when the hardware keyboard is used, the Input Method Editor (IME ) follows the cursor. You can set
DesiredCandidateWindowAlignment to BottomEdge to align the Input Method Editor (IME ) to the bottom edge and
left side of the text edit control.
When the Soft Input Panel (SIP ) is used, DesiredCandidateWindowAlignment doesn't have any effect. The Input
Method Editor (IME ) remains docked to the Soft Input Panel (SIP ) whenever the Soft Input Panel (SIP ) is used.
You can also handle the CandidateWindowBoundsChanged event to adapt your UI to the placement of the Input
Method Editor (IME ).
See CandidateWindowBoundsChangedCandidateWindowBoundsChangedCandidateWindowBoundsChanged
Also
RichEditBox.DesiredCandidateWindowAlignmentProperty
RichEditBox.DesiredCandidateWindowAlignmentProperty
RichEditBox.DesiredCandidateWindowAlignmentProperty
I n this Article
Edit
Identifies the DesiredCandidateWindowAlignment dependency property.
public : static DependencyProperty DesiredCandidateWindowAlignmentProperty { get; }
static DependencyProperty DesiredCandidateWindowAlignmentProperty();
public static DependencyProperty DesiredCandidateWindowAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the DesiredCandidateWindowAlignment dependency property.
See Dependency properties overview
Also
RichEditBox.DisabledFormattingAccelerators RichEditBox.
DisabledFormattingAccelerators RichEditBox.Disabled
FormattingAccelerators
I n this Article
Edit
Gets or sets a value that indicates which keyboard shortcuts for formatting are disabled.
public : DisabledFormattingAccelerators DisabledFormattingAccelerators { get; set; }
DisabledFormattingAccelerators DisabledFormattingAccelerators();

void DisabledFormattingAccelerators(DisabledFormattingAccelerators disabledformattingaccelerators);


public DisabledFormattingAccelerators DisabledFormattingAccelerators { get; set; }

<RichEditBox DisabledFormattingAccelerators="disabledFormattingAcceleratorsValue"/>

Returns
DisabledFormattingAccelerators
A value that indicates which keyboard shortcuts for formatting are disabled. The default is None.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


RichEditBox.DisabledFormattingAcceleratorsProperty
RichEditBox.DisabledFormattingAcceleratorsProperty
RichEditBox.DisabledFormattingAcceleratorsProperty
I n this Article
Edit
Identifies the DisabledFormattingAccelerators dependency property.
public : static DependencyProperty DisabledFormattingAcceleratorsProperty { get; }
static DependencyProperty DisabledFormattingAcceleratorsProperty();
public static DependencyProperty DisabledFormattingAcceleratorsProperty { get; }

Returns
DependencyProperty
The identifier for the DisabledFormattingAccelerators dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


RichEditBox.Document RichEditBox.Document RichEdit
Box.Document
I n this Article
Edit
Gets an object that enables access to the text object model for the text contained in a RichEditBox.
public : ITextDocument Document { get; }
ITextDocument Document();
public ITextDocument Document { get; }

Returns
ITextDocument
An object that enables access to the text object model.
RichEditBox.GetLinguisticAlternativesAsync RichEditBox.
GetLinguisticAlternativesAsync RichEditBox.GetLinguistic
AlternativesAsync
I n this Article
Edit
Asynchronously gets a list of candidate words based on the provided phonetic characters in an Input Method Editor
(IME ).

public : IAsyncOperation<IVectorView<Platform::String>> GetLinguisticAlternativesAsync()


IAsyncOperation<IVectorView<winrt::hstring>> GetLinguisticAlternativesAsync() const;
public IAsyncOperation<IReadOnlyList<string>> GetLinguisticAlternativesAsync()

Returns
IAsyncOperation<IReadOnlyList<string>>
A list of candidate words based on the provided phonetic characters in an Input Method Editor (IME ).
Attributes RemoteAsyncAttribute
Additional features and requirements
Device family Windows 10 (introduced v10.0.10586.0)

API contract Windows.Foundation.UniversalApiContract (introduced v2)


RichEditBox.HandwritingView RichEditBox.Handwriting
View RichEditBox.HandwritingView
I n this Article
Edit
Gets or sets the HandwritingView associated with this text control.
public : HandwritingView HandwritingView { get; set; }
HandwritingView HandwritingView();

void HandwritingView(HandwritingView handwritingview);


public HandwritingView HandwritingView { get; set; }

Returns
HandwritingView
The HandwritingView associated with this text control.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

See Text input with the handwriting view


Also
RichEditBox.HandwritingViewProperty RichEditBox.
HandwritingViewProperty RichEditBox.HandwritingView
Property
I n this Article
Edit
Identifies the HandwritingView dependency property.
public : static DependencyProperty HandwritingViewProperty { get; }
static DependencyProperty HandwritingViewProperty();
public static DependencyProperty HandwritingViewProperty { get; }

Returns
DependencyProperty
The identifier for the HandwritingView dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


RichEditBox.Header RichEditBox.Header RichEditBox.
Header
I n this Article
Edit
Gets or sets the content for the control's header.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<RichEditBox Header="headerString"/>

Returns
object
The content of the control's header. The default is null.

Remarks
You can set a data template for the Header by using the HeaderTemplate property.
RichEditBox.HeaderProperty RichEditBox.HeaderProperty
RichEditBox.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
RichEditBox.HeaderTemplate RichEditBox.Header
Template RichEditBox.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the control's header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<RichEditBox>
<RichEditBox.HeaderTemplate>
singleDataTemplate
</RichEditBox.HeaderTemplate>
</RichEditBox>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
RichEditBox.HeaderTemplateProperty RichEditBox.
HeaderTemplateProperty RichEditBox.HeaderTemplate
Property
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
RichEditBox.HorizontalTextAlignment RichEditBox.
HorizontalTextAlignment RichEditBox.HorizontalText
Alignment
I n this Article
Edit
Gets or sets a value that indicates how text is aligned in the RichEditBox.
public : TextAlignment HorizontalTextAlignment { get; set; }
TextAlignment HorizontalTextAlignment();

void HorizontalTextAlignment(TextAlignment horizontaltextalignment);


public TextAlignment HorizontalTextAlignment { get; set; }

<RichEditBox HorizontalTextAlignment="textAlignmentValue"/>

Returns
TextAlignment
One of the TextAlignment enumeration values that specifies how text is aligned. The default is Left.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
This property provides the same functionality as the TextAlignment property. If both properties are set to conflicting
values, the last one set is used.
Apps that target the Fall Creators Update (SDK 16299) or later should use this property instead of TextAlignment. If
your app also supports previous versions, see Version adaptive apps: Use new APIs while maintaining compatibility
with previous versions for more info.
RichEditBox.HorizontalTextAlignmentProperty RichEdit
Box.HorizontalTextAlignmentProperty RichEditBox.
HorizontalTextAlignmentProperty
I n this Article
Edit
Identifies the HorizontalTextAlignment dependency property.
public : static DependencyProperty HorizontalTextAlignmentProperty { get; }
static DependencyProperty HorizontalTextAlignmentProperty();
public static DependencyProperty HorizontalTextAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalTextAlignment dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


RichEditBox.InputScope RichEditBox.InputScope RichEdit
Box.InputScope
I n this Article
Edit
Gets or sets the context for input used by this RichEditBox.
public : InputScope InputScope { get; set; }
InputScope InputScope();

void InputScope(InputScope inputscope);


public InputScope InputScope { get; set; }

<RichEditBox InputScope="inputScopeName" .../>

Returns
InputScope
The input scope, which provides a hint at the type of text input expected by the control.

Examples
Here's how to set the InputScope in XAML and in code.
<RichEditBox InputScope="Formula"/>

RichEditBox editBox = new RichEditBox();

InputScope scope = new InputScope();


InputScopeName scopeName = new InputScopeName();
scopeName.NameValue = InputScopeNameValue.Formula;
scope.Names.Add(scopeName);
editBox.InputScope = scope;

Remarks
The input scope provides a hint at the type of text input expected by the control. Various elements of the system can
respond to the hint provided by the input scope and provide a specialized UI for the input type. For example, the soft
keyboard might show a number pad for text input when the control has its InputScope set to Number.
The control might also interpret the data being entered differently (typically for East Asian related input scopes). The
input scope does not perform any validation, and does not prevent the user from providing any input through a
hardware keyboard or other input device.
Note

While this property can hold a collection of InputeNameScope values, only the first is used, and the rest are ignored.
RichEditBox.InputScopeProperty RichEditBox.InputScope
Property RichEditBox.InputScopeProperty
I n this Article
Edit
Identifies the InputScope dependency property.
public : static DependencyProperty InputScopeProperty { get; }
static DependencyProperty InputScopeProperty();
public static DependencyProperty InputScopeProperty { get; }

Returns
DependencyProperty
The identifier for the InputScope dependency property.
RichEditBox.IsColorFontEnabled RichEditBox.IsColorFont
Enabled RichEditBox.IsColorFontEnabled
I n this Article
Edit
Gets or sets a value that determines whether font glyphs that contain color layers, such as Segoe UI Emoji, are
rendered in color.
public : Platform::Boolean IsColorFontEnabled { get; set; }
bool IsColorFontEnabled();

void IsColorFontEnabled(bool iscolorfontenabled);


public bool IsColorFontEnabled { get; set; }

<RichEditBox IsColorFontEnabled="bool" />

Returns
bool
true if color glyphs show in color; otherwise, false. The default is true.

Remarks
Windows 8.1 introduces the ability for fonts to include multiple colored layers for each glyph. For example, the Segoe
UI Emoji font defines color versions of the Emoticon and other Emoji characters. By default, the IsColorFontEnabled
property is true and fonts with these additional layers are rendered in color.
In Windows 8, Extensible Application Markup Language (XAML ) text controls don't render multi-color fonts in color.
When an app that was compiled for Windows 8 is recompiled for Windows 8.1, color rendering of multi-color fonts is
enabled by default. Some glyphs in multi-color fonts have different layout metrics when rendered in color. This could
cause different layout in apps when they are recompiled for Windows 8.1. To retain the Windows 8 behavior when
your app is recompiled for Windows 8.1, set IsColorFontEnabled to false.
RichEditBox.IsColorFontEnabledProperty RichEditBox.Is
ColorFontEnabledProperty RichEditBox.IsColorFont
EnabledProperty
I n this Article
Edit
Identifies the IsColorFontEnabled dependency property.
public : static DependencyProperty IsColorFontEnabledProperty { get; }
static DependencyProperty IsColorFontEnabledProperty();
public static DependencyProperty IsColorFontEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsColorFontEnabled dependency property.
RichEditBox.IsHandwritingViewEnabled RichEditBox.Is
HandwritingViewEnabled RichEditBox.IsHandwritingView
Enabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can enter text in the handwriting view.
public : Platform::Boolean IsHandwritingViewEnabled { get; set; }
bool IsHandwritingViewEnabled();

void IsHandwritingViewEnabled(bool ishandwritingviewenabled);


public bool IsHandwritingViewEnabled { get; set; }

Returns
bool
true to allow the user to enter text in the handwriting view; otherwise, false.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

Examples
In this example, we disable the handwriting view by setting the IsHandwritingViewEnabled property of the RichEditBox
control to false. All text controls that support the handwriting view support a similar property.
<RichEditBox Name="NoHandwritingRichEditBox"
Width="680"
FontSize="24"
VerticalAlignment="Top" HorizontalAlignment="Center"
IsHandwritingViewEnabled="False">
PlaceholderText="Handwriting view not supported">
</RichEditBox>

Remarks
When a user taps into a text input box using a Windows pen, the text box transforms to let the user write directly into it
with a pen, rather than opening a separate input panel.

See Text input with the handwriting view


Also
RichEditBox.IsHandwritingViewEnabledProperty RichEdit
Box.IsHandwritingViewEnabledProperty RichEditBox.Is
HandwritingViewEnabledProperty
I n this Article
Edit
Identifies the IsHandwritingViewEnabled dependency property.
public : static DependencyProperty IsHandwritingViewEnabledProperty { get; }
static DependencyProperty IsHandwritingViewEnabledProperty();
public static DependencyProperty IsHandwritingViewEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsHandwritingViewEnabled dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

Examples
In this example, we disable the handwriting view by setting the IsHandwritingViewEnabled property of the RichEditBox
control to false. All text controls that support the handwriting view support a similar property.
<RIchEditBox Name="SampleTextBox"
Height="50" Width="500"
FontSize="36" FontFamily="Segoe UI"
PlaceholderText="Try taping with your pen"
IsHandwritingViewEnabled="False">
</RichEditBox>

See Text input with the handwriting view


Also
RichEditBox.IsReadOnly RichEditBox.IsReadOnly RichEdit
Box.IsReadOnly
I n this Article
Edit
Gets or sets a value that indicates whether the user can change the text in the RichEditBox.
public : Platform::Boolean IsReadOnly { get; set; }
bool IsReadOnly();

void IsReadOnly(bool isreadonly);


public bool IsReadOnly { get; set; }

<RichEditBox IsReadOnly="bool"/>

Returns
bool
True if the RichEditBox is read-only; otherwise, false. The default is false.
RichEditBox.IsReadOnlyProperty RichEditBox.IsReadOnly
Property RichEditBox.IsReadOnlyProperty
I n this Article
Edit
Identifies the IsReadOnly dependency property.
public : static DependencyProperty IsReadOnlyProperty { get; }
static DependencyProperty IsReadOnlyProperty();
public static DependencyProperty IsReadOnlyProperty { get; }

Returns
DependencyProperty
The identifier for the IsReadOnly dependency property.
RichEditBox.IsSpellCheckEnabled RichEditBox.IsSpell
CheckEnabled RichEditBox.IsSpellCheckEnabled
I n this Article
Edit
Gets or sets a value that indicates whether the text input should interact with a spell check engine.
public : Platform::Boolean IsSpellCheckEnabled { get; set; }
bool IsSpellCheckEnabled();

void IsSpellCheckEnabled(bool isspellcheckenabled);


public bool IsSpellCheckEnabled { get; set; }

<RichEditBox IsSpellCheckEnabled="bool" />

Returns
bool
True if the text input should interact with a spell check engine; otherwise, false. The default is true.
RichEditBox.IsSpellCheckEnabledProperty RichEditBox.Is
SpellCheckEnabledProperty RichEditBox.IsSpellCheck
EnabledProperty
I n this Article
Edit
Identifies the IsSpellCheckEnabled dependency property.
public : static DependencyProperty IsSpellCheckEnabledProperty { get; }
static DependencyProperty IsSpellCheckEnabledProperty();
public static DependencyProperty IsSpellCheckEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsSpellCheckEnabled dependency property.
RichEditBox.IsTextPredictionEnabled RichEditBox.IsText
PredictionEnabled RichEditBox.IsTextPredictionEnabled
I n this Article
Edit
Gets or sets a value that indicates whether text prediction features ("autocomplete") are enabled for this RichEditBox.
public : Platform::Boolean IsTextPredictionEnabled { get; set; }
bool IsTextPredictionEnabled();

void IsTextPredictionEnabled(bool istextpredictionenabled);


public bool IsTextPredictionEnabled { get; set; }

<RichEditBox IsTextPredictionEnabled="bool" />

Returns
bool
True to enable text prediction features; otherwise, false. The default is true.

Remarks
This property doesn't affect Input Method Editor (IME ) for Japanese or Chinese languages. Text prediction for these
languages is shown even if this property is false.
RichEditBox.IsTextPredictionEnabledProperty RichEdit
Box.IsTextPredictionEnabledProperty RichEditBox.IsText
PredictionEnabledProperty
I n this Article
Edit
Identifies the IsTextPredictionEnabled dependency property.
public : static DependencyProperty IsTextPredictionEnabledProperty { get; }
static DependencyProperty IsTextPredictionEnabledProperty();
public static DependencyProperty IsTextPredictionEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextPredictionEnabled dependency property.
RichEditBox.MaxLength RichEditBox.MaxLength RichEdit
Box.MaxLength
I n this Article
Edit
Gets or sets the value that specifies the maximum number of characters allowed for user input.
public : int MaxLength { get; set; }
int32_t MaxLength();

void MaxLength(int32_t maxlength);


public int MaxLength { get; set; }

<RichEditBox MaxLength="int"/>

Returns
int
The maximum number of characters allowed for user input. The default is 0 (no limit).
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Remarks
A MaxLength value of 0 specifies that there is no limit on the number of characters allowed for user input.
RichEditBox.MaxLengthProperty RichEditBox.MaxLength
Property RichEditBox.MaxLengthProperty
I n this Article
Edit
Identifies the MaxLength dependency property.
public : static DependencyProperty MaxLengthProperty { get; }
static DependencyProperty MaxLengthProperty();
public static DependencyProperty MaxLengthProperty { get; }

Returns
DependencyProperty
The identifier for the MaxLength dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


RichEditBox.Paste RichEditBox.Paste RichEditBox.Paste
I n this Article
Edit
Occurs when text is pasted into the control.

public : event TextControlPasteEventHandler Paste


// Register
event_token Paste(TextControlPasteEventHandler const& handler) const;

// Revoke with event_token


void Paste(event_token const& cookie) const;

// Revoke with event_revoker


Paste_revoker Paste(auto_revoke_t, TextControlPasteEventHandler const& handler) const;
public event TextControlPasteEventHandler Paste

<RichEditBox Paste="eventhandler"/>

Remarks
The Paste event occurs before any content is inserted into the control. You can handle this event to check the contents
of the clipboard and perform any actions on the content before it's inserted. If you perform any action, set the handled
property to true; otherwise, the default paste action is performed. If you set the handled property to true, then it's
assumed the app has handled the insertion, and no default action is performed. You are responsible for determining
the insertion point and clipboard content to insert, and inserting the content.
RichEditBox.PlaceholderText RichEditBox.PlaceholderText
RichEditBox.PlaceholderText
I n this Article
Edit
Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation.
public : Platform::String PlaceholderText { get; set; }
winrt::hstring PlaceholderText();

void PlaceholderText(winrt::hstring placeholdertext);


public string PlaceholderText { get; set; }

<RichEditBox PlaceholderText="placeholderString"/>

Returns
string
The text that is displayed in the control when no value is entered. The default is an empty string ("").
RichEditBox.PlaceholderTextProperty RichEditBox.
PlaceholderTextProperty RichEditBox.PlaceholderText
Property
I n this Article
Edit
Identifies the PlaceholderText dependency property.
public : static DependencyProperty PlaceholderTextProperty { get; }
static DependencyProperty PlaceholderTextProperty();
public static DependencyProperty PlaceholderTextProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderText dependency property.
RichEditBox.PreventKeyboardDisplayOnProgrammatic
Focus RichEditBox.PreventKeyboardDisplayOn
ProgrammaticFocus RichEditBox.PreventKeyboardDisplay
OnProgrammaticFocus
I n this Article
Edit
Gets or sets a value that indicates whether the on-screen keyboard is shown when the control receives focus
programmatically.
public : Platform::Boolean PreventKeyboardDisplayOnProgrammaticFocus { get; set; }
bool PreventKeyboardDisplayOnProgrammaticFocus();

void PreventKeyboardDisplayOnProgrammaticFocus(bool preventkeyboarddisplayonprogrammaticfocus);


public bool PreventKeyboardDisplayOnProgrammaticFocus { get; set; }

<RichEditBox PreventKeyboardDisplayOnProgrammaticFocus="bool"/>

Returns
bool
true if the on-screen keyboard is not shown when the control receives focus programmatically; otherwise, false. The
default is false.

Remarks
Set this property to true to prevent the onscreen touch keyboard from showing when focus is programmatically set on
a text box. By default, the onscreen touch keyboard is displayed whenever focus moves to an editable text box and the
most recent input was generated by touch. This happens whether focus is set programmatically or by user interaction.
In some situations, you might not want the keyboard to show when focus is set programmatically. For example, you
might want to prevent the keyboard from covering part of your UI until the user is ready to continue their interaction.
RichEditBox.PreventKeyboardDisplayOnProgrammatic
FocusProperty RichEditBox.PreventKeyboardDisplayOn
ProgrammaticFocusProperty RichEditBox.Prevent
KeyboardDisplayOnProgrammaticFocusProperty
I n this Article
Edit
Identifies the PreventKeyboardDisplayOnProgrammaticFocus dependency property.
public : static DependencyProperty PreventKeyboardDisplayOnProgrammaticFocusProperty { get; }
static DependencyProperty PreventKeyboardDisplayOnProgrammaticFocusProperty();
public static DependencyProperty PreventKeyboardDisplayOnProgrammaticFocusProperty { get; }

Returns
DependencyProperty
The identifier for the PreventKeyboardDisplayOnProgrammaticFocus dependency property.
RichEditBox.ProofingMenuFlyout RichEditBox.Proofing
MenuFlyout RichEditBox.ProofingMenuFlyout
I n this Article
Edit
Gets the flyout that shows proofing commands.
public : FlyoutBase ProofingMenuFlyout { get; }
FlyoutBase ProofingMenuFlyout();
public FlyoutBase ProofingMenuFlyout { get; }

Returns
FlyoutBase
The flyout that shows proofing commands.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RichEditBox.ProofingMenuFlyoutProperty RichEditBox.
ProofingMenuFlyoutProperty RichEditBox.ProofingMenu
FlyoutProperty
I n this Article
Edit
Identifies the ProofingMenuFlyout dependency property.
public : static DependencyProperty ProofingMenuFlyoutProperty { get; }
static DependencyProperty ProofingMenuFlyoutProperty();
public static DependencyProperty ProofingMenuFlyoutProperty { get; }

Returns
DependencyProperty
The identifier for the ProofingMenuFlyout dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RichEditBox RichEditBox RichEditBox
I n this Article
Edit
Initializes a new instance of the RichEditBox class.

public : RichEditBox()
RichEditBox() const;
public RichEditBox()
RichEditBox.SelectionChanged RichEditBox.Selection
Changed RichEditBox.SelectionChanged
I n this Article
Edit
Occurs when the text selection has changed.
public : event RoutedEventHandler SelectionChanged
// Register
event_token SelectionChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void SelectionChanged(event_token const& cookie) const;

// Revoke with event_revoker


SelectionChanged_revoker SelectionChanged(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler SelectionChanged

<RichEditBox SelectionChanged="eventhandler"/>
RichEditBox.SelectionChanging RichEditBox.Selection
Changing RichEditBox.SelectionChanging
I n this Article
Edit
Occurs when the text selection starts to change.
public : event TypedEventHandler<RichEditBox, RichEditBoxSelectionChangingEventArgs>
SelectionChanging
// Register
event_token SelectionChanging(TypedEventHandler<RichEditBox, RichEditBoxSelectionChangingEventArgs>
const& handler) const;

// Revoke with event_token


void SelectionChanging(event_token const& cookie) const;

// Revoke with event_revoker


SelectionChanging_revoker SelectionChanging(auto_revoke_t, TypedEventHandler<RichEditBox,
RichEditBoxSelectionChangingEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, RichEditBoxSelectionChangingEventArgs> SelectionChanging

<RichEditBox SelectionChanging="eventhandler"/>
RichEditBox.SelectionFlyout RichEditBox.SelectionFlyout
RichEditBox.SelectionFlyout
I n this Article
Edit
Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.
public : FlyoutBase SelectionFlyout { get; set; }
FlyoutBase SelectionFlyout();

void SelectionFlyout(FlyoutBase selectionflyout);


public FlyoutBase SelectionFlyout { get; set; }

Returns
FlyoutBase
The flyout that is shown when text is selected, or null if no flyout is shown. The default is an instance of
TextCommandBarFlyout.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RichEditBox.SelectionFlyoutProperty RichEditBox.
SelectionFlyoutProperty RichEditBox.SelectionFlyout
Property
I n this Article
Edit
Identifies the SelectionFlyout dependency property.
public : static DependencyProperty SelectionFlyoutProperty { get; }
static DependencyProperty SelectionFlyoutProperty();
public static DependencyProperty SelectionFlyoutProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionFlyout dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RichEditBox.SelectionHighlightColor RichEditBox.
SelectionHighlightColor RichEditBox.SelectionHighlight
Color
I n this Article
Edit
Gets or sets the brush used to highlight the selected text.
public : SolidColorBrush SelectionHighlightColor { get; set; }
SolidColorBrush SelectionHighlightColor();

void SelectionHighlightColor(SolidColorBrush selectionhighlightcolor);


public SolidColorBrush SelectionHighlightColor { get; set; }

<RichEditBox SelectionHighlightColor="{StaticResource resourceName}"/>

Returns
SolidColorBrush
The brush used to highlight the selected text. The default is a null brush from a pure code perspective, but the default
control template for RichEditBox applies a theme resource brush for this in a runtime instance of a RichEditBox control.

Remarks
The control template sets the default selection highlight color to the system resource
TextSelectionHighlightColorThemeBrush. To change the selection highlight color for all editable text controls in
your app, you can override the TextSelectionHighlightColorThemeBrush system resource in App.xaml. This will
affect PasswordBox, TextBox, and RichEditBox controls. For more info, see XAML theme resources or RichEditBox
styles and templates.
See Use brushes
Also
RichEditBox.SelectionHighlightColorProperty RichEdit
Box.SelectionHighlightColorProperty RichEditBox.
SelectionHighlightColorProperty
I n this Article
Edit
Identifies the SelectionHighlightColor dependency property.
public : static DependencyProperty SelectionHighlightColorProperty { get; }
static DependencyProperty SelectionHighlightColorProperty();
public static DependencyProperty SelectionHighlightColorProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionHighlightColor dependency property.
RichEditBox.SelectionHighlightColorWhenNotFocused
RichEditBox.SelectionHighlightColorWhenNotFocused
RichEditBox.SelectionHighlightColorWhenNotFocused
I n this Article
Edit
Gets or sets the brush used to highlight the selected text when the RichEditBox does not have focus.
public : SolidColorBrush SelectionHighlightColorWhenNotFocused { get; set; }
SolidColorBrush SelectionHighlightColorWhenNotFocused();

void SelectionHighlightColorWhenNotFocused(SolidColorBrush selectionhighlightcolorwhennotfocused);


public SolidColorBrush SelectionHighlightColorWhenNotFocused { get; set; }

<RichEditBox SelectionHighlightColorWhenNotFocused="{StaticResource resourceName}"/>

Returns
SolidColorBrush
The brush used to highlight the selected text when RichEditBox loses focus. The default is a null brush from a pure
code perspective, but the default control template for RichEditBox applies a Transparent brush for this in a runtime
instance of a RichEditBox control. To disable the SelectionHighlightColorWhenNotFocused, set the brush to
Transparent once again.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


RichEditBox.SelectionHighlightColorWhenNotFocused
Property RichEditBox.SelectionHighlightColorWhenNot
FocusedProperty RichEditBox.SelectionHighlightColor
WhenNotFocusedProperty
I n this Article
Edit
Identifies the SelectionHighlightColorWhenNotFocused dependency property.
public : static DependencyProperty SelectionHighlightColorWhenNotFocusedProperty { get; }
static DependencyProperty SelectionHighlightColorWhenNotFocusedProperty();
public static DependencyProperty SelectionHighlightColorWhenNotFocusedProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionHighlightColorWhenNotFocused dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


RichEditBox.TextAlignment RichEditBox.TextAlignment
RichEditBox.TextAlignment
I n this Article
Edit
Gets or sets a value that indicates how text is aligned in the RichEditBox.
public : TextAlignment TextAlignment { get; set; }
TextAlignment TextAlignment();

void TextAlignment(TextAlignment textalignment);


public TextAlignment TextAlignment { get; set; }

<RichEditBox TextAlignment="textAlignmentValue"/>

Returns
TextAlignment
One of the TextAlignment enumeration values that specifies how text is aligned. The default is Left.
RichEditBox.TextAlignmentProperty RichEditBox.Text
AlignmentProperty RichEditBox.TextAlignmentProperty
I n this Article
Edit
Identifies the TextAlignment dependency property.
public : static DependencyProperty TextAlignmentProperty { get; }
static DependencyProperty TextAlignmentProperty();
public static DependencyProperty TextAlignmentProperty { get; }

Returns
DependencyProperty
Identifier for the TextAlignment dependency property.
RichEditBox.TextChanged RichEditBox.TextChanged Rich
EditBox.TextChanged
I n this Article
Edit
Occurs when content changes in the RichEditBox.
public : event RoutedEventHandler TextChanged
// Register
event_token TextChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void TextChanged(event_token const& cookie) const;

// Revoke with event_revoker


TextChanged_revoker TextChanged(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler TextChanged

<RichEditBox TextChanged="eventhandler"/>
RichEditBox.TextChanging RichEditBox.TextChanging Rich
EditBox.TextChanging
I n this Article
Edit
Occurs synchronously when the text in the edit box starts to change, but before it is rendered.
public : event TypedEventHandler<RichEditBox, RichEditBoxTextChangingEventArgs> TextChanging
// Register
event_token TextChanging(TypedEventHandler<RichEditBox, RichEditBoxTextChangingEventArgs> const&
handler) const;

// Revoke with event_token


void TextChanging(event_token const& cookie) const;

// Revoke with event_revoker


TextChanging_revoker TextChanging(auto_revoke_t, TypedEventHandler<RichEditBox,
RichEditBoxTextChangingEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, RichEditBoxTextChangingEventArgs> TextChanging

<RichEditBox TextChanging="eventhandler"/>

Remarks
For event data, see RichEditBoxTextChangingEventArgs.
The TextChanging event occurs synchronously before the new text is rendered. In contrast, the TextChanged event is
asynchronous and occurs after the new text is rendered.
When the TextChanging event occurs, the Document property already reflects the new value (but it's not rendered in
the UI). You typically handle this event to update the text value and selection before the text is rendered. This prevents
the text flickering that can happen when text is rendered, updated, and re-rendered rapidly.
Note

This is a synchronous event that can occur at times when changes to the XAML visual tree are not allowed, such as
during layout. Therefore, you should limit code within the TextChanging event handler primarily to inspecting and
updating the Document property. Attempting to perform other actions, such as showing a popup or adding/removing
elements from the visual tree, might cause potentially fatal errors that can lead to a crash. We recommend that you
perform these other changes either in a TextChanged event handler, or run them as a separate asynchronous operation.
RichEditBox.TextCompositionChanged RichEditBox.Text
CompositionChanged RichEditBox.TextComposition
Changed
I n this Article
Edit
Occurs when text being composed through an Input Method Editor (IME ) changes.
public : event TypedEventHandler<RichEditBox, TextCompositionChangedEventArgs>
TextCompositionChanged
// Register
event_token TextCompositionChanged(TypedEventHandler<RichEditBox, TextCompositionChangedEventArgs>
const& handler) const;

// Revoke with event_token


void TextCompositionChanged(event_token const& cookie) const;

// Revoke with event_revoker


TextCompositionChanged_revoker TextCompositionChanged(auto_revoke_t, TypedEventHandler<RichEditBox,
TextCompositionChangedEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, TextCompositionChangedEventArgs> TextCompositionChanged

<RichEditBox TextCompositionChanged="eventhandler"/>

Remarks
For event data, see TextCompositionChangedEventArgs.
This event occurs only when text is composed through an Input Method Editor (IME ). Text composition events occur in
the following order:
TextCompositionStarted
TextChanging
TextChanged
TextCompositionChanged
TextCompositionEnded
After the TextCompositionStarted event, the TextChanging > TextChanged > TextCompositionChanged event cycle can
occur multiple times before the TextCompositionEnded event occurs.
See Input Method Editor (IME )
Also
RichEditBox.TextCompositionEnded RichEditBox.Text
CompositionEnded RichEditBox.TextCompositionEnded
I n this Article
Edit
Occurs when a user stops composing text through an Input Method Editor (IME ).
public : event TypedEventHandler<RichEditBox, TextCompositionEndedEventArgs> TextCompositionEnded
// Register
event_token TextCompositionEnded(TypedEventHandler<RichEditBox, TextCompositionEndedEventArgs>
const& handler) const;

// Revoke with event_token


void TextCompositionEnded(event_token const& cookie) const;

// Revoke with event_revoker


TextCompositionEnded_revoker TextCompositionEnded(auto_revoke_t, TypedEventHandler<RichEditBox,
TextCompositionEndedEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, TextCompositionEndedEventArgs> TextCompositionEnded

<RichEditBox TextCompositionEnded="eventhandler"/>

Remarks
For event data, see TextCompositionEndedEventArgs.
This event occurs only when text is composed through an Input Method Editor (IME ). Text composition events occur in
the following order:
TextCompositionStarted
TextChanging
TextChanged
TextCompositionChanged
TextCompositionEnded
After the TextCompositionStarted event, the TextChanging > TextChanged > TextCompositionChanged event cycle can
occur multiple times before the TextCompositionEnded event occurs.
See Input Method Editor (IME )
Also
RichEditBox.TextCompositionStarted RichEditBox.Text
CompositionStarted RichEditBox.TextCompositionStarted
I n this Article
Edit
Occurs when a user starts composing text through an Input Method Editor (IME ).
public : event TypedEventHandler<RichEditBox, TextCompositionStartedEventArgs>
TextCompositionStarted
// Register
event_token TextCompositionStarted(TypedEventHandler<RichEditBox, TextCompositionStartedEventArgs>
const& handler) const;

// Revoke with event_token


void TextCompositionStarted(event_token const& cookie) const;

// Revoke with event_revoker


TextCompositionStarted_revoker TextCompositionStarted(auto_revoke_t, TypedEventHandler<RichEditBox,
TextCompositionStartedEventArgs> const& handler) const;
public event TypedEventHandler<RichEditBox, TextCompositionStartedEventArgs> TextCompositionStarted

<RichEditBox TextCompositionStarted="eventhandler"/>

Remarks
For event data, see TextCompositionStartedEventArgs.
This event occurs only when text is composed through an Input Method Editor (IME ). Text composition events occur in
the following order:
TextCompositionStarted
TextChanging
TextChanged
TextCompositionChanged
TextCompositionEnded
After the TextCompositionStarted event, the TextChanging > TextChanged > TextCompositionChanged event cycle can
occur multiple times before the TextCompositionEnded event occurs.
See Input Method Editor (IME )
Also
RichEditBox.TextDocument RichEditBox.TextDocument
RichEditBox.TextDocument
I n this Article
Edit
Gets an object that enables access to the text object model for the text contained in a RichEditBox.
public : RichEditTextDocument TextDocument { get; }
RichEditTextDocument TextDocument();
public RichEditTextDocument TextDocument { get; }

Returns
RichEditTextDocument
An object that enables access to the text object model.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
The TextDocument property is equivalent to the Document property except for the type. The Document property is of
type ITextDocument, and can be type cast to RichEditTextDocument. The TextDocument property, on the other hand, is
already typed as RichEditTextDocument, so no type cast is necessary.
RichEditBox.TextReadingOrder RichEditBox.TextReading
Order RichEditBox.TextReadingOrder
I n this Article
Edit
Gets or sets a value that indicates how the reading order is determined for the RichEditBox.
public : TextReadingOrder TextReadingOrder { get; set; }
TextReadingOrder TextReadingOrder();

void TextReadingOrder(TextReadingOrder textreadingorder);


public TextReadingOrder TextReadingOrder { get; set; }

<RichEditBox TextReadingOrder="textReadingOrderValue"/>

Returns
TextReadingOrder
A value that indicates how the reading order is determined for the RichEditBox. The default is DetectFromContent.

Remarks
This property can be useful when the base direction of the text is unknown, and may not match the user's language or
direction. For more info, see the Remarks section of the TextReadingOrder enumeration or How to support
bidirectional UI.
See TextReadingOrder
Also How to support bidirectional UI
RichEditBox.TextReadingOrderProperty RichEditBox.Text
ReadingOrderProperty RichEditBox.TextReadingOrder
Property
I n this Article
Edit
Identifies the TextReadingOrder dependency property.
public : static DependencyProperty TextReadingOrderProperty { get; }
static DependencyProperty TextReadingOrderProperty();
public static DependencyProperty TextReadingOrderProperty { get; }

Returns
DependencyProperty
The identifier for the TextReadingOrder dependency property.
See Dependency properties overview
Also
RichEditBox.TextWrapping RichEditBox.TextWrapping
RichEditBox.TextWrapping
I n this Article
Edit
Gets or sets a value that indicates how text wrapping occurs if a line of text extends beyond the available width of the
RichEditBox.
public : TextWrapping TextWrapping { get; set; }
TextWrapping TextWrapping();

void TextWrapping(TextWrapping textwrapping);


public TextWrapping TextWrapping { get; set; }

<RichEditBox TextWrapping="Wrap"/>
-or-
<RichEditBox TextWrapping="NoWrap"/>

Returns
TextWrapping
One of the TextWrapping enumeration values that specifies whether text is wrapped. The default is Wrap.

Remarks
TextBox and RichEditBox don't support the WrapWholeWords value for their TextWrapping properties. If you try to
use WrapWholeWords as a value for TextBox.TextWrapping or RichEditBox.TextWrapping an invalid argument
exception is thrown.
RichEditBox.TextWrappingProperty RichEditBox.Text
WrappingProperty RichEditBox.TextWrappingProperty
I n this Article
Edit
Identifies the TextWrapping dependency property.
public : static DependencyProperty TextWrappingProperty { get; }
static DependencyProperty TextWrappingProperty();
public static DependencyProperty TextWrappingProperty { get; }

Returns
DependencyProperty
The identifier for the TextWrapping dependency property.
RichEditBoxSelectionChangingEventArgs RichEditBox
SelectionChangingEventArgs RichEditBoxSelection
ChangingEventArgs Class
Provides event data for the RichEditBox.SelectionChanging event.

D eclaration
public : sealed class RichEditBoxSelectionChangingEventArgs :
IRichEditBoxSelectionChangingEventArgs
struct winrt::Windows::UI::Xaml::Controls::RichEditBoxSelectionChangingEventArgs :
IRichEditBoxSelectionChangingEventArgs
public sealed class RichEditBoxSelectionChangingEventArgs :
IRichEditBoxSelectionChangingEventArgs

I nheritance H ierarchy
None

Remarks
An instance of this class is passed as a parameter to the SelectionChanging event handler.

Properties
Cancel
Cancel
Cancel

Gets or sets a value that indicates whether the selection operation should be canceled.

SelectionLength
SelectionLength
SelectionLength

Gets the length of the text selection.

SelectionStart
SelectionStart
SelectionStart

Gets the starting index of the text selection.


RichEditBoxSelectionChangingEventArgs.Cancel RichEdit
BoxSelectionChangingEventArgs.Cancel RichEditBox
SelectionChangingEventArgs.Cancel
I n this Article
Edit
Gets or sets a value that indicates whether the selection operation should be canceled.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
true to cancel the selection operation; otherwise, false. The default is false.
RichEditBoxSelectionChangingEventArgs.SelectionLength
RichEditBoxSelectionChangingEventArgs.SelectionLength
RichEditBoxSelectionChangingEventArgs.SelectionLength
I n this Article
Edit
Gets the length of the text selection.
public : int SelectionLength { get; }
int32_t SelectionLength();
public int SelectionLength { get; }

Returns
int
The length of the text selection.
RichEditBoxSelectionChangingEventArgs.SelectionStart
RichEditBoxSelectionChangingEventArgs.SelectionStart
RichEditBoxSelectionChangingEventArgs.SelectionStart
I n this Article
Edit
Gets the starting index of the text selection.
public : int SelectionStart { get; }
int32_t SelectionStart();
public int SelectionStart { get; }

Returns
int
The starting index of the text selection.
RichEditBoxTextChangingEventArgs RichEditBoxText
ChangingEventArgs RichEditBoxTextChangingEventArgs
Class
Provides event data for the RichEditBox.TextChanging event.

D eclaration
public : sealed class RichEditBoxTextChangingEventArgs : IRichEditBoxTextChangingEventArgs,
IRichEditBoxTextChangingEventArgs2
struct winrt::Windows::UI::Xaml::Controls::RichEditBoxTextChangingEventArgs :
IRichEditBoxTextChangingEventArgs, IRichEditBoxTextChangingEventArgs2
public sealed class RichEditBoxTextChangingEventArgs : IRichEditBoxTextChangingEventArgs,
IRichEditBoxTextChangingEventArgs2

I nheritance H ierarchy
None

Remarks
An instance of this class is passed as a parameter to the TextChanging event handler.

Properties
IsContentChanging
IsContentChanging
IsContentChanging

Gets a value that indicates whether the event occured due to a change in the text content.
RichEditBoxTextChangingEventArgs.IsContentChanging
RichEditBoxTextChangingEventArgs.IsContentChanging
RichEditBoxTextChangingEventArgs.IsContentChanging
I n this Article
Edit
Gets a value that indicates whether the event occured due to a change in the text content.
public : Platform::Boolean IsContentChanging { get; }
bool IsContentChanging();
public bool IsContentChanging { get; }

Returns
bool
true if a change to the text content caused the event; otherwise, false.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Remarks
This event is fired for a format or content change. The IsContentChanging property helps to distinguish when text
content is changing.
RichEditClipboardFormat RichEditClipboardFormat Rich
EditClipboardFormat Enum
Defines constants that specify the format of text copied from a RichEditBox.

D eclaration
public : enum class RichEditClipboardFormat
enum class winrt::Windows::UI::Xaml::Controls::RichEditClipboardFormat : int32_t
public enum RichEditClipboardFormat

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the RichEditBox.ClipboardCopyFormat property. For more info, see
ClipboardCopyFormat.

Fields
AllFormats AllFormats AllFormats Text is copied as both plain text and rich text.

PlainText PlainText PlainText Text is copied only as plain text.


RichTextBlock RichTextBlock RichTextBlock Class
Represents a rich text display container that supports formatted text, hyperlinks, inline images, and other rich content.
RichTextBlock supports a built-in overflow model.

D eclaration
public : sealed class RichTextBlock : FrameworkElement, IRichTextBlock, IRichTextBlock2,
IRichTextBlock3, IRichTextBlock4, IRichTextBlock5, IRichTextBlock6
struct winrt::Windows::UI::Xaml::Controls::RichTextBlock : FrameworkElement, IRichTextBlock,
IRichTextBlock2, IRichTextBlock3, IRichTextBlock4, IRichTextBlock5, IRichTextBlock6
public sealed class RichTextBlock : FrameworkElement, IRichTextBlock, IRichTextBlock2,
IRichTextBlock3, IRichTextBlock4, IRichTextBlock5, IRichTextBlock6

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
 Tip

For more info, design guidance, and code examples, see Rich text block.
The RichTextBlock control displays read-only text, and provides several features for advanced text layout. Use a
RichTextBlock when you need support for paragraphs, inline UI elements, or overflow text.
TextBlock provides a simpler content model, so it’s typically easier to use, and it can provide better text rendering
performance than RichTextBlock. It also provides many of the same formatting options for customizing how your text
is rendered. However, RichTextBlock provides several unique features that TextBlock doesn’t provide.
For more info and examples, see the RichTextBlock control guide.
Paragraphs and formatting
The content property of RichTextBlock is the Blocks property, which is based on the Paragraph element. Set the
indentation for paragraphs by setting the TextIndent property.
You can use text elements and the attached properties of the Typography class to apply character and paragraph
formatting to the text in the RichTextBlock. For example, you can apply Bold, Italic, and Underline to any portion of the
text in the control.
I nline UI elements
You can use an InlineUIContainer in the content of a RichTextBlock to embed elements that are derived from
UIElement, such as images, in your text.
Overflow content
You can use a RichTextBlock with RichTextBlockOverflow elements to create advanced page layouts, such as multi-
column text. The content for a RichTextBlockOverflow element always comes from a RichTextBlock element. You link
RichTextBlockOverflow elements by setting them as the OverflowContentTarget of a RichTextBlock or another
RichTextBlockOverflow.
Font fallback
The default FontFamily for RichTextBlock is Segoe UI and the default FontSize is 15 device-independent pixel (DIP ). By
default, RichTextBlock utilizes a font fallback mechanism to show glyphs that are not included in the specified font. If
the glyph that is needed in a RichTextBlock is not available in the specified font, the font fallback mechanism goes
through a list of fonts on the system to try and display the required characters in a different font.

Constructors
RichTextBlock()
RichTextBlock()
RichTextBlock()

Initializes a new instance of the RichTextBlock class.

Properties
BaselineOffset
BaselineOffset
BaselineOffset

Gets a value that represents the offset in pixels from the top of the content to the baseline of the first paragraph.
The baseline of the paragraph is the baseline of the first line in it.

Blocks
Blocks
Blocks

Gets the contents of the RichTextBlock.

CharacterSpacing
CharacterSpacing
CharacterSpacing

Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.

CharacterSpacingProperty
CharacterSpacingProperty
CharacterSpacingProperty

Identifies the CharacterSpacing dependency property.

ContentEnd
ContentEnd
ContentEnd

Gets a TextPointer that indicates the end of content in the RichTextBlock.

ContentStart
ContentStart
ContentStart

Gets a TextPointer that indicates the start of content in the RichTextBlock.

FontFamily
FontFamily
FontFamily

Gets or sets the preferred top-level font family for the text content in this element.

FontFamilyProperty
FontFamilyProperty
FontFamilyProperty

Identifies the FontFamily dependency property.

FontSize
FontSize
FontSize

Gets or sets the font size for the text content in this element.

FontSizeProperty
FontSizeProperty
FontSizeProperty

Identifies the FontSize dependency property.

FontStretch
FontStretch
FontStretch

Gets or sets the font stretch for the text content in this element.

FontStretchProperty
FontStretchProperty
FontStretchProperty

Identifies the FontStretch dependency property.

FontStyle
FontStyle
FontStyle

Gets or sets the font style for the content in this element.
FontStyleProperty
FontStyleProperty
FontStyleProperty

Identifies the FontStyle dependency property.

FontWeight
FontWeight
FontWeight

Gets or sets the top-level font weight for the RichTextBlock.

FontWeightProperty
FontWeightProperty
FontWeightProperty

Identifies the FontWeight dependency property.

Foreground
Foreground
Foreground

Gets or sets the Brush to apply to the text contents of the RichTextBlock.

ForegroundProperty
ForegroundProperty
ForegroundProperty

Identifies the Foreground dependency property.

HasOverflowContent
HasOverflowContent
HasOverflowContent

Gets a value that indicates whether the RichTextBlock has content that extends beyond its bounds, that can provide
content to an OverflowContentTarget element.

HasOverflowContentProperty
HasOverflowContentProperty
HasOverflowContentProperty

Identifies the HasOverflowContent dependency property.

HorizontalTextAlignment
HorizontalTextAlignment
HorizontalTextAlignment

Gets or sets a value that indicates how text is aligned in the RichTextBlock.

HorizontalTextAlignmentProperty
HorizontalTextAlignmentProperty
HorizontalTextAlignmentProperty

Identifies the HorizontalTextAlignment dependency property.

IsColorFontEnabled
IsColorFontEnabled
IsColorFontEnabled

Gets or sets a value that determines whether font glyphs that contain color layers, such as Segoe UI Emoji, are
rendered in color.

IsColorFontEnabledProperty
IsColorFontEnabledProperty
IsColorFontEnabledProperty

Identifies the IsColorFontEnabled dependency property.

IsTextScaleFactorEnabled
IsTextScaleFactorEnabled
IsTextScaleFactorEnabled

Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.

IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty

Identifies the IsTextScaleFactorEnabled dependency property.

IsTextSelectionEnabled
IsTextSelectionEnabled
IsTextSelectionEnabled

Gets or sets a value that determines whether text content of the RichTextBlock can be selected for clipboard or
drag purposes, or for UI styling changes that indicate selected text.

IsTextSelectionEnabledProperty
IsTextSelectionEnabledProperty
IsTextSelectionEnabledProperty
Identifies the IsTextSelectionEnabled dependency property.

IsTextTrimmed
IsTextTrimmed
IsTextTrimmed

Gets a value that indicates whether the control has trimmed text that overflows the content area.

IsTextTrimmedProperty
IsTextTrimmedProperty
IsTextTrimmedProperty

Identifies the IsTextTrimmed dependency property.

LineHeight
LineHeight
LineHeight

Gets or sets the height of each line of content.

LineHeightProperty
LineHeightProperty
LineHeightProperty

Identifies the LineHeight dependency property.

LineStackingStrategy
LineStackingStrategy
LineStackingStrategy

Gets or sets a value that indicates how a line box is determined for each line of text in the RichTextBlock.

LineStackingStrategyProperty
LineStackingStrategyProperty
LineStackingStrategyProperty

Identifies the LineStackingStrategy dependency property.

MaxLines
MaxLines
MaxLines

Gets or sets the maximum lines of text shown in the RichTextBlock.


MaxLinesProperty
MaxLinesProperty
MaxLinesProperty

Identifies the MaxLines dependency property.

OpticalMarginAlignment
OpticalMarginAlignment
OpticalMarginAlignment

Get or sets a value that indicates how the font is modified to align with fonts of different sizes.

OpticalMarginAlignmentProperty
OpticalMarginAlignmentProperty
OpticalMarginAlignmentProperty

Identifies the OpticalMarginAlignment dependency property.

OverflowContentTarget
OverflowContentTarget
OverflowContentTarget

Gets or sets a reference to a RichTextBlockOverflow that is the linked target for any text overflow from this
RichTextBlock.

OverflowContentTargetProperty
OverflowContentTargetProperty
OverflowContentTargetProperty

Identifies the OverflowContentTarget dependency property.

Padding
Padding
Padding

Gets or sets a value that indicates the thickness of padding space between the boundaries of the content area and
the content displayed by a RichTextBlock.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.

SelectedText
SelectedText
SelectedText

Gets a text range of selected text.

SelectedTextProperty
SelectedTextProperty
SelectedTextProperty

Identifies the SelectedText dependency property.

SelectionEnd
SelectionEnd
SelectionEnd

Gets the end position of the text selected in the RichTextBlock.

SelectionFlyout
SelectionFlyout
SelectionFlyout

Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.

SelectionFlyoutProperty
SelectionFlyoutProperty
SelectionFlyoutProperty

Identifies the SelectionFlyout dependency property.

SelectionHighlightColor
SelectionHighlightColor
SelectionHighlightColor

Gets or sets the brush used to highlight the selected text.

SelectionHighlightColorProperty
SelectionHighlightColorProperty
SelectionHighlightColorProperty

Identifies the SelectionHighlightColor dependency property.

SelectionStart
SelectionStart
SelectionStart

Gets the starting position of the text selected in the RichTextBlock.


TextAlignment
TextAlignment
TextAlignment

Gets or sets a value that indicates how the text is aligned in the RichTextBlock.

TextAlignmentProperty
TextAlignmentProperty
TextAlignmentProperty

Identifies the TextAlignment dependency property.

TextDecorations
TextDecorations
TextDecorations

Gets or sets a value that indicates what decorations are applied to the text.

TextDecorationsProperty
TextDecorationsProperty
TextDecorationsProperty

Identifies the TextDecorations dependency property.

TextHighlighters
TextHighlighters
TextHighlighters

Gets the collection of text highlights.

TextIndent
TextIndent
TextIndent

Gets or sets the indentation of the first line of text in each paragraph in the RichTextBlock.

TextIndentProperty
TextIndentProperty
TextIndentProperty

Identifies the TextIndent dependency property.

TextLineBounds
TextLineBounds
TextLineBounds
Gets or sets a value that indicates how the line box height is determined for each line of text in the RichTextBlock.

TextLineBoundsProperty
TextLineBoundsProperty
TextLineBoundsProperty

Identifies the TextLineBounds dependency property.

TextReadingOrder
TextReadingOrder
TextReadingOrder

Gets or sets a value that indicates how the reading order is determined for the RichTextBlock.

TextReadingOrderProperty
TextReadingOrderProperty
TextReadingOrderProperty

Identifies the TextReadingOrder dependency property.

TextTrimming
TextTrimming
TextTrimming

Gets or sets a value that indicates how text is trimmed when it overflows the content area.

TextTrimmingProperty
TextTrimmingProperty
TextTrimmingProperty

Identifies the TextTrimming dependency property.

TextWrapping
TextWrapping
TextWrapping

Gets or sets a value that indicates whether text wrapping occurs if a line of text extends beyond the available width
of the RichTextBlock.

TextWrappingProperty
TextWrappingProperty
TextWrappingProperty

Identifies the TextWrapping dependency property.


Methods
CopySelectionToClipboard()
CopySelectionToClipboard()
CopySelectionToClipboard()

Copies the selected content to the Windows clipboard.

Focus(FocusState)
Focus(FocusState)
Focus(FocusState)

Focuses the RichTextBlock, as if it were a conventionally focusable control.

GetPositionFromPoint(Point)
GetPositionFromPoint(Point)
GetPositionFromPoint(Point)

Returns a TextPointer text reference from a RichTextBlock by hit-testing a specific Point within the text display area.

Select(TextPointer, TextPointer)
Select(TextPointer, TextPointer)
Select(TextPointer, TextPointer)

Selects a range of text in the RichTextBlock.

SelectAll()
SelectAll()
SelectAll()

Selects the entire contents in the RichTextBlock.

Events
ContextMenuOpening
ContextMenuOpening
ContextMenuOpening

Occurs when the system processes an interaction that displays a context menu.

IsTextTrimmedChanged
IsTextTrimmedChanged
IsTextTrimmedChanged

Occurs when the IsTextTrimmed property value has changed.


SelectionChanged
SelectionChanged
SelectionChanged

Occurs when the text selection has changed.

See Also
OverflowContentTarget OverflowContentTarget OverflowContentTarget
RichTextBlockOverflow
RichTextBlock.BaselineOffset RichTextBlock.BaselineOffset
RichTextBlock.BaselineOffset
I n this Article
Edit
Gets a value that represents the offset in pixels from the top of the content to the baseline of the first paragraph. The
baseline of the paragraph is the baseline of the first line in it.
public : double BaselineOffset { get; }
double BaselineOffset();
public double BaselineOffset { get; }

Returns
double
The computed baseline for the first paragraph, or 0 if the RichTextBlock is empty.
RichTextBlock.Blocks RichTextBlock.Blocks RichTextBlock.
Blocks
I n this Article
Edit
Gets the contents of the RichTextBlock.
public : BlockCollection Blocks { get; }
BlockCollection Blocks();
public BlockCollection Blocks { get; }

<RichTextBlock ...>
blocksContent
</RichTextBlock>

Returns
BlockCollection
A BlockCollection that contains the contents of the RichTextBlock.
RichTextBlock.CharacterSpacing RichTextBlock.Character
Spacing RichTextBlock.CharacterSpacing
I n this Article
Edit
Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.
public : int CharacterSpacing { get; set; }
int32_t CharacterSpacing();

void CharacterSpacing(int32_t characterspacing);


public int CharacterSpacing { get; set; }

<RichTextBlock CharacterSpacing="int"/>

Returns
int
The uniform spacing between characters, in units of 1/1000 of an em. The default is 0. Positive values increase tracking
and loosen character spacing. Negative values decrease tracking and tighten the character spacing.

Examples
To see an example, see scenario 1, "Tracking (character spacing)", of the XAML text display sample.

Remarks
Tracking is the typographic term for an amount of space added or removed between all pairs of characters in a portion
of text. This feature can be accessed through the CharacterSpacing property on TextBlock and RichTextBlock.
CharacterSpacing is measured in 1/1000 of an "em". One "em" is equivalent to the current font size of the control. For
example, an additional 14 pixels will be inserted between each character in a text control with FontSize="14" and
CharacterSpacing="1000" .

See XAML text display sample


Also
RichTextBlock.CharacterSpacingProperty RichTextBlock.
CharacterSpacingProperty RichTextBlock.Character
SpacingProperty
I n this Article
Edit
Identifies the CharacterSpacing dependency property.
public : static DependencyProperty CharacterSpacingProperty { get; }
static DependencyProperty CharacterSpacingProperty();
public static DependencyProperty CharacterSpacingProperty { get; }

Returns
DependencyProperty
The identifier for the CharacterSpacing dependency property.
RichTextBlock.ContentEnd RichTextBlock.ContentEnd Rich
TextBlock.ContentEnd
I n this Article
Edit
Gets a TextPointer that indicates the end of content in the RichTextBlock.
public : TextPointer ContentEnd { get; }
TextPointer ContentEnd();
public TextPointer ContentEnd { get; }

Returns
TextPointer
A TextPointer that indicates the end of content in the RichTextBlock.
RichTextBlock.ContentStart RichTextBlock.ContentStart
RichTextBlock.ContentStart
I n this Article
Edit
Gets a TextPointer that indicates the start of content in the RichTextBlock.
public : TextPointer ContentStart { get; }
TextPointer ContentStart();
public TextPointer ContentStart { get; }

Returns
TextPointer
A TextPointer that indicates the start of content in the RichTextBlock.
RichTextBlock.ContextMenuOpening RichTextBlock.
ContextMenuOpening RichTextBlock.ContextMenu
Opening
I n this Article
Edit
Occurs when the system processes an interaction that displays a context menu.
public : event ContextMenuOpeningEventHandler ContextMenuOpening
// Register
event_token ContextMenuOpening(ContextMenuOpeningEventHandler const& handler) const;

// Revoke with event_token


void ContextMenuOpening(event_token const& cookie) const;

// Revoke with event_revoker


ContextMenuOpening_revoker ContextMenuOpening(auto_revoke_t, ContextMenuOpeningEventHandler const&
handler) const;
public event ContextMenuOpeningEventHandler ContextMenuOpening

<RichTextBlock ContextMenuOpening="eventhandler" />


RichTextBlock.CopySelectionToClipboard RichTextBlock.
CopySelectionToClipboard RichTextBlock.CopySelection
ToClipboard
I n this Article
Edit
Copies the selected content to the Windows clipboard.
public : void CopySelectionToClipboard()
void CopySelectionToClipboard() const;
public void CopySelectionToClipboard()

Additional features and requirements


Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RichTextBlock.Focus RichTextBlock.Focus RichTextBlock.
Focus
I n this Article
Edit
Focuses the RichTextBlock, as if it were a conventionally focusable control.
public : Platform::Boolean Focus(FocusState value)
bool Focus(FocusState value) const;
public bool Focus(FocusState value)

Parameters
value FocusState
Specifies the desired target for focus state, as a value of the enumeration.
Returns
bool
true if focus was set to the RichTextBlock, or focus was already there. false if the RichTextBlock is not focusable.

Remarks
RichTextBlock.FontFamily RichTextBlock.FontFamily Rich
TextBlock.FontFamily
I n this Article
Edit
Gets or sets the preferred top-level font family for the text content in this element.
public : FontFamily FontFamily { get; set; }
FontFamily FontFamily();

void FontFamily(FontFamily fontfamily);


public FontFamily FontFamily { get; set; }

<RichTextBlock FontFamily="fontFamily" />


-or-
<RichTextBlock FontFamily="fontFamilyName[,fallbackFontFamilyName]" />
-or-
<RichTextBlock FontFamily="fontURI#fontFamily" />

Returns
FontFamily
A FontFamily object that specifies the preferred font family, or a primary preferred font family with one or more
fallback font families. For information about defaults, see the FontFamily class topic.

Remarks
Set the FontFamily property to specify the default font family to use for all text in the RichTextBlock. You can override
this value for specific text elements in the RichTextBlock by setting the TextElement.FontFamily property.
RichTextBlock.FontFamilyProperty RichTextBlock.Font
FamilyProperty RichTextBlock.FontFamilyProperty
I n this Article
Edit
Identifies the FontFamily dependency property.
public : static DependencyProperty FontFamilyProperty { get; }
static DependencyProperty FontFamilyProperty();
public static DependencyProperty FontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the FontFamily dependency property.
RichTextBlock.FontSize RichTextBlock.FontSize RichText
Block.FontSize
I n this Article
Edit
Gets or sets the font size for the text content in this element.
public : double FontSize { get; set; }
double FontSize();

void FontSize(double fontsize);


public double FontSize { get; set; }

<RichTextBlock FontSize="double" .../>

Returns
double
A non-negative value that specifies the font size, measured in pixels. The default is 11.

Remarks
Set the FontSize property to specify the default font size to use for all text in the RichTextBlock. You can override this
value for specific text elements in the RichTextBlock by setting the TextElement.FontSize property.
RichTextBlock.FontSizeProperty RichTextBlock.FontSize
Property RichTextBlock.FontSizeProperty
I n this Article
Edit
Identifies the FontSize dependency property.
public : static DependencyProperty FontSizeProperty { get; }
static DependencyProperty FontSizeProperty();
public static DependencyProperty FontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the FontSize dependency property.
RichTextBlock.FontStretch RichTextBlock.FontStretch Rich
TextBlock.FontStretch
I n this Article
Edit
Gets or sets the font stretch for the text content in this element.
public : FontStretch FontStretch { get; set; }
FontStretch FontStretch();

void FontStretch(FontStretch fontstretch);


public FontStretch FontStretch { get; set; }

<RichTextBlock FontStretch="fontStretchMemberName"/>

Returns
FontStretch
The requested font stretch, as a FontStretch constant. The default is Normal.

Remarks
Set the FontStretch property to specify the default font stretch to use for all text in the RichTextBlock. You can override
this value for specific text elements in the RichTextBlock by setting the TextElement.FontStretch property.
RichTextBlock.FontStretchProperty RichTextBlock.Font
StretchProperty RichTextBlock.FontStretchProperty
I n this Article
Edit
Identifies the FontStretch dependency property.
public : static DependencyProperty FontStretchProperty { get; }
static DependencyProperty FontStretchProperty();
public static DependencyProperty FontStretchProperty { get; }

Returns
DependencyProperty
The identifier for the FontStretch dependency property.
RichTextBlock.FontStyle RichTextBlock.FontStyle RichText
Block.FontStyle
I n this Article
Edit
Gets or sets the font style for the content in this element.
public : FontStyle FontStyle { get; set; }
FontStyle FontStyle();

void FontStyle(FontStyle fontstyle);


public FontStyle FontStyle { get; set; }

<RichTextBlock FontStyle="fontStyleMemberName"/>

Returns
FontStyle
The requested font style, which is a FontStyle enumeration named constant. The default is Normal.

Remarks
Set the FontStyle property to specify the default font stretch to use for all text in the RichTextBlock. You can override
this value for specific text elements in the RichTextBlock by setting the TextElement.FontStyle property.
RichTextBlock.FontStyleProperty RichTextBlock.FontStyle
Property RichTextBlock.FontStyleProperty
I n this Article
Edit
Identifies the FontStyle dependency property.
public : static DependencyProperty FontStyleProperty { get; }
static DependencyProperty FontStyleProperty();
public static DependencyProperty FontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the FontStyle dependency property.
RichTextBlock.FontWeight RichTextBlock.FontWeight Rich
TextBlock.FontWeight
I n this Article
Edit
Gets or sets the top-level font weight for the RichTextBlock.
public : FontWeight FontWeight { get; set; }
FontWeight FontWeight();

void FontWeight(FontWeight fontweight);


public FontWeight FontWeight { get; set; }

<RichTextBlock FontWeight="fontWeightsMemberName"/>

Returns
FontWeight
The requested font weight, which is a FontWeight that is obtained from one of the FontWeights property values. The
default is Normal.

Remarks
Set the FontWeight property to specify the default font stretch to use for all text in the RichTextBlock. You can override
this value for specific text elements in the RichTextBlock by setting the TextElement.FontWeight property.
RichTextBlock.FontWeightProperty RichTextBlock.Font
WeightProperty RichTextBlock.FontWeightProperty
I n this Article
Edit
Identifies the FontWeight dependency property.
public : static DependencyProperty FontWeightProperty { get; }
static DependencyProperty FontWeightProperty();
public static DependencyProperty FontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the FontWeight dependency property.
RichTextBlock.Foreground RichTextBlock.Foreground Rich
TextBlock.Foreground
I n this Article
Edit
Gets or sets the Brush to apply to the text contents of the RichTextBlock.
public : Brush Foreground { get; set; }
Brush Foreground();

void Foreground(Brush foreground);


public Brush Foreground { get; set; }

<RichTextBlock Foreground="{StaticResource resourceName}"/>

Returns
Brush
The brush used to apply to the text contents. The default is a null brush from a pure code perspective, but the default
text styles set this to Black (for Light theme) or White (for Dark theme) for a TextBlock element in UI.

Remarks
Set the Foreground property to specify the default brush to use for all text in the RichTextBlock. You can override this
value for specific text elements (such as a Run ) in the RichTextBlock by setting the TextElement.Foreground property.
The default appearance of text and text styles depends heavily on the active theme and other settings. The theme and
various styles and behaviors that are using default system settings or user preferences are the source of the effective
runtime appearance of RichTextBlock foreground color of text as well as other text characteristics. You can change these
defaults by changing the property values, or by applying a different style to specific RichTextBlock instances. You can
change the foreground value for all default text by overriding the resource named
DefaultTextForegroundThemeBrush in App.xaml.
See Use brushes
Also
RichTextBlock.ForegroundProperty RichTextBlock.
ForegroundProperty RichTextBlock.ForegroundProperty
I n this Article
Edit
Identifies the Foreground dependency property.
public : static DependencyProperty ForegroundProperty { get; }
static DependencyProperty ForegroundProperty();
public static DependencyProperty ForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the Foreground dependency property.
RichTextBlock.GetPositionFromPoint RichTextBlock.Get
PositionFromPoint RichTextBlock.GetPositionFromPoint
I n this Article
Edit
Returns a TextPointer text reference from a RichTextBlock by hit-testing a specific Point within the text display area.
public : TextPointer GetPositionFromPoint(Point point)
TextPointer GetPositionFromPoint(Point point) const;
public TextPointer GetPositionFromPoint(Point point)

Parameters
point Point
The point to test.
Returns
TextPointer
The determined text reference.
RichTextBlock.HasOverflowContent RichTextBlock.Has
OverflowContent RichTextBlock.HasOverflowContent
I n this Article
Edit
Gets a value that indicates whether the RichTextBlock has content that extends beyond its bounds, that can provide
content to an OverflowContentTarget element.
public : Platform::Boolean HasOverflowContent { get; }
bool HasOverflowContent();
public bool HasOverflowContent { get; }

Returns
bool
True if the RichTextBlock has content that extends beyond its bounds; otherwise, false.

Remarks
If HasOverflowContent is true and the OverflowContentTarget property is set, the extra content flows into the
OverflowContentTarget element.
See RichTextBlockOverflow
Also
RichTextBlock.HasOverflowContentProperty RichText
Block.HasOverflowContentProperty RichTextBlock.Has
OverflowContentProperty
I n this Article
Edit
Identifies the HasOverflowContent dependency property.
public : static DependencyProperty HasOverflowContentProperty { get; }
static DependencyProperty HasOverflowContentProperty();
public static DependencyProperty HasOverflowContentProperty { get; }

Returns
DependencyProperty
The identifier for the HasOverflowContent dependency property.
RichTextBlock.HorizontalTextAlignment RichTextBlock.
HorizontalTextAlignment RichTextBlock.HorizontalText
Alignment
I n this Article
Edit
Gets or sets a value that indicates how text is aligned in the RichTextBlock.
public : TextAlignment HorizontalTextAlignment { get; set; }
TextAlignment HorizontalTextAlignment();

void HorizontalTextAlignment(TextAlignment horizontaltextalignment);


public TextAlignment HorizontalTextAlignment { get; set; }

<RichTextBlock HorizontalTextAlignment="textAlignmentValue"/>

Returns
TextAlignment
One of the TextAlignment enumeration values that specifies how text is aligned. The default is Left.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
This property provides the same functionality as the TextAlignment property. If both properties are set to conflicting
values, the last one set is used.
Apps that target the Fall Creators Update (SDK 16299) or later should use this property instead of TextAlignment. If
your app also supports previous versions, see Version adaptive apps: Use new APIs while maintaining compatibility
with previous versions for more info.
RichTextBlock.HorizontalTextAlignmentProperty RichText
Block.HorizontalTextAlignmentProperty RichTextBlock.
HorizontalTextAlignmentProperty
I n this Article
Edit
Identifies the HorizontalTextAlignment dependency property.
public : static DependencyProperty HorizontalTextAlignmentProperty { get; }
static DependencyProperty HorizontalTextAlignmentProperty();
public static DependencyProperty HorizontalTextAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalTextAlignment dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


RichTextBlock.IsColorFontEnabled RichTextBlock.IsColor
FontEnabled RichTextBlock.IsColorFontEnabled
I n this Article
Edit
Gets or sets a value that determines whether font glyphs that contain color layers, such as Segoe UI Emoji, are
rendered in color.
public : Platform::Boolean IsColorFontEnabled { get; set; }
bool IsColorFontEnabled();

void IsColorFontEnabled(bool iscolorfontenabled);


public bool IsColorFontEnabled { get; set; }

<RichEditBlock IsColorFontEnabled="bool" />

Returns
bool
true if color glyphs show in color; otherwise, false. The default is true.

Remarks
Windows 8.1 introduces the ability for fonts to include multiple colored layers for each glyph. For example, the Segoe
UI Emoji font defines color versions of the Emoticon and other Emoji characters. By default, the IsColorFontEnabled
property is true and fonts with these additional layers are rendered in color.
In Windows 8, Extensible Application Markup Language (XAML ) text controls don't render multi-color fonts in color.
When an app that was compiled for Windows 8 is recompiled for Windows 8.1, color rendering of multi-color fonts is
enabled by default. Some glyphs in multi-color fonts have different layout metrics when rendered in color. This could
cause different layout in apps when they are recompiled for Windows 8.1. To retain the Windows 8 behavior when
your app is recompiled for Windows 8.1, set IsColorFontEnabled to false.
RichTextBlock.IsColorFontEnabledProperty RichTextBlock.
IsColorFontEnabledProperty RichTextBlock.IsColorFont
EnabledProperty
I n this Article
Edit
Identifies the IsColorFontEnabled dependency property.
public : static DependencyProperty IsColorFontEnabledProperty { get; }
static DependencyProperty IsColorFontEnabledProperty();
public static DependencyProperty IsColorFontEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsColorFontEnabled dependency property.
RichTextBlock.IsTextScaleFactorEnabled RichTextBlock.Is
TextScaleFactorEnabled RichTextBlock.IsTextScaleFactor
Enabled
I n this Article
Edit
Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.
public : Platform::Boolean IsTextScaleFactorEnabled { get; set; }
bool IsTextScaleFactorEnabled();

void IsTextScaleFactorEnabled(bool istextscalefactorenabled);


public bool IsTextScaleFactorEnabled { get; set; }

<RichTextBlock IsTextScaleFactorEnabled="bool"/>

Returns
bool
true if automatic text enlargement is enabled; otherwise, false.
See Accessible text requirements
Also
RichTextBlock.IsTextScaleFactorEnabledProperty RichText
Block.IsTextScaleFactorEnabledProperty RichTextBlock.Is
TextScaleFactorEnabledProperty
I n this Article
Edit
Identifies the IsTextScaleFactorEnabled dependency property.
public : static DependencyProperty IsTextScaleFactorEnabledProperty { get; }
static DependencyProperty IsTextScaleFactorEnabledProperty();
public static DependencyProperty IsTextScaleFactorEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextScaleFactorEnabled dependency property.
RichTextBlock.IsTextSelectionEnabled RichTextBlock.IsText
SelectionEnabled RichTextBlock.IsTextSelectionEnabled
I n this Article
Edit
Gets or sets a value that determines whether text content of the RichTextBlock can be selected for clipboard or drag
purposes, or for UI styling changes that indicate selected text.
public : Platform::Boolean IsTextSelectionEnabled { get; set; }
bool IsTextSelectionEnabled();

void IsTextSelectionEnabled(bool istextselectionenabled);


public bool IsTextSelectionEnabled { get; set; }

<RichTextBlock IsTextSelectionEnabled="bool" />

Returns
bool
true if text content of the RichTextBlock can be selected for clipboard or drag purposes. false if text cannot be selected.
The default is true.
RichTextBlock.IsTextSelectionEnabledProperty RichText
Block.IsTextSelectionEnabledProperty RichTextBlock.IsText
SelectionEnabledProperty
I n this Article
Edit
Identifies the IsTextSelectionEnabled dependency property.
public : static DependencyProperty IsTextSelectionEnabledProperty { get; }
static DependencyProperty IsTextSelectionEnabledProperty();
public static DependencyProperty IsTextSelectionEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextSelectionEnabled dependency property.
RichTextBlock.IsTextTrimmed RichTextBlock.IsTextTrimmed
RichTextBlock.IsTextTrimmed
I n this Article
Edit
Gets a value that indicates whether the control has trimmed text that overflows the content area.
public : Platform::Boolean IsTextTrimmed { get; }
bool IsTextTrimmed();
public bool IsTextTrimmed { get; }

Returns
bool
true if text is trimmed; otherwise, false.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
See the TextTrimming property and TextTrimming enumeration for more info about how text is trimmed.
RichTextBlock.IsTextTrimmedChanged RichTextBlock.IsText
TrimmedChanged RichTextBlock.IsTextTrimmedChanged
I n this Article
Edit
Occurs when the IsTextTrimmed property value has changed.
public : event TypedEventHandler<RichTextBlock, IsTextTrimmedChangedEventArgs> IsTextTrimmedChanged
// Register
event_token IsTextTrimmedChanged(TypedEventHandler<RichTextBlock, IsTextTrimmedChangedEventArgs>
const& handler) const;

// Revoke with event_token


void IsTextTrimmedChanged(event_token const& cookie) const;

// Revoke with event_revoker


IsTextTrimmedChanged_revoker IsTextTrimmedChanged(auto_revoke_t, TypedEventHandler<RichTextBlock,
IsTextTrimmedChangedEventArgs> const& handler) const;
public event TypedEventHandler<RichTextBlock, IsTextTrimmedChangedEventArgs> IsTextTrimmedChanged

<RichTextBlock IsTextTrimmedChanged="eventhandler"/>
RichTextBlock.IsTextTrimmedProperty RichTextBlock.IsText
TrimmedProperty RichTextBlock.IsTextTrimmedProperty
I n this Article
Edit
Identifies the IsTextTrimmed dependency property.
public : static DependencyProperty IsTextTrimmedProperty { get; }
static DependencyProperty IsTextTrimmedProperty();
public static DependencyProperty IsTextTrimmedProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextTrimmed dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


RichTextBlock.LineHeight RichTextBlock.LineHeight Rich
TextBlock.LineHeight
I n this Article
Edit
Gets or sets the height of each line of content.
public : double LineHeight { get; set; }
double LineHeight();

void LineHeight(double lineheight);


public double LineHeight { get; set; }

<RichTextBlock LineHeight="double"/>

Returns
double
The height of each line in pixels. A value of 0 indicates that the line height is determined automatically from the current
font characteristics. The default is 0.
RichTextBlock.LineHeightProperty RichTextBlock.Line
HeightProperty RichTextBlock.LineHeightProperty
I n this Article
Edit
Identifies the LineHeight dependency property.
public : static DependencyProperty LineHeightProperty { get; }
static DependencyProperty LineHeightProperty();
public static DependencyProperty LineHeightProperty { get; }

Returns
DependencyProperty
The identifier for the LineHeight dependency property.
RichTextBlock.LineStackingStrategy RichTextBlock.Line
StackingStrategy RichTextBlock.LineStackingStrategy
I n this Article
Edit
Gets or sets a value that indicates how a line box is determined for each line of text in the RichTextBlock.
public : LineStackingStrategy LineStackingStrategy { get; set; }
LineStackingStrategy LineStackingStrategy();

void LineStackingStrategy(LineStackingStrategy linestackingstrategy);


public LineStackingStrategy LineStackingStrategy { get; set; }

<RichTextBlock LineStackingStrategy="BlockLineHeight"/>
-or-
<RichTextBlock LineStackingStrategy="MaxHeight"/>

Returns
LineStackingStrategy
A value that indicates how a line box is determined for each line of text in the RichTextBlock. The default is MaxHeight.
RichTextBlock.LineStackingStrategyProperty RichText
Block.LineStackingStrategyProperty RichTextBlock.Line
StackingStrategyProperty
I n this Article
Edit
Identifies the LineStackingStrategy dependency property.
public : static DependencyProperty LineStackingStrategyProperty { get; }
static DependencyProperty LineStackingStrategyProperty();
public static DependencyProperty LineStackingStrategyProperty { get; }

Returns
DependencyProperty
The identifier for the LineStackingStrategy dependency property.
RichTextBlock.MaxLines RichTextBlock.MaxLines RichText
Block.MaxLines
I n this Article
Edit
Gets or sets the maximum lines of text shown in the RichTextBlock.
public : int MaxLines { get; set; }
int32_t MaxLines();

void MaxLines(int32_t maxlines);


public int MaxLines { get; set; }

<RichTextBlock MaxLines="int"/>

Returns
int
The maximum lines of text shown in the RichTextBlock. The default is 0, which is a special value that represents "Auto"
behavior. The value cannot be negative.

Remarks
Use the MaxLines property to specify the maximum lines of text shown in a text block. The text control will adjust it’s
height to show no more than the specified number of lines, regardless of the font size, font style, or text length.
Negative integer values are invalid, and will cause a run-time exception.
RichTextBlock.MaxLinesProperty RichTextBlock.MaxLines
Property RichTextBlock.MaxLinesProperty
I n this Article
Edit
Identifies the MaxLines dependency property.
public : static DependencyProperty MaxLinesProperty { get; }
static DependencyProperty MaxLinesProperty();
public static DependencyProperty MaxLinesProperty { get; }

Returns
DependencyProperty
The identifier for the MaxLines dependency property.
RichTextBlock.OpticalMarginAlignment RichTextBlock.
OpticalMarginAlignment RichTextBlock.OpticalMargin
Alignment
I n this Article
Edit
Get or sets a value that indicates how the font is modified to align with fonts of different sizes.
public : OpticalMarginAlignment OpticalMarginAlignment { get; set; }
OpticalMarginAlignment OpticalMarginAlignment();

void OpticalMarginAlignment(OpticalMarginAlignment opticalmarginalignment);


public OpticalMarginAlignment OpticalMarginAlignment { get; set; }

<RichTextBlock OpticalMarginAlignment="None"/>
-or-
<RichTextBlock OpticalMarginAlignment="TrimSideBearings"/>

Returns
OpticalMarginAlignment
A value of the enumeration that indicates how the font is modified to align at different sizes. The default is None.

Remarks
When OpticalMarginAlignment is set to TrimSideBearings, the text is trimmed to the leftmost stroke of the first
character and the rightmost stroke of the last character on a line. For example, an "L" has a small amount of space to
the left of the vertical stroke, which scales with font size. When TrimSideBearings is set, the left of the vertical stroke is
directly aligned without the spacing. This enables easier alignment to the Windows grid system as explained in Laying
out an app page.
RichTextBlock.OpticalMarginAlignmentProperty RichText
Block.OpticalMarginAlignmentProperty RichTextBlock.
OpticalMarginAlignmentProperty
I n this Article
Edit
Identifies the OpticalMarginAlignment dependency property.
public : static DependencyProperty OpticalMarginAlignmentProperty { get; }
static DependencyProperty OpticalMarginAlignmentProperty();
public static DependencyProperty OpticalMarginAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the OpticalMarginAlignment dependency property.
RichTextBlock.OverflowContentTarget RichTextBlock.
OverflowContentTarget RichTextBlock.OverflowContent
Target
I n this Article
Edit
Gets or sets a reference to a RichTextBlockOverflow that is the linked target for any text overflow from this
RichTextBlock.
public : RichTextBlockOverflow OverflowContentTarget { get; set; }
RichTextBlockOverflow OverflowContentTarget();

void OverflowContentTarget(RichTextBlockOverflow overflowcontenttarget);


public RichTextBlockOverflow OverflowContentTarget { get; set; }

RichTextBlock OverflowContentTarget="{Binding ElementName=nameOfTarget}" />

Returns
RichTextBlockOverflow
The target for overflow.
See RichTextBlockOverflow
Also
RichTextBlock.OverflowContentTargetProperty RichText
Block.OverflowContentTargetProperty RichTextBlock.
OverflowContentTargetProperty
I n this Article
Edit
Identifies the OverflowContentTarget dependency property.
public : static DependencyProperty OverflowContentTargetProperty { get; }
static DependencyProperty OverflowContentTargetProperty();
public static DependencyProperty OverflowContentTargetProperty { get; }

Returns
DependencyProperty
The identifier for the OverflowContentTarget dependency property.
RichTextBlock.Padding RichTextBlock.Padding RichText
Block.Padding
I n this Article
Edit
Gets or sets a value that indicates the thickness of padding space between the boundaries of the content area and the
content displayed by a RichTextBlock.
public : Thickness Padding { get; set; }
Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<RichTextBlock Padding="uniform"/>
- or -
<RichTextBlock Padding="left&Right,top&Bottom"/>
- or -
<RichTextBlock Padding="left,top,right,bottom"/>

Returns
Thickness
A Thickness structure that specifies the amount of padding to apply.

Remarks
A related property is Margin (a property of FrameworkElement ). For more info about the relationship between margin
and padding, see Alignment, margin, and padding or Define layouts with XAML.
See Thickness
Also Alignment, margin, and padding
RichTextBlock.PaddingProperty RichTextBlock.Padding
Property RichTextBlock.PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
RichTextBlock RichTextBlock RichTextBlock
I n this Article
Edit
Initializes a new instance of the RichTextBlock class.

public : RichTextBlock()
RichTextBlock() const;
public RichTextBlock()
RichTextBlock.Select RichTextBlock.Select RichTextBlock.
Select
I n this Article
Edit
Selects a range of text in the RichTextBlock.
public : void Select(TextPointer start, TextPointer end)
void Select(TextPointer start, TextPointer end) const;
public void Select(TextPointer start, TextPointer end)

Parameters
start TextPointer
An object that represents the start of the range to select.
end TextPointer
An object that represents the end of the range to select.

Remarks
In Windows Presentation Foundation (WPF ) and Microsoft Silverlight the equivalent API uses integer for start and
end positions. This implementation uses TextPointer objects to specify the selection.
RichTextBlock.SelectAll RichTextBlock.SelectAll RichText
Block.SelectAll
I n this Article
Edit
Selects the entire contents in the RichTextBlock.
public : void SelectAll()
void SelectAll() const;
public void SelectAll()
RichTextBlock.SelectedText RichTextBlock.SelectedText
RichTextBlock.SelectedText
I n this Article
Edit
Gets a text range of selected text.
public : Platform::String SelectedText { get; }
winrt::hstring SelectedText();
public string SelectedText { get; }

Returns
string
A text range of the selected text.
RichTextBlock.SelectedTextProperty RichTextBlock.
SelectedTextProperty RichTextBlock.SelectedTextProperty
I n this Article
Edit
Identifies the SelectedText dependency property.
public : static DependencyProperty SelectedTextProperty { get; }
static DependencyProperty SelectedTextProperty();
public static DependencyProperty SelectedTextProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedText dependency property.
RichTextBlock.SelectionChanged RichTextBlock.Selection
Changed RichTextBlock.SelectionChanged
I n this Article
Edit
Occurs when the text selection has changed.
public : event RoutedEventHandler SelectionChanged
// Register
event_token SelectionChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void SelectionChanged(event_token const& cookie) const;

// Revoke with event_revoker


SelectionChanged_revoker SelectionChanged(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler SelectionChanged

<RichTextBlock SelectionChanged="eventhandler"/>
RichTextBlock.SelectionEnd RichTextBlock.SelectionEnd
RichTextBlock.SelectionEnd
I n this Article
Edit
Gets the end position of the text selected in the RichTextBlock.
public : TextPointer SelectionEnd { get; }
TextPointer SelectionEnd();
public TextPointer SelectionEnd { get; }

Returns
TextPointer
An object that represents the selection end, or null if no selection exists.

Remarks
Use Select to set the selection start and end.
RichTextBlock.SelectionFlyout RichTextBlock.Selection
Flyout RichTextBlock.SelectionFlyout
I n this Article
Edit
Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.
public : FlyoutBase SelectionFlyout { get; set; }
FlyoutBase SelectionFlyout();

void SelectionFlyout(FlyoutBase selectionflyout);


public FlyoutBase SelectionFlyout { get; set; }

Returns
FlyoutBase
The flyout that is shown when text is selected, or null if no flyout is shown. The default is an instance of
TextCommandBarFlyout.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RichTextBlock.SelectionFlyoutProperty RichTextBlock.
SelectionFlyoutProperty RichTextBlock.SelectionFlyout
Property
I n this Article
Edit
Identifies the SelectionFlyout dependency property.
public : static DependencyProperty SelectionFlyoutProperty { get; }
static DependencyProperty SelectionFlyoutProperty();
public static DependencyProperty SelectionFlyoutProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionFlyout dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


RichTextBlock.SelectionHighlightColor RichTextBlock.
SelectionHighlightColor RichTextBlock.SelectionHighlight
Color
I n this Article
Edit
Gets or sets the brush used to highlight the selected text.
public : SolidColorBrush SelectionHighlightColor { get; set; }
SolidColorBrush SelectionHighlightColor();

void SelectionHighlightColor(SolidColorBrush selectionhighlightcolor);


public SolidColorBrush SelectionHighlightColor { get; set; }

<RichTextBlock SelectionHighlightColor="{StaticResource resourceName}"/>

Returns
SolidColorBrush
The brush used to highlight the selected text. The default is a null brush from a pure code perspective, but the default
text styles for RichTextBlock content apply a theme resource brush for this in a runtime instance of a RichTextBlock
control.

Remarks
A default text style sets the default selection highlight color to the system resource
TextSelectionHighlightColorThemeBrush. To change the selection highlight color for all editable text controls in
your app, you can override the TextSelectionHighlightColorThemeBrush system resource in App.xaml. This will
affect PasswordBox, TextBox, and RichEditBox controls as well as RichTextBlock content. For more info, see XAML
theme resources.
See Use brushes
Also
RichTextBlock.SelectionHighlightColorProperty RichText
Block.SelectionHighlightColorProperty RichTextBlock.
SelectionHighlightColorProperty
I n this Article
Edit
Identifies the SelectionHighlightColor dependency property.
public : static DependencyProperty SelectionHighlightColorProperty { get; }
static DependencyProperty SelectionHighlightColorProperty();
public static DependencyProperty SelectionHighlightColorProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionHighlightColor dependency property.
RichTextBlock.SelectionStart RichTextBlock.SelectionStart
RichTextBlock.SelectionStart
I n this Article
Edit
Gets the starting position of the text selected in the RichTextBlock.
public : TextPointer SelectionStart { get; }
TextPointer SelectionStart();
public TextPointer SelectionStart { get; }

Returns
TextPointer
An object that represents the selection start, or null if no selection exists.

Remarks
Use Select to set the selection start and end.
RichTextBlock.TextAlignment RichTextBlock.TextAlignment
RichTextBlock.TextAlignment
I n this Article
Edit
Gets or sets a value that indicates how the text is aligned in the RichTextBlock.
public : TextAlignment TextAlignment { get; set; }
TextAlignment TextAlignment();

void TextAlignment(TextAlignment textalignment);


public TextAlignment TextAlignment { get; set; }

<RichTextBlock TextAlignment="textAlignmentValue"/>

Returns
TextAlignment
One of the TextAlignment enumeration values that indicates how text is aligned. The default is Left.
RichTextBlock.TextAlignmentProperty RichTextBlock.Text
AlignmentProperty RichTextBlock.TextAlignmentProperty
I n this Article
Edit
Identifies the TextAlignment dependency property.
public : static DependencyProperty TextAlignmentProperty { get; }
static DependencyProperty TextAlignmentProperty();
public static DependencyProperty TextAlignmentProperty { get; }

Returns
DependencyProperty
Identifier for the TextAlignment dependency property.
RichTextBlock.TextDecorations RichTextBlock.Text
Decorations RichTextBlock.TextDecorations
I n this Article
Edit
Gets or sets a value that indicates what decorations are applied to the text.
public : TextDecorations TextDecorations { get; set; }
TextDecorations TextDecorations();

void TextDecorations(TextDecorations textdecorations);


public TextDecorations TextDecorations { get; set; }

<RichTextBlock TextDecorations="textDecorationsMemberName"/>

Returns
TextDecorations
A value of the enumeration. The default is None.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Examples
This example shows how to apply text decorations to text in a RichTextBlock, both at the control level and at the
TextElement level.
<RichTextBlock TextDecorations="Underline"
Loaded="RichTextBlock_Loaded">
<Paragraph>This text has an underline.</Paragraph>
<Paragraph TextDecorations="Strikethrough">
This text has a strikethrough, but no underline.
</Paragraph>
<Paragraph TextDecorations="Strikethrough, Underline">This text has it all!</Paragraph>
<Paragraph x:Name="Paragraph4">This text is decorated in code.</Paragraph>
</RichTextBlock>

private void RichTextBlock_Loaded(object sender, RoutedEventArgs e)


{
// Apply both strikethough and underline to the last paragraph.
Paragraph4.TextDecorations =
TextDecorations.Strikethrough | TextDecorations.Underline;
}

Remarks
Starting with the Windows 10 Creators Update (SDK version 15063), this property is the preferred way to
strikethrough or underline text.
For earlier versions of Windows, you can underline text with the Underline class.
RichTextBlock.TextDecorationsProperty RichTextBlock.Text
DecorationsProperty RichTextBlock.TextDecorations
Property
I n this Article
Edit
Identifies the TextDecorations dependency property.
public : static DependencyProperty TextDecorationsProperty { get; }
static DependencyProperty TextDecorationsProperty();
public static DependencyProperty TextDecorationsProperty { get; }

Returns
DependencyProperty
The identifier for the TextDecorations dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


RichTextBlock.TextHighlighters RichTextBlock.Text
Highlighters RichTextBlock.TextHighlighters
I n this Article
Edit
Gets the collection of text highlights.
public : IVector<TextHighlighter> TextHighlighters { get; }
IVector<TextHighlighter> TextHighlighters();
public IList<TextHighlighter> TextHighlighters { get; }

Returns
IList<TextHighlighter>
The collection of text highlights.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


RichTextBlock.TextIndent RichTextBlock.TextIndent Rich
TextBlock.TextIndent
I n this Article
Edit
Gets or sets the indentation of the first line of text in each paragraph in the RichTextBlock.
public : double TextIndent { get; set; }
double TextIndent();

void TextIndent(double textindent);


public double TextIndent { get; set; }

<RichTextBlock TextIndent="double"/>

Returns
double
The offset amount of the first line of text in a paragraph.

Remarks
You can override this setting for specific paragraphs in a RichTextBlock by setting the Paragraph.TextIndent property to
a different value.
RichTextBlock.TextIndentProperty RichTextBlock.Text
IndentProperty RichTextBlock.TextIndentProperty
I n this Article
Edit
Identifies the TextIndent dependency property.
public : static DependencyProperty TextIndentProperty { get; }
static DependencyProperty TextIndentProperty();
public static DependencyProperty TextIndentProperty { get; }

Returns
DependencyProperty
The identifier of the TextIndent dependency property.
RichTextBlock.TextLineBounds RichTextBlock.TextLine
Bounds RichTextBlock.TextLineBounds
I n this Article
Edit
Gets or sets a value that indicates how the line box height is determined for each line of text in the RichTextBlock.
public : TextLineBounds TextLineBounds { get; set; }
TextLineBounds TextLineBounds();

void TextLineBounds(TextLineBounds textlinebounds);


public TextLineBounds TextLineBounds { get; set; }

<RichTextBlock TextLineBounds="textLineBoundsValue"/>

Returns
TextLineBounds
A value that indicates how the line box height is determined for each line of text in the RichTextBlock. The default is
Full.

Remarks
For illustrations of how the different values for TextLineBounds affect adjacent lines of text, see TextLineBounds.
RichTextBlock.TextLineBoundsProperty RichTextBlock.Text
LineBoundsProperty RichTextBlock.TextLineBounds
Property
I n this Article
Edit
Identifies the TextLineBounds dependency property.
public : static DependencyProperty TextLineBoundsProperty { get; }
static DependencyProperty TextLineBoundsProperty();
public static DependencyProperty TextLineBoundsProperty { get; }

Returns
DependencyProperty
The identifier for the TextLineBounds dependency property.
RichTextBlock.TextReadingOrder RichTextBlock.Text
ReadingOrder RichTextBlock.TextReadingOrder
I n this Article
Edit
Gets or sets a value that indicates how the reading order is determined for the RichTextBlock.
public : TextReadingOrder TextReadingOrder { get; set; }
TextReadingOrder TextReadingOrder();

void TextReadingOrder(TextReadingOrder textreadingorder);


public TextReadingOrder TextReadingOrder { get; set; }

<RichTextBlock TextReadingOrder="textReadingOrderValue"/>

Returns
TextReadingOrder
A value that indicates how the reading order is determined for the RichTextBlock. The default is DetectFromContent.

Remarks
This property can be useful when the base direction of the text is unknown, and may not match the user's language or
direction. For more info, see the Remarks section of the TextReadingOrder enumeration or How to support
bidirectional UI.
Note

In Windows 8.1, the default value is 0, Default. Starting with Windows 10, the enumeration value 0 has the constant
name UseFlowDirection, and is not the default value.
See TextReadingOrder
Also How to support bidirectional UI
RichTextBlock.TextReadingOrderProperty RichTextBlock.
TextReadingOrderProperty RichTextBlock.TextReading
OrderProperty
I n this Article
Edit
Identifies the TextReadingOrder dependency property.
public : static DependencyProperty TextReadingOrderProperty { get; }
static DependencyProperty TextReadingOrderProperty();
public static DependencyProperty TextReadingOrderProperty { get; }

Returns
DependencyProperty
The identifier for the TextReadingOrder dependency property.
RichTextBlock.TextTrimming RichTextBlock.TextTrimming
RichTextBlock.TextTrimming
I n this Article
Edit
Gets or sets a value that indicates how text is trimmed when it overflows the content area.
public : TextTrimming TextTrimming { get; set; }
TextTrimming TextTrimming();

void TextTrimming(TextTrimming texttrimming);


public TextTrimming TextTrimming { get; set; }

<RichTextBlock TextTrimming="None"/>
-or-
<RichTextBlock TextTrimming="WordEllipsis"/>

Returns
TextTrimming
One of the TextTrimming enumeration values that specifies the text trimming behavior to use. The default is None.
RichTextBlock.TextTrimmingProperty RichTextBlock.Text
TrimmingProperty RichTextBlock.TextTrimmingProperty
I n this Article
Edit
Identifies the TextTrimming dependency property.
public : static DependencyProperty TextTrimmingProperty { get; }
static DependencyProperty TextTrimmingProperty();
public static DependencyProperty TextTrimmingProperty { get; }

Returns
DependencyProperty
The identifier of the TextTrimming dependency property.
RichTextBlock.TextWrapping RichTextBlock.TextWrapping
RichTextBlock.TextWrapping
I n this Article
Edit
Gets or sets a value that indicates whether text wrapping occurs if a line of text extends beyond the available width of
the RichTextBlock.
public : TextWrapping TextWrapping { get; set; }
TextWrapping TextWrapping();

void TextWrapping(TextWrapping textwrapping);


public TextWrapping TextWrapping { get; set; }

<RichTextBlock TextWrapping="Wrap"/>
-or-
<RichTextBlock TextWrapping="NoWrap"/>

Returns
TextWrapping
One of the TextWrapping enumeration values that specifies whether text is wrapped. The default is Wrap.
RichTextBlock.TextWrappingProperty RichTextBlock.Text
WrappingProperty RichTextBlock.TextWrappingProperty
I n this Article
Edit
Identifies the TextWrapping dependency property.
public : static DependencyProperty TextWrappingProperty { get; }
static DependencyProperty TextWrappingProperty();
public static DependencyProperty TextWrappingProperty { get; }

Returns
DependencyProperty
The identifier for the TextWrapping dependency property.
RichTextBlockOverflow RichTextBlockOverflow RichText
BlockOverflow Class
Represents a rich text display overflow container. This element cannot have direct content. The only purpose of
RichTextBlockOverflow is to display text content that does not fit in the bounds of a RichTextBlock or another
RichTextBlockOverflow element.

D eclaration
public : sealed class RichTextBlockOverflow : FrameworkElement, IRichTextBlockOverflow,
IRichTextBlockOverflow2, IRichTextBlockOverflow3
struct winrt::Windows::UI::Xaml::Controls::RichTextBlockOverflow : FrameworkElement,
IRichTextBlockOverflow, IRichTextBlockOverflow2, IRichTextBlockOverflow3
public sealed class RichTextBlockOverflow : FrameworkElement, IRichTextBlockOverflow,
IRichTextBlockOverflow2, IRichTextBlockOverflow3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
You can use a RichTextBlock with RichTextBlockOverflow elements to create advanced page layouts. The content for a
RichTextBlockOverflow element always comes from a RichTextBlock element. You link RichTextBlockOverflow
elements by setting them as the OverflowContentTarget of a RichTextBlock or another RichTextBlockOverflow.

Constructors
RichTextBlockOverflow()
RichTextBlockOverflow()
RichTextBlockOverflow()

Initializes a new instance of the RichTextBlockOverflow class.

Properties
BaselineOffset
BaselineOffset
BaselineOffset

Gets a value that represents the offset in pixels from the top of the content to the baseline of the first paragraph.
The baseline of the paragraph is the baseline of the first line in it.

ContentEnd
ContentEnd
ContentEnd

Gets a TextPointer that indicates the end of content in the RichTextBlockOverflow.


ContentSource
ContentSource
ContentSource

Gets the RichTextBlock content source of this RichTextBlockOverflow.

ContentStart
ContentStart
ContentStart

Gets a TextPointer that indicates the start of content in the RichTextBlockOverflow.

HasOverflowContent
HasOverflowContent
HasOverflowContent

Gets a value that indicates whether the RichTextBlockOverflow has content that extends beyond its bounds, that
can provide content to an OverflowContentTarget element.

HasOverflowContentProperty
HasOverflowContentProperty
HasOverflowContentProperty

Identifies the HasOverflowContent dependency property.

IsTextTrimmed
IsTextTrimmed
IsTextTrimmed

Gets a value that indicates whether the control has trimmed text that overflows the content area.

IsTextTrimmedProperty
IsTextTrimmedProperty
IsTextTrimmedProperty

Identifies the IsTextTrimmed dependency property.

MaxLines
MaxLines
MaxLines

Gets or sets the maximum lines of text shown in the RichTextBlockOverflow.

MaxLinesProperty
MaxLinesProperty
MaxLinesProperty

Identifies the MaxLines dependency property.

OverflowContentTarget
OverflowContentTarget
OverflowContentTarget

Gets or sets a reference to another RichTextBlockOverflow that is the linked target for any text overflow from this
RichTextBlockOverflow.

OverflowContentTargetProperty
OverflowContentTargetProperty
OverflowContentTargetProperty

Identifies the OverflowContentTarget dependency property.

Padding
Padding
Padding

Gets or sets a value that indicates the thickness of padding space between the boundaries of the content area and
the content displayed by a RichTextBlockOverflow.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.

Methods
Focus(FocusState)
Focus(FocusState)
Focus(FocusState)

Focuses the RichTextBlockOverflow, as if it were a conventionally focusable control.

GetPositionFromPoint(Point)
GetPositionFromPoint(Point)
GetPositionFromPoint(Point)

Returns a TextPointer text reference from a RichTextBlockOverflow by hit-testing a specific Point within the text
display area.
Events
IsTextTrimmedChanged
IsTextTrimmedChanged
IsTextTrimmedChanged

Occurs when the IsTextTrimmed property value has changed.

See Also
FrameworkElement
OverflowContentTarget OverflowContentTarget OverflowContentTarget
RichTextBlock
FrameworkElement
FrameworkElement
RichTextBlockOverflow.BaselineOffset RichTextBlock
Overflow.BaselineOffset RichTextBlockOverflow.Baseline
Offset
I n this Article
Edit
Gets a value that represents the offset in pixels from the top of the content to the baseline of the first paragraph. The
baseline of the paragraph is the baseline of the first line in it.
public : double BaselineOffset { get; }
double BaselineOffset();
public double BaselineOffset { get; }

Returns
double
The computed baseline for the first paragraph, or 0 if the RichTextBlockOverflow is empty.
RichTextBlockOverflow.ContentEnd RichTextBlock
Overflow.ContentEnd RichTextBlockOverflow.ContentEnd
I n this Article
Edit
Gets a TextPointer that indicates the end of content in the RichTextBlockOverflow.
public : TextPointer ContentEnd { get; }
TextPointer ContentEnd();
public TextPointer ContentEnd { get; }

Returns
TextPointer
A TextPointer that indicates the end of content in the RichTextBlockOverflow.
RichTextBlockOverflow.ContentSource RichTextBlock
Overflow.ContentSource RichTextBlockOverflow.Content
Source
I n this Article
Edit
Gets the RichTextBlock content source of this RichTextBlockOverflow.
public : RichTextBlock ContentSource { get; }
RichTextBlock ContentSource();
public RichTextBlock ContentSource { get; }

Returns
RichTextBlock
The content source for this RichTextBlockOverflow.

Remarks
This is a calculated property that is reflective of how OverflowContentTarget is set.
RichTextBlockOverflow.ContentStart RichTextBlock
Overflow.ContentStart RichTextBlockOverflow.Content
Start
I n this Article
Edit
Gets a TextPointer that indicates the start of content in the RichTextBlockOverflow.
public : TextPointer ContentStart { get; }
TextPointer ContentStart();
public TextPointer ContentStart { get; }

Returns
TextPointer
A TextPointer that indicates the start of content in the RichTextBlockOverflow.
RichTextBlockOverflow.Focus RichTextBlockOverflow.
Focus RichTextBlockOverflow.Focus
I n this Article
Edit
Focuses the RichTextBlockOverflow, as if it were a conventionally focusable control.
public : Platform::Boolean Focus(FocusState value)
bool Focus(FocusState value) const;
public bool Focus(FocusState value)

Parameters
value FocusState
Specifies the desired target for focus state, as a value of the enumeration.
Returns
bool
true if focus was set to the RichTextBlockOverflow, or focus was already there. false if the RichTextBlockOverflow is
not focusable.

Remarks
RichTextBlockOverflow.GetPositionFromPoint RichText
BlockOverflow.GetPositionFromPoint RichTextBlock
Overflow.GetPositionFromPoint
I n this Article
Edit
Returns a TextPointer text reference from a RichTextBlockOverflow by hit-testing a specific Point within the text display
area.
public : TextPointer GetPositionFromPoint(Point point)
TextPointer GetPositionFromPoint(Point point) const;
public TextPointer GetPositionFromPoint(Point point)

Parameters
point Point
The point to test.
Returns
TextPointer
The determined text reference.
RichTextBlockOverflow.HasOverflowContent RichText
BlockOverflow.HasOverflowContent RichTextBlock
Overflow.HasOverflowContent
I n this Article
Edit
Gets a value that indicates whether the RichTextBlockOverflow has content that extends beyond its bounds, that can
provide content to an OverflowContentTarget element.
public : Platform::Boolean HasOverflowContent { get; }
bool HasOverflowContent();
public bool HasOverflowContent { get; }

Returns
bool
True if the RichTextBlockOverflow has content that extends beyond its bounds; otherwise, false.

Remarks
If HasOverflowContent is true and the OverflowContentTarget property is set, the extra content flows into the
OverflowContentTarget element.
RichTextBlockOverflow.HasOverflowContentProperty
RichTextBlockOverflow.HasOverflowContentProperty
RichTextBlockOverflow.HasOverflowContentProperty
I n this Article
Edit
Identifies the HasOverflowContent dependency property.
public : static DependencyProperty HasOverflowContentProperty { get; }
static DependencyProperty HasOverflowContentProperty();
public static DependencyProperty HasOverflowContentProperty { get; }

Returns
DependencyProperty
The identifier for the HasOverflowContent dependency property.
RichTextBlockOverflow.IsTextTrimmed RichTextBlock
Overflow.IsTextTrimmed RichTextBlockOverflow.IsText
Trimmed
I n this Article
Edit
Gets a value that indicates whether the control has trimmed text that overflows the content area.
public : Platform::Boolean IsTextTrimmed { get; }
bool IsTextTrimmed();
public bool IsTextTrimmed { get; }

Returns
bool
true if text is trimmed; otherwise, false.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
See the TextTrimming property and TextTrimming enumeration for more info about how text is trimmed.
RichTextBlockOverflow.IsTextTrimmedChanged RichText
BlockOverflow.IsTextTrimmedChanged RichTextBlock
Overflow.IsTextTrimmedChanged
I n this Article
Edit
Occurs when the IsTextTrimmed property value has changed.
public : event TypedEventHandler<RichTextBlockOverflow, IsTextTrimmedChangedEventArgs>
IsTextTrimmedChanged
// Register
event_token IsTextTrimmedChanged(TypedEventHandler<RichTextBlockOverflow,
IsTextTrimmedChangedEventArgs> const& handler) const;

// Revoke with event_token


void IsTextTrimmedChanged(event_token const& cookie) const;

// Revoke with event_revoker


IsTextTrimmedChanged_revoker IsTextTrimmedChanged(auto_revoke_t,
TypedEventHandler<RichTextBlockOverflow, IsTextTrimmedChangedEventArgs> const& handler) const;
public event TypedEventHandler<RichTextBlockOverflow, IsTextTrimmedChangedEventArgs>
IsTextTrimmedChanged

<RichTextBlockOverflow IsTextTrimmedChanged="eventhandler"/>
RichTextBlockOverflow.IsTextTrimmedProperty RichText
BlockOverflow.IsTextTrimmedProperty RichTextBlock
Overflow.IsTextTrimmedProperty
I n this Article
Edit
Identifies the IsTextTrimmed dependency property.
public : static DependencyProperty IsTextTrimmedProperty { get; }
static DependencyProperty IsTextTrimmedProperty();
public static DependencyProperty IsTextTrimmedProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextTrimmed dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


RichTextBlockOverflow.MaxLines RichTextBlockOverflow.
MaxLines RichTextBlockOverflow.MaxLines
I n this Article
Edit
Gets or sets the maximum lines of text shown in the RichTextBlockOverflow.
public : int MaxLines { get; set; }
int32_t MaxLines();

void MaxLines(int32_t maxlines);


public int MaxLines { get; set; }

<RichTextBlockOverflow MaxLines="int"/>

Returns
int
The maximum lines of text shown in the RichTextBlockOverflow. The default is 0, which is a special value that
represents "Auto" behavior. The value cannot be negative.

Remarks
Use the MaxLines property to specify the maximum lines of text shown in a text block. The text control will adjust it’s
height to show no more than the specified number of lines, regardless of the font size, font style, or text length.
Negative integer values are invalid, and will cause a run-time exception.
RichTextBlockOverflow.MaxLinesProperty RichTextBlock
Overflow.MaxLinesProperty RichTextBlockOverflow.Max
LinesProperty
I n this Article
Edit
Identifies the MaxLines dependency property.
public : static DependencyProperty MaxLinesProperty { get; }
static DependencyProperty MaxLinesProperty();
public static DependencyProperty MaxLinesProperty { get; }

Returns
DependencyProperty
The identifier for the MaxLines dependency property.
RichTextBlockOverflow.OverflowContentTarget RichText
BlockOverflow.OverflowContentTarget RichTextBlock
Overflow.OverflowContentTarget
I n this Article
Edit
Gets or sets a reference to another RichTextBlockOverflow that is the linked target for any text overflow from this
RichTextBlockOverflow.
public : RichTextBlockOverflow OverflowContentTarget { get; set; }
RichTextBlockOverflow OverflowContentTarget();

void OverflowContentTarget(RichTextBlockOverflow overflowcontenttarget);


public RichTextBlockOverflow OverflowContentTarget { get; set; }

RichTextBlockOverflow OverflowContentTarget="{Binding ElementName=nameOfTarget}" />

Returns
RichTextBlockOverflow RichTextBlockOverflow RichTextBlockOverflow
The target for overflow.
RichTextBlockOverflow.OverflowContentTargetProperty
RichTextBlockOverflow.OverflowContentTargetProperty
RichTextBlockOverflow.OverflowContentTargetProperty
I n this Article
Edit
Identifies the OverflowContentTarget dependency property.
public : static DependencyProperty OverflowContentTargetProperty { get; }
static DependencyProperty OverflowContentTargetProperty();
public static DependencyProperty OverflowContentTargetProperty { get; }

Returns
DependencyProperty
The identifier for the OverflowContentTarget dependency property.
RichTextBlockOverflow.Padding RichTextBlockOverflow.
Padding RichTextBlockOverflow.Padding
I n this Article
Edit
Gets or sets a value that indicates the thickness of padding space between the boundaries of the content area and the
content displayed by a RichTextBlockOverflow.
public : Thickness Padding { get; set; }
Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<RichTextBlockOverflow Padding="uniform"/>
- or -
<RichTextBlockOverflow Padding="left&Right,top&Bottom"/>
- or -
<RichTextBlockOverflow Padding="left,top,right,bottom"/>

Returns
Thickness
A Thickness structure that specifies the amount of padding to apply.

Remarks
RichTextBlock also has a Padding property, therefore the padding applied to the RichTextBlockOverflow can be
different than on the RichTextBlock associated with it. The padding on the overflow won't default to the value from the
associated RichTextBlock, so you'll have to set it manually if you want the same padding on each.
A related property is Margin (a property of FrameworkElement ). For more info about the relationship between margin
and padding, see Alignment, margin, and padding or Define layouts with XAML.
See Thickness
Also RichTextBlock
Alignment, margin, and padding
RichTextBlockOverflow.PaddingProperty RichTextBlock
Overflow.PaddingProperty RichTextBlockOverflow.
PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
RichTextBlockOverflow RichTextBlockOverflow RichText
BlockOverflow
I n this Article
Edit
Initializes a new instance of the RichTextBlockOverflow class.
public : RichTextBlockOverflow()
RichTextBlockOverflow() const;
public RichTextBlockOverflow()
RowDefinition RowDefinition RowDefinition Class
Defines row -specific properties that apply to Grid elements.

D eclaration
public : sealed class RowDefinition : DependencyObject, IRowDefinition
struct winrt::Windows::UI::Xaml::Controls::RowDefinition : DependencyObject, IRowDefinition
public sealed class RowDefinition : DependencyObject, IRowDefinition

I nheritance H ierarchy
DependencyObject

Constructors
RowDefinition()
RowDefinition()
RowDefinition()

Initializes a new instance of the RowDefinition class.

Properties
ActualHeight
ActualHeight
ActualHeight

Gets a value that represents the calculated height of the RowDefinition.

Height
Height
Height

Gets the calculated height of a RowDefinition element, or sets the GridLength value of a row that is defined by the
RowDefinition.

HeightProperty
HeightProperty
HeightProperty

Identifies the Height dependency property.

MaxHeight
MaxHeight
MaxHeight

Gets or sets a value that represents the maximum height of a RowDefinition.


MaxHeightProperty
MaxHeightProperty
MaxHeightProperty

Identifies the MaxHeight dependency property.

MinHeight
MinHeight
MinHeight

Gets or sets a value that represents the minimum allowed height of a RowDefinition.

MinHeightProperty
MinHeightProperty
MinHeightProperty

Identifies the MinHeight dependency property.

See Also
DependencyObject
RowDefinition.ActualHeight RowDefinition.ActualHeight
RowDefinition.ActualHeight
I n this Article
Edit
Gets a value that represents the calculated height of the RowDefinition.
public : double ActualHeight { get; }
double ActualHeight();
public double ActualHeight { get; }

Returns
double
A value that represents the calculated height in pixels. The default value is 0.
RowDefinition.Height RowDefinition.Height Row
Definition.Height
I n this Article
Edit
Gets the calculated height of a RowDefinition element, or sets the GridLength value of a row that is defined by the
RowDefinition.
public : GridLength Height { get; set; }
GridLength Height();

void Height(GridLength height);


public GridLength Height { get; set; }

<RowDefinition Height="doubleValue"/>
- or -
<RowDefinition Height="starSizing"/>
-or-
<RowDefinition Height="Auto"/>

Returns
GridLength
The GridLength that represents the height of the row. The default value is a GridLength representing a "1*" sizing.

Remarks
The default value of Width is a GridLength representing a "1*" sizing. This structure value has a Value data value of
1.0, and a GridUnitType data value of Star. With this default, each new RowDefinition you define for a Grid will have
"1*" sizing, and each will be allotted an equal number of pixels for height of its content in layout handling. It's not
uncommon to define RowDefinition as an object element in XAML without any attributes set and to just use this
default behavior. The same is true for ColumnDefinition.
The value you set for Height can be constrained if you also set a value for MinHeight or MaxHeight. Each of these
properties can take only pixel measurements, not Star sizing. If a RowDefinition uses Star or Auto sizing but also has
MinHeight or MaxHeight constraints, the MinHeight or MaxHeight must be honored by the Grid layout behavior, even
if that means giving or taking layout space from other Star sizing rows defined in the Grid that don't have constraints.
It's more common to use Star sizing than absolute pixel values for a Grid definition in a UWP app using C++, C#, or
Visual Basic. Star sizing supports the dynamic layout concept, which helps your app look great on screens with
different sizes, pixel densities and orientations. For more info, see Define layouts with XAML.
See Grid.Row
Also Define layouts with XAML
RowDefinition.HeightProperty RowDefinition.Height
Property RowDefinition.HeightProperty
I n this Article
Edit
Identifies the Height dependency property.
public : static DependencyProperty HeightProperty { get; }
static DependencyProperty HeightProperty();
public static DependencyProperty HeightProperty { get; }

Returns
DependencyProperty
The identifier for the Height dependency property.
RowDefinition.MaxHeight RowDefinition.MaxHeight Row
Definition.MaxHeight
I n this Article
Edit
Gets or sets a value that represents the maximum height of a RowDefinition.
public : double MaxHeight { get; set; }
double MaxHeight();

void MaxHeight(double maxheight);


public double MaxHeight { get; set; }

<RowDefinition MaxHeight="double"/>

Returns
double
A Double that represents the maximum height.
RowDefinition.MaxHeightProperty RowDefinition.Max
HeightProperty RowDefinition.MaxHeightProperty
I n this Article
Edit
Identifies the MaxHeight dependency property.
public : static DependencyProperty MaxHeightProperty { get; }
static DependencyProperty MaxHeightProperty();
public static DependencyProperty MaxHeightProperty { get; }

Returns
DependencyProperty
The identifier for the MaxHeight dependency property.
RowDefinition.MinHeight RowDefinition.MinHeight Row
Definition.MinHeight
I n this Article
Edit
Gets or sets a value that represents the minimum allowed height of a RowDefinition.
public : double MinHeight { get; set; }
double MinHeight();

void MinHeight(double minheight);


public double MinHeight { get; set; }

<RowDefinition MinHeight="double"/>

Returns
double
A Double that represents the minimum allowed height. The default value is 0.
RowDefinition.MinHeightProperty RowDefinition.Min
HeightProperty RowDefinition.MinHeightProperty
I n this Article
Edit
Identifies the MinHeight dependency property.
public : static DependencyProperty MinHeightProperty { get; }
static DependencyProperty MinHeightProperty();
public static DependencyProperty MinHeightProperty { get; }

Returns
DependencyProperty
The identifier for the MinHeight dependency property.
RowDefinition RowDefinition RowDefinition
I n this Article
Edit
Initializes a new instance of the RowDefinition class.

public : RowDefinition()
RowDefinition() const;
public RowDefinition()
RowDefinitionCollection RowDefinitionCollection Row
DefinitionCollection Class
Provides access to an ordered, strongly typed collection of RowDefinition objects.

D eclaration
public : sealed class RowDefinitionCollection : IIterable<RowDefinition>, IVector<RowDefinition>
struct winrt::Windows::UI::Xaml::Controls::RowDefinitionCollection : IIterable<RowDefinition>,
IVector<RowDefinition>
public sealed class RowDefinitionCollection : IEnumerable<RowDefinition>, IList<RowDefinition>

I nheritance H ierarchy
None

Remarks
Enumerating the collection in C# or Microsoft V isual B asic
A RowDefinitionCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate
the items in the collection. The compiler does the type-casting for you and you won't need to cast to
IEnumerable<RowDefinition> explicitly. If you do need to cast explicitly, for example if you want to call
GetEnumerator, cast to IEnumerablewith a RowDefinition constraint.

Properties
Item[Int32]
Item[Int32]
Item[Int32]

Gets or sets the element at the specified index.

Size
Size
Size

Gets the size (count) of the collection.

Methods
Append(RowDefinition)
Append(RowDefinition)
Append(RowDefinition)

Adds a new item to the collection.

Clear()
Clear()
Clear()

Removes all items from the collection.

First()
First()
First()

Returns the iterator for iteration over the items in the collection.

GetAt(UInt32)
GetAt(UInt32)
GetAt(UInt32)

Returns the RowDefinition located at the specified index.

GetEnumerator()
GetEnumerator()
GetEnumerator()

Returns an enumerator that iterates through the collection.

GetMany(UInt32, RowDefinition[])
GetMany(UInt32, RowDefinition[])
GetMany(UInt32, RowDefinition[])

Retrieves multiple elements in a single pass through the iterator.

GetView()
GetView()
GetView()

Gets an immutable view into the collection.

IndexOf(T)
IndexOf(T)
IndexOf(T)

Determines the index of a specific item in the System.Collections.Generic.IList`1.

IndexOf(RowDefinition, UInt32)
IndexOf(RowDefinition, UInt32)
IndexOf(RowDefinition, UInt32)

Retrieves the index of the specified item.


Insert(Int32, T)
Insert(Int32, T)
Insert(Int32, T)

Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

InsertAt(UInt32, RowDefinition)
InsertAt(UInt32, RowDefinition)
InsertAt(UInt32, RowDefinition)

Inserts the specified item at the specified index.

RemoveAt(Int32)
RemoveAt(Int32)
RemoveAt(Int32)

Removes the System.Collections.Generic.IList`1 item at the specified index.

RemoveAt(UInt32)
RemoveAt(UInt32)
RemoveAt(UInt32)

Removes the item at the specified index.

RemoveAtEnd()
RemoveAtEnd()
RemoveAtEnd()

Removes the last item in the collection.

ReplaceAll(RowDefinition[])
ReplaceAll(RowDefinition[])
ReplaceAll(RowDefinition[])

Initially clears the collection, then inserts the provided array as new items.

SetAt(UInt32, RowDefinition)
SetAt(UInt32, RowDefinition)
SetAt(UInt32, RowDefinition)

Sets the value at the specified index to the RowDefinition value specified.

See Also
RowDefinition
RowDefinitionCollection.Append RowDefinition
Collection.Append RowDefinitionCollection.Append
I n this Article
Edit
Adds a new item to the collection.
public : void Append(RowDefinition value)
void Append(RowDefinition value) const;
// This member is not implemented in C#

Parameters
value RowDefinition
The new item to add.
RowDefinitionCollection.Clear RowDefinitionCollection.
Clear RowDefinitionCollection.Clear
I n this Article
Edit
Removes all items from the collection.
public : void Clear()
void Clear() const;
// This member is not implemented in C#
RowDefinitionCollection.First RowDefinitionCollection.
First RowDefinitionCollection.First
I n this Article
Edit
Returns the iterator for iteration over the items in the collection.
public : IIterator<RowDefinition> First()
IIterator<RowDefinition> First() const;
// This member is not implemented in C#

Returns
IIterator<RowDefinition>
The iterator object. The iterator's current position is at the 0-index position, or at the collection end if the collection is
empty.
RowDefinitionCollection.GetAt RowDefinitionCollection.
GetAt RowDefinitionCollection.GetAt
I n this Article
Edit
Returns the RowDefinition located at the specified index.
public : RowDefinition GetAt(unsigned int index)
RowDefinition GetAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The integer index for the value to retrieve.
Returns
RowDefinition
The RowDefinition value at the specified index.
IEnumerable<T>.GetEnumerator IEnumerable<T>.Get
Enumerator
I n this Article
Edit
Returns an enumerator that iterates through the collection.
// This member is not implemented in C++/CX
IEnumerator<T> GetEnumerator()

Returns
An enumerator that can be used to iterate through the collection.
RowDefinitionCollection.GetMany RowDefinition
Collection.GetMany RowDefinitionCollection.GetMany
I n this Article
Edit
Retrieves multiple elements in a single pass through the iterator.
public : unsigned int GetMany(unsigned int startIndex, RowDefinition[] items)
uint32_t GetMany(uint32_t startIndex, RowDefinition[] items) const;
// This member is not implemented in C#

Parameters
startIndex UInt32
The index from which to start retrieval.
items RowDefinition[]
Provides the destination for the result. Size the initial array size as a "capacity" in order to specify how many results
should be retrieved.
Returns
uint
The number of items retrieved.
RowDefinitionCollection.GetView RowDefinition
Collection.GetView RowDefinitionCollection.GetView
I n this Article
Edit
Gets an immutable view into the collection.
public : IVectorView<RowDefinition> GetView()
IVectorView<RowDefinition> GetView() const;
// This member is not implemented in C#

Returns
IReadOnlyList<RowDefinition>
An object representing the immutable collection view.
RowDefinitionCollection.IndexOf RowDefinition
Collection.IndexOf RowDefinitionCollection.IndexOf
I n this Article

Overloads
IndexOf(T) IndexOf(T)
Determines the index of a specific item in the
System.Collections.Generic.IList`1.

IndexOf(RowDefinition, UInt32) IndexOf(RowDefinition,


UInt32) IndexOf(RowDefinition, UInt32) Retrieves the index of the specified item.

IndexOf(T) IndexOf(T)
Edit
Determines the index of a specific item in the System.Collections.Generic.IList`1.
// This member is not implemented in C++/CX
int IndexOf(T item)

Parameters
item TTT
The object to locate in the System.Collections.Generic.IList`1.
Returns
The index of item if found in the list; otherwise, -1.

IndexOf(RowDefinition, UInt32) IndexOf(RowDefinition, UInt32)


IndexOf(RowDefinition, UInt32)
Edit
Retrieves the index of the specified item.
public : Platform::Boolean IndexOf(RowDefinition value, unsigned int index)
bool IndexOf(RowDefinition value, uint32_t const& index) const;
// This member is not implemented in C#

Parameters
value RowDefinition
The value to find in the collection.
index UInt32
The index of the item to find, if found.
Returns
bool
true if an item with the specified value was found; otherwise, false.
IList<T>.Insert IList<T>.Insert
I n this Article
Edit
Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

// This member is not implemented in C++/CX


void Insert(int index, T item)

Parameters
index
The zero-based index at which item should be inserted.
item TT
The object to insert into the System.Collections.Generic.IList`1.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.
RowDefinitionCollection.InsertAt RowDefinition
Collection.InsertAt RowDefinitionCollection.InsertAt
I n this Article
Edit
Inserts the specified item at the specified index.
public : void InsertAt(unsigned int index, RowDefinition value)
void InsertAt(uint32_t index, RowDefinition value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value RowDefinition
The value to set.

Remarks
InsertAt expands the collection and moves all subsequent index items by one. In contrast, SetAt replaces the item at the
index, and the collection count remains the same.
IList<T>.Item IList<T>.Item
I n this Article
Edit
Gets or sets the element at the specified index.

// This member is not implemented in C++/CX


T this[int index] { get; set; }

Parameters
index
The zero-based index of the element to get or set.
Returns
TT
The element at the specified index.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The property is set and the System.Collections.Generic.IList`1 is read-only.
RowDefinitionCollection.RemoveAt RowDefinition
Collection.RemoveAt RowDefinitionCollection.RemoveAt
I n this Article

Overloads
RemoveAt(Int32) RemoveAt(Int32)
Removes the System.Collections.Generic.IList`1 item at the
specified index.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Removes the item at the specified index.

RemoveAt(Int32) RemoveAt(Int32)
Edit
Removes the System.Collections.Generic.IList`1 item at the specified index.
// This member is not implemented in C++/CX
void RemoveAt(int index)

Parameters
index
The zero-based index of the item to remove.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Edit
Removes the item at the specified index.
public : void RemoveAt(unsigned int index)
void RemoveAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The index position of the item to remove.
Remarks
If successful, calling this method reduces the collection size by one. Items with index values greater than the called
index have their index values reduced by one.
RowDefinitionCollection.RemoveAtEnd RowDefinition
Collection.RemoveAtEnd RowDefinitionCollection.
RemoveAtEnd
I n this Article
Edit
Removes the last item in the collection.
public : void RemoveAtEnd()
void RemoveAtEnd() const;
// This member is not implemented in C#

Remarks
If successful, calling this method reduces the collection size by one.
RowDefinitionCollection.ReplaceAll RowDefinition
Collection.ReplaceAll RowDefinitionCollection.ReplaceAll
I n this Article
Edit
Initially clears the collection, then inserts the provided array as new items.
public : void ReplaceAll(RowDefinition[] items)
void ReplaceAll(RowDefinition[] items) const;
// This member is not implemented in C#

Parameters
items RowDefinition[]
The new collection items.
RowDefinitionCollection.SetAt RowDefinitionCollection.
SetAt RowDefinitionCollection.SetAt
I n this Article
Edit
Sets the value at the specified index to the RowDefinition value specified.
public : void SetAt(unsigned int index, RowDefinition value)
void SetAt(uint32_t index, RowDefinition value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value RowDefinition
The value to set.

Remarks
InsertAt expands the collection and moves all subsequent index items by one. In contrast, SetAt replaces the item at the
index, and the collection count remains the same.
RowDefinitionCollection.Size RowDefinitionCollection.
Size RowDefinitionCollection.Size
I n this Article
Edit
Gets the size (count) of the collection.
public : unsigned int Size { get; }
uint32_t Size();
// This member is not implemented in C#

Returns
uint
The count of items in the collection.
ScrollBarVisibility ScrollBarVisibility ScrollBarVisibility
Enum
Defines constants that specify the visibility of a scrollbar within a ScrollViewer control.

D eclaration
public : enum class ScrollBarVisibility
enum class winrt::Windows::UI::Xaml::Controls::ScrollBarVisibility : int32_t
public enum ScrollBarVisibility

I nheritance H ierarchy
None

Fields
Auto A ScrollBar appears only when the viewport cannot display all of the content.
Auto
Auto The dimension of the content is set to the corresponding dimension of the ScrollViewer parent. For a horizontal
ScrollBar, the width of the content is set to the ViewportWidth of the ScrollViewer. For a vertical ScrollBar, the
height of the content is set to the ViewportHeight of the ScrollViewer.

Disabled A ScrollBar does not appear even when the viewport cannot display all of the content. Scrolling is disabled.
Disabled
Disabled The dimension of the content is set to the corresponding dimension of the ScrollViewer parent. For a horizontal
ScrollBar, the width of the content is set to the ViewportWidth of the ScrollViewer. For a vertical ScrollBar, the
height of the content is set to the ViewportHeight of the ScrollViewer.

Hidden A ScrollBar does not appear even when the viewport cannot display all of the content. Scrolling is still enabled, and
Hidden can occur through touch, keyboard, or mouse wheel interaction.
Hidden
The dimension of the content is not affected by the dimension of the ScrollViewer.

Visible A ScrollBar always appears.


Visible
Visible The dimension of the content is set to the corresponding dimension of the ScrollViewer parent. For a horizontal
ScrollBar, the width of the content is set to the ViewportWidth of the ScrollViewer. For a vertical ScrollBar, the
height of the content is set to the ViewportHeight of the ScrollViewer.
ScrollContentPresenter ScrollContentPresenter Scroll
ContentPresenter Class
Displays the content of a ScrollViewer control.

D eclaration
public : sealed class ScrollContentPresenter : ContentPresenter, IScrollContentPresenter,
IScrollContentPresenter2
struct winrt::Windows::UI::Xaml::Controls::ScrollContentPresenter : ContentPresenter,
IScrollContentPresenter, IScrollContentPresenter2
public sealed class ScrollContentPresenter : ContentPresenter, IScrollContentPresenter,
IScrollContentPresenter2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
ContentPresenter

Constructors
ScrollContentPresenter()
ScrollContentPresenter()
ScrollContentPresenter()

Initializes a new instance of the ScrollContentPresenter class.

Properties
CanContentRenderOutsideBounds
CanContentRenderOutsideBounds
CanContentRenderOutsideBounds

Gets or sets a value that indicates whether scrolled content can render outside the bounds of the ScrollViewer.

CanContentRenderOutsideBoundsProperty
CanContentRenderOutsideBoundsProperty
CanContentRenderOutsideBoundsProperty

Identifies the CanContentRenderOutsideBounds dependency property.

CanHorizontallyScroll
CanHorizontallyScroll
CanHorizontallyScroll

Gets or sets a value that indicates whether scrolling on the horizontal axis is possible.
CanVerticallyScroll
CanVerticallyScroll
CanVerticallyScroll

Gets or sets a value that indicates whether scrolling on the vertical axis is possible.

ExtentHeight
ExtentHeight
ExtentHeight

Gets the vertical size of all the scrollable content.

ExtentWidth
ExtentWidth
ExtentWidth

Gets the horizontal size of all the scrollable content.

HorizontalOffset
HorizontalOffset
HorizontalOffset

Gets the distance the content has been scrolled horizontally.

ScrollOwner
ScrollOwner
ScrollOwner

Gets or sets the ScrollViewer element that controls scrolling behavior.

SizesContentToTemplatedParent
SizesContentToTemplatedParent
SizesContentToTemplatedParent

Gets or sets a value that indicates whether, when used in the ControlTemplate for a ScrollViewer, the presenter
restricts the size of its Content to the owning ScrollViewer size.

SizesContentToTemplatedParentProperty
SizesContentToTemplatedParentProperty
SizesContentToTemplatedParentProperty

Identifies the SizesContentToTemplatedParent dependency property.

VerticalOffset
VerticalOffset
VerticalOffset

Gets the distance the content has been scrolled vertically.

ViewportHeight
ViewportHeight
ViewportHeight

Gets the vertical size of the viewable content.

ViewportWidth
ViewportWidth
ViewportWidth

Gets the horizontal size of the viewable content.

Methods
LineDown()
LineDown()
LineDown()

Scrolls the ScrollContentPresenter content downward by one line.

LineLeft()
LineLeft()
LineLeft()

Scrolls the ScrollContentPresenter content to the left by a predetermined amount.

LineRight()
LineRight()
LineRight()

Scrolls the ScrollContentPresenter content to the right by a predetermined amount.

LineUp()
LineUp()
LineUp()

Scrolls the ScrollContentPresenter content upward by one line.

MakeVisible(UIElement, Rect)
MakeVisible(UIElement, Rect)
MakeVisible(UIElement, Rect)
Forces content to scroll until the coordinate space of a visual object is visible.

MouseWheelDown()
MouseWheelDown()
MouseWheelDown()

Scrolls down within content after a user clicks the wheel button on a mouse.

MouseWheelLeft()
MouseWheelLeft()
MouseWheelLeft()

Scrolls left within content after a user clicks the wheel button on a mouse.

MouseWheelRight()
MouseWheelRight()
MouseWheelRight()

Scrolls right within content after a user clicks the wheel button on a mouse.

MouseWheelUp()
MouseWheelUp()
MouseWheelUp()

Scrolls up within content after a user clicks the wheel button on a mouse.

PageDown()
PageDown()
PageDown()

Scrolls down within the content by one page.

PageLeft()
PageLeft()
PageLeft()

Scrolls left within the content by one page.

PageRight()
PageRight()
PageRight()

Scrolls right within the content by one page.


PageUp()
PageUp()
PageUp()

Scrolls up within the content by one page.

SetHorizontalOffset(Double)
SetHorizontalOffset(Double)
SetHorizontalOffset(Double)

Sets the distance the content has been scrolled horizontally.

SetVerticalOffset(Double)
SetVerticalOffset(Double)
SetVerticalOffset(Double)

Sets the distance the content has been scrolled vertically.

See Also
ContentPresenter
ScrollContentPresenter.CanContentRenderOutside
Bounds ScrollContentPresenter.CanContentRender
OutsideBounds ScrollContentPresenter.CanContent
RenderOutsideBounds
I n this Article
Edit
Gets or sets a value that indicates whether scrolled content can render outside the bounds of the ScrollViewer.
public : Platform::Boolean CanContentRenderOutsideBounds { get; set; }
bool CanContentRenderOutsideBounds();

void CanContentRenderOutsideBounds(bool cancontentrenderoutsidebounds);


public bool CanContentRenderOutsideBounds { get; set; }

Returns
bool
true if scrolled content can render outside the bounds of the ScrollViewer; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ScrollContentPresenter.CanContentRenderOutside
BoundsProperty ScrollContentPresenter.CanContent
RenderOutsideBoundsProperty ScrollContentPresenter.
CanContentRenderOutsideBoundsProperty
I n this Article
Edit
Identifies the CanContentRenderOutsideBounds dependency property.
public : static DependencyProperty CanContentRenderOutsideBoundsProperty { get; }
static DependencyProperty CanContentRenderOutsideBoundsProperty();
public static DependencyProperty CanContentRenderOutsideBoundsProperty { get; }

Returns
DependencyProperty
The identifier for the CanContentRenderOutsideBounds dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ScrollContentPresenter.CanHorizontallyScroll Scroll
ContentPresenter.CanHorizontallyScroll ScrollContent
Presenter.CanHorizontallyScroll
I n this Article
Edit
Gets or sets a value that indicates whether scrolling on the horizontal axis is possible.
public : Platform::Boolean CanHorizontallyScroll { get; set; }
bool CanHorizontallyScroll();

void CanHorizontallyScroll(bool canhorizontallyscroll);


public bool CanHorizontallyScroll { get; set; }

Returns
bool
true if scrolling is possible; otherwise, false.

Remarks
Note

This property is not intended to be set in XAML. You can set the panel's Orientation property in XAML and optionally
change the ScrollViewer.HorizontalScrollBarVisibility or ScrollViewer.VerticalScrollBarVisibility to change how
scrolling works. This property can be changed in code. In some cases you will need to use VisualTreeHelper to access
the panel. For example, when used in an ItemsPanel, there's no property that provides access to a
ScrollContentPresenter within the panel.
ScrollContentPresenter.CanVerticallyScroll ScrollContent
Presenter.CanVerticallyScroll ScrollContentPresenter.Can
VerticallyScroll
I n this Article
Edit
Gets or sets a value that indicates whether scrolling on the vertical axis is possible.
public : Platform::Boolean CanVerticallyScroll { get; set; }
bool CanVerticallyScroll();

void CanVerticallyScroll(bool canverticallyscroll);


public bool CanVerticallyScroll { get; set; }

Returns
bool
true if scrolling is possible; otherwise, false.

Remarks
Note

This property is not intended to be set in XAML. You can set the panel's Orientation property in XAML and optionally
change the ScrollViewer.HorizontalScrollBarVisibility or ScrollViewer.VerticalScrollBarVisibility to change how
scrolling works. This property can be changed in code. In some cases you will need to use VisualTreeHelper to access
the panel. For example, when used in an ItemsPanel, there's no property that provides access to a
ScrollContentPresenter within the panel.
ScrollContentPresenter.ExtentHeight ScrollContent
Presenter.ExtentHeight ScrollContentPresenter.Extent
Height
I n this Article
Edit
Gets the vertical size of all the scrollable content.
public : double ExtentHeight { get; }
double ExtentHeight();
public double ExtentHeight { get; }

Returns
double
The vertical size of the all scrollable content.

Remarks
The extent includes all the content in the ScrollViewer, whether visible or not. The viewport is the visible area of the
content.
ScrollContentPresenter.ExtentWidth ScrollContent
Presenter.ExtentWidth ScrollContentPresenter.Extent
Width
I n this Article
Edit
Gets the horizontal size of all the scrollable content.
public : double ExtentWidth { get; }
double ExtentWidth();
public double ExtentWidth { get; }

Returns
double
The horizontal size of all the scrollable content.

Remarks
The extent includes all the content in the ScrollViewer, whether visible or not. The viewport is the visible area of the
content.
ScrollContentPresenter.HorizontalOffset ScrollContent
Presenter.HorizontalOffset ScrollContentPresenter.
HorizontalOffset
I n this Article
Edit
Gets the distance the content has been scrolled horizontally.
public : double HorizontalOffset { get; }
double HorizontalOffset();
public double HorizontalOffset { get; }

Returns
double
The distance the content has been scrolled horizontally.
ScrollContentPresenter.LineDown ScrollContentPresenter.
LineDown ScrollContentPresenter.LineDown
I n this Article
Edit
Scrolls the ScrollContentPresenter content downward by one line.
public : void LineDown()
void LineDown() const;
public void LineDown()
ScrollContentPresenter.LineLeft ScrollContentPresenter.
LineLeft ScrollContentPresenter.LineLeft
I n this Article
Edit
Scrolls the ScrollContentPresenter content to the left by a predetermined amount.
public : void LineLeft()
void LineLeft() const;
public void LineLeft()
ScrollContentPresenter.LineRight ScrollContentPresenter.
LineRight ScrollContentPresenter.LineRight
I n this Article
Edit
Scrolls the ScrollContentPresenter content to the right by a predetermined amount.
public : void LineRight()
void LineRight() const;
public void LineRight()
ScrollContentPresenter.LineUp ScrollContentPresenter.
LineUp ScrollContentPresenter.LineUp
I n this Article
Edit
Scrolls the ScrollContentPresenter content upward by one line.
public : void LineUp()
void LineUp() const;
public void LineUp()
ScrollContentPresenter.MakeVisible ScrollContent
Presenter.MakeVisible ScrollContentPresenter.Make
Visible
I n this Article
Edit
Forces content to scroll until the coordinate space of a visual object is visible.
public : Rect MakeVisible(UIElement visual, Rect rectangle)
Rect MakeVisible(UIElement visual, Rect rectangle) const;
public Rect MakeVisible(UIElement visual, Rect rectangle)

Parameters
visual UIElement
A UIElement that becomes visible.
rectangle Rect
The bounding rectangle that identifies the coordinate space to make visible.
Returns
Rect
A Rect that represents the visible region after scrolling happens.
ScrollContentPresenter.MouseWheelDown ScrollContent
Presenter.MouseWheelDown ScrollContentPresenter.
MouseWheelDown
I n this Article
Edit
Scrolls down within content after a user clicks the wheel button on a mouse.
public : void MouseWheelDown()
void MouseWheelDown() const;
public void MouseWheelDown()
ScrollContentPresenter.MouseWheelLeft ScrollContent
Presenter.MouseWheelLeft ScrollContentPresenter.Mouse
WheelLeft
I n this Article
Edit
Scrolls left within content after a user clicks the wheel button on a mouse.
public : void MouseWheelLeft()
void MouseWheelLeft() const;
public void MouseWheelLeft()
ScrollContentPresenter.MouseWheelRight ScrollContent
Presenter.MouseWheelRight ScrollContentPresenter.
MouseWheelRight
I n this Article
Edit
Scrolls right within content after a user clicks the wheel button on a mouse.
public : void MouseWheelRight()
void MouseWheelRight() const;
public void MouseWheelRight()
ScrollContentPresenter.MouseWheelUp ScrollContent
Presenter.MouseWheelUp ScrollContentPresenter.Mouse
WheelUp
I n this Article
Edit
Scrolls up within content after a user clicks the wheel button on a mouse.
public : void MouseWheelUp()
void MouseWheelUp() const;
public void MouseWheelUp()
ScrollContentPresenter.PageDown ScrollContent
Presenter.PageDown ScrollContentPresenter.PageDown
I n this Article
Edit
Scrolls down within the content by one page.
public : void PageDown()
void PageDown() const;
public void PageDown()
ScrollContentPresenter.PageLeft ScrollContentPresenter.
PageLeft ScrollContentPresenter.PageLeft
I n this Article
Edit
Scrolls left within the content by one page.
public : void PageLeft()
void PageLeft() const;
public void PageLeft()
ScrollContentPresenter.PageRight ScrollContent
Presenter.PageRight ScrollContentPresenter.PageRight
I n this Article
Edit
Scrolls right within the content by one page.
public : void PageRight()
void PageRight() const;
public void PageRight()
ScrollContentPresenter.PageUp ScrollContentPresenter.
PageUp ScrollContentPresenter.PageUp
I n this Article
Edit
Scrolls up within the content by one page.
public : void PageUp()
void PageUp() const;
public void PageUp()
ScrollContentPresenter ScrollContentPresenter Scroll
ContentPresenter
I n this Article
Edit
Initializes a new instance of the ScrollContentPresenter class.
public : ScrollContentPresenter()
ScrollContentPresenter() const;
public ScrollContentPresenter()
ScrollContentPresenter.ScrollOwner ScrollContent
Presenter.ScrollOwner ScrollContentPresenter.Scroll
Owner
I n this Article
Edit
Gets or sets the ScrollViewer element that controls scrolling behavior.
public : Platform::Object ScrollOwner { get; set; }
winrt::Windows::Foundation::IInspectable ScrollOwner();

void ScrollOwner(winrt::Windows::Foundation::IInspectable scrollowner);


public object ScrollOwner { get; set; }

Returns
object
The ScrollViewer element that controls scrolling behavior.

Remarks
This property is not intended to be set in XAML.
ScrollContentPresenter.SetHorizontalOffset ScrollContent
Presenter.SetHorizontalOffset ScrollContentPresenter.Set
HorizontalOffset
I n this Article
Edit
Sets the distance the content has been scrolled horizontally.
public : void SetHorizontalOffset(double offset)
void SetHorizontalOffset(double offset) const;
public void SetHorizontalOffset(Double offset)

Parameters
offset Double
The distance the content has been scrolled horizontally.
ScrollContentPresenter.SetVerticalOffset ScrollContent
Presenter.SetVerticalOffset ScrollContentPresenter.Set
VerticalOffset
I n this Article
Edit
Sets the distance the content has been scrolled vertically.
public : void SetVerticalOffset(double offset)
void SetVerticalOffset(double offset) const;
public void SetVerticalOffset(Double offset)

Parameters
offset Double
The distance the content has been scrolled vertically.
ScrollContentPresenter.SizesContentToTemplatedParent
ScrollContentPresenter.SizesContentToTemplatedParent
ScrollContentPresenter.SizesContentToTemplatedParent
I n this Article
Edit
Gets or sets a value that indicates whether, when used in the ControlTemplate for a ScrollViewer, the presenter restricts
the size of its Content to the owning ScrollViewer size.
public : Platform::Boolean SizesContentToTemplatedParent { get; set; }
bool SizesContentToTemplatedParent();

void SizesContentToTemplatedParent(bool sizescontenttotemplatedparent);


public bool SizesContentToTemplatedParent { get; set; }

Returns
bool
true if the presenter restricts its Content size to the owning ScrollViewer size; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
By default, when a ScrollContentPresenter is sizing its Content during layout, it allows the content to be as wide as the
content desires if CanHorizontallyScroll is true, and allows the content to be as high as the content desires if
CanVerticallyScroll is true.
When the ScrollContentPresenter is used in the ControlTemplate for a ScrollViewer, setting the
SizesContentToTemplatedParent property to true causes it to restrict the size of its Content to the owning ScrollViewer
size.
See Content
Also
ScrollContentPresenter.SizesContentToTemplatedParent
Property ScrollContentPresenter.SizesContentTo
TemplatedParentProperty ScrollContentPresenter.Sizes
ContentToTemplatedParentProperty
I n this Article
Edit
Identifies the SizesContentToTemplatedParent dependency property.
public : static DependencyProperty SizesContentToTemplatedParentProperty { get; }
static DependencyProperty SizesContentToTemplatedParentProperty();
public static DependencyProperty SizesContentToTemplatedParentProperty { get; }

Returns
DependencyProperty
The identifier for the SizesContentToTemplatedParent dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ScrollContentPresenter.VerticalOffset ScrollContent
Presenter.VerticalOffset ScrollContentPresenter.Vertical
Offset
I n this Article
Edit
Gets the distance the content has been scrolled vertically.
public : double VerticalOffset { get; }
double VerticalOffset();
public double VerticalOffset { get; }

Returns
double
The distance the content has been scrolled vertically.
ScrollContentPresenter.ViewportHeight ScrollContent
Presenter.ViewportHeight ScrollContentPresenter.
ViewportHeight
I n this Article
Edit
Gets the vertical size of the viewable content.
public : double ViewportHeight { get; }
double ViewportHeight();
public double ViewportHeight { get; }

Returns
double
The vertical size of the viewable content.

Remarks
The viewport includes all the visible content in the ScrollViewer.
ScrollContentPresenter.ViewportWidth ScrollContent
Presenter.ViewportWidth ScrollContentPresenter.
ViewportWidth
I n this Article
Edit
Gets the horizontal size of the viewable content.
public : double ViewportWidth { get; }
double ViewportWidth();
public double ViewportWidth { get; }

Returns
double
The horizontal size of the viewable content.

Remarks
The viewport includes all the visible content in the ScrollViewer.
ScrollIntoViewAlignment ScrollIntoViewAlignment Scroll
IntoViewAlignment Enum
Defines constants that describe how an item that is programmatically scrolled into view aligns with the visible area.

D eclaration
public : enum class ScrollIntoViewAlignment
enum class winrt::Windows::UI::Xaml::Controls::ScrollIntoViewAlignment : int32_t
public enum ScrollIntoViewAlignment

I nheritance H ierarchy
None

Remarks
When scrolled vertically, the leading edge is the top edge.
When scrolled horizontally, the leading edge is the left edge if FlowDirection is LeftToRight, and the right edge if
FlowDirection is RightToLeft.

Fields
Default Default Default The item aligns with the nearest edge.

Leading Leading Leading The item aligns with the leading edge.

See Also
ScrollMode ScrollMode ScrollMode Enum
Defines constants that specify scrolling behavior for ScrollViewer and other parts involved in scrolling scenarios.

D eclaration
public : enum class ScrollMode
enum class winrt::Windows::UI::Xaml::Controls::ScrollMode : int32_t
public enum ScrollMode

I nheritance H ierarchy
None

Fields
Auto Auto Auto Scrolling is enabled but behavior uses a "rails" manipulation mode.

Disabled Disabled Disabled Scrolling is disabled.

Enabled Enabled Enabled Scrolling is enabled.


ScrollViewer ScrollViewer ScrollViewer Class
Represents a scrollable area that can contain other visible elements.

D eclaration
public : sealed class ScrollViewer : ContentControl, IScrollAnchorProvider, IScrollViewer,
IScrollViewer2, IScrollViewer3, IScrollViewer4
struct winrt::Windows::UI::Xaml::Controls::ScrollViewer : ContentControl, IScrollAnchorProvider,
IScrollViewer, IScrollViewer2, IScrollViewer3, IScrollViewer4
public sealed class ScrollViewer : ContentControl, IScrollAnchorProvider, IScrollViewer,
IScrollViewer2, IScrollViewer3, IScrollViewer4

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
 Tip

For more info, design guidance, and code examples, see Scroll viewer controls.
ScrollViewer is a container control that lets the user pan and zoom its content.

A ScrollViewer enables content to be displayed in a smaller area than its actual size. When the content of the
ScrollViewer is not entirely visible, the ScrollViewer displays scrollbars that the user can use to move the content areas
that is visible. The area that includes all of the content of the ScrollViewer is the extent. The visible area of the content is
the viewport.
It's typical for a ScrollViewer control to exist as a composite part of other controls. A ScrollViewer part along with the
ScrollContentPresenter class for support will display a viewport along with scrollbars only when the host control's
layout space is being constrained smaller than the expanded content size. This is often the case for lists, so ListView
and GridView templates always include a ScrollViewer. TextBox and RichEditBox also include a ScrollViewer in their
templates.
When a ScrollViewer part in a control exists, the host control often has built-in event handling for certain input events
and manipulations that enable the content to scroll. For example, a GridView interprets a swipe gesture and this causes
the content to scroll horizontally. The input events and raw manipulations that the host control receives are considered
handled by the control, and lower-level events such as PointerPressed won't be raised and won't bubble to any parent
containers either. You can change some of the built-in control handling by overriding a control class and the On*
virtual methods for events, or by retemplating the control. But in either case it's not trivial to reproduce the original
default behavior, which is typically there so that the control reacts in expected ways to events and to a user's input
actions and gestures. So you should consider whether you really need that input event to fire. You might want to
investigate whether there are other input events or gestures that are not being control-handled, and use those in your
app or control interaction design.
To make it possible for controls that include a ScrollViewer to influence some of the behavior and properties that are
from within the ScrollViewer part, ScrollViewer defines a number of XAML attached properties that can be set in styles
and used in template bindings.
Pen interaction
Prerelease. Fall Creators Update (Windows 10 Insider Preview Build 16215 and later) - Behavior
change

By default, instead of text selection, an active pen now scrolls/pans in UWP apps (just like touch, touchpad, and passive
pen). The ScrollViewer consumes pointer events unless you specify that you want to handle the events yourself, and
don't want them to be used for manipulation.
If your app depends on the previous behavior, you can override pen scrolling and revert to the previous behavior. To do
this, handle the **PointerPressed** event and set the **ManipulationMode** property to specify that the system
should not handle pen interaction to scroll your main ScrollViewer. You also handle the **PointerReleased** and
**PointerCanceled** events to turn the default system behavior back on when the Pen is removed.
This example shows how to:
Register the events using the AddHandler method with the handledEventsToo parameter set to true.
Check if the pointer device is a Pen.
In the PointerPressed event handler, turn off system manipulation support in the ScrollViewer.
In the PointerReleased and PointerCanceled event handlers, turn back on system manipulation support.
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<ScrollViewer x:Name="myScrollViewer">
<Image Source="Assets/StoreLogo.png"/>
</ScrollViewer>
</Grid>
public MainPage()
{
this.InitializeComponent();

this.myScrollViewer.AddHandler(UIElement.PointerPressedEvent,
new PointerEventHandler(myScrollViewer_PointerPressed),
true /*handledEventsToo*/);
this.myScrollViewer.AddHandler(UIElement.PointerReleasedEvent,
new PointerEventHandler(myScrollViewer_PointerReleased),
true /*handledEventsToo*/);
this.myScrollViewer.AddHandler(UIElement.PointerCanceledEvent,
new PointerEventHandler(myScrollViewer_PointerCanceled),
true /*handledEventsToo*/);
}

private void myScrollViewer_PointerPressed(object sender, PointerRoutedEventArgs e)


{
if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen)
{
(myScrollViewer.Content as UIElement).ManipulationMode &= ~ManipulationModes.System;
}
}

private void myScrollViewer_PointerReleased(object sender, PointerRoutedEventArgs e)


{
if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen)
{
(myScrollViewer.Content as UIElement).ManipulationMode |= ManipulationModes.System;
}
}

private void myScrollViewer_PointerCanceled(object sender, PointerRoutedEventArgs e)


{
if (e.Pointer.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Pen)
{
(myScrollViewer.Content as UIElement).ManipulationMode |= ManipulationModes.System;
}
}

ScrollV iewer X A ML attached properties


ScrollViewer defines the following XAML attached properties:
ScrollViewer.BringIntoViewOnFocusChange
ScrollViewer.HorizontalScrollBarVisibility
ScrollViewer.HorizontalScrollMode
ScrollViewer.IsDeferredScrollingEnabled
ScrollViewer.IsHorizontalRailEnabled
ScrollViewer.IsHorizontalScrollChainingEnabled
ScrollViewer.IsScrollInertiaEnabled
ScrollViewer.IsVerticalRailEnabled
ScrollViewer.IsVerticalScrollChainingEnabled
ScrollViewer.IsZoomChainingEnabled
ScrollViewer.IsZoomInertiaEnabled
ScrollViewer.VerticalScrollBarVisibility
ScrollViewer.VerticalScrollMode
ScrollViewer.ZoomMode These XAML attached properties are intended for cases where the ScrollViewer is implicit,
such as when the ScrollViewer exists in the default template for a ListView or GridView, and you want to be able to
influence the scrolling behavior of the control without accessing template parts. For cases where a ScrollViewer is
explicit in your XAML, as is shown in the example code in the Examples section, you don't need to use attached
property syntax. Just use attribute syntax, for example <ScrollViewer ZoomMode="Enabled" /> .

In order to support XAML processor access to the attached properties, and also to expose equivalent get and set
operations to code, each XAML attached property has a pair of Get and Set accessor methods. For example, the
GetHorizontalScrollMode and SetHorizontalScrollMode methods support and provide the equivalent code-only
support for ScrollViewer.HorizontalScrollMode. Alternatively, you can use the dependency property system to get or
set the value of the attached property. Call GetValue or SetValue, passing the arguments of the dependency property
identifier to set, and a reference to the target object on which to get or set the value.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the ScrollViewer control.

R ES O U R CE K EY D ES CR IPTIO N

ScrollViewerScrollBarSeparatorBackground Background color of the scrollbar separator

Windows 8 behavior
G esture handling by track pad devices
For Windows 8, track pad device gestures that were input-handled by a ScrollViewer control part were interpreted as
mouse wheel input, and thus would fire a PointerWheelChanged event. Starting with Windows 8.1, ScrollViewer uses
an underlying manipulation logic that interprets track pad gestures as actions that the ScrollViewer responds to, and
thus the gesture is considered handled by the control and the PointerWheelChanged event is not fired anymore.
If you migrate your app code from Windows 8 to Windows 8.1 you may want to account for this behavior change,
because it results in PointerWheelChanged being fired in fewer cases. Also, the behavior that's now built-in to
ScrollViewer may be duplicating what your handler would have done.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.
App UI for On - Screen Keyboard
Windows 8 had an internally implemented logic that would associate a ScrollViewer with the overall app UI whenever
the user invokes the On-Screen Keyboard. This On-Screen Keyboard is a specific accessibility feature that users request
through the Ease of Access Center. It's not the same as the soft keyboard that can appear in app UI for text input
controls, if the system detects no keyboard device. What the internal ScrollViewer does here is to make it possible to
scroll the area where the app is, if scrolling it is forced because the keyboard is taking UI space.
Starting with Windows 8.1, the system still has UI/layout behavior when the On-Screen Keyboard appears, but it no
longer uses this internally created ScrollViewer. Instead it uses a dedicated internal control that app code can't change
or inspect.
Most aspects of this behavior change don't affect apps at all. However, your app might have anticipated this behavior,
by providing an implicit Style for ScrollViewer that's meant to change the layout, or by walking the tree with
VisualTreeHelper to find this internally created ScrollViewer and alter it at run-time. For an app that is compiled for
Windows 8.1 that code won't be useful.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.

Constructors
ScrollViewer()
ScrollViewer()
ScrollViewer()

Initializes a new instance of the ScrollViewer class.

Properties
BringIntoViewOnFocusChange
BringIntoViewOnFocusChange
BringIntoViewOnFocusChange

Gets or sets a value that determines whether the ScrollViewer uses a bring-into-view scroll behavior when an item
in the view gets focus.

BringIntoViewOnFocusChangeProperty
BringIntoViewOnFocusChangeProperty
BringIntoViewOnFocusChangeProperty

Identifies the BringIntoViewOnFocusChange dependency property.

CanContentRenderOutsideBounds
CanContentRenderOutsideBounds
CanContentRenderOutsideBounds

Gets or sets a value that indicates whether scrolled content can render outside the bounds of the ScrollViewer.

CanContentRenderOutsideBoundsProperty
CanContentRenderOutsideBoundsProperty
CanContentRenderOutsideBoundsProperty

Identifies the CanContentRenderOutsideBounds dependency property.

ComputedHorizontalScrollBarVisibility
ComputedHorizontalScrollBarVisibility
ComputedHorizontalScrollBarVisibility

Gets a value that indicates whether the horizontal ScrollBar is visible.


ComputedHorizontalScrollBarVisibilityProperty
ComputedHorizontalScrollBarVisibilityProperty
ComputedHorizontalScrollBarVisibilityProperty

Identifies the ComputedHorizontalScrollBarVisibility dependency property.

ComputedVerticalScrollBarVisibility
ComputedVerticalScrollBarVisibility
ComputedVerticalScrollBarVisibility

Gets a value that indicates whether the vertical ScrollBar is visible.

ComputedVerticalScrollBarVisibilityProperty
ComputedVerticalScrollBarVisibilityProperty
ComputedVerticalScrollBarVisibilityProperty

Identifies the ComputedVerticalScrollBarVisibility dependency property.

CurrentAnchor
CurrentAnchor
CurrentAnchor

The currently chosen anchor element to use for scroll anchoring.

ExtentHeight
ExtentHeight
ExtentHeight

Gets the vertical size of all the scrollable content in the ScrollViewer.

ExtentHeightProperty
ExtentHeightProperty
ExtentHeightProperty

Identifier for the ExtentHeight dependency property.

ExtentWidth
ExtentWidth
ExtentWidth

Gets the horizontal size of all the scrollable content in the ScrollViewer.

ExtentWidthProperty
ExtentWidthProperty
ExtentWidthProperty
Identifier for the ExtentWidth dependency property.

HorizontalAnchorRatio
HorizontalAnchorRatio
HorizontalAnchorRatio

Determines the horizontal position of the ScrollViewer's anchor point with respect to the viewport. By default, the
ScrollViewer selects an element as its CurrentAnchor by identifying the element in its viewport nearest to the
anchor point.

HorizontalAnchorRatioProperty
HorizontalAnchorRatioProperty
HorizontalAnchorRatioProperty

Identifies the HorizontalAnchorRatio dependency property.

HorizontalOffset
HorizontalOffset
HorizontalOffset

Gets the distance the content has been scrolled horizontally.

HorizontalOffsetProperty
HorizontalOffsetProperty
HorizontalOffsetProperty

Identifies the HorizontalOffset dependency property.

HorizontalScrollBarVisibility
HorizontalScrollBarVisibility
HorizontalScrollBarVisibility

Gets or sets a value that indicates whether a horizontal ScrollBar should be displayed.

HorizontalScrollBarVisibilityProperty
HorizontalScrollBarVisibilityProperty
HorizontalScrollBarVisibilityProperty

Identifies the HorizontalScrollBarVisibility dependency property.

HorizontalScrollMode
HorizontalScrollMode
HorizontalScrollMode

Gets or sets a value that determines how manipulation input influences scrolling behavior on the horizontal axis.
HorizontalScrollModeProperty
HorizontalScrollModeProperty
HorizontalScrollModeProperty

Identifies the HorizontalScrollMode dependency property.

HorizontalSnapPointsAlignment
HorizontalSnapPointsAlignment
HorizontalSnapPointsAlignment

Gets or sets a value that indicates how the existing snap points are horizontally aligned versus the initial viewport.

HorizontalSnapPointsAlignmentProperty
HorizontalSnapPointsAlignmentProperty
HorizontalSnapPointsAlignmentProperty

Identifies the HorizontalSnapPointsAlignment dependency property.

HorizontalSnapPointsType
HorizontalSnapPointsType
HorizontalSnapPointsType

Gets or sets a value that declares how manipulation behavior reacts to the snap points along the horizontal axis.

HorizontalSnapPointsTypeProperty
HorizontalSnapPointsTypeProperty
HorizontalSnapPointsTypeProperty

Identifies the HorizontalSnapPointsType dependency property.

IsDeferredScrollingEnabled
IsDeferredScrollingEnabled
IsDeferredScrollingEnabled

Gets or sets a value that determines the deferred scrolling behavior for a ScrollViewer.

IsDeferredScrollingEnabledProperty
IsDeferredScrollingEnabledProperty
IsDeferredScrollingEnabledProperty

Identifies the IsDeferredScrollingEnabled dependency property.

IsHorizontalRailEnabled
IsHorizontalRailEnabled
IsHorizontalRailEnabled
Gets or sets a value that indicates whether the scroll rail is enabled for the horizontal axis.

IsHorizontalRailEnabledProperty
IsHorizontalRailEnabledProperty
IsHorizontalRailEnabledProperty

Identifies the IsHorizontalRailEnabled dependency property.

IsHorizontalScrollChainingEnabled
IsHorizontalScrollChainingEnabled
IsHorizontalScrollChainingEnabled

Gets or sets a value that indicates whether scroll chaining is enabled from this child to its parent, for the horizontal
axis.

IsHorizontalScrollChainingEnabledProperty
IsHorizontalScrollChainingEnabledProperty
IsHorizontalScrollChainingEnabledProperty

Identifies the IsHorizontalScrollChainingEnabled dependency property.

IsScrollInertiaEnabled
IsScrollInertiaEnabled
IsScrollInertiaEnabled

Gets or sets a value that indicates whether scroll actions should include inertia in their behavior and value.

IsScrollInertiaEnabledProperty
IsScrollInertiaEnabledProperty
IsScrollInertiaEnabledProperty

Identifies the IsScrollInertiaEnabled dependency property.

IsVerticalRailEnabled
IsVerticalRailEnabled
IsVerticalRailEnabled

Gets or sets a value that indicates whether the scroll rail is enabled for the vertical axis.

IsVerticalRailEnabledProperty
IsVerticalRailEnabledProperty
IsVerticalRailEnabledProperty

Identifies the IsVerticalRailEnabled dependency property.


IsVerticalScrollChainingEnabled
IsVerticalScrollChainingEnabled
IsVerticalScrollChainingEnabled

Gets or sets a value that indicates whether scroll chaining is enabled from this child to its parent, for the vertical
axis.

IsVerticalScrollChainingEnabledProperty
IsVerticalScrollChainingEnabledProperty
IsVerticalScrollChainingEnabledProperty

Identifies the IsVerticalScrollChainingEnabled dependency property.

IsZoomChainingEnabled
IsZoomChainingEnabled
IsZoomChainingEnabled

Gets or sets a value that indicates whether zoom chaining is enabled from this child to its parent.

IsZoomChainingEnabledProperty
IsZoomChainingEnabledProperty
IsZoomChainingEnabledProperty

Identifies the IsZoomChainingEnabled dependency property.

IsZoomInertiaEnabled
IsZoomInertiaEnabled
IsZoomInertiaEnabled

Gets or sets a value that indicates whether zoom actions should include inertia in their behavior and value.

IsZoomInertiaEnabledProperty
IsZoomInertiaEnabledProperty
IsZoomInertiaEnabledProperty

Identifies the IsZoomInertiaEnabled dependency property.

LeftHeader
LeftHeader
LeftHeader

Gets or sets the content of the left header.

LeftHeaderProperty
LeftHeaderProperty
LeftHeaderProperty

Identifies the LeftHeader dependency property.

MaxZoomFactor
MaxZoomFactor
MaxZoomFactor

Gets or sets a value that indicates the maximum permitted run-time value of ZoomFactor.

MaxZoomFactorProperty
MaxZoomFactorProperty
MaxZoomFactorProperty

Identifies the MaxZoomFactor dependency property.

MinZoomFactor
MinZoomFactor
MinZoomFactor

Gets or sets a value that indicates the minimum permitted run-time value of ZoomFactor.

MinZoomFactorProperty
MinZoomFactorProperty
MinZoomFactorProperty

Identifies the MinZoomFactor dependency property.

ReduceViewportForCoreInputViewOcclusions
ReduceViewportForCoreInputViewOcclusions
ReduceViewportForCoreInputViewOcclusions

Gets or sets a value that indicates whether the ScrollViewer should try to adjust its content to keep it visible when
a docked CoreInputView occludes part of it.

ReduceViewportForCoreInputViewOcclusionsProperty
ReduceViewportForCoreInputViewOcclusionsProperty
ReduceViewportForCoreInputViewOcclusionsProperty

Identifies the ReduceViewportForCoreInputViewOcclusions dependency property.

ScrollableHeight
ScrollableHeight
ScrollableHeight

Gets a value that represents the vertical size of the area that can be scrolled; the difference between the height of
the extent and the height of the viewport.

ScrollableHeightProperty
ScrollableHeightProperty
ScrollableHeightProperty

Identifies the ScrollableHeight dependency property.

ScrollableWidth
ScrollableWidth
ScrollableWidth

Gets a value that represents the horizontal size of the area that can be scrolled; the difference between the width of
the extent and the width of the viewport.

ScrollableWidthProperty
ScrollableWidthProperty
ScrollableWidthProperty

Identifies the ScrollableWidth dependency property.

TopHeader
TopHeader
TopHeader

Gets or sets the content of the top header.

TopHeaderProperty
TopHeaderProperty
TopHeaderProperty

Identifies the TopHeader dependency property.

TopLeftHeader
TopLeftHeader
TopLeftHeader

Gets or sets the content of the top, left header.

TopLeftHeaderProperty
TopLeftHeaderProperty
TopLeftHeaderProperty

Identifies the TopLeftHeader dependency property.


VerticalAnchorRatio
VerticalAnchorRatio
VerticalAnchorRatio

Determines the vertical position of the ScrollViewer's anchor point with respect to the viewport. By default, the
ScrollViewer selects an element as its CurrentAnchor by identifying the element in its viewport nearest to the
anchor point.

VerticalAnchorRatioProperty
VerticalAnchorRatioProperty
VerticalAnchorRatioProperty

Identifies the VerticalAnchorRatio dependency property.

VerticalOffset
VerticalOffset
VerticalOffset

Gets the distance the content has been scrolled vertically.

VerticalOffsetProperty
VerticalOffsetProperty
VerticalOffsetProperty

Identifies the VerticalOffset dependency property.

VerticalScrollBarVisibility
VerticalScrollBarVisibility
VerticalScrollBarVisibility

Gets or sets a value that indicates whether a vertical ScrollBar should be displayed.

VerticalScrollBarVisibilityProperty
VerticalScrollBarVisibilityProperty
VerticalScrollBarVisibilityProperty

Identifies the VerticalScrollBarVisibility dependency property.

VerticalScrollMode
VerticalScrollMode
VerticalScrollMode

Gets or sets a value that determines how manipulation input influences scrolling behavior on the vertical axis.

VerticalScrollModeProperty
VerticalScrollModeProperty
VerticalScrollModeProperty

Identifies the VerticalScrollMode dependency property.

VerticalSnapPointsAlignment
VerticalSnapPointsAlignment
VerticalSnapPointsAlignment

Gets or sets a value that indicates how the existing snap points are vertically aligned versus the initial viewport.

VerticalSnapPointsAlignmentProperty
VerticalSnapPointsAlignmentProperty
VerticalSnapPointsAlignmentProperty

Identifies the VerticalSnapPointsAlignment dependency property.

VerticalSnapPointsType
VerticalSnapPointsType
VerticalSnapPointsType

Gets or sets a value that declares how manipulation behavior reacts to the snap points along the vertical axis.

VerticalSnapPointsTypeProperty
VerticalSnapPointsTypeProperty
VerticalSnapPointsTypeProperty

Identifies the VerticalSnapPointsType dependency property.

ViewportHeight
ViewportHeight
ViewportHeight

Gets the vertical size of the viewable content.

ViewportHeightProperty
ViewportHeightProperty
ViewportHeightProperty

Identifies the ViewportHeight dependency property.

ViewportWidth
ViewportWidth
ViewportWidth

Gets the horizontal size of the viewable content.


ViewportWidthProperty
ViewportWidthProperty
ViewportWidthProperty

Identifies the ViewportWidth dependency property.

ZoomFactor
ZoomFactor
ZoomFactor

Gets a value that indicates the current zoom factor engaged for content scaling.

ZoomFactorProperty
ZoomFactorProperty
ZoomFactorProperty

Identifies the ZoomFactor dependency property.

ZoomMode
ZoomMode
ZoomMode

Gets or sets a value that indicates whether zoom behavior in the ScrollViewer content is enabled.

ZoomModeProperty
ZoomModeProperty
ZoomModeProperty

Identifies the ZoomMode dependency property.

ZoomSnapPoints
ZoomSnapPoints
ZoomSnapPoints

Gets the observable collection of zoom snap point factors that are held by the ScrollViewer.

ZoomSnapPointsProperty
ZoomSnapPointsProperty
ZoomSnapPointsProperty

Identifies the ZoomSnapPoints dependency property.

ZoomSnapPointsType
ZoomSnapPointsType
ZoomSnapPointsType
Gets or sets a value that indicates how zoom snap points are processed for interaction input.

ZoomSnapPointsTypeProperty
ZoomSnapPointsTypeProperty
ZoomSnapPointsTypeProperty

Identifies the ZoomSnapPointsType dependency property.

Methods
ChangeView(IReference<Double>, IReference<Double>, IReference<Single>)
ChangeView(IReference<Double>, IReference<Double>, IReference<Single>)
ChangeView(IReference<Double>, IReference<Double>, IReference<Single>)

Causes the ScrollViewer to load a new view into the viewport using the specified offsets and zoom factor.

ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean)


ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean)
ChangeView(IReference<Double>, IReference<Double>, IReference<Single>, Boolean)

Causes the ScrollViewer to load a new view into the viewport using the specified offsets and zoom factor, and
optionally disables scrolling animation.

GetBringIntoViewOnFocusChange(DependencyObject)
GetBringIntoViewOnFocusChange(DependencyObject)
GetBringIntoViewOnFocusChange(DependencyObject)

Gets the value of the BringIntoViewOnFocusChange dependency property /


ScrollViewer.BringIntoViewOnFocusChange XAML attached property from a specified element.

GetCanContentRenderOutsideBounds(DependencyObject)
GetCanContentRenderOutsideBounds(DependencyObject)
GetCanContentRenderOutsideBounds(DependencyObject)

Gets the value of the CanContentRenderOutsideBounds dependency property /


ScrollViewer.CanContentRenderOutsideBounds XAML attached property on a specified element.

GetHorizontalScrollBarVisibility(DependencyObject)
GetHorizontalScrollBarVisibility(DependencyObject)
GetHorizontalScrollBarVisibility(DependencyObject)

Gets the value of the HorizontalScrollBarVisibility dependency property /


ScrollViewer.HorizontalScrollBarVisibility XAML attached property from a specified element.

GetHorizontalScrollMode(DependencyObject)
GetHorizontalScrollMode(DependencyObject)
GetHorizontalScrollMode(DependencyObject)

Gets the value of the HorizontalScrollMode dependency property / ScrollViewer.HorizontalScrollMode XAML


attached property from a specified element.

GetIsDeferredScrollingEnabled(DependencyObject)
GetIsDeferredScrollingEnabled(DependencyObject)
GetIsDeferredScrollingEnabled(DependencyObject)

Gets the value of the IsDeferredScrollingEnabled dependency property /


ScrollViewer.IsDeferredScrollingInertiaEnabled XAML attached property from a specified element.

GetIsHorizontalRailEnabled(DependencyObject)
GetIsHorizontalRailEnabled(DependencyObject)
GetIsHorizontalRailEnabled(DependencyObject)

Gets the value of the IsHorizontalRailEnabled dependency property / ScrollViewer.IsHorizontalRailEnabled


XAML attached property from a specified element.

GetIsHorizontalScrollChainingEnabled(DependencyObject)
GetIsHorizontalScrollChainingEnabled(DependencyObject)
GetIsHorizontalScrollChainingEnabled(DependencyObject)

Gets the value of the IsHorizontalScrollChainingEnabled dependency property /


ScrollViewer.IsHorizontalScrollChainingEnabled XAML attached property from a specified element.

GetIsScrollInertiaEnabled(DependencyObject)
GetIsScrollInertiaEnabled(DependencyObject)
GetIsScrollInertiaEnabled(DependencyObject)

Gets the value of the IsScrollInertiaEnabled dependency property / ScrollViewer.IsScrollInertiaEnabled


XAML attached property from a specified element.

GetIsVerticalRailEnabled(DependencyObject)
GetIsVerticalRailEnabled(DependencyObject)
GetIsVerticalRailEnabled(DependencyObject)

Gets the value of the IsVerticalRailEnabled dependency property / ScrollViewer.IsVerticalRailEnabled XAML


attached property from a specified element.

GetIsVerticalScrollChainingEnabled(DependencyObject)
GetIsVerticalScrollChainingEnabled(DependencyObject)
GetIsVerticalScrollChainingEnabled(DependencyObject)

Gets the value of the IsVerticalScrollChainingEnabled dependency property /


ScrollViewer.IsVerticalScrollChainingEnabled XAML attached property from a specified element.
GetIsZoomChainingEnabled(DependencyObject)
GetIsZoomChainingEnabled(DependencyObject)
GetIsZoomChainingEnabled(DependencyObject)

Gets the value of the IsZoomChainingEnabled dependency property / ScrollViewer.IsZoomChainingEnabled


XAML attached property from a specified element.

GetIsZoomInertiaEnabled(DependencyObject)
GetIsZoomInertiaEnabled(DependencyObject)
GetIsZoomInertiaEnabled(DependencyObject)

Gets the value of the IsZoomInertiaEnabled dependency property / ScrollViewer.IsZoomInertiaEnabled XAML


attached property from a specified element.

GetVerticalScrollBarVisibility(DependencyObject)
GetVerticalScrollBarVisibility(DependencyObject)
GetVerticalScrollBarVisibility(DependencyObject)

Gets the value of the VerticalScrollBarVisibility dependency property /


ScrollViewer.VerticalScrollBarVisibility XAML attached property from a specified element.

GetVerticalScrollMode(DependencyObject)
GetVerticalScrollMode(DependencyObject)
GetVerticalScrollMode(DependencyObject)

Gets the value of the VerticalScrollMode dependency property / ScrollViewer.VerticalScrollMode XAML


attached property from a specified element.

GetZoomMode(DependencyObject)
GetZoomMode(DependencyObject)
GetZoomMode(DependencyObject)

Gets the value of the ZoomMode dependency property / ScrollViewer.ZoomMode XAML attached property from
a specified element.

InvalidateScrollInfo()
InvalidateScrollInfo()
InvalidateScrollInfo()

Called when the value of properties that describe the size and location of the scroll area change.

RegisterAnchorCandidate(UIElement)
RegisterAnchorCandidate(UIElement)
RegisterAnchorCandidate(UIElement)

Registers a UIElement as a potential scroll anchor.


ScrollToHorizontalOffset(Double)
ScrollToHorizontalOffset(Double)
ScrollToHorizontalOffset(Double)
Note

ScrollToHorizontalOffset may be altered or unavailable for releases after Windows 8.1. Instead, use ChangeView.
Scrolls the content that is within the ScrollViewer to the specified horizontal offset position.

ScrollToVerticalOffset(Double)
ScrollToVerticalOffset(Double)
ScrollToVerticalOffset(Double)
Note

ScrollToVerticalOffset may be altered or unavailable for releases after Windows 8.1. Instead, use ChangeView.
Scrolls the content that is within the ScrollViewer to the specified vertical offset position.

SetBringIntoViewOnFocusChange(DependencyObject, Boolean)
SetBringIntoViewOnFocusChange(DependencyObject, Boolean)
SetBringIntoViewOnFocusChange(DependencyObject, Boolean)

Sets the value of the BringIntoViewOnFocusChange dependency property /


ScrollViewer.BringIntoViewOnFocusChange XAML attached property on a specified element.

SetCanContentRenderOutsideBounds(DependencyObject, Boolean)
SetCanContentRenderOutsideBounds(DependencyObject, Boolean)
SetCanContentRenderOutsideBounds(DependencyObject, Boolean)

Sets the value of the CanContentRenderOutsideBounds dependency property /


ScrollViewer.CanContentRenderOutsideBounds XAML attached property on a specified element.

SetHorizontalScrollBarVisibility(DependencyObject, ScrollBarVisibility)
SetHorizontalScrollBarVisibility(DependencyObject, ScrollBarVisibility)
SetHorizontalScrollBarVisibility(DependencyObject, ScrollBarVisibility)

Sets the value of the HorizontalScrollBarVisibility dependency property /


ScrollViewer.HorizontalScrollBarVisibility XAML attached property on a specified element.

SetHorizontalScrollMode(DependencyObject, ScrollMode)
SetHorizontalScrollMode(DependencyObject, ScrollMode)
SetHorizontalScrollMode(DependencyObject, ScrollMode)

Sets the value of the HorizontalScrollMode dependency property / ScrollViewer.HorizontalScrollMode XAML


attached property on a specified element.

SetIsDeferredScrollingEnabled(DependencyObject, Boolean)
SetIsDeferredScrollingEnabled(DependencyObject, Boolean)
SetIsDeferredScrollingEnabled(DependencyObject, Boolean)

Sets the value of the IsDeferredScrollingEnabled dependency property /


ScrollViewer.IsDeferredScrollingEnabled XAML attached property on a specified element.

SetIsHorizontalRailEnabled(DependencyObject, Boolean)
SetIsHorizontalRailEnabled(DependencyObject, Boolean)
SetIsHorizontalRailEnabled(DependencyObject, Boolean)

Sets the value of the IsHorizontalRailEnabled dependency property / ScrollViewer.IsHorizontalRailEnabled


XAML attached property on a specified element.

SetIsHorizontalScrollChainingEnabled(DependencyObject, Boolean)
SetIsHorizontalScrollChainingEnabled(DependencyObject, Boolean)
SetIsHorizontalScrollChainingEnabled(DependencyObject, Boolean)

Sets the value of the IsHorizontalScrollChainingEnabled dependency property /


ScrollViewer.IsHorizontalScrollChainingEnabled XAML attached property on a specified element.

SetIsScrollInertiaEnabled(DependencyObject, Boolean)
SetIsScrollInertiaEnabled(DependencyObject, Boolean)
SetIsScrollInertiaEnabled(DependencyObject, Boolean)

Sets the value of the IsScrollInertiaEnabled dependency property / ScrollViewer.IsScrollInertiaEnabled


XAML attached property on a specified element.

SetIsVerticalRailEnabled(DependencyObject, Boolean)
SetIsVerticalRailEnabled(DependencyObject, Boolean)
SetIsVerticalRailEnabled(DependencyObject, Boolean)

Sets the value of the IsVerticalRailEnabled dependency property / ScrollViewer.IsVerticalRailEnabled XAML


attached property on a specified element.

SetIsVerticalScrollChainingEnabled(DependencyObject, Boolean)
SetIsVerticalScrollChainingEnabled(DependencyObject, Boolean)
SetIsVerticalScrollChainingEnabled(DependencyObject, Boolean)

Sets the value of the IsVerticalScrollChainingEnabled dependency property /


ScrollViewer.IsVerticalScrollChainingEnabled XAML attached property on a specified element.

SetIsZoomChainingEnabled(DependencyObject, Boolean)
SetIsZoomChainingEnabled(DependencyObject, Boolean)
SetIsZoomChainingEnabled(DependencyObject, Boolean)

Sets the value of the IsZoomChainingEnabled dependency property / ScrollViewer.IsZoomChainingEnabled


XAML attached property on a specified element.
SetIsZoomInertiaEnabled(DependencyObject, Boolean)
SetIsZoomInertiaEnabled(DependencyObject, Boolean)
SetIsZoomInertiaEnabled(DependencyObject, Boolean)

Sets the value of the IsZoomInertiaEnabled dependency property / ScrollViewer.IsZoomInertiaEnabled XAML


attached property on a specified element.

SetVerticalScrollBarVisibility(DependencyObject, ScrollBarVisibility)
SetVerticalScrollBarVisibility(DependencyObject, ScrollBarVisibility)
SetVerticalScrollBarVisibility(DependencyObject, ScrollBarVisibility)

Sets the value of the VerticalScrollBarVisibility dependency property /


ScrollViewer.VerticalScrollBarVisibility XAML attached property on a specified element.

SetVerticalScrollMode(DependencyObject, ScrollMode)
SetVerticalScrollMode(DependencyObject, ScrollMode)
SetVerticalScrollMode(DependencyObject, ScrollMode)

Sets the value of the VerticalScrollMode dependency property / ScrollViewer.VerticalScrollMode XAML


attached property on a specified element.

SetZoomMode(DependencyObject, ZoomMode)
SetZoomMode(DependencyObject, ZoomMode)
SetZoomMode(DependencyObject, ZoomMode)

Sets the value of the ZoomMode dependency property / ScrollViewer.ZoomMode XAML attached property on a
specified element.

UnregisterAnchorCandidate(UIElement)
UnregisterAnchorCandidate(UIElement)
UnregisterAnchorCandidate(UIElement)

Unregisters a UIElement as a potential scroll anchor.

ZoomToFactor(Single)
ZoomToFactor(Single)
ZoomToFactor(Single)
Note

ZoomToFactor may be altered or unavailable for releases after Windows 8.1. Instead, use ChangeView.
Sets the effective value of ZoomFactor.

Events
AnchorRequested
AnchorRequested
AnchorRequested

Occurs when an anchor is requested at the beginning of the Arrange pass. Handle this event to override the
ScrollViewer's default logic to select an anchor element as part of scroll anchoring.

DirectManipulationCompleted
DirectManipulationCompleted
DirectManipulationCompleted

Occurs when any direct manipulation of the ScrollViewer finishes.

DirectManipulationStarted
DirectManipulationStarted
DirectManipulationStarted

Occurs when any direct manipulation of the ScrollViewer begins.

ViewChanged
ViewChanged
ViewChanged

Occurs when manipulations such as scrolling and zooming have caused the view to change.

ViewChanging
ViewChanging
ViewChanging

Occurs when manipulations such as scrolling and zooming cause the view to change.

See Also
ScrollViewer.AnchorRequested ScrollViewer.Anchor
Requested ScrollViewer.AnchorRequested
I n this Article
Edit
Occurs when an anchor is requested at the beginning of the Arrange pass. Handle this event to override the
ScrollViewer's default logic to select an anchor element as part of scroll anchoring.
public : event TypedEventHandler<ScrollViewer, AnchorRequestedEventArgs> AnchorRequested
// Register
event_token AnchorRequested(TypedEventHandler<ScrollViewer, AnchorRequestedEventArgs> const&
handler) const;

// Revoke with event_token


void AnchorRequested(event_token const& cookie) const;

// Revoke with event_revoker


AnchorRequested_revoker AnchorRequested(auto_revoke_t, TypedEventHandler<ScrollViewer,
AnchorRequestedEventArgs> const& handler) const;
public event TypedEventHandler<ScrollViewer, AnchorRequestedEventArgs> AnchorRequested

Remarks
Explicitly set the Anchor property of the AnchorRequestedEventArgs to a UIElement within the ScrollViewer 's subtree
to override the default policy of choosing an anchor element. The AnchorCandidates property provides the list of
candidates currently registered with the ScrollViewer.
ScrollViewer.BringIntoViewOnFocusChange ScrollViewer.
BringIntoViewOnFocusChange ScrollViewer.BringInto
ViewOnFocusChange
I n this Article
Edit
Gets or sets a value that determines whether the ScrollViewer uses a bring-into-view scroll behavior when an item in
the view gets focus.
public : Platform::Boolean BringIntoViewOnFocusChange { get; set; }
bool BringIntoViewOnFocusChange();

void BringIntoViewOnFocusChange(bool bringintoviewonfocuschange);


public bool BringIntoViewOnFocusChange { get; set; }

<ScrollViewer BringIntoViewOnFocusChange="bool" />


-or-
<object ScrollViewer.BringIntoViewOnFocusChange="bool"/>

Returns
bool
true to use a behavior that brings focused items into view. false to use a behavior that focused items do not
automatically scroll into view. The default is true.

Remarks
For XAML usage, BringIntoViewOnFocusChange can either be an attribute on an explicit ScrollViewer element, or a
ScrollViewer.BringIntoViewOnFocusChange attached property usage on an element that is a child of a control
that supports scrollview implicitly in its template.
ScrollViewer.BringIntoViewOnFocusChangeProperty
ScrollViewer.BringIntoViewOnFocusChangeProperty
ScrollViewer.BringIntoViewOnFocusChangeProperty
I n this Article
Edit
Identifies the BringIntoViewOnFocusChange dependency property.
public : static DependencyProperty BringIntoViewOnFocusChangeProperty { get; }
static DependencyProperty BringIntoViewOnFocusChangeProperty();
public static DependencyProperty BringIntoViewOnFocusChangeProperty { get; }

Returns
DependencyProperty
The identifier for the BringIntoViewOnFocusChange dependency property.
ScrollViewer.CanContentRenderOutsideBounds Scroll
Viewer.CanContentRenderOutsideBounds ScrollViewer.
CanContentRenderOutsideBounds
I n this Article
Edit
Gets or sets a value that indicates whether scrolled content can render outside the bounds of the ScrollViewer.
public : Platform::Boolean CanContentRenderOutsideBounds { get; set; }
bool CanContentRenderOutsideBounds();

void CanContentRenderOutsideBounds(bool cancontentrenderoutsidebounds);


public bool CanContentRenderOutsideBounds { get; set; }

Returns
bool
true if scrolled content can render outside the bounds of the ScrollViewer; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ScrollViewer.CanContentRenderOutsideBoundsProperty
ScrollViewer.CanContentRenderOutsideBoundsProperty
ScrollViewer.CanContentRenderOutsideBoundsProperty
I n this Article
Edit
Identifies the CanContentRenderOutsideBounds dependency property.
public : static DependencyProperty CanContentRenderOutsideBoundsProperty { get; }
static DependencyProperty CanContentRenderOutsideBoundsProperty();
public static DependencyProperty CanContentRenderOutsideBoundsProperty { get; }

Returns
DependencyProperty
The identifier for the CanContentRenderOutsideBounds dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ScrollViewer.ChangeView ScrollViewer.ChangeView Scroll
Viewer.ChangeView
I n this Article

Overloads
ChangeView(IReference<Double>, IReference<Double>,
IReference<Single>) ChangeView(IReference<Double>, Causes the ScrollViewer to load a new view into the viewport
IReference<Double>, IReference<Single>) ChangeView( using the specified offsets and zoom factor.
IReference<Double>, IReference<Double>, IReference<
Single>)

ChangeView(IReference<Double>, IReference<Double>,
IReference<Single>, Boolean) ChangeView(IReference< Causes the ScrollViewer to load a new view into the viewport
Double>, IReference<Double>, IReference<Single>, Boolean) using the specified offsets and zoom factor, and optionally
ChangeView(IReference<Double>, IReference<Double>, disables scrolling animation.
IReference<Single>, Boolean)

ChangeView(IReference<Double>, IReference<Double>,
IReference<Single>) ChangeView(IReference<Double>,
IReference<Double>, IReference<Single>)
ChangeView(IReference<Double>, IReference<Double>,
IReference<Single>)
Edit
Causes the ScrollViewer to load a new view into the viewport using the specified offsets and zoom factor.
public : Platform::Boolean ChangeView(IReference<double> horizontalOffset, IReference<double>
verticalOffset, IReference<float> zoomFactor)
bool ChangeView(IReference<double> horizontalOffset, IReference<double> verticalOffset,
IReference<Single> zoomFactor) const;
public bool ChangeView(Nullable<Double> horizontalOffset, Nullable<Double> verticalOffset,
Nullable<Single> zoomFactor)

Parameters
horizontalOffset Nullable<Double>
A value between 0 and ScrollableWidth that specifies the distance the content should be scrolled horizontally.
verticalOffset Nullable<Double>
A value between 0 and ScrollableHeight that specifies the distance the content should be scrolled vertically.
zoomFactor Nullable<Single>
A value between MinZoomFactor and MaxZoomFactor that specifies the required target ZoomFactor.
Returns
bool
true if the view is changed; otherwise, false.
Attributes OverloadAttribute
Examples
This code results in a ScrollViewer named myScrollViewer being scrolled to a horizontal offset of 2.

bool flag = myScrollViewer.ChangeView(2, null, null);

bool flag{ myScrollViewer.ChangeView(Windows::Foundation::IReference<double>{2.f}, nullptr, nullptr)


};

Remarks
You can set parameter values to null to use this method to scroll only horizontally, only vertically, or to only change the
zoom factor.
See
Also
ChangeView (IReference<Double>, IReference<Double>, IReference<Single>,
Boolean)ChangeView (IReference<Double>, IReference<Double>, IReference<Single>,
Boolean)ChangeView (IReference<Double>, IReference<Double>, IReference<Single>, Boolean)

ChangeView(IReference<Double>, IReference<Double>,
IReference<Single>, Boolean) ChangeView(IReference<Double>,
IReference<Double>, IReference<Single>, Boolean)
ChangeView(IReference<Double>, IReference<Double>,
IReference<Single>, Boolean)
Edit
Causes the ScrollViewer to load a new view into the viewport using the specified offsets and zoom factor, and
optionally disables scrolling animation.

public : Platform::Boolean ChangeView(IReference<double> horizontalOffset, IReference<double>


verticalOffset, IReference<float> zoomFactor, bool disableAnimation)
bool ChangeView(IReference<double> horizontalOffset, IReference<double> verticalOffset,
IReference<Single> zoomFactor, bool disableAnimation) const;
public bool ChangeView(Nullable<Double> horizontalOffset, Nullable<Double> verticalOffset,
Nullable<Single> zoomFactor, Boolean disableAnimation)

Parameters
horizontalOffset Nullable<Double>
A value between 0 and ScrollableWidth that specifies the distance the content should be scrolled horizontally.
verticalOffset Nullable<Double>
A value between 0 and ScrollableHeight that specifies the distance the content should be scrolled vertically.
zoomFactor Nullable<Single>
A value between MinZoomFactor and MaxZoomFactor that specifies the required target ZoomFactor.
disableAnimation Boolean
true to disable zoom/pan animations while changing the view; otherwise, false. The default is false.
Returns
bool
true if the view is changed; otherwise, false.
Attributes OverloadAttribute
Examples
This code results in a ScrollViewer named myScrollViewer being scrolled to a horizontal offset of 2 without
animation.
bool flag = myScrollViewer.ChangeView(2, null, null, true);

bool flag{ myScrollViewer.ChangeView(Windows::Foundation::IReference<double>{2.f}, nullptr, nullptr,


true) };

Remarks
You can set parameter values to null to use this method to scroll only horizontally, only vertically, or to only change the
zoom factor.
See
Also
ChangeView (IReference<Double>, IReference<Double>,
IReference<Single>)ChangeView (IReference<Double>, IReference<Double>,
IReference<Single>)ChangeView (IReference<Double>, IReference<Double>, IReference<Single>)
ScrollViewer.ComputedHorizontalScrollBarVisibility Scroll
Viewer.ComputedHorizontalScrollBarVisibility Scroll
Viewer.ComputedHorizontalScrollBarVisibility
I n this Article
Edit
Gets a value that indicates whether the horizontal ScrollBar is visible.
public : Visibility ComputedHorizontalScrollBarVisibility { get; }
Visibility ComputedHorizontalScrollBarVisibility();
public Visibility ComputedHorizontalScrollBarVisibility { get; }

Returns
Visibility
A Visibility that indicates whether the horizontal scroll bar is visible. The default value is Hidden.
ScrollViewer.ComputedHorizontalScrollBarVisibility
Property ScrollViewer.ComputedHorizontalScrollBar
VisibilityProperty ScrollViewer.ComputedHorizontalScroll
BarVisibilityProperty
I n this Article
Edit
Identifies the ComputedHorizontalScrollBarVisibility dependency property.
public : static DependencyProperty ComputedHorizontalScrollBarVisibilityProperty { get; }
static DependencyProperty ComputedHorizontalScrollBarVisibilityProperty();
public static DependencyProperty ComputedHorizontalScrollBarVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the ComputedHorizontalScrollBarVisibility dependency property.
ScrollViewer.ComputedVerticalScrollBarVisibility Scroll
Viewer.ComputedVerticalScrollBarVisibility ScrollViewer.
ComputedVerticalScrollBarVisibility
I n this Article
Edit
Gets a value that indicates whether the vertical ScrollBar is visible.
public : Visibility ComputedVerticalScrollBarVisibility { get; }
Visibility ComputedVerticalScrollBarVisibility();
public Visibility ComputedVerticalScrollBarVisibility { get; }

Returns
Visibility
A Visibility that indicates whether the vertical scroll bar is visible. The default value is Visible.
ScrollViewer.ComputedVerticalScrollBarVisibilityProperty
ScrollViewer.ComputedVerticalScrollBarVisibilityProperty
ScrollViewer.ComputedVerticalScrollBarVisibilityProperty
I n this Article
Edit
Identifies the ComputedVerticalScrollBarVisibility dependency property.
public : static DependencyProperty ComputedVerticalScrollBarVisibilityProperty { get; }
static DependencyProperty ComputedVerticalScrollBarVisibilityProperty();
public static DependencyProperty ComputedVerticalScrollBarVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the ComputedVerticalScrollBarVisibility dependency property.
ScrollViewer.CurrentAnchor ScrollViewer.CurrentAnchor
ScrollViewer.CurrentAnchor
I n this Article
Edit
The currently chosen anchor element to use for scroll anchoring.
public : UIElement CurrentAnchor { get; }
UIElement CurrentAnchor();
public UIElement CurrentAnchor { get; }

Returns
UIElement
The most recently chosen UIElement for scroll anchoring after a layout pass, or null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
If there are no anchor candidates registered with the ScrollViewer or none have been chosen, then CurrentAnchor is
null.
ScrollViewer.DirectManipulationCompleted ScrollViewer.
DirectManipulationCompleted ScrollViewer.Direct
ManipulationCompleted
I n this Article
Edit
Occurs when any direct manipulation of the ScrollViewer finishes.
public : event EventHandler<Platform::Object> DirectManipulationCompleted
// Register
event_token DirectManipulationCompleted(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void DirectManipulationCompleted(event_token const& cookie) const;

// Revoke with event_revoker


DirectManipulationCompleted_revoker DirectManipulationCompleted(auto_revoke_t,
EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> DirectManipulationCompleted
ScrollViewer.DirectManipulationStarted ScrollViewer.
DirectManipulationStarted ScrollViewer.Direct
ManipulationStarted
I n this Article
Edit
Occurs when any direct manipulation of the ScrollViewer begins.
public : event EventHandler<Platform::Object> DirectManipulationStarted
// Register
event_token DirectManipulationStarted(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void DirectManipulationStarted(event_token const& cookie) const;

// Revoke with event_revoker


DirectManipulationStarted_revoker DirectManipulationStarted(auto_revoke_t,
EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> DirectManipulationStarted
ScrollViewer.ExtentHeight ScrollViewer.ExtentHeight
ScrollViewer.ExtentHeight
I n this Article
Edit
Gets the vertical size of all the scrollable content in the ScrollViewer.
public : double ExtentHeight { get; }
double ExtentHeight();
public double ExtentHeight { get; }

Returns
double
The vertical size of all the scrollable content in the ScrollViewer.

Remarks
The extent includes all the content in the ScrollViewer, whether visible or not. The viewport is the visible area of the
content.
ScrollViewer.ExtentHeightProperty ScrollViewer.Extent
HeightProperty ScrollViewer.ExtentHeightProperty
I n this Article
Edit
Identifier for the ExtentHeight dependency property.
public : static DependencyProperty ExtentHeightProperty { get; }
static DependencyProperty ExtentHeightProperty();
public static DependencyProperty ExtentHeightProperty { get; }

Returns
DependencyProperty
The identifier for the ExtentHeight dependency property.
ScrollViewer.ExtentWidth ScrollViewer.ExtentWidth Scroll
Viewer.ExtentWidth
I n this Article
Edit
Gets the horizontal size of all the scrollable content in the ScrollViewer.
public : double ExtentWidth { get; }
double ExtentWidth();
public double ExtentWidth { get; }

Returns
double
The horizontal size of all the scrollable content in the ScrollViewer.

Remarks
The extent includes all the content in the ScrollViewer, whether visible or not. The viewport is the visible area of the
content.
ScrollViewer.ExtentWidthProperty ScrollViewer.Extent
WidthProperty ScrollViewer.ExtentWidthProperty
I n this Article
Edit
Identifier for the ExtentWidth dependency property.
public : static DependencyProperty ExtentWidthProperty { get; }
static DependencyProperty ExtentWidthProperty();
public static DependencyProperty ExtentWidthProperty { get; }

Returns
DependencyProperty
The identifier for the ExtentWidth dependency property.
ScrollViewer.GetBringIntoViewOnFocusChange Scroll
Viewer.GetBringIntoViewOnFocusChange ScrollViewer.
GetBringIntoViewOnFocusChange
I n this Article
Edit
Gets the value of the BringIntoViewOnFocusChange dependency property /
ScrollViewer.BringIntoViewOnFocusChange XAML attached property from a specified element.

public : static Platform::Boolean GetBringIntoViewOnFocusChange(DependencyObject element)


static bool GetBringIntoViewOnFocusChange(DependencyObject element) const;
public static bool GetBringIntoViewOnFocusChange(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.

Remarks
For more info, see Remarks for the BringIntoViewOnFocusChange property.
ScrollViewer.GetCanContentRenderOutsideBounds Scroll
Viewer.GetCanContentRenderOutsideBounds Scroll
Viewer.GetCanContentRenderOutsideBounds
I n this Article
Edit
Gets the value of the CanContentRenderOutsideBounds dependency property /
ScrollViewer.CanContentRenderOutsideBounds XAML attached property on a specified element.

public : static Platform::Boolean GetCanContentRenderOutsideBounds(DependencyObject element)


static bool GetCanContentRenderOutsideBounds(DependencyObject element) const;
public static bool GetCanContentRenderOutsideBounds(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
For more info, see the CanContentRenderOutsideBounds property.
ScrollViewer.GetHorizontalScrollBarVisibility ScrollViewer.
GetHorizontalScrollBarVisibility ScrollViewer.Get
HorizontalScrollBarVisibility
I n this Article
Edit
Gets the value of the HorizontalScrollBarVisibility dependency property /
ScrollViewer.HorizontalScrollBarVisibility XAML attached property from a specified element.

public : static ScrollBarVisibility GetHorizontalScrollBarVisibility(DependencyObject element)


static ScrollBarVisibility GetHorizontalScrollBarVisibility(DependencyObject element) const;
public static ScrollBarVisibility GetHorizontalScrollBarVisibility(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
ScrollBarVisibility
The value of the property, as obtained from the property store.

Remarks
For more info, see Remarks for the HorizontalScrollBarVisibility property.
ScrollViewer.GetHorizontalScrollMode ScrollViewer.Get
HorizontalScrollMode ScrollViewer.GetHorizontalScroll
Mode
I n this Article
Edit
Gets the value of the HorizontalScrollMode dependency property / ScrollViewer.HorizontalScrollMode XAML
attached property from a specified element.

public : static ScrollMode GetHorizontalScrollMode(DependencyObject element)


static ScrollMode GetHorizontalScrollMode(DependencyObject element) const;
public static ScrollMode GetHorizontalScrollMode(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
ScrollMode
The value of the property, as obtained from the property store.

Remarks
For more info, see Remarks for the HorizontalScrollMode property.
ScrollViewer.GetIsDeferredScrollingEnabled ScrollViewer.
GetIsDeferredScrollingEnabled ScrollViewer.GetIs
DeferredScrollingEnabled
I n this Article
Edit
Gets the value of the IsDeferredScrollingEnabled dependency property /
ScrollViewer.IsDeferredScrollingInertiaEnabled XAML attached property from a specified element.

public : static Platform::Boolean GetIsDeferredScrollingEnabled(DependencyObject element)


static bool GetIsDeferredScrollingEnabled(DependencyObject element) const;
public static bool GetIsDeferredScrollingEnabled(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.

Remarks
For more info, see Remarks for the IsDeferredScrollingEnabled property.
ScrollViewer.GetIsHorizontalRailEnabled ScrollViewer.Get
IsHorizontalRailEnabled ScrollViewer.GetIsHorizontalRail
Enabled
I n this Article
Edit
Gets the value of the IsHorizontalRailEnabled dependency property / ScrollViewer.IsHorizontalRailEnabled
XAML attached property from a specified element.

public : static Platform::Boolean GetIsHorizontalRailEnabled(DependencyObject element)


static bool GetIsHorizontalRailEnabled(DependencyObject element) const;
public static bool GetIsHorizontalRailEnabled(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.

Remarks
For more info, see the IsHorizontalRailEnabled property.
ScrollViewer.GetIsHorizontalScrollChainingEnabled Scroll
Viewer.GetIsHorizontalScrollChainingEnabled Scroll
Viewer.GetIsHorizontalScrollChainingEnabled
I n this Article
Edit
Gets the value of the IsHorizontalScrollChainingEnabled dependency property /
ScrollViewer.IsHorizontalScrollChainingEnabled XAML attached property from a specified element.

public : static Platform::Boolean GetIsHorizontalScrollChainingEnabled(DependencyObject element)


static bool GetIsHorizontalScrollChainingEnabled(DependencyObject element) const;
public static bool GetIsHorizontalScrollChainingEnabled(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.

Remarks
For more info, see the IsHorizontalScrollChainingEnabled property.
ScrollViewer.GetIsScrollInertiaEnabled ScrollViewer.GetIs
ScrollInertiaEnabled ScrollViewer.GetIsScrollInertia
Enabled
I n this Article
Edit
Gets the value of the IsScrollInertiaEnabled dependency property / ScrollViewer.IsScrollInertiaEnabled XAML
attached property from a specified element.

public : static Platform::Boolean GetIsScrollInertiaEnabled(DependencyObject element)


static bool GetIsScrollInertiaEnabled(DependencyObject element) const;
public static bool GetIsScrollInertiaEnabled(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.

Remarks
For more info, see the IsScrollInertiaEnabled property.
ScrollViewer.GetIsVerticalRailEnabled ScrollViewer.GetIs
VerticalRailEnabled ScrollViewer.GetIsVerticalRailEnabled
I n this Article
Edit
Gets the value of the IsVerticalRailEnabled dependency property / ScrollViewer.IsVerticalRailEnabled XAML
attached property from a specified element.
public : static Platform::Boolean GetIsVerticalRailEnabled(DependencyObject element)
static bool GetIsVerticalRailEnabled(DependencyObject element) const;
public static bool GetIsVerticalRailEnabled(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.

Remarks
For more info, see the IsVerticalRailEnabled property.
ScrollViewer.GetIsVerticalScrollChainingEnabled Scroll
Viewer.GetIsVerticalScrollChainingEnabled ScrollViewer.
GetIsVerticalScrollChainingEnabled
I n this Article
Edit
Gets the value of the IsVerticalScrollChainingEnabled dependency property /
ScrollViewer.IsVerticalScrollChainingEnabled XAML attached property from a specified element.

public : static Platform::Boolean GetIsVerticalScrollChainingEnabled(DependencyObject element)


static bool GetIsVerticalScrollChainingEnabled(DependencyObject element) const;
public static bool GetIsVerticalScrollChainingEnabled(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.

Remarks
For more info, see the IsVerticalScrollChainingEnabled property.
ScrollViewer.GetIsZoomChainingEnabled ScrollViewer.
GetIsZoomChainingEnabled ScrollViewer.GetIsZoom
ChainingEnabled
I n this Article
Edit
Gets the value of the IsZoomChainingEnabled dependency property / ScrollViewer.IsZoomChainingEnabled XAML
attached property from a specified element.

public : static Platform::Boolean GetIsZoomChainingEnabled(DependencyObject element)


static bool GetIsZoomChainingEnabled(DependencyObject element) const;
public static bool GetIsZoomChainingEnabled(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.

Remarks
For more info, see the IsZoomChainingEnabled property.
ScrollViewer.GetIsZoomInertiaEnabled ScrollViewer.GetIs
ZoomInertiaEnabled ScrollViewer.GetIsZoomInertia
Enabled
I n this Article
Edit
Gets the value of the IsZoomInertiaEnabled dependency property / ScrollViewer.IsZoomInertiaEnabled XAML
attached property from a specified element.

public : static Platform::Boolean GetIsZoomInertiaEnabled(DependencyObject element)


static bool GetIsZoomInertiaEnabled(DependencyObject element) const;
public static bool GetIsZoomInertiaEnabled(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
bool
The value of the property, as obtained from the property store.

Remarks
For more info, see the IsZoomInertiaEnabled property.
ScrollViewer.GetVerticalScrollBarVisibility ScrollViewer.
GetVerticalScrollBarVisibility ScrollViewer.GetVertical
ScrollBarVisibility
I n this Article
Edit
Gets the value of the VerticalScrollBarVisibility dependency property / ScrollViewer.VerticalScrollBarVisibility
XAML attached property from a specified element.

public : static ScrollBarVisibility GetVerticalScrollBarVisibility(DependencyObject element)


static ScrollBarVisibility GetVerticalScrollBarVisibility(DependencyObject element) const;
public static ScrollBarVisibility GetVerticalScrollBarVisibility(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
ScrollBarVisibility
The value of the property, as obtained from the property store.

Remarks
For more info, see the VerticalScrollBarVisibility property.
ScrollViewer.GetVerticalScrollMode ScrollViewer.Get
VerticalScrollMode ScrollViewer.GetVerticalScrollMode
I n this Article
Edit
Gets the value of the VerticalScrollMode dependency property / ScrollViewer.VerticalScrollMode XAML attached
property from a specified element.
public : static ScrollMode GetVerticalScrollMode(DependencyObject element)
static ScrollMode GetVerticalScrollMode(DependencyObject element) const;
public static ScrollMode GetVerticalScrollMode(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
ScrollMode
The value of the property, as obtained from the property store.

Remarks
For more info, see the VerticalScrollMode property.
ScrollViewer.GetZoomMode ScrollViewer.GetZoomMode
ScrollViewer.GetZoomMode
I n this Article
Edit
Gets the value of the ZoomMode dependency property / ScrollViewer.ZoomMode XAML attached property from a
specified element.
public : static ZoomMode GetZoomMode(DependencyObject element)
static ZoomMode GetZoomMode(DependencyObject element) const;
public static ZoomMode GetZoomMode(DependencyObject element)

Parameters
element DependencyObject
The element from which the property value is read.
Returns
ZoomMode
The value of the property, as obtained from the property store.

Remarks
For more info, see the ZoomMode property.
ScrollViewer.HorizontalAnchorRatio ScrollViewer.
HorizontalAnchorRatio ScrollViewer.HorizontalAnchor
Ratio
I n this Article
Edit
Determines the horizontal position of the ScrollViewer's anchor point with respect to the viewport. By default, the
ScrollViewer selects an element as its CurrentAnchor by identifying the element in its viewport nearest to the anchor
point.
public : double HorizontalAnchorRatio { get; set; }
double HorizontalAnchorRatio();

void HorizontalAnchorRatio(double horizontalanchorratio);


public double HorizontalAnchorRatio { get; set; }

Returns
double
A normalized value (0.0f to 1.0f). The default is 0.0f.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
A value of 0.0 represents the left-most point within the viewport. A value of 1.0f represents the right-most point within
the viewport. A value of 0.5f represents the center-most point within the viewport.
When the value is 0.0 or 1.0 the ScrollViewer applies special behavior when the scroll position is at the start or end of
the scrollable area.
ScrollViewer.HorizontalAnchorRatioProperty Scroll
Viewer.HorizontalAnchorRatioProperty ScrollViewer.
HorizontalAnchorRatioProperty
I n this Article
Edit
Identifies the HorizontalAnchorRatio dependency property.
public : static DependencyProperty HorizontalAnchorRatioProperty { get; }
static DependencyProperty HorizontalAnchorRatioProperty();
public static DependencyProperty HorizontalAnchorRatioProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalAnchorRatio dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ScrollViewer.HorizontalOffset ScrollViewer.Horizontal
Offset ScrollViewer.HorizontalOffset
I n this Article
Edit
Gets the distance the content has been scrolled horizontally.
public : double HorizontalOffset { get; }
double HorizontalOffset();
public double HorizontalOffset { get; }

Returns
double
The distance the content has been scrolled horizontally.
ScrollViewer.HorizontalOffsetProperty ScrollViewer.
HorizontalOffsetProperty ScrollViewer.HorizontalOffset
Property
I n this Article
Edit
Identifies the HorizontalOffset dependency property.
public : static DependencyProperty HorizontalOffsetProperty { get; }
static DependencyProperty HorizontalOffsetProperty();
public static DependencyProperty HorizontalOffsetProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalOffset dependency property.
ScrollViewer.HorizontalScrollBarVisibility ScrollViewer.
HorizontalScrollBarVisibility ScrollViewer.HorizontalScroll
BarVisibility
I n this Article
Edit
Gets or sets a value that indicates whether a horizontal ScrollBar should be displayed.
public : ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }
ScrollBarVisibility HorizontalScrollBarVisibility();

void HorizontalScrollBarVisibility(ScrollBarVisibility horizontalscrollbarvisibility);


public ScrollBarVisibility HorizontalScrollBarVisibility { get; set; }

<ScrollViewer HorizontalScrollBarVisibility="scrollBarVisibilityMemberName"/>
-or-
<object ScrollViewer.HorizontalScrollBarVisibility="scrollBarVisibilityMemberName"/>

Returns
ScrollBarVisibility
A ScrollBarVisibility value that indicates whether a horizontal ScrollBar should be displayed. The default value is
Disabled.

Remarks
For XAML usage, HorizontalScrollBarVisibility can either be an attribute on an explicit ScrollViewer element, or a
ScrollViewer.HorizontalScrollBarVisibility attached property usage on an element that is a child of a control
that supports scrollview implicitly in its template. Controls with a ScrollViewer as part of their composition typically
use template binding such that setting the attached property at the level of the control will change the scroll behavior
of the ScrollViewer part within the control. Otherwise, it may be necessary to replace the template in order to change
the scroll behavior of a ScrollViewer part.
ScrollViewer.HorizontalScrollBarVisibilityProperty Scroll
Viewer.HorizontalScrollBarVisibilityProperty ScrollViewer.
HorizontalScrollBarVisibilityProperty
I n this Article
Edit
Identifies the HorizontalScrollBarVisibility dependency property.
public : static DependencyProperty HorizontalScrollBarVisibilityProperty { get; }
static DependencyProperty HorizontalScrollBarVisibilityProperty();
public static DependencyProperty HorizontalScrollBarVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalScrollBarVisibility dependency property.
ScrollViewer.HorizontalScrollMode ScrollViewer.
HorizontalScrollMode ScrollViewer.HorizontalScrollMode
I n this Article
Edit
Gets or sets a value that determines how manipulation input influences scrolling behavior on the horizontal axis.
public : ScrollMode HorizontalScrollMode { get; set; }
ScrollMode HorizontalScrollMode();

void HorizontalScrollMode(ScrollMode horizontalscrollmode);


public ScrollMode HorizontalScrollMode { get; set; }

<ScrollViewer HorizontalScrollMode="scrollModeMemberName" />


-or-
<object ScrollViewer.HorizontalScrollMode="scrollModeMemberName"/>

Returns
ScrollMode
A value of the enumeration. The typical default (as set through the default template, not class initialization) is Enabled.

Remarks
Scrolling behavior can also be set through a ScrollViewer.HorizontalScrollMode XAML attached property usage, or
by calling SetHorizontalScrollMode. This is for cases where the ScrollViewer is implicit, such as when the ScrollViewer
exists in the default template for a GridView, and you want to be able to influence the scrolling behavior without
accessing template parts. Controls with a ScrollViewer as part of their composition typically use template binding such
that setting the attached property at the level of the control will change the scroll behavior of the ScrollViewer part
within the control. Otherwise, it may be necessary to replace the template in order to change the scroll behavior of a
ScrollViewer part.
ScrollViewer.HorizontalScrollModeProperty ScrollViewer.
HorizontalScrollModeProperty ScrollViewer.Horizontal
ScrollModeProperty
I n this Article
Edit
Identifies the HorizontalScrollMode dependency property.
public : static DependencyProperty HorizontalScrollModeProperty { get; }
static DependencyProperty HorizontalScrollModeProperty();
public static DependencyProperty HorizontalScrollModeProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalScrollMode dependency property.
ScrollViewer.HorizontalSnapPointsAlignment Scroll
Viewer.HorizontalSnapPointsAlignment ScrollViewer.
HorizontalSnapPointsAlignment
I n this Article
Edit
Gets or sets a value that indicates how the existing snap points are horizontally aligned versus the initial viewport.
public : SnapPointsAlignment HorizontalSnapPointsAlignment { get; set; }
SnapPointsAlignment HorizontalSnapPointsAlignment();

void HorizontalSnapPointsAlignment(SnapPointsAlignment horizontalsnappointsalignment);


public SnapPointsAlignment HorizontalSnapPointsAlignment { get; set; }

<ScrollViewer HorizontalSnapPointsAlignment="snapPointsAlignmentMemberName" />

Returns
SnapPointsAlignment
A value of the enumeration.
ScrollViewer.HorizontalSnapPointsAlignmentProperty
ScrollViewer.HorizontalSnapPointsAlignmentProperty
ScrollViewer.HorizontalSnapPointsAlignmentProperty
I n this Article
Edit
Identifies the HorizontalSnapPointsAlignment dependency property.
public : static DependencyProperty HorizontalSnapPointsAlignmentProperty { get; }
static DependencyProperty HorizontalSnapPointsAlignmentProperty();
public static DependencyProperty HorizontalSnapPointsAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalSnapPointsAlignment dependency property.
ScrollViewer.HorizontalSnapPointsType ScrollViewer.
HorizontalSnapPointsType ScrollViewer.HorizontalSnap
PointsType
I n this Article
Edit
Gets or sets a value that declares how manipulation behavior reacts to the snap points along the horizontal axis.
public : SnapPointsType HorizontalSnapPointsType { get; set; }
SnapPointsType HorizontalSnapPointsType();

void HorizontalSnapPointsType(SnapPointsType horizontalsnappointstype);


public SnapPointsType HorizontalSnapPointsType { get; set; }

<ScrollViewer HorizontalSnapPointsType="snapPointsTypeMemberName" />

Returns
SnapPointsType
A value of the enumeration. The default is None but might be set through a control template.

Examples
This XAML is from the default template for a Hub control. A Hub has a ScrollViewer part that surrounds an
ItemsStackPanel for its content. Hub uses the Optional value for its snapping behavior in both dimensions (although
VerticalScrollMode is disabled in starting visual states) and disables ZoomMode. Note how the
SnapPointsAlignment properties are also set as attributes here.

<ControlTemplate TargetType="Hub">
...
<ScrollViewer x:Name="ScrollViewer"
Grid.RowSpan="2"
HorizontalScrollMode="Auto"
HorizontalScrollBarVisibility="Auto"
VerticalScrollMode="Disabled"
VerticalScrollBarVisibility="Disabled"
HorizontalSnapPointsAlignment="Near"
HorizontalSnapPointsType="Optional"
VerticalSnapPointsAlignment="Near"
VerticalSnapPointsType="Optional"
ZoomMode="Disabled">
<ItemsStackPanel x:Name="Panel"
Orientation="{TemplateBinding Orientation}"
CacheLength="20" />
</ScrollViewer>
...
</ControlTemplate>

Remarks
For panning actions, there are often natural stopping places. Snap points provide a way to indicate where these places
are. Then, when a user swipes, the manipulation result favors that natural point using behavior as expressed by a
SnapPointsType value.
**Proximity points (Optional and OptionalSingle): ** When a user is going to naturally stop the manipulation in the
proximity of a snap point, proximity points help the user land at the natural stopping place. Because the user has to
land in proximity to the snap point to cause it to stop there, the user will sometimes have to perform another swipe to
reach a snap point.
**Mandatory snap points (Mandatory and MandatorySingle): ** In contrast to proximity, mandatory snap points
ensure that the content is adjusted to always land on a snap point. Even if the user releases the manipulation halfway
between two snap-points, it will always move to one of the snap points.
To see the effects of snap points on ScrollViewer behavior yourself, get the XAML scrolling, panning and zooming
sample. Run the sample on a touch device (not the simulator). Try out the SnapPointsType values when you view the
"Panning with snap-points" example page of the sample.
To learn more about the swipe gesture and panning, see the "Panning behaviors" section of Guidelines for panning.
The default value of None is the default of the enumeration. If it's set, this property is often set as an attribute in a
XAML template part, or as a style Setter. Each control potentially sets this differently. Getting the value at run time will
provide the value that came from applied styles and templates.
See SnapPointsType
Also XAML scrolling, panning and zooming sample
ScrollViewer.HorizontalSnapPointsTypeProperty Scroll
Viewer.HorizontalSnapPointsTypeProperty ScrollViewer.
HorizontalSnapPointsTypeProperty
I n this Article
Edit
Identifies the HorizontalSnapPointsType dependency property.
public : static DependencyProperty HorizontalSnapPointsTypeProperty { get; }
static DependencyProperty HorizontalSnapPointsTypeProperty();
public static DependencyProperty HorizontalSnapPointsTypeProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalSnapPointsType dependency property.
ScrollViewer.InvalidateScrollInfo ScrollViewer.Invalidate
ScrollInfo ScrollViewer.InvalidateScrollInfo
I n this Article
Edit
Called when the value of properties that describe the size and location of the scroll area change.
public : void InvalidateScrollInfo()
void InvalidateScrollInfo() const;
public void InvalidateScrollInfo()
ScrollViewer.IsDeferredScrollingEnabled ScrollViewer.Is
DeferredScrollingEnabled ScrollViewer.IsDeferred
ScrollingEnabled
I n this Article
Edit
Gets or sets a value that determines the deferred scrolling behavior for a ScrollViewer.
public : Platform::Boolean IsDeferredScrollingEnabled { get; set; }
bool IsDeferredScrollingEnabled();

void IsDeferredScrollingEnabled(bool isdeferredscrollingenabled);


public bool IsDeferredScrollingEnabled { get; set; }

<ScrollViewer IsDeferredScrollingEnabled="bool" />


-or-
<object ScrollViewer.IsDeferredScrollingEnabled="bool"/>

Returns
bool
true if deferred scrolling should occur; otherwise, false.

Remarks
Deferred scrolling behavior means that the view does not scroll until a user action is completed. For example, if a
region scrolls when the user manipulates a thumb control, and IsDeferredScrollingEnabled is true, the scroll does not
occur until the touch point on the thumb is released. In contrast, if IsDeferredScrollingEnabled is false, the region
scrolls any time that the touch point selection point along the slider track is moved.
For XAML usage, IsDeferredScrollingEnabled can either be an attribute on an explicit ScrollViewer element, or a
ScrollViewer.IsDeferredScrollingEnabled attached property usage on an element that is a child of a control that
supports scrollview implicitly in its template.
ScrollViewer.IsDeferredScrollingEnabledProperty Scroll
Viewer.IsDeferredScrollingEnabledProperty ScrollViewer.
IsDeferredScrollingEnabledProperty
I n this Article
Edit
Identifies the IsDeferredScrollingEnabled dependency property.
public : static DependencyProperty IsDeferredScrollingEnabledProperty { get; }
static DependencyProperty IsDeferredScrollingEnabledProperty();
public static DependencyProperty IsDeferredScrollingEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsDeferredScrollingEnabled dependency property.
ScrollViewer.IsHorizontalRailEnabled ScrollViewer.Is
HorizontalRailEnabled ScrollViewer.IsHorizontalRail
Enabled
I n this Article
Edit
Gets or sets a value that indicates whether the scroll rail is enabled for the horizontal axis.
public : Platform::Boolean IsHorizontalRailEnabled { get; set; }
bool IsHorizontalRailEnabled();

void IsHorizontalRailEnabled(bool ishorizontalrailenabled);


public bool IsHorizontalRailEnabled { get; set; }

<ScrollViewer IsHorizontalRailEnabled="bool" />


-or-
<object ScrollViewer.IsHorizontalRailEnabled="bool"/>

Returns
bool
True to enable the horizontal scroll rail; otherwise, false. The default is true.
ScrollViewer.IsHorizontalRailEnabledProperty Scroll
Viewer.IsHorizontalRailEnabledProperty ScrollViewer.Is
HorizontalRailEnabledProperty
I n this Article
Edit
Identifies the IsHorizontalRailEnabled dependency property.
public : static DependencyProperty IsHorizontalRailEnabledProperty { get; }
static DependencyProperty IsHorizontalRailEnabledProperty();
public static DependencyProperty IsHorizontalRailEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsHorizontalRailEnabled dependency property.
ScrollViewer.IsHorizontalScrollChainingEnabled Scroll
Viewer.IsHorizontalScrollChainingEnabled ScrollViewer.Is
HorizontalScrollChainingEnabled
I n this Article
Edit
Gets or sets a value that indicates whether scroll chaining is enabled from this child to its parent, for the horizontal axis.
public : Platform::Boolean IsHorizontalScrollChainingEnabled { get; set; }
bool IsHorizontalScrollChainingEnabled();

void IsHorizontalScrollChainingEnabled(bool ishorizontalscrollchainingenabled);


public bool IsHorizontalScrollChainingEnabled { get; set; }

<ScrollViewer IsHorizontalScrollChainingEnabled="bool" />


-or-
<object ScrollViewer.IsHorizontalScrollChainingEnabled="bool"/>

Returns
bool
true to enable horizontal scroll chaining from child to parent; otherwise, false.

Remarks
For XAML usage, IsHorizontalScrollChainingEnabled can either be an attribute on an explicit ScrollViewer element, or
a ScrollViewer.IsHorizontalScrollChainingEnabled attached property usage on an element that is a child of a
control that supports scrollview implicitly in its template.
ScrollViewer.IsHorizontalScrollChainingEnabledProperty
ScrollViewer.IsHorizontalScrollChainingEnabledProperty
ScrollViewer.IsHorizontalScrollChainingEnabledProperty
I n this Article
Edit
Identifies the IsHorizontalScrollChainingEnabled dependency property.
public : static DependencyProperty IsHorizontalScrollChainingEnabledProperty { get; }
static DependencyProperty IsHorizontalScrollChainingEnabledProperty();
public static DependencyProperty IsHorizontalScrollChainingEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsHorizontalScrollChainingEnabled dependency property.
ScrollViewer.IsScrollInertiaEnabled ScrollViewer.IsScroll
InertiaEnabled ScrollViewer.IsScrollInertiaEnabled
I n this Article
Edit
Gets or sets a value that indicates whether scroll actions should include inertia in their behavior and value.
public : Platform::Boolean IsScrollInertiaEnabled { get; set; }
bool IsScrollInertiaEnabled();

void IsScrollInertiaEnabled(bool isscrollinertiaenabled);


public bool IsScrollInertiaEnabled { get; set; }

<ScrollViewer IsScrollInertiaEnabled="bool" />


-or-
<object ScrollViewer.IsScrollInertiaEnabled="bool"/>

Returns
bool
true if scroll actions should include inertia in their behavior and value; otherwise, false.

Remarks
For XAML usage, IsScrollInertiaEnabled can either be an attribute on an explicit ScrollViewer element, or a
ScrollViewer.IsScrollInertiaEnabled attached property usage on an element that is a child of a control that supports
scrollview implicitly in its template.
ScrollViewer.IsScrollInertiaEnabledProperty ScrollViewer.
IsScrollInertiaEnabledProperty ScrollViewer.IsScrollInertia
EnabledProperty
I n this Article
Edit
Identifies the IsScrollInertiaEnabled dependency property.
public : static DependencyProperty IsScrollInertiaEnabledProperty { get; }
static DependencyProperty IsScrollInertiaEnabledProperty();
public static DependencyProperty IsScrollInertiaEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsScrollInertiaEnabled dependency property.
ScrollViewer.IsVerticalRailEnabled ScrollViewer.IsVertical
RailEnabled ScrollViewer.IsVerticalRailEnabled
I n this Article
Edit
Gets or sets a value that indicates whether the scroll rail is enabled for the vertical axis.
public : Platform::Boolean IsVerticalRailEnabled { get; set; }
bool IsVerticalRailEnabled();

void IsVerticalRailEnabled(bool isverticalrailenabled);


public bool IsVerticalRailEnabled { get; set; }

<ScrollViewer IsVerticalRailEnabled="bool" />


-or-
<object ScrollViewer.IsVerticalRailEnabled="bool"/>

Returns
bool
True to enable the vertical scroll rail; otherwise, false. The default is true.
ScrollViewer.IsVerticalRailEnabledProperty ScrollViewer.Is
VerticalRailEnabledProperty ScrollViewer.IsVerticalRail
EnabledProperty
I n this Article
Edit
Identifies the IsVerticalRailEnabled dependency property.
public : static DependencyProperty IsVerticalRailEnabledProperty { get; }
static DependencyProperty IsVerticalRailEnabledProperty();
public static DependencyProperty IsVerticalRailEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsVerticalRailEnabled dependency property.
ScrollViewer.IsVerticalScrollChainingEnabled ScrollViewer.
IsVerticalScrollChainingEnabled ScrollViewer.IsVertical
ScrollChainingEnabled
I n this Article
Edit
Gets or sets a value that indicates whether scroll chaining is enabled from this child to its parent, for the vertical axis.
public : Platform::Boolean IsVerticalScrollChainingEnabled { get; set; }
bool IsVerticalScrollChainingEnabled();

void IsVerticalScrollChainingEnabled(bool isverticalscrollchainingenabled);


public bool IsVerticalScrollChainingEnabled { get; set; }

<ScrollViewer IsVerticalScrollChainingEnabled="bool" />


-or-
<object ScrollViewer.IsVerticalScrollChainingEnabled="bool"/>

Returns
bool
true to enable vertical scroll chaining from child to parent; otherwise, false.

Remarks
For XAML usage, IsVerticalScrollChainingEnabled can either be an attribute on an explicit ScrollViewer element, or a
ScrollViewer.IsVerticalScrollChainingEnabled attached property usage on an element that is a child of a control
that supports scrollview implicitly in its template.
ScrollViewer.IsVerticalScrollChainingEnabledProperty
ScrollViewer.IsVerticalScrollChainingEnabledProperty
ScrollViewer.IsVerticalScrollChainingEnabledProperty
I n this Article
Edit
Identifies the IsVerticalScrollChainingEnabled dependency property.
public : static DependencyProperty IsVerticalScrollChainingEnabledProperty { get; }
static DependencyProperty IsVerticalScrollChainingEnabledProperty();
public static DependencyProperty IsVerticalScrollChainingEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsVerticalScrollChainingEnabled dependency property.
ScrollViewer.IsZoomChainingEnabled ScrollViewer.Is
ZoomChainingEnabled ScrollViewer.IsZoomChaining
Enabled
I n this Article
Edit
Gets or sets a value that indicates whether zoom chaining is enabled from this child to its parent.
public : Platform::Boolean IsZoomChainingEnabled { get; set; }
bool IsZoomChainingEnabled();

void IsZoomChainingEnabled(bool iszoomchainingenabled);


public bool IsZoomChainingEnabled { get; set; }

<ScrollViewer IsZoomChainingEnabled="bool" />


-or-
<object ScrollViewer.IsZoomChainingEnabled="bool"/>

Returns
bool
true to enable zoom chaining from child to parent; otherwise, false.

Remarks
For XAML usage, IsZoomChainingEnabled can either be an attribute on an explicit ScrollViewer element, or a
ScrollViewer.IsZoomChainingEnabled attached property usage on an element that is a child of a control that
supports scrollview implicitly in its template.
ScrollViewer.IsZoomChainingEnabledProperty Scroll
Viewer.IsZoomChainingEnabledProperty ScrollViewer.Is
ZoomChainingEnabledProperty
I n this Article
Edit
Identifies the IsZoomChainingEnabled dependency property.
public : static DependencyProperty IsZoomChainingEnabledProperty { get; }
static DependencyProperty IsZoomChainingEnabledProperty();
public static DependencyProperty IsZoomChainingEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsZoomChainingEnabled dependency property.
ScrollViewer.IsZoomInertiaEnabled ScrollViewer.IsZoom
InertiaEnabled ScrollViewer.IsZoomInertiaEnabled
I n this Article
Edit
Gets or sets a value that indicates whether zoom actions should include inertia in their behavior and value.
public : Platform::Boolean IsZoomInertiaEnabled { get; set; }
bool IsZoomInertiaEnabled();

void IsZoomInertiaEnabled(bool iszoominertiaenabled);


public bool IsZoomInertiaEnabled { get; set; }

<ScrollViewer IsZoomInertiaEnabled="bool" />


-or-
<object ScrollViewer.IsZoomInertiaEnabled="bool"/>

Returns
bool
true if zoom actions should include inertia in their behavior and value; otherwise, false.

Remarks
For XAML usage, IsZoomInertiaEnabled can either be an attribute on an explicit ScrollViewer element, or a
ScrollViewer.IsZoomInertiaEnabled attached property usage on an element that is a child of a control that
supports scrollview implicitly in its template.
ScrollViewer.IsZoomInertiaEnabledProperty ScrollViewer.
IsZoomInertiaEnabledProperty ScrollViewer.IsZoom
InertiaEnabledProperty
I n this Article
Edit
Identifies the IsZoomInertiaEnabled dependency property.
public : static DependencyProperty IsZoomInertiaEnabledProperty { get; }
static DependencyProperty IsZoomInertiaEnabledProperty();
public static DependencyProperty IsZoomInertiaEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsZoomInertiaEnabled dependency property.
ScrollViewer.LeftHeader ScrollViewer.LeftHeader Scroll
Viewer.LeftHeader
I n this Article
Edit
Gets or sets the content of the left header.
public : UIElement LeftHeader { get; set; }
UIElement LeftHeader();

void LeftHeader(UIElement leftheader);


public UIElement LeftHeader { get; set; }

<ScrollViewer>
<ScrollViewer.LeftHeader>headerObject</ScrollViewer.LeftHeader>
</ScrollViewer>

Returns
UIElement
The content of the left header.

Remarks
The LeftHeader, TopHeader, and TopLeftHeader properties can be set only when ScrollViewer content's
HorizontalAlignment is Left and VerticalAlignment is Top.
The left header scrolls vertically, but not horizontally.
ScrollViewer.LeftHeaderProperty ScrollViewer.LeftHeader
Property ScrollViewer.LeftHeaderProperty
I n this Article
Edit
Identifies the LeftHeader dependency property.
public : static DependencyProperty LeftHeaderProperty { get; }
static DependencyProperty LeftHeaderProperty();
public static DependencyProperty LeftHeaderProperty { get; }

Returns
DependencyProperty
The identifier for the LeftHeader dependency property.
ScrollViewer.MaxZoomFactor ScrollViewer.MaxZoom
Factor ScrollViewer.MaxZoomFactor
I n this Article
Edit
Gets or sets a value that indicates the maximum permitted run-time value of ZoomFactor.
public : float MaxZoomFactor { get; set; }
float MaxZoomFactor();

void MaxZoomFactor(float maxzoomfactor);


public float MaxZoomFactor { get; set; }

<ScrollViewer MaxZoomFactor="single" />

Returns
float
The maximum permitted run-time value of ZoomFactor. The default is 10.
ScrollViewer.MaxZoomFactorProperty ScrollViewer.Max
ZoomFactorProperty ScrollViewer.MaxZoomFactor
Property
I n this Article
Edit
Identifies the MaxZoomFactor dependency property.
public : static DependencyProperty MaxZoomFactorProperty { get; }
static DependencyProperty MaxZoomFactorProperty();
public static DependencyProperty MaxZoomFactorProperty { get; }

Returns
DependencyProperty
The identifier for the MaxZoomFactor dependency property.
ScrollViewer.MinZoomFactor ScrollViewer.MinZoom
Factor ScrollViewer.MinZoomFactor
I n this Article
Edit
Gets or sets a value that indicates the minimum permitted run-time value of ZoomFactor.
public : float MinZoomFactor { get; set; }
float MinZoomFactor();

void MinZoomFactor(float minzoomfactor);


public float MinZoomFactor { get; set; }

<ScrollViewer MinZoomFactor="single" />

Returns
float
The minimum permitted run-time value of ZoomFactor. The default is 0.1.
ScrollViewer.MinZoomFactorProperty ScrollViewer.Min
ZoomFactorProperty ScrollViewer.MinZoomFactor
Property
I n this Article
Edit
Identifies the MinZoomFactor dependency property.
public : static DependencyProperty MinZoomFactorProperty { get; }
static DependencyProperty MinZoomFactorProperty();
public static DependencyProperty MinZoomFactorProperty { get; }

Returns
DependencyProperty
The identifier for the MinZoomFactor dependency property.
ScrollViewer.ReduceViewportForCoreInputView
Occlusions ScrollViewer.ReduceViewportForCoreInput
ViewOcclusions ScrollViewer.ReduceViewportForCore
InputViewOcclusions
I n this Article
Edit
Gets or sets a value that indicates whether the ScrollViewer should try to adjust its content to keep it visible when a
docked CoreInputView occludes part of it.
public : Platform::Boolean ReduceViewportForCoreInputViewOcclusions { get; set; }
bool ReduceViewportForCoreInputViewOcclusions();

void ReduceViewportForCoreInputViewOcclusions(bool reduceviewportforcoreinputviewocclusions);


public bool ReduceViewportForCoreInputViewOcclusions { get; set; }

Returns
bool
true if the ScrollViewer should try to adjust its content; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
When this feature is enabled and a docked CoreInputView covers part of the ScrollViewer control, the ScrollViewer
reduces the space available to its content according to the size and location of the CoreInputView. Then the
ScrollViewer, as in any other case where the content is constrained, allows the user to pan/scroll the content. Also, any
time a text edit control gets focus, it automatically brings itself into view, so the user isn't required to manually pan.
This property defaults to false, and it's typically not necessary for you to set it in your app. XAML maintains a
ScrollViewer internally with this feature enabled, and your window content is displayed in this ScrollViewer. That is,
Window.Current.Content is automatically parented to a ScrollViewer that has this feature enabled.
ScrollViewer.ReduceViewportForCoreInputView
OcclusionsProperty ScrollViewer.ReduceViewportForCore
InputViewOcclusionsProperty ScrollViewer.Reduce
ViewportForCoreInputViewOcclusionsProperty
I n this Article
Edit
Identifies the ReduceViewportForCoreInputViewOcclusions dependency property.
public : static DependencyProperty ReduceViewportForCoreInputViewOcclusionsProperty { get; }
static DependencyProperty ReduceViewportForCoreInputViewOcclusionsProperty();
public static DependencyProperty ReduceViewportForCoreInputViewOcclusionsProperty { get; }

Returns
DependencyProperty
The identifier for the ReduceViewportForCoreInputViewOcclusions dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ScrollViewer.RegisterAnchorCandidate ScrollViewer.
RegisterAnchorCandidate ScrollViewer.RegisterAnchor
Candidate
I n this Article
Edit
Registers a UIElement as a potential scroll anchor.
public : void RegisterAnchorCandidate(UIElement element)
void RegisterAnchorCandidate(UIElement element) const;
public void RegisterAnchorCandidate(UIElement element)

Parameters
element UIElement
A UIElement within the subtree of the ScrollViewer.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
When an element has CanBeScrollAnchor set to true the framework locates the first IScrollAnchorProvider in that
element's chain of ancestors and automatically calls its RegisterAnchorCandidate method. This occurs both when the
property is set on an existing element or an element is added to the live tree with the property already set.
Similarly, when the property is set to false (or an element is removed from the visual tree with the property set to
true), the framework calls the UnregisterAnchorCandidate on the first IScrollAnchorProvider.
ScrollViewer.ScrollableHeight ScrollViewer.Scrollable
Height ScrollViewer.ScrollableHeight
I n this Article
Edit
Gets a value that represents the vertical size of the area that can be scrolled; the difference between the height of the
extent and the height of the viewport.
public : double ScrollableHeight { get; }
double ScrollableHeight();
public double ScrollableHeight { get; }

Returns
double
The vertical size of the area that can be scrolled. This property has no default value.
ScrollViewer.ScrollableHeightProperty ScrollViewer.
ScrollableHeightProperty ScrollViewer.ScrollableHeight
Property
I n this Article
Edit
Identifies the ScrollableHeight dependency property.
public : static DependencyProperty ScrollableHeightProperty { get; }
static DependencyProperty ScrollableHeightProperty();
public static DependencyProperty ScrollableHeightProperty { get; }

Returns
DependencyProperty
The identifier for the ScrollableHeight dependency property.
ScrollViewer.ScrollableWidth ScrollViewer.Scrollable
Width ScrollViewer.ScrollableWidth
I n this Article
Edit
Gets a value that represents the horizontal size of the area that can be scrolled; the difference between the width of the
extent and the width of the viewport.
public : double ScrollableWidth { get; }
double ScrollableWidth();
public double ScrollableWidth { get; }

Returns
double
The horizontal size of the area that can be scrolled. This property has no default value.
ScrollViewer.ScrollableWidthProperty ScrollViewer.
ScrollableWidthProperty ScrollViewer.ScrollableWidth
Property
I n this Article
Edit
Identifies the ScrollableWidth dependency property.
public : static DependencyProperty ScrollableWidthProperty { get; }
static DependencyProperty ScrollableWidthProperty();
public static DependencyProperty ScrollableWidthProperty { get; }

Returns
DependencyProperty
The identifier for the ScrollableWidth dependency property.
ScrollViewer.ScrollToHorizontalOffset ScrollViewer.Scroll
ToHorizontalOffset ScrollViewer.ScrollToHorizontalOffset
I n this Article
Edit
Note

ScrollToHorizontalOffset may be altered or unavailable for releases after Windows 8.1. Instead, use ChangeView.
Scrolls the content that is within the ScrollViewer to the specified horizontal offset position.
public : void ScrollToHorizontalOffset(double offset)
void ScrollToHorizontalOffset(double offset) const;
public void ScrollToHorizontalOffset(Double offset)

Parameters
offset Double
The position that the content scrolls to.
Attributes DeprecatedAttribute
ScrollViewer.ScrollToVerticalOffset ScrollViewer.ScrollTo
VerticalOffset ScrollViewer.ScrollToVerticalOffset
I n this Article
Edit
Note

ScrollToVerticalOffset may be altered or unavailable for releases after Windows 8.1. Instead, use ChangeView.
Scrolls the content that is within the ScrollViewer to the specified vertical offset position.
public : void ScrollToVerticalOffset(double offset)
void ScrollToVerticalOffset(double offset) const;
public void ScrollToVerticalOffset(Double offset)

Parameters
offset Double
The position that the content scrolls to.
Attributes DeprecatedAttribute
ScrollViewer ScrollViewer ScrollViewer
I n this Article
Edit
Initializes a new instance of the ScrollViewer class.

public : ScrollViewer()
ScrollViewer() const;
public ScrollViewer()
ScrollViewer.SetBringIntoViewOnFocusChange Scroll
Viewer.SetBringIntoViewOnFocusChange ScrollViewer.Set
BringIntoViewOnFocusChange
I n this Article
Edit
Sets the value of the BringIntoViewOnFocusChange dependency property /
ScrollViewer.BringIntoViewOnFocusChange XAML attached property on a specified element.

public : static void SetBringIntoViewOnFocusChange(DependencyObject element, bool


bringIntoViewOnFocusChange)
static void SetBringIntoViewOnFocusChange(DependencyObject element, bool bringIntoViewOnFocusChange)
const;
public static void SetBringIntoViewOnFocusChange(DependencyObject element, Boolean
bringIntoViewOnFocusChange)

Parameters
element DependencyObject
The element on which to set the property value.
bringIntoViewOnFocusChange Boolean
The value to set.

Remarks
For more info, see Remarks for the BringIntoViewOnFocusChange property.
ScrollViewer.SetCanContentRenderOutsideBounds Scroll
Viewer.SetCanContentRenderOutsideBounds Scroll
Viewer.SetCanContentRenderOutsideBounds
I n this Article
Edit
Sets the value of the CanContentRenderOutsideBounds dependency property /
ScrollViewer.CanContentRenderOutsideBounds XAML attached property on a specified element.

public : static void SetCanContentRenderOutsideBounds(DependencyObject element, bool


canContentRenderOutsideBounds)
static void SetCanContentRenderOutsideBounds(DependencyObject element, bool
canContentRenderOutsideBounds) const;
public static void SetCanContentRenderOutsideBounds(DependencyObject element, Boolean
canContentRenderOutsideBounds)

Parameters
element DependencyObject
The element on which to set the property value.
canContentRenderOutsideBounds Boolean
The value to set.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
For more info, see the CanContentRenderOutsideBounds property.
ScrollViewer.SetHorizontalScrollBarVisibility ScrollViewer.
SetHorizontalScrollBarVisibility ScrollViewer.Set
HorizontalScrollBarVisibility
I n this Article
Edit
Sets the value of the HorizontalScrollBarVisibility dependency property /
ScrollViewer.HorizontalScrollBarVisibility XAML attached property on a specified element.

public : static void SetHorizontalScrollBarVisibility(DependencyObject element, ScrollBarVisibility


horizontalScrollBarVisibility)
static void SetHorizontalScrollBarVisibility(DependencyObject element, ScrollBarVisibility
horizontalScrollBarVisibility) const;
public static void SetHorizontalScrollBarVisibility(DependencyObject element, ScrollBarVisibility
horizontalScrollBarVisibility)

Parameters
element DependencyObject
The element on which to set the property value.
horizontalScrollBarVisibility ScrollBarVisibility
The value to set.

Remarks
For more info, see Remarks for the HorizontalScrollBarVisibility property.
ScrollViewer.SetHorizontalScrollMode ScrollViewer.Set
HorizontalScrollMode ScrollViewer.SetHorizontalScroll
Mode
I n this Article
Edit
Sets the value of the HorizontalScrollMode dependency property / ScrollViewer.HorizontalScrollMode XAML
attached property on a specified element.

public : static void SetHorizontalScrollMode(DependencyObject element, ScrollMode


horizontalScrollMode)
static void SetHorizontalScrollMode(DependencyObject element, ScrollMode horizontalScrollMode)
const;
public static void SetHorizontalScrollMode(DependencyObject element, ScrollMode
horizontalScrollMode)

Parameters
element DependencyObject
The element on which to set the property value.
horizontalScrollMode ScrollMode
The value to set.

Remarks
For more info, see Remarks for the HorizontalScrollMode property.
ScrollViewer.SetIsDeferredScrollingEnabled ScrollViewer.
SetIsDeferredScrollingEnabled ScrollViewer.SetIsDeferred
ScrollingEnabled
I n this Article
Edit
Sets the value of the IsDeferredScrollingEnabled dependency property / ScrollViewer.IsDeferredScrollingEnabled
XAML attached property on a specified element.

public : static void SetIsDeferredScrollingEnabled(DependencyObject element, bool


isDeferredScrollingEnabled)
static void SetIsDeferredScrollingEnabled(DependencyObject element, bool isDeferredScrollingEnabled)
const;
public static void SetIsDeferredScrollingEnabled(DependencyObject element, Boolean
isDeferredScrollingEnabled)

Parameters
element DependencyObject
The element on which to set the property value.
isDeferredScrollingEnabled Boolean
The value to set.

Remarks
For more info, see Remarks for the IsDeferredScrollingEnabled property.
ScrollViewer.SetIsHorizontalRailEnabled ScrollViewer.Set
IsHorizontalRailEnabled ScrollViewer.SetIsHorizontalRail
Enabled
I n this Article
Edit
Sets the value of the IsHorizontalRailEnabled dependency property / ScrollViewer.IsHorizontalRailEnabled XAML
attached property on a specified element.

public : static void SetIsHorizontalRailEnabled(DependencyObject element, bool


isHorizontalRailEnabled)
static void SetIsHorizontalRailEnabled(DependencyObject element, bool isHorizontalRailEnabled)
const;
public static void SetIsHorizontalRailEnabled(DependencyObject element, Boolean
isHorizontalRailEnabled)

Parameters
element DependencyObject
The element on which to set the property value.
isHorizontalRailEnabled Boolean
The value to set.

Remarks
For more info, see the IsHorizontalRailEnabled property.
ScrollViewer.SetIsHorizontalScrollChainingEnabled Scroll
Viewer.SetIsHorizontalScrollChainingEnabled Scroll
Viewer.SetIsHorizontalScrollChainingEnabled
I n this Article
Edit
Sets the value of the IsHorizontalScrollChainingEnabled dependency property /
ScrollViewer.IsHorizontalScrollChainingEnabled XAML attached property on a specified element.

public : static void SetIsHorizontalScrollChainingEnabled(DependencyObject element, bool


isHorizontalScrollChainingEnabled)
static void SetIsHorizontalScrollChainingEnabled(DependencyObject element, bool
isHorizontalScrollChainingEnabled) const;
public static void SetIsHorizontalScrollChainingEnabled(DependencyObject element, Boolean
isHorizontalScrollChainingEnabled)

Parameters
element DependencyObject
The element on which to set the property value.
isHorizontalScrollChainingEnabled Boolean
The value to set.

Remarks
For more info, see the IsHorizontalScrollChainingEnabled property.
ScrollViewer.SetIsScrollInertiaEnabled ScrollViewer.SetIs
ScrollInertiaEnabled ScrollViewer.SetIsScrollInertia
Enabled
I n this Article
Edit
Sets the value of the IsScrollInertiaEnabled dependency property / ScrollViewer.IsScrollInertiaEnabled XAML
attached property on a specified element.

public : static void SetIsScrollInertiaEnabled(DependencyObject element, bool


isScrollInertiaEnabled)
static void SetIsScrollInertiaEnabled(DependencyObject element, bool isScrollInertiaEnabled) const;
public static void SetIsScrollInertiaEnabled(DependencyObject element, Boolean
isScrollInertiaEnabled)

Parameters
element DependencyObject
The element on which to set the property value.
isScrollInertiaEnabled Boolean
The value to set.

Remarks
For more info, see the IsScrollInertiaEnabled property.
ScrollViewer.SetIsVerticalRailEnabled ScrollViewer.SetIs
VerticalRailEnabled ScrollViewer.SetIsVerticalRailEnabled
I n this Article
Edit
Sets the value of the IsVerticalRailEnabled dependency property / ScrollViewer.IsVerticalRailEnabled XAML
attached property on a specified element.
public : static void SetIsVerticalRailEnabled(DependencyObject element, bool isVerticalRailEnabled)
static void SetIsVerticalRailEnabled(DependencyObject element, bool isVerticalRailEnabled) const;
public static void SetIsVerticalRailEnabled(DependencyObject element, Boolean isVerticalRailEnabled)

Parameters
element DependencyObject
The element on which to set the property value.
isVerticalRailEnabled Boolean
The value to set.

Remarks
For more info, see the IsVerticalRailEnabled property.
ScrollViewer.SetIsVerticalScrollChainingEnabled Scroll
Viewer.SetIsVerticalScrollChainingEnabled ScrollViewer.
SetIsVerticalScrollChainingEnabled
I n this Article
Edit
Sets the value of the IsVerticalScrollChainingEnabled dependency property /
ScrollViewer.IsVerticalScrollChainingEnabled XAML attached property on a specified element.

public : static void SetIsVerticalScrollChainingEnabled(DependencyObject element, bool


isVerticalScrollChainingEnabled)
static void SetIsVerticalScrollChainingEnabled(DependencyObject element, bool
isVerticalScrollChainingEnabled) const;
public static void SetIsVerticalScrollChainingEnabled(DependencyObject element, Boolean
isVerticalScrollChainingEnabled)

Parameters
element DependencyObject
The element on which to set the property value.
isVerticalScrollChainingEnabled Boolean
The value to set.

Remarks
For more info, see the IsVerticalScrollChainingEnabled property.
ScrollViewer.SetIsZoomChainingEnabled ScrollViewer.Set
IsZoomChainingEnabled ScrollViewer.SetIsZoomChaining
Enabled
I n this Article
Edit
Sets the value of the IsZoomChainingEnabled dependency property / ScrollViewer.IsZoomChainingEnabled XAML
attached property on a specified element.

public : static void SetIsZoomChainingEnabled(DependencyObject element, bool isZoomChainingEnabled)


static void SetIsZoomChainingEnabled(DependencyObject element, bool isZoomChainingEnabled) const;
public static void SetIsZoomChainingEnabled(DependencyObject element, Boolean isZoomChainingEnabled)

Parameters
element DependencyObject
The element on which to set the property value.
isZoomChainingEnabled Boolean
The value to set.

Remarks
For more info, see the IsZoomChainingEnabled property.
ScrollViewer.SetIsZoomInertiaEnabled ScrollViewer.SetIs
ZoomInertiaEnabled ScrollViewer.SetIsZoomInertia
Enabled
I n this Article
Edit
Sets the value of the IsZoomInertiaEnabled dependency property / ScrollViewer.IsZoomInertiaEnabled XAML
attached property on a specified element.

public : static void SetIsZoomInertiaEnabled(DependencyObject element, bool isZoomInertiaEnabled)


static void SetIsZoomInertiaEnabled(DependencyObject element, bool isZoomInertiaEnabled) const;
public static void SetIsZoomInertiaEnabled(DependencyObject element, Boolean isZoomInertiaEnabled)

Parameters
element DependencyObject
The element on which to set the property value.
isZoomInertiaEnabled Boolean
The value to set.

Remarks
For more info, see the IsZoomInertiaEnabled property.
ScrollViewer.SetVerticalScrollBarVisibility ScrollViewer.Set
VerticalScrollBarVisibility ScrollViewer.SetVerticalScroll
BarVisibility
I n this Article
Edit
Sets the value of the VerticalScrollBarVisibility dependency property / ScrollViewer.VerticalScrollBarVisibility
XAML attached property on a specified element.

public : static void SetVerticalScrollBarVisibility(DependencyObject element, ScrollBarVisibility


verticalScrollBarVisibility)
static void SetVerticalScrollBarVisibility(DependencyObject element, ScrollBarVisibility
verticalScrollBarVisibility) const;
public static void SetVerticalScrollBarVisibility(DependencyObject element, ScrollBarVisibility
verticalScrollBarVisibility)

Parameters
element DependencyObject
The element on which to set the property value.
verticalScrollBarVisibility ScrollBarVisibility
The value to set.

Remarks
For more info, see the VerticalScrollBarVisibility property.
ScrollViewer.SetVerticalScrollMode ScrollViewer.Set
VerticalScrollMode ScrollViewer.SetVerticalScrollMode
I n this Article
Edit
Sets the value of the VerticalScrollMode dependency property / ScrollViewer.VerticalScrollMode XAML attached
property on a specified element.
public : static void SetVerticalScrollMode(DependencyObject element, ScrollMode verticalScrollMode)
static void SetVerticalScrollMode(DependencyObject element, ScrollMode verticalScrollMode) const;
public static void SetVerticalScrollMode(DependencyObject element, ScrollMode verticalScrollMode)

Parameters
element DependencyObject
The element on which to set the property value.
verticalScrollMode ScrollMode
The value to set.

Remarks
For more info, see the VerticalScrollMode property.
ScrollViewer.SetZoomMode ScrollViewer.SetZoomMode
ScrollViewer.SetZoomMode
I n this Article
Edit
Sets the value of the ZoomMode dependency property / ScrollViewer.ZoomMode XAML attached property on a
specified element.
public : static void SetZoomMode(DependencyObject element, ZoomMode zoomMode)
static void SetZoomMode(DependencyObject element, ZoomMode zoomMode) const;
public static void SetZoomMode(DependencyObject element, ZoomMode zoomMode)

Parameters
element DependencyObject
The element on which to set the property value.
zoomMode ZoomMode
The value to set.

Remarks
For more info, see the ZoomMode property.
ScrollViewer.TopHeader ScrollViewer.TopHeader Scroll
Viewer.TopHeader
I n this Article
Edit
Gets or sets the content of the top header.
public : UIElement TopHeader { get; set; }
UIElement TopHeader();

void TopHeader(UIElement topheader);


public UIElement TopHeader { get; set; }

<ScrollViewer>
<ScrollViewer.TopHeader>headerObject</ScrollViewer.TopHeader>
</ScrollViewer>

Returns
UIElement
The content of the top header.

Remarks
The LeftHeader, TopHeader, and TopLeftHeader properties can be set only when ScrollViewer content's
HorizontalAlignment is Left and VerticalAlignment is Top.
The top header scrolls horizontally, but not vertically.
ScrollViewer.TopHeaderProperty ScrollViewer.TopHeader
Property ScrollViewer.TopHeaderProperty
I n this Article
Edit
Identifies the TopHeader dependency property.
public : static DependencyProperty TopHeaderProperty { get; }
static DependencyProperty TopHeaderProperty();
public static DependencyProperty TopHeaderProperty { get; }

Returns
DependencyProperty
The identifier for the TopHeader dependency property.
ScrollViewer.TopLeftHeader ScrollViewer.TopLeftHeader
ScrollViewer.TopLeftHeader
I n this Article
Edit
Gets or sets the content of the top, left header.
public : UIElement TopLeftHeader { get; set; }
UIElement TopLeftHeader();

void TopLeftHeader(UIElement topleftheader);


public UIElement TopLeftHeader { get; set; }

<ScrollViewer>
<ScrollViewer.TopLeftHeader>headerObject</ScrollViewer.TopLeftHeader>
</ScrollViewer>

Returns
UIElement
The content of the top, left header.

Remarks
The LeftHeader, TopHeader, and TopLeftHeader properties can be set only when ScrollViewer content's
HorizontalAlignment is Left and VerticalAlignment is Top.
The top left header doesn't scroll in any direction.
ScrollViewer.TopLeftHeaderProperty ScrollViewer.TopLeft
HeaderProperty ScrollViewer.TopLeftHeaderProperty
I n this Article
Edit
Identifies the TopLeftHeader dependency property.
public : static DependencyProperty TopLeftHeaderProperty { get; }
static DependencyProperty TopLeftHeaderProperty();
public static DependencyProperty TopLeftHeaderProperty { get; }

Returns
DependencyProperty
The identifier for the TopLeftHeader dependency property.
ScrollViewer.UnregisterAnchorCandidate ScrollViewer.
UnregisterAnchorCandidate ScrollViewer.Unregister
AnchorCandidate
I n this Article
Edit
Unregisters a UIElement as a potential scroll anchor.
public : void UnregisterAnchorCandidate(UIElement element)
void UnregisterAnchorCandidate(UIElement element) const;
public void UnregisterAnchorCandidate(UIElement element)

Parameters
element UIElement
A UIElement within the subtree of the ScrollViewer.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
When an element's CanBeScrollAnchor property changes to false (or the element is removed from the visual tree), the
framework locates the first IScrollAnchorProvider in that element's chain of ancestors and automatically calls its
UnregisterAnchorCandidate method.
ScrollViewer.VerticalAnchorRatio ScrollViewer.Vertical
AnchorRatio ScrollViewer.VerticalAnchorRatio
I n this Article
Edit
Determines the vertical position of the ScrollViewer's anchor point with respect to the viewport. By default, the
ScrollViewer selects an element as its CurrentAnchor by identifying the element in its viewport nearest to the anchor
point.

public : double VerticalAnchorRatio { get; set; }


double VerticalAnchorRatio();

void VerticalAnchorRatio(double verticalanchorratio);


public double VerticalAnchorRatio { get; set; }

Returns
double
A normalized value (0.0f to 1.0f). The default is 0.0f.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
A value of 0.0 represents the top-most point within the viewport. A value of 1.0f represents the bottom-most point
within the viewport. A value of 0.5f represents the center-most point within the viewport.
When the value is 0.0 or 1.0, the ScrollViewer applies special behavior when the scroll position is at the start or end of
the scrollable area.
ScrollViewer.VerticalAnchorRatioProperty ScrollViewer.
VerticalAnchorRatioProperty ScrollViewer.VerticalAnchor
RatioProperty
I n this Article
Edit
Identifies the VerticalAnchorRatio dependency property.
public : static DependencyProperty VerticalAnchorRatioProperty { get; }
static DependencyProperty VerticalAnchorRatioProperty();
public static DependencyProperty VerticalAnchorRatioProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalAnchorRatio dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ScrollViewer.VerticalOffset ScrollViewer.VerticalOffset
ScrollViewer.VerticalOffset
I n this Article
Edit
Gets the distance the content has been scrolled vertically.
public : double VerticalOffset { get; }
double VerticalOffset();
public double VerticalOffset { get; }

Returns
double
The distance the content has been scrolled vertically.
ScrollViewer.VerticalOffsetProperty ScrollViewer.Vertical
OffsetProperty ScrollViewer.VerticalOffsetProperty
I n this Article
Edit
Identifies the VerticalOffset dependency property.
public : static DependencyProperty VerticalOffsetProperty { get; }
static DependencyProperty VerticalOffsetProperty();
public static DependencyProperty VerticalOffsetProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalOffset dependency property.
ScrollViewer.VerticalScrollBarVisibility ScrollViewer.
VerticalScrollBarVisibility ScrollViewer.VerticalScrollBar
Visibility
I n this Article
Edit
Gets or sets a value that indicates whether a vertical ScrollBar should be displayed.
public : ScrollBarVisibility VerticalScrollBarVisibility { get; set; }
ScrollBarVisibility VerticalScrollBarVisibility();

void VerticalScrollBarVisibility(ScrollBarVisibility verticalscrollbarvisibility);


public ScrollBarVisibility VerticalScrollBarVisibility { get; set; }

<ScrollViewer VerticalScrollBarVisibility="scrollBarVisibilityMemberName"/>
-or-
<object ScrollViewer.VerticalScrollBarVisibility="scrollBarVisibilityMemberName"/>

Returns
ScrollBarVisibility
A ScrollBarVisibility value that indicates whether a vertical ScrollBar should be displayed. The default value is Visible.

Remarks
Scrolling behavior can also be set through a ScrollViewer.VerticalScrollBarVisibility XAML attached property
usage, or by calling SetVerticalScrollBarVisibility. This is for cases where the ScrollViewer is implicit, such as when the
ScrollViewer exists in the default template for a GridView, and you want to be able to influence the scrolling behavior
without accessing template parts. Controls with a ScrollViewer as part of their composition typically use template
binding such that setting the attached property at the level of the control will change the scroll behavior of the
ScrollViewer part within the control. Otherwise, it may be necessary to replace the template in order to change the
scroll behavior of a ScrollViewer part.
ScrollViewer.VerticalScrollBarVisibilityProperty Scroll
Viewer.VerticalScrollBarVisibilityProperty ScrollViewer.
VerticalScrollBarVisibilityProperty
I n this Article
Edit
Identifies the VerticalScrollBarVisibility dependency property.
public : static DependencyProperty VerticalScrollBarVisibilityProperty { get; }
static DependencyProperty VerticalScrollBarVisibilityProperty();
public static DependencyProperty VerticalScrollBarVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalScrollBarVisibility dependency property.
ScrollViewer.VerticalScrollMode ScrollViewer.Vertical
ScrollMode ScrollViewer.VerticalScrollMode
I n this Article
Edit
Gets or sets a value that determines how manipulation input influences scrolling behavior on the vertical axis.
public : ScrollMode VerticalScrollMode { get; set; }
ScrollMode VerticalScrollMode();

void VerticalScrollMode(ScrollMode verticalscrollmode);


public ScrollMode VerticalScrollMode { get; set; }

<ScrollViewer VerticalScrollMode="scrollModeMemberName" />


-or-
<object ScrollViewer.VerticalScrollMode="scrollModeMemberName"/>

Returns
ScrollMode
A value of the enumeration. The typical default (as set through the default template, not class initialization) is Enabled.

Remarks
Scrolling behavior can also be set through a ScrollViewer.VerticalScrollMode XAML attached property usage, or
by calling SetVerticalScrollMode. This is for cases where the ScrollViewer is implicit, such as when the ScrollViewer
exists in the default template for a GridView, and you want to be able to influence the scrolling behavior without
accessing template parts. Controls with a ScrollViewer as part of their composition typically use template binding such
that setting the attached property at the level of the control will change the scroll behavior of the ScrollViewer part
within the control. Otherwise, it may be necessary to replace the template in order to change the scroll behavior of a
ScrollViewer part.
ScrollViewer.VerticalScrollModeProperty ScrollViewer.
VerticalScrollModeProperty ScrollViewer.VerticalScroll
ModeProperty
I n this Article
Edit
Identifies the VerticalScrollMode dependency property.
public : static DependencyProperty VerticalScrollModeProperty { get; }
static DependencyProperty VerticalScrollModeProperty();
public static DependencyProperty VerticalScrollModeProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalScrollMode dependency property.
ScrollViewer.VerticalSnapPointsAlignment ScrollViewer.
VerticalSnapPointsAlignment ScrollViewer.VerticalSnap
PointsAlignment
I n this Article
Edit
Gets or sets a value that indicates how the existing snap points are vertically aligned versus the initial viewport.
public : SnapPointsAlignment VerticalSnapPointsAlignment { get; set; }
SnapPointsAlignment VerticalSnapPointsAlignment();

void VerticalSnapPointsAlignment(SnapPointsAlignment verticalsnappointsalignment);


public SnapPointsAlignment VerticalSnapPointsAlignment { get; set; }

<ScrollViewer VerticalSnapPointsAlignment="snapPointsAlignmentMemberName" />

Returns
SnapPointsAlignment
A value of the enumeration.
ScrollViewer.VerticalSnapPointsAlignmentProperty Scroll
Viewer.VerticalSnapPointsAlignmentProperty Scroll
Viewer.VerticalSnapPointsAlignmentProperty
I n this Article
Edit
Identifies the VerticalSnapPointsAlignment dependency property.
public : static DependencyProperty VerticalSnapPointsAlignmentProperty { get; }
static DependencyProperty VerticalSnapPointsAlignmentProperty();
public static DependencyProperty VerticalSnapPointsAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalSnapPointsAlignment dependency property.
ScrollViewer.VerticalSnapPointsType ScrollViewer.Vertical
SnapPointsType ScrollViewer.VerticalSnapPointsType
I n this Article
Edit
Gets or sets a value that declares how manipulation behavior reacts to the snap points along the vertical axis.
public : SnapPointsType VerticalSnapPointsType { get; set; }
SnapPointsType VerticalSnapPointsType();

void VerticalSnapPointsType(SnapPointsType verticalsnappointstype);


public SnapPointsType VerticalSnapPointsType { get; set; }

<ScrollViewer VerticalSnapPointsType="snapPointsTypeMemberName" />

Returns
SnapPointsType
A value of the enumeration. The default is None but might be set through a control template.

Examples
This XAML is from the default template for a Hub control. A Hub has a ScrollViewer part that surrounds an
ItemsStackPanel for its content. Hub uses the Optional value for its snapping behavior in both dimensions (although
VerticalScrollMode is disabled in starting visual states) and disables ZoomMode. Note how the
SnapPointsAlignment properties are also set as attributes here.

<ControlTemplate TargetType="Hub">
...
<ScrollViewer x:Name="ScrollViewer"
Grid.RowSpan="2"
HorizontalScrollMode="Auto"
HorizontalScrollBarVisibility="Auto"
VerticalScrollMode="Disabled"
VerticalScrollBarVisibility="Disabled"
HorizontalSnapPointsAlignment="Near"
HorizontalSnapPointsType="Optional"
VerticalSnapPointsAlignment="Near"
VerticalSnapPointsType="Optional"
ZoomMode="Disabled">
<ItemsStackPanel x:Name="Panel"
Orientation="{TemplateBinding Orientation}"
CacheLength="20" />
</ScrollViewer>
...
</ControlTemplate>

Remarks
For panning actions, there are often natural stopping places. Snap points provide a way to indicate where these places
are. Then, when a user swipes, the manipulation result favors that natural point using behavior as expressed by a
SnapPointsType value.
**Proximity points (Optional and OptionalSingle): ** When a user is going to naturally stop the manipulation in the
proximity of a snap point, proximity points help the user land at the natural stopping place. Because the user has to
land in proximity to the snap point to cause it to stop there, the user will sometimes have to perform another swipe to
reach a snap point.
**Mandatory snap points (Mandatory and MandatorySingle): ** In contrast to proximity, mandatory snap points
ensure that the content is adjusted to always land on a snap point. Even if the user releases the manipulation halfway
between two snap-points, it will always move to one of the snap points.
To see the effects of snap points on ScrollViewer behavior yourself, get the XAML scrolling, panning and zooming
sample. Run the sample on a touch device (not the simulator). Try out the SnapPointsType values when you view the
"Panning with snap-points" example page of the sample.
To learn more about the swipe gesture and panning, see the "Panning behaviors" section of Guidelines for panning.
The default value of None is the default of the enumeration. If it's set, this property is often set as an attribute in a
XAML template part, or as a style Setter. Each control potentially sets this differently. Getting the value at run time will
provide the value that came from applied styles and templates.
See SnapPointsType
Also XAML scrolling, panning and zooming sample
ScrollViewer.VerticalSnapPointsTypeProperty Scroll
Viewer.VerticalSnapPointsTypeProperty ScrollViewer.
VerticalSnapPointsTypeProperty
I n this Article
Edit
Identifies the VerticalSnapPointsType dependency property.
public : static DependencyProperty VerticalSnapPointsTypeProperty { get; }
static DependencyProperty VerticalSnapPointsTypeProperty();
public static DependencyProperty VerticalSnapPointsTypeProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalSnapPointsType dependency property.
ScrollViewer.ViewChanged ScrollViewer.ViewChanged
ScrollViewer.ViewChanged
I n this Article
Edit
Occurs when manipulations such as scrolling and zooming have caused the view to change.
public : event EventHandler<ScrollViewerViewChangedEventArgs> ViewChanged
// Register
event_token ViewChanged(EventHandler<ScrollViewerViewChangedEventArgs> const& handler) const;

// Revoke with event_token


void ViewChanged(event_token const& cookie) const;

// Revoke with event_revoker


ViewChanged_revoker ViewChanged(auto_revoke_t, EventHandler<ScrollViewerViewChangedEventArgs> const&
handler) const;
public event EventHandler<ScrollViewerViewChangedEventArgs> ViewChanged

<ScrollViewer ViewChanged="eventhandler"/>

Remarks
ViewChanging fires before ViewChanged.
In your event handler, use a parameter of type ScrollViewerViewChangedEventArgs for the second parameter of your
handler method. ScrollViewerViewChangedEventArgs includes the IsIntermediate property, which reports whether the
manipulation that fired the event is completed or still ongoing.
Not every underlying manipulation will necessarily fire this event. The class logic delays and consolidates intermediate
events into a single occurrence in some cases.
See ViewChangingViewChangingViewChanging
Also
ScrollViewer.ViewChanging ScrollViewer.ViewChanging
ScrollViewer.ViewChanging
I n this Article
Edit
Occurs when manipulations such as scrolling and zooming cause the view to change.
public : event EventHandler<ScrollViewerViewChangingEventArgs> ViewChanging
// Register
event_token ViewChanging(EventHandler<ScrollViewerViewChangingEventArgs> const& handler) const;

// Revoke with event_token


void ViewChanging(event_token const& cookie) const;

// Revoke with event_revoker


ViewChanging_revoker ViewChanging(auto_revoke_t, EventHandler<ScrollViewerViewChangingEventArgs>
const& handler) const;
public event EventHandler<ScrollViewerViewChangingEventArgs> ViewChanging

<ScrollViewer ViewChanging="eventhandler"/>

Remarks
ScrollViewerViewChangingEventArgs includes the IsInertial property, which reports whether the manipulation that is
firing the event contains an inertial component.
Not every underlying manipulation will necessarily fire this event. The ScrollViewer logic delays and consolidates
intermediate events into a single occurrence in some cases.
ScrollViewer.ViewportHeight ScrollViewer.Viewport
Height ScrollViewer.ViewportHeight
I n this Article
Edit
Gets the vertical size of the viewable content.
public : double ViewportHeight { get; }
double ViewportHeight();
public double ViewportHeight { get; }

Returns
double
The vertical size of the viewable content.

Remarks
The viewport includes all the visible content in the ScrollViewer.
ScrollViewer.ViewportHeightProperty ScrollViewer.
ViewportHeightProperty ScrollViewer.ViewportHeight
Property
I n this Article
Edit
Identifies the ViewportHeight dependency property.
public : static DependencyProperty ViewportHeightProperty { get; }
static DependencyProperty ViewportHeightProperty();
public static DependencyProperty ViewportHeightProperty { get; }

Returns
DependencyProperty
The identifier for the ViewportHeight dependency property.
ScrollViewer.ViewportWidth ScrollViewer.ViewportWidth
ScrollViewer.ViewportWidth
I n this Article
Edit
Gets the horizontal size of the viewable content.
public : double ViewportWidth { get; }
double ViewportWidth();
public double ViewportWidth { get; }

Returns
double
The horizontal size of the viewable content.

Remarks
The viewport includes all the visible content in the ScrollViewer.
ScrollViewer.ViewportWidthProperty ScrollViewer.
ViewportWidthProperty ScrollViewer.ViewportWidth
Property
I n this Article
Edit
Identifies the ViewportWidth dependency property.
public : static DependencyProperty ViewportWidthProperty { get; }
static DependencyProperty ViewportWidthProperty();
public static DependencyProperty ViewportWidthProperty { get; }

Returns
DependencyProperty
The identifier for the ViewportWidth dependency property.
ScrollViewer.ZoomFactor ScrollViewer.ZoomFactor Scroll
Viewer.ZoomFactor
I n this Article
Edit
Gets a value that indicates the current zoom factor engaged for content scaling.
public : float ZoomFactor { get; }
float ZoomFactor();
public float ZoomFactor { get; }

Returns
float
The current zoom factor engaged for content scaling. The default is 1.0, where 1.0 indicates no additional scaling.

Remarks
To change the value of this property at run-time or for initialization, use ChangeView.
ScrollViewer.ZoomFactorProperty ScrollViewer.Zoom
FactorProperty ScrollViewer.ZoomFactorProperty
I n this Article
Edit
Identifies the ZoomFactor dependency property.
public : static DependencyProperty ZoomFactorProperty { get; }
static DependencyProperty ZoomFactorProperty();
public static DependencyProperty ZoomFactorProperty { get; }

Returns
DependencyProperty
The identifier for the ZoomFactor dependency property.
ScrollViewer.ZoomMode ScrollViewer.ZoomMode Scroll
Viewer.ZoomMode
I n this Article
Edit
Gets or sets a value that indicates whether zoom behavior in the ScrollViewer content is enabled.
public : ZoomMode ZoomMode { get; set; }
ZoomMode ZoomMode();

void ZoomMode(ZoomMode zoommode);


public ZoomMode ZoomMode { get; set; }

<ScrollViewer ZoomMode="zoomModeMemberName" />


-or-
<object ScrollViewer.ZoomMode="zoomModeMemberName"/>

Returns
ZoomMode
A value of the enumeration.

Remarks
No default value is listed for this property. Controls that incorporate a ScrollViewer in compositing often set a value for
ZoomMode in the default template and starting visual states, and it is this templated value that you will typically start
with. Controls with a ScrollViewer as part of their composition typically use template binding such that setting the
attached property at the level of the control will change the scroll behavior of the ScrollViewer part within the control.
Otherwise, it may be necessary to replace the template in order to change the scroll behavior of a ScrollViewer part.
ScrollViewer.ZoomModeProperty ScrollViewer.Zoom
ModeProperty ScrollViewer.ZoomModeProperty
I n this Article
Edit
Identifies the ZoomMode dependency property.
public : static DependencyProperty ZoomModeProperty { get; }
static DependencyProperty ZoomModeProperty();
public static DependencyProperty ZoomModeProperty { get; }

Returns
DependencyProperty
The identifier for the ZoomMode dependency property.
ScrollViewer.ZoomSnapPoints ScrollViewer.ZoomSnap
Points ScrollViewer.ZoomSnapPoints
I n this Article
Edit
Gets the observable collection of zoom snap point factors that are held by the ScrollViewer.
public : IVector<float> ZoomSnapPoints { get; }
IVector<float> ZoomSnapPoints();
public IList<float> ZoomSnapPoints { get; }

Returns
IList<float>
A collection of Single values that represent zoom factors as snap points.
ScrollViewer.ZoomSnapPointsProperty ScrollViewer.
ZoomSnapPointsProperty ScrollViewer.ZoomSnapPoints
Property
I n this Article
Edit
Identifies the ZoomSnapPoints dependency property.
public : static DependencyProperty ZoomSnapPointsProperty { get; }
static DependencyProperty ZoomSnapPointsProperty();
public static DependencyProperty ZoomSnapPointsProperty { get; }

Returns
DependencyProperty
The identifier for the ZoomSnapPoints dependency property.
ScrollViewer.ZoomSnapPointsType ScrollViewer.Zoom
SnapPointsType ScrollViewer.ZoomSnapPointsType
I n this Article
Edit
Gets or sets a value that indicates how zoom snap points are processed for interaction input.
public : SnapPointsType ZoomSnapPointsType { get; set; }
SnapPointsType ZoomSnapPointsType();

void ZoomSnapPointsType(SnapPointsType zoomsnappointstype);


public SnapPointsType ZoomSnapPointsType { get; set; }

<ScrollViewer ZoomSnapPointsType="snapPointsTypeMemberName"/>

Returns
SnapPointsType
A value of the enumeration.
See SnapPointsType
Also
ScrollViewer.ZoomSnapPointsTypeProperty ScrollViewer.
ZoomSnapPointsTypeProperty ScrollViewer.ZoomSnap
PointsTypeProperty
I n this Article
Edit
Identifies the ZoomSnapPointsType dependency property.
public : static DependencyProperty ZoomSnapPointsTypeProperty { get; }
static DependencyProperty ZoomSnapPointsTypeProperty();
public static DependencyProperty ZoomSnapPointsTypeProperty { get; }

Returns
DependencyProperty
The identifier for the ZoomSnapPointsType dependency property.
ScrollViewer.ZoomToFactor ScrollViewer.ZoomToFactor
ScrollViewer.ZoomToFactor
I n this Article
Edit
Note

ZoomToFactor may be altered or unavailable for releases after Windows 8.1. Instead, use ChangeView.
Sets the effective value of ZoomFactor.
public : void ZoomToFactor(float factor)
void ZoomToFactor(Single factor) const;
public void ZoomToFactor(Single factor)

Parameters
factor Single
The zoom factor to set. The factors are based on a norm of 1.0, which represents no zoom applied. The values you can
set are also influenced by current values for MinZoomFactor and MaxZoomFactor.
Attributes DeprecatedAttribute
ScrollViewerView ScrollViewerView ScrollViewerView
Class
Provides a view for a ScrollViewer when its view is changing.

D eclaration
public : sealed class ScrollViewerView : IScrollViewerView
struct winrt::Windows::UI::Xaml::Controls::ScrollViewerView : IScrollViewerView
public sealed class ScrollViewerView : IScrollViewerView

I nheritance H ierarchy
None

Properties
HorizontalOffset
HorizontalOffset
HorizontalOffset

Gets the distance the content has been scrolled horizontally.

VerticalOffset
VerticalOffset
VerticalOffset

Gets the distance the content has been scrolled vertically.

ZoomFactor
ZoomFactor
ZoomFactor

Gets a value that indicates the current zoom factor engaged for content scaling.
ScrollViewerView.HorizontalOffset ScrollViewerView.
HorizontalOffset ScrollViewerView.HorizontalOffset
I n this Article
Edit
Gets the distance the content has been scrolled horizontally.
public : double HorizontalOffset { get; }
double HorizontalOffset();
public double HorizontalOffset { get; }

Returns
double
The distance the content has been scrolled horizontally.
ScrollViewerView.VerticalOffset ScrollViewerView.Vertical
Offset ScrollViewerView.VerticalOffset
I n this Article
Edit
Gets the distance the content has been scrolled vertically.
public : double VerticalOffset { get; }
double VerticalOffset();
public double VerticalOffset { get; }

Returns
double
The distance the content has been scrolled vertically.
ScrollViewerView.ZoomFactor ScrollViewerView.Zoom
Factor ScrollViewerView.ZoomFactor
I n this Article
Edit
Gets a value that indicates the current zoom factor engaged for content scaling.
public : float ZoomFactor { get; }
float ZoomFactor();
public float ZoomFactor { get; }

Returns
float
The current zoom factor engaged for content scaling. The default is 1.0, where 1.0 indicates no additional scaling.
ScrollViewerViewChangedEventArgs ScrollViewerView
ChangedEventArgs ScrollViewerViewChangedEventArgs
Class
Provides event data for the ViewChanged event and similar control-specific events.

D eclaration
public : sealed class ScrollViewerViewChangedEventArgs : IScrollViewerViewChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::ScrollViewerViewChangedEventArgs :
IScrollViewerViewChangedEventArgs
public sealed class ScrollViewerViewChangedEventArgs : IScrollViewerViewChangedEventArgs

I nheritance H ierarchy
None

Constructors
ScrollViewerViewChangedEventArgs()
ScrollViewerViewChangedEventArgs()
ScrollViewerViewChangedEventArgs()

Initializes a new instance of the ScrollViewerViewChangedEventArgs class.

Properties
IsIntermediate
IsIntermediate
IsIntermediate

Gets a value that indicates whether the underlying manipulation that raised the event is complete.
ScrollViewerViewChangedEventArgs.IsIntermediate Scroll
ViewerViewChangedEventArgs.IsIntermediate Scroll
ViewerViewChangedEventArgs.IsIntermediate
I n this Article
Edit
Gets a value that indicates whether the underlying manipulation that raised the event is complete.
public : Platform::Boolean IsIntermediate { get; }
bool IsIntermediate();
public bool IsIntermediate { get; }

Returns
bool
True if the manipulation is at an intermediate stage and not yet final; false if the manipulation is final.
ScrollViewerViewChangedEventArgs ScrollViewerView
ChangedEventArgs ScrollViewerViewChangedEventArgs
I n this Article
Edit
Initializes a new instance of the ScrollViewerViewChangedEventArgs class.
public : ScrollViewerViewChangedEventArgs()
ScrollViewerViewChangedEventArgs() const;
public ScrollViewerViewChangedEventArgs()
ScrollViewerViewChangingEventArgs ScrollViewerView
ChangingEventArgs ScrollViewerViewChangingEventArgs
Class
Provides event data for the ViewChanging event and similar control-specific events.

D eclaration
public : sealed class ScrollViewerViewChangingEventArgs : IScrollViewerViewChangingEventArgs
struct winrt::Windows::UI::Xaml::Controls::ScrollViewerViewChangingEventArgs :
IScrollViewerViewChangingEventArgs
public sealed class ScrollViewerViewChangingEventArgs : IScrollViewerViewChangingEventArgs

I nheritance H ierarchy
None

Properties
FinalView
FinalView
FinalView

Gets the view that the ScrollViewer will show when the view comes to rest after a pan/zoom manipulation.

IsInertial
IsInertial
IsInertial

Gets a value that indicates whether the pan/zoom manipulation has an inertial component.

NextView
NextView
NextView

Gets the view that the ScrollViewer will show next.


ScrollViewerViewChangingEventArgs.FinalView Scroll
ViewerViewChangingEventArgs.FinalView ScrollViewer
ViewChangingEventArgs.FinalView
I n this Article
Edit
Gets the view that the ScrollViewer will show when the view comes to rest after a pan/zoom manipulation.
public : ScrollViewerView FinalView { get; }
ScrollViewerView FinalView();
public ScrollViewerView FinalView { get; }

Returns
ScrollViewerView
The view that the ScrollViewer will show when the view comes to rest after a pan/zoom manipulation.
ScrollViewerViewChangingEventArgs.IsInertial Scroll
ViewerViewChangingEventArgs.IsInertial ScrollViewer
ViewChangingEventArgs.IsInertial
I n this Article
Edit
Gets a value that indicates whether the pan/zoom manipulation has an inertial component.
public : Platform::Boolean IsInertial { get; }
bool IsInertial();
public bool IsInertial { get; }

Returns
bool
true if the pan/zoom manipulation has an inertial component; otherwise, false.

Remarks
IsInertial is true for manipulations that occur:
using a mouse wheel.
using key strokes on ScrollViewer and other controls that support direct manipulation.
by calling ChangeView with animation enabled.
IsInertial is false for manipulations that occur:
by dragging the Thumb on a scrollbar.
using key strokes on controls that don't support direct manipulation.
by calling ChangeView with animation disabled.
ScrollViewerViewChangingEventArgs.NextView Scroll
ViewerViewChangingEventArgs.NextView ScrollViewer
ViewChangingEventArgs.NextView
I n this Article
Edit
Gets the view that the ScrollViewer will show next.
public : ScrollViewerView NextView { get; }
ScrollViewerView NextView();
public ScrollViewerView NextView { get; }

Returns
ScrollViewerView
The view that the ScrollViewer will show next.
SearchBox SearchBox SearchBox Class
Represents a control that can be used to enter search query text. (Not recommended for Universal Windows Platform
(UWP ) apps. See AutoSuggestBox.)

D eclaration
public : class SearchBox : Control, ISearchBox
struct winrt::Windows::UI::Xaml::Controls::SearchBox : Control, ISearchBox
public class SearchBox : Control, ISearchBox

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
Windows 10
Im p o rt a nt

Although SearchBox is implemented in the Universal device family, it is not fully functional on mobile devices. Use
AutoSuggestBox for your universal search experience. See SearchBox deprecated in favor of AutoSuggestBox.
Windows 8.x
To support keyboard interaction and make your app's search experience consistent with the Start screen, set the
FocusOnKeyboardInput property to true. For more info, see Guidelines and checklist for search.
At a minimum each SearchBox control should always have a QuerySubmitted handler. This handler passes the user's
query text to a search results page that the handler opens. Open this page by calling Frame.Navigate. For more info on
how to write a basic QuerySubmitted handler and create a search results page as part of your app, see Enabling users
to search for information in your .
In addition to the basic results and search experience, a SearchBox also supports search suggestions, programmatically
setting the starting search text, and search history. The search suggestion feature is supported by API in the
Windows.ApplicationModel.Search namespace. For example code that shows how to use these features, see SearchBox
control sample.
Note

An app can't use both the search box (Windows.UI.Xaml.Controls.SearchBox for UWP app using C++, C#, or Visual
Basic, WinJS.UI.SearchBox for Windows app using JavaScript) and the SearchPane. Using both the search box and the
search pane in the same app causes the app to throw an exception with this message: "Cannot create instance of type
'Windows.UI.Xaml.Controls.SearchBox'"

Constructors
SearchBox()
SearchBox()
SearchBox()

Initializes a new instance of the SearchBox class.


Properties
ChooseSuggestionOnEnter
ChooseSuggestionOnEnter
ChooseSuggestionOnEnter

Gets or sets a value that determines whether the suggested search query is activated when the user presses Enter.

ChooseSuggestionOnEnterProperty
ChooseSuggestionOnEnterProperty
ChooseSuggestionOnEnterProperty

Identifies the ChooseSuggestionOnEnter dependency property.

FocusOnKeyboardInput
FocusOnKeyboardInput
FocusOnKeyboardInput

Gets or sets a value that determines whether a user can search by typing anywhere in the app.

FocusOnKeyboardInputProperty
FocusOnKeyboardInputProperty
FocusOnKeyboardInputProperty

Identifies the FocusOnKeyboardInput dependency property.

PlaceholderText
PlaceholderText
PlaceholderText

Gets or sets the text that is displayed in the control until the value is changed by a user action or some other
operation.

PlaceholderTextProperty
PlaceholderTextProperty
PlaceholderTextProperty

Identifies the PlaceholderText dependency property.

QueryText
QueryText
QueryText

Gets or sets the text contents of the search box.

QueryTextProperty
QueryTextProperty
QueryTextProperty

Identifies the QueryText dependency property.

SearchHistoryContext
SearchHistoryContext
SearchHistoryContext

Gets or sets a string that identifies the context of the search and is used to store the user's search history with the
app.

SearchHistoryContextProperty
SearchHistoryContextProperty
SearchHistoryContextProperty

Identifies the SearchHistoryContext dependency property.

SearchHistoryEnabled
SearchHistoryEnabled
SearchHistoryEnabled

Gets or sets a value that determines whether search suggestions are made from the search history.

SearchHistoryEnabledProperty
SearchHistoryEnabledProperty
SearchHistoryEnabledProperty

Identifies the SearchHistoryEnabled dependency property.

Methods
SetLocalContentSuggestionSettings(LocalContentSuggestionSettings)
SetLocalContentSuggestionSettings(LocalContentSuggestionSettings)
SetLocalContentSuggestionSettings(LocalContentSuggestionSettings)

Specifies whether suggestions based on local files are automatically displayed in the search box suggestions, and
defines the criteria that Windows uses to locate and filter these suggestions.

Events
PrepareForFocusOnKeyboardInput
PrepareForFocusOnKeyboardInput
PrepareForFocusOnKeyboardInput

Occurs when the FocusOnKeyboardInput property is true and the app receives textual keyboard input.
QueryChanged
QueryChanged
QueryChanged

Occurs when the query text changes.

QuerySubmitted
QuerySubmitted
QuerySubmitted

Occurs when the user submits a search query.

ResultSuggestionChosen
ResultSuggestionChosen
ResultSuggestionChosen

Occurs when the user picks a suggested search result.

SuggestionsRequested
SuggestionsRequested
SuggestionsRequested

Occurs when the user's query text changes and the app needs to provide new suggestions to display in the search
pane.

See Also
Control
SearchBox.ChooseSuggestionOnEnter SearchBox.Choose
SuggestionOnEnter SearchBox.ChooseSuggestionOn
Enter
I n this Article
Edit
Gets or sets a value that determines whether the suggested search query is activated when the user presses Enter.
public : Platform::Boolean ChooseSuggestionOnEnter { get; set; }
bool ChooseSuggestionOnEnter();

void ChooseSuggestionOnEnter(bool choosesuggestiononenter);


public bool ChooseSuggestionOnEnter { get; set; }

<SearchBox ChooseSuggestionOnEnter="bool"/>

Returns
bool
true if the suggested search query is activated when the user presses Enter; otherwise, false. The default is false.
SearchBox.ChooseSuggestionOnEnterProperty Search
Box.ChooseSuggestionOnEnterProperty SearchBox.
ChooseSuggestionOnEnterProperty
I n this Article
Edit
Identifies the ChooseSuggestionOnEnter dependency property.
public : static DependencyProperty ChooseSuggestionOnEnterProperty { get; }
static DependencyProperty ChooseSuggestionOnEnterProperty();
public static DependencyProperty ChooseSuggestionOnEnterProperty { get; }

Returns
DependencyProperty
The identifier for the ChooseSuggestionOnEnter dependency property.
SearchBox.FocusOnKeyboardInput SearchBox.FocusOn
KeyboardInput SearchBox.FocusOnKeyboardInput
I n this Article
Edit
Gets or sets a value that determines whether a user can search by typing anywhere in the app.
public : Platform::Boolean FocusOnKeyboardInput { get; set; }
bool FocusOnKeyboardInput();

void FocusOnKeyboardInput(bool focusonkeyboardinput);


public bool FocusOnKeyboardInput { get; set; }

<SearchBox FocusOnKeyboardInput="bool"/>

Returns
bool
true if the user can search by typing anywhere in the app; otherwise, false. The default is false.

Remarks
Note

When FocusOnKeyboardInput is set to true, there’s an issue that sometimes creates duplicate characters in the
SearchBox control when using the touch keyboard. You can work around the issue by following these steps:
1. Disable FocusOnKeyboardInput after the SearchBox receives focus. To do this, register for the
PrepareForFocusOnKeyboardInput event and use the event handler to set FocusOnKeyboardInput to false.
2. When the SearchBox loses focus, set FocusOnKeyboardInput back to true. To do this, register for the LostFocus event
and use the event handler to set FocusOnKeyboardInput back to true.
When FocusOnKeyboardInput is true, keyboard input on the current thread is intercepted and textual input is
redirected to the SearchBox. Only textual input will cause the SearchBox to receive focus. Non-text keys, such as arrows
or Tab, are not redirected to the SearchBox. WIN/CTRL/ALT key combinations (except for Ctrl-V for paste) are also not
redirected.
To do more than just set focus in the SearchBox, such as make the control visible, handle the
PrepareForFocusOnKeyboardInput event.
You should set FocusOnKeyboardInput to false if the user sets focus on some other editable text field.
To learn more about when you should let users type to search, see Guidelines and checklist for search.
See PrepareForFocusOnKeyboardInputPrepareForFocusOnKeyboardInputPrepareForFocusOnKeyboardInput
Also Guidelines and checklist for search
SearchBox.FocusOnKeyboardInputProperty SearchBox.
FocusOnKeyboardInputProperty SearchBox.FocusOn
KeyboardInputProperty
I n this Article
Edit
Identifies the FocusOnKeyboardInput dependency property.
public : static DependencyProperty FocusOnKeyboardInputProperty { get; }
static DependencyProperty FocusOnKeyboardInputProperty();
public static DependencyProperty FocusOnKeyboardInputProperty { get; }

Returns
DependencyProperty
The identifier for the FocusOnKeyboardInput dependency property.

Remarks
Note

When FocusOnKeyboardInput is set to true, there’s an issue that sometimes causes users to see duplicate characters in
the SearchBox control when using the touch keyboard. You can work around the issue by following these steps: 1.
Register for the PrepareForFocusOnKeyboardInput event and use the event handler to set FocusOnKeyboardInput to
false. 2. Register for the LostFocus event and use the event handler to set FocusOnKeyboardInput back to true.
SearchBox.PlaceholderText SearchBox.PlaceholderText
SearchBox.PlaceholderText
I n this Article
Edit
Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation.
public : Platform::String PlaceholderText { get; set; }
winrt::hstring PlaceholderText();

void PlaceholderText(winrt::hstring placeholdertext);


public string PlaceholderText { get; set; }

<SearchBox PlaceholderText="placeholderString"/>

Returns
string
The text that is displayed in the control when no value is entered. The default is an empty string (""). The maximum
placeholder text length is 128 characters.
SearchBox.PlaceholderTextProperty SearchBox.
PlaceholderTextProperty SearchBox.PlaceholderText
Property
I n this Article
Edit
Identifies the PlaceholderText dependency property.
public : static DependencyProperty PlaceholderTextProperty { get; }
static DependencyProperty PlaceholderTextProperty();
public static DependencyProperty PlaceholderTextProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderText dependency property.
SearchBox.PrepareForFocusOnKeyboardInput SearchBox.
PrepareForFocusOnKeyboardInput SearchBox.PrepareFor
FocusOnKeyboardInput
I n this Article
Edit
Occurs when the FocusOnKeyboardInput property is true and the app receives textual keyboard input.
public : event TypedEventHandler<SearchBox, RoutedEventArgs> PrepareForFocusOnKeyboardInput
// Register
event_token PrepareForFocusOnKeyboardInput(TypedEventHandler<SearchBox, RoutedEventArgs> const&
handler) const;

// Revoke with event_token


void PrepareForFocusOnKeyboardInput(event_token const& cookie) const;

// Revoke with event_revoker


PrepareForFocusOnKeyboardInput_revoker PrepareForFocusOnKeyboardInput(auto_revoke_t,
TypedEventHandler<SearchBox, RoutedEventArgs> const& handler) const;
public event TypedEventHandler<SearchBox, RoutedEventArgs> PrepareForFocusOnKeyboardInput

<SearchBox PrepareForFocusOnKeyboardInput="eventhandler"/>

Remarks
This event occurs only if the FocusOnKeyboardInput property is true. If you wan to provide "type-to-search" behavior
in your app, you should handle this event and synchronously ensure the SearchBox control is visible before the event
call completes. After this event occurs, the control sets focus to itself.
When FocusOnKeyboardInput is true, keyboard input on the current thread is intercepted and textual input is
redirected to the SearchBox. Only textual input will cause the SearchBox to receive focus. Non-text keys, such as arrows
or Tab, are not redirected to the SearchBox. WIN/CTRL/ALT key combinations (except for Ctrl-V for paste) are also not
redirected.
SearchBox.QueryChanged SearchBox.QueryChanged
SearchBox.QueryChanged
I n this Article
Edit
Occurs when the query text changes.
public : event TypedEventHandler<SearchBox, SearchBoxQueryChangedEventArgs> QueryChanged
// Register
event_token QueryChanged(TypedEventHandler<SearchBox, SearchBoxQueryChangedEventArgs> const&
handler) const;

// Revoke with event_token


void QueryChanged(event_token const& cookie) const;

// Revoke with event_revoker


QueryChanged_revoker QueryChanged(auto_revoke_t, TypedEventHandler<SearchBox,
SearchBoxQueryChangedEventArgs> const& handler) const;
public event TypedEventHandler<SearchBox, SearchBoxQueryChangedEventArgs> QueryChanged

<SearchBox QueryChanged="eventhandler"/>
SearchBox.QuerySubmitted SearchBox.QuerySubmitted
SearchBox.QuerySubmitted
I n this Article
Edit
Occurs when the user submits a search query.
public : event TypedEventHandler<SearchBox, SearchBoxQuerySubmittedEventArgs> QuerySubmitted
// Register
event_token QuerySubmitted(TypedEventHandler<SearchBox, SearchBoxQuerySubmittedEventArgs> const&
handler) const;

// Revoke with event_token


void QuerySubmitted(event_token const& cookie) const;

// Revoke with event_revoker


QuerySubmitted_revoker QuerySubmitted(auto_revoke_t, TypedEventHandler<SearchBox,
SearchBoxQuerySubmittedEventArgs> const& handler) const;
public event TypedEventHandler<SearchBox, SearchBoxQuerySubmittedEventArgs> QuerySubmitted

<SearchBox QuerySubmitted="eventhandler"/>

Examples
Here's a basic XAML definition for a SearchBox, and an implementation of the QuerySubmitted handler. It calls
Frame.Navigate to load a search query result page (not shown) that's named SearchResultsPage1 . The this/Me
reference in the handlers is the containing page instance, as is typical for on-page input event handling code. You can
see similar code as part of Quickstart: Adding search to an app and Enabling users to search for information in your .
<SearchBox x:Name="mySearchBox"
FocusOnKeyboardInput="True"
QuerySubmitted="mySearchBox_QuerySubmitted"
Height="35" />

private void mySearchBox_QuerySubmitted(SearchBox sender, SearchBoxQuerySubmittedEventArgs args)


{
this.Frame.Navigate(typeof(SearchResultsPage1), args.QueryText);
}

Private Sub mySearchBox_QuerySubmitted(sender As SearchBox, args As


SearchBoxQuerySubmittedEventArgs)
Me.Frame.Navigate(GetType(SearchResultsPage1), args.QueryText)
End Sub

Remarks
Handle this event so that you can get the QueryText value from SearchBoxQuerySubmittedEventArgs, and pass it on
as navigation data when you load a search results page to display to the user.
For a complete example of how to handle QuerySubmitted as part of a complete example that also does search
suggestions, see SearchBox control sample.
The handler signature for QuerySubmitted uses TypedEventHandler and enforces that the sender parameter be a
SearchBox instance, not just Object.
See Enabling users to search for information in your
Also Quickstart: Adding search to an app
SearchBox control sample
SearchBox.QueryText SearchBox.QueryText SearchBox.
QueryText
I n this Article
Edit
Gets or sets the text contents of the search box.
public : Platform::String QueryText { get; set; }
winrt::hstring QueryText();

void QueryText(winrt::hstring querytext);


public string QueryText { get; set; }

<SearchBox QueryText="string"/>

Returns
string
A string containing the text contents of the search box. The default is an empty string (""). The maximum query text
length is 2048 characters.
SearchBox.QueryTextProperty SearchBox.QueryText
Property SearchBox.QueryTextProperty
I n this Article
Edit
Identifies the QueryText dependency property.
public : static DependencyProperty QueryTextProperty { get; }
static DependencyProperty QueryTextProperty();
public static DependencyProperty QueryTextProperty { get; }

Returns
DependencyProperty
The identifier for the QueryText dependency property.
SearchBox.ResultSuggestionChosen SearchBox.Result
SuggestionChosen SearchBox.ResultSuggestionChosen
I n this Article
Edit
Occurs when the user picks a suggested search result.
public : event TypedEventHandler<SearchBox, SearchBoxResultSuggestionChosenEventArgs>
ResultSuggestionChosen
// Register
event_token ResultSuggestionChosen(TypedEventHandler<SearchBox,
SearchBoxResultSuggestionChosenEventArgs> const& handler) const;

// Revoke with event_token


void ResultSuggestionChosen(event_token const& cookie) const;

// Revoke with event_revoker


ResultSuggestionChosen_revoker ResultSuggestionChosen(auto_revoke_t, TypedEventHandler<SearchBox,
SearchBoxResultSuggestionChosenEventArgs> const& handler) const;
public event TypedEventHandler<SearchBox, SearchBoxResultSuggestionChosenEventArgs>
ResultSuggestionChosen

<SearchBox ResultSuggestionChosen="eventhandler"/>
SearchBox SearchBox SearchBox
I n this Article
Edit
Initializes a new instance of the SearchBox class.

public : SearchBox()
SearchBox() const;
public SearchBox()
SearchBox.SearchHistoryContext SearchBox.Search
HistoryContext SearchBox.SearchHistoryContext
I n this Article
Edit
Gets or sets a string that identifies the context of the search and is used to store the user's search history with the app.
public : Platform::String SearchHistoryContext { get; set; }
winrt::hstring SearchHistoryContext();

void SearchHistoryContext(winrt::hstring searchhistorycontext);


public string SearchHistoryContext { get; set; }

<SearchBox SearchHistoryContext="string"/>

Returns
string
A string that identifies the context of the search. The default is an empty string ("").

Remarks
The search history context string is used as a secondary key for storing search history. The primary key is the AppId.
You can use the search history context string to store different search histories for different pages or search entry
points in the app. If you don't set this property, Windows assumes that all searches in your app occur in the same
context.
SearchBox.SearchHistoryContextProperty SearchBox.
SearchHistoryContextProperty SearchBox.SearchHistory
ContextProperty
I n this Article
Edit
Identifies the SearchHistoryContext dependency property.
public : static DependencyProperty SearchHistoryContextProperty { get; }
static DependencyProperty SearchHistoryContextProperty();
public static DependencyProperty SearchHistoryContextProperty { get; }

Returns
DependencyProperty
The identifier for the SearchHistoryContext dependency property.
SearchBox.SearchHistoryEnabled SearchBox.Search
HistoryEnabled SearchBox.SearchHistoryEnabled
I n this Article
Edit
Gets or sets a value that determines whether search suggestions are made from the search history.
public : Platform::Boolean SearchHistoryEnabled { get; set; }
bool SearchHistoryEnabled();

void SearchHistoryEnabled(bool searchhistoryenabled);


public bool SearchHistoryEnabled { get; set; }

<SearchBox SearchHistoryEnabled="bool"/>

Returns
bool
true if search suggestions are made from the search history; otherwise, false. The default is true.
SearchBox.SearchHistoryEnabledProperty SearchBox.
SearchHistoryEnabledProperty SearchBox.SearchHistory
EnabledProperty
I n this Article
Edit
Identifies the SearchHistoryEnabled dependency property.
public : static DependencyProperty SearchHistoryEnabledProperty { get; }
static DependencyProperty SearchHistoryEnabledProperty();
public static DependencyProperty SearchHistoryEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the SearchHistoryEnabled dependency property.
SearchBox.SetLocalContentSuggestionSettings Search
Box.SetLocalContentSuggestionSettings SearchBox.Set
LocalContentSuggestionSettings
I n this Article
Edit
Specifies whether suggestions based on local files are automatically displayed in the search box suggestions, and
defines the criteria that Windows uses to locate and filter these suggestions.
public : void SetLocalContentSuggestionSettings(LocalContentSuggestionSettings settings)
void SetLocalContentSuggestionSettings(LocalContentSuggestionSettings settings) const;
public void SetLocalContentSuggestionSettings(LocalContentSuggestionSettings settings)

Parameters
settings LocalContentSuggestionSettings
The new settings for local content suggestions.

Examples
Here, suggestions are restricted to one kind of file, music files, using an AQS string. Two of the most common AQS
filters restrict based on file kind, like "kind:music" in the example; and based on file name extension, like "ext:.mp3". You
can learn more about AQS in Advanced Query Syntax.
public MainPage()
{
this.InitializeComponent();

// Let Windows provide suggestions from local files.


var settings = new Windows.ApplicationModel.Search.LocalContentSuggestionSettings();
settings.Enabled = true;
// Access to the music library requires that the Music Library capability
// be declared in the app manifest .
settings.Locations.Add(Windows.Storage.KnownFolders.MusicLibrary);
settings.AqsFilter = "kind:Music";
MySearchBox.SetLocalContentSuggestionSettings(settings);
}

Remarks
When local content suggestions are enabled, Windows provides search suggestions from the user's local files as the
user enters query text. For example, a picture application can configure local content suggestions so that search
suggestions come only from a particular kind of image file that is stored in the user's picture library.
To search a local library, the appropriate capability must be declared in the app manifest. For more info, see App
capability declarations.
SearchBox.SuggestionsRequested SearchBox.Suggestions
Requested SearchBox.SuggestionsRequested
I n this Article
Edit
Occurs when the user's query text changes and the app needs to provide new suggestions to display in the search
pane.
public : event TypedEventHandler<SearchBox, SearchBoxSuggestionsRequestedEventArgs>
SuggestionsRequested
// Register
event_token SuggestionsRequested(TypedEventHandler<SearchBox,
SearchBoxSuggestionsRequestedEventArgs> const& handler) const;

// Revoke with event_token


void SuggestionsRequested(event_token const& cookie) const;

// Revoke with event_revoker


SuggestionsRequested_revoker SuggestionsRequested(auto_revoke_t, TypedEventHandler<SearchBox,
SearchBoxSuggestionsRequestedEventArgs> const& handler) const;
public event TypedEventHandler<SearchBox, SearchBoxSuggestionsRequestedEventArgs>
SuggestionsRequested

<SearchBox SuggestionsRequested="eventhandler"/>

Remarks
You can get suggestions from several sources:
You can define them yourself. For example, you could create a list of car manufacturers.
You can get them from Windows if your app searches local files.
You can get them from a web service or server.
For user experience guidelines for displaying suggestions, see Guidelines and checklist for search.
You can use LocalContentSuggestionSettings to add suggestions, based on local files from Windows, in only a few
lines of code. Alternatively, you can register for the search box control's SuggestionsRequested event and build your
own list of suggestions that is made up of suggestions you retrieved from another source (like a locally-defined list or a
web service).
For code examples that show how to add search suggestions, download the SearchBox control sample. The sample
demonstrates how to add search suggestions by using all three possible sources, and how to add suggestions for East
Asian languages by using alternate forms of the query text generated by an Input Method Editor (IME ). (We
recommend using query text alternatives if your app will be used by Japanese or Chinese users.)
Types of search suggestions
There are two types of suggestions your app can display: suggestions that help users refine a query (query
suggestions), and suggestions that are actual results of a query (result suggestions). You may choose to display either
or both types of suggestions.
If you provide query suggestions and the user selects one, your app should respond by displaying results for the
selected, refined query in your app's search results page.
If you provide result suggestions, you must also register a ResultSuggestionChosen event handler so that you can
respond when the user selects one of your result suggestions and you can display the result to the user.
D isplaying app - provided suggestions
After you obtain suggestions, you display them by adding them to the
SearchSuggestionsRequest.@Windows.ApplicationModel.Search.SearchSuggestionCollection?
text=SearchSuggestionCollection.
If you choose to display both query suggestions and result suggestions, you should group the suggestions by
suggestion type (query or result) and separate the groups using AppendSearchSeparator. Each separator takes the
place of a suggestion and must be followed by at least one suggestion, decreasing the number of suggestions that you
can display.
The maximum length of all of the textual fields in a suggestion (such as text, detail text, and image alt text) is 512
characters.
To learn more about using suggestions to create a good search experience for your users in Guidelines and checklist
for search.
H andling the SuggestionsRequested event asynchronously
If you want to respond to the SuggestionsRequested event asynchronously, you must obtain a
SearchSuggestionsRequestDeferral object before you edit the suggestion list. Here's an example from Quickstart:
Adding search to an app that shows how:
public async static void SearchBox_SuggestionsRequested(
SearchBox sender,
SearchBoxSuggestionsRequestedEventArgs args)
{

// This object lets us edit the SearchSuggestionCollection asynchronously.


var deferral = args.Request.GetDeferral();

try {

// Retrieve the system-supplied suggestions.


var suggestions = args.Request.SearchSuggestionCollection;

var groups = await SampleDataSource.GetGroupsAsync();


foreach (var group in groups)
{
var matchingItems = group.Items.Where(
item => item.Title.StartsWith(
args.QueryText, StringComparison.CurrentCultureIgnoreCase));

foreach (var item in matchingItems)


{
suggestions.AppendQuerySuggestion(item.Title);
}
}

foreach (string alternative in args.LinguisticDetails.QueryTextAlternatives)


{
if (alternative.StartsWith(
args.QueryText, StringComparison.CurrentCultureIgnoreCase))
{
suggestions.AppendQuerySuggestion(alternative);
}
}
}
finally {
deferral.Complete();
}

See Quickstart: Adding search to an app


Also
SearchBoxQueryChangedEventArgs SearchBoxQuery
ChangedEventArgs SearchBoxQueryChangedEventArgs
Class
Provides event data for the SearchBox.QueryChanged event.

D eclaration
public : sealed class SearchBoxQueryChangedEventArgs : ISearchBoxQueryChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::SearchBoxQueryChangedEventArgs :
ISearchBoxQueryChangedEventArgs
public sealed class SearchBoxQueryChangedEventArgs : ISearchBoxQueryChangedEventArgs

I nheritance H ierarchy
None

Remarks
Im p o rt a nt

Although SearchBox is implemented in the Universal device family, it is not fully functional on mobile devices. Use
AutoSuggestBox for your universal search experience. See SearchBox deprecated in favor of AutoSuggestBox.

Properties
Language
Language
Language

Gets the Internet Engineering Task Force (IETF ) language tag (BCP 47 standard) that identifies the language
currently associated with the user's text input device.

LinguisticDetails
LinguisticDetails
LinguisticDetails

Gets information about query text that the user enters through an Input Method Editor (IME ).

QueryText
QueryText
QueryText

Gets the query text of the current search.


SearchBoxQueryChangedEventArgs.Language SearchBox
QueryChangedEventArgs.Language SearchBoxQuery
ChangedEventArgs.Language
I n this Article
Edit
Gets the Internet Engineering Task Force (IETF ) language tag (BCP 47 standard) that identifies the language currently
associated with the user's text input device.
public : Platform::String Language { get; }
winrt::hstring Language();
public string Language { get; }

Returns
string
The IETF BCP 47 standard language tag.
SearchBoxQueryChangedEventArgs.LinguisticDetails
SearchBoxQueryChangedEventArgs.LinguisticDetails
SearchBoxQueryChangedEventArgs.LinguisticDetails
I n this Article
Edit
Gets information about query text that the user enters through an Input Method Editor (IME ).
public : SearchQueryLinguisticDetails LinguisticDetails { get; }
SearchQueryLinguisticDetails LinguisticDetails();
public SearchQueryLinguisticDetails LinguisticDetails { get; }

Returns
SearchQueryLinguisticDetails
Linguistic information about query text that the user enters through an Input Method Editor (IME ).
SearchBoxQueryChangedEventArgs.QueryText SearchBox
QueryChangedEventArgs.QueryText SearchBoxQuery
ChangedEventArgs.QueryText
I n this Article
Edit
Gets the query text of the current search.
public : Platform::String QueryText { get; }
winrt::hstring QueryText();
public string QueryText { get; }

Returns
string
The query text of the current search.
SearchBoxQuerySubmittedEventArgs SearchBoxQuery
SubmittedEventArgs SearchBoxQuerySubmittedEvent
Args Class
Provides event data for the SearchBox.QuerySubmitted event.

D eclaration
public : sealed class SearchBoxQuerySubmittedEventArgs : ISearchBoxQuerySubmittedEventArgs
struct winrt::Windows::UI::Xaml::Controls::SearchBoxQuerySubmittedEventArgs :
ISearchBoxQuerySubmittedEventArgs
public sealed class SearchBoxQuerySubmittedEventArgs : ISearchBoxQuerySubmittedEventArgs

I nheritance H ierarchy
None

Remarks
Im p o rt a nt

Although SearchBox is implemented in the Universal device family, it is not fully functional on mobile devices. Use
AutoSuggestBox for your universal search experience. See SearchBox deprecated in favor of AutoSuggestBox.

Properties
KeyModifiers
KeyModifiers
KeyModifiers

Gets any modifier keys that are pressed when the user presses enter to submit a query.

Language
Language
Language

Gets the Internet Engineering Task Force (IETF ) language tag (BCP 47 standard) that identifies the language
currently associated with the user's text input device.

LinguisticDetails
LinguisticDetails
LinguisticDetails

Gets information about query text that the user enters through an Input Method Editor (IME ).

QueryText
QueryText
QueryText

Gets the query text of the current search.


SearchBoxQuerySubmittedEventArgs.KeyModifiers
SearchBoxQuerySubmittedEventArgs.KeyModifiers
SearchBoxQuerySubmittedEventArgs.KeyModifiers
I n this Article
Edit
Gets any modifier keys that are pressed when the user presses enter to submit a query.
public : VirtualKeyModifiers KeyModifiers { get; }
VirtualKeyModifiers KeyModifiers();
public VirtualKeyModifiers KeyModifiers { get; }

Returns
VirtualKeyModifiers
Any modifier keys that are pressed when the user presses enter to submit a query.
SearchBoxQuerySubmittedEventArgs.Language Search
BoxQuerySubmittedEventArgs.Language SearchBox
QuerySubmittedEventArgs.Language
I n this Article
Edit
Gets the Internet Engineering Task Force (IETF ) language tag (BCP 47 standard) that identifies the language currently
associated with the user's text input device.
public : Platform::String Language { get; }
winrt::hstring Language();
public string Language { get; }

Returns
string
The IETF BCP 47 standard language tag.
SearchBoxQuerySubmittedEventArgs.LinguisticDetails
SearchBoxQuerySubmittedEventArgs.LinguisticDetails
SearchBoxQuerySubmittedEventArgs.LinguisticDetails
I n this Article
Edit
Gets information about query text that the user enters through an Input Method Editor (IME ).
public : SearchQueryLinguisticDetails LinguisticDetails { get; }
SearchQueryLinguisticDetails LinguisticDetails();
public SearchQueryLinguisticDetails LinguisticDetails { get; }

Returns
SearchQueryLinguisticDetails
Linguistic information about query text that the user enters through an Input Method Editor (IME ).
SearchBoxQuerySubmittedEventArgs.QueryText Search
BoxQuerySubmittedEventArgs.QueryText SearchBox
QuerySubmittedEventArgs.QueryText
I n this Article
Edit
Gets the query text of the current search.
public : Platform::String QueryText { get; }
winrt::hstring QueryText();
public string QueryText { get; }

Returns
string
The query text of the current search.
SearchBoxResultSuggestionChosenEventArgs SearchBox
ResultSuggestionChosenEventArgs SearchBoxResult
SuggestionChosenEventArgs Class
Provides event data for the SearchBox.ResultSuggestionChosen event.

D eclaration
public : sealed class SearchBoxResultSuggestionChosenEventArgs :
ISearchBoxResultSuggestionChosenEventArgs
struct winrt::Windows::UI::Xaml::Controls::SearchBoxResultSuggestionChosenEventArgs :
ISearchBoxResultSuggestionChosenEventArgs
public sealed class SearchBoxResultSuggestionChosenEventArgs :
ISearchBoxResultSuggestionChosenEventArgs

I nheritance H ierarchy
None

Remarks
Im p o rt a nt

Although SearchBox is implemented in the Universal device family, it is not fully functional on mobile devices. Use
AutoSuggestBox for your universal search experience. See SearchBox deprecated in favor of AutoSuggestBox.

Constructors
SearchBoxResultSuggestionChosenEventArgs()
SearchBoxResultSuggestionChosenEventArgs()
SearchBoxResultSuggestionChosenEventArgs()

Initializes a new instance of the SearchBoxResultSuggestionChosenEventArgs class.

Properties
KeyModifiers
KeyModifiers
KeyModifiers

Gets any modifier keys that are pressed when the user presses enter to pick a search result.

Tag
Tag
Tag

The app-defined tag for the suggested result that the user selected.
SearchBoxResultSuggestionChosenEventArgs.Key
Modifiers SearchBoxResultSuggestionChosenEventArgs.
KeyModifiers SearchBoxResultSuggestionChosenEvent
Args.KeyModifiers
I n this Article
Edit
Gets any modifier keys that are pressed when the user presses enter to pick a search result.
public : VirtualKeyModifiers KeyModifiers { get; }
VirtualKeyModifiers KeyModifiers();
public VirtualKeyModifiers KeyModifiers { get; }

Returns
VirtualKeyModifiers
Any modifier keys that are pressed when the user presses enter to pick a search result.
SearchBoxResultSuggestionChosenEventArgs SearchBox
ResultSuggestionChosenEventArgs SearchBoxResult
SuggestionChosenEventArgs
I n this Article
Edit
Initializes a new instance of the SearchBoxResultSuggestionChosenEventArgs class.
public : SearchBoxResultSuggestionChosenEventArgs()
SearchBoxResultSuggestionChosenEventArgs() const;
public SearchBoxResultSuggestionChosenEventArgs()
SearchBoxResultSuggestionChosenEventArgs.Tag Search
BoxResultSuggestionChosenEventArgs.Tag SearchBox
ResultSuggestionChosenEventArgs.Tag
I n this Article
Edit
The app-defined tag for the suggested result that the user selected.
public : Platform::String Tag { get; }
winrt::hstring Tag();
public string Tag { get; }

Returns
string
The app-defined tag for the selected search result.
SearchBoxSuggestionsRequestedEventArgs SearchBox
SuggestionsRequestedEventArgs SearchBoxSuggestions
RequestedEventArgs Class
Provides event data for the SearchBox.SuggestionsRequested event.

D eclaration
public : sealed class SearchBoxSuggestionsRequestedEventArgs :
ISearchBoxSuggestionsRequestedEventArgs
struct winrt::Windows::UI::Xaml::Controls::SearchBoxSuggestionsRequestedEventArgs :
ISearchBoxSuggestionsRequestedEventArgs
public sealed class SearchBoxSuggestionsRequestedEventArgs :
ISearchBoxSuggestionsRequestedEventArgs

I nheritance H ierarchy
None

Remarks
Im p o rt a nt

Although SearchBox is implemented in the Universal device family, it is not fully functional on mobile devices. Use
AutoSuggestBox for your universal search experience. See SearchBox deprecated in favor of AutoSuggestBox.

Properties
Language
Language
Language

Gets the Internet Engineering Task Force (IETF ) language tag (BCP 47 standard) that identifies the language
currently associated with the user's text input device.

LinguisticDetails
LinguisticDetails
LinguisticDetails

Gets information about query text that the user enters through an Input Method Editor (IME ).

QueryText
QueryText
QueryText

Gets the query text of the current search.

Request
Request
Request

Gets the object that stores the suggestions and information about this request.
SearchBoxSuggestionsRequestedEventArgs.Language
SearchBoxSuggestionsRequestedEventArgs.Language
SearchBoxSuggestionsRequestedEventArgs.Language
I n this Article
Edit
Gets the Internet Engineering Task Force (IETF ) language tag (BCP 47 standard) that identifies the language currently
associated with the user's text input device.
public : Platform::String Language { get; }
winrt::hstring Language();
public string Language { get; }

Returns
string
The IETF BCP 47 standard language tag.
SearchBoxSuggestionsRequestedEventArgs.Linguistic
Details SearchBoxSuggestionsRequestedEventArgs.
LinguisticDetails SearchBoxSuggestionsRequestedEvent
Args.LinguisticDetails
I n this Article
Edit
Gets information about query text that the user enters through an Input Method Editor (IME ).
public : SearchQueryLinguisticDetails LinguisticDetails { get; }
SearchQueryLinguisticDetails LinguisticDetails();
public SearchQueryLinguisticDetails LinguisticDetails { get; }

Returns
SearchQueryLinguisticDetails
Linguistic information about query text that the user enters through an Input Method Editor (IME ).
SearchBoxSuggestionsRequestedEventArgs.QueryText
SearchBoxSuggestionsRequestedEventArgs.QueryText
SearchBoxSuggestionsRequestedEventArgs.QueryText
I n this Article
Edit
Gets the query text of the current search.
public : Platform::String QueryText { get; }
winrt::hstring QueryText();
public string QueryText { get; }

Returns
string
The query text of the current search.
SearchBoxSuggestionsRequestedEventArgs.Request
SearchBoxSuggestionsRequestedEventArgs.Request
SearchBoxSuggestionsRequestedEventArgs.Request
I n this Article
Edit
Gets the object that stores the suggestions and information about this request.
public : SearchSuggestionsRequest Request { get; }
SearchSuggestionsRequest Request();
public SearchSuggestionsRequest Request { get; }

Returns
SearchSuggestionsRequest
The object that stores the suggestions and information about this request.
See SearchSuggestionsRequest
Also
SectionsInViewChangedEventArgs SectionsInView
ChangedEventArgs SectionsInViewChangedEventArgs
Class
Provides data for the Hub.SectionsInViewChanged event.

D eclaration
public : class SectionsInViewChangedEventArgs : ISectionsInViewChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::SectionsInViewChangedEventArgs :
ISectionsInViewChangedEventArgs
public class SectionsInViewChangedEventArgs : ISectionsInViewChangedEventArgs

I nheritance H ierarchy
None

Properties
AddedSections
AddedSections
AddedSections

Gets a collection that contains the hub sections that moved into view.

RemovedSections
RemovedSections
RemovedSections

Gets a collection that contains the hub sections that moved out of view.
SectionsInViewChangedEventArgs.AddedSections
SectionsInViewChangedEventArgs.AddedSections
SectionsInViewChangedEventArgs.AddedSections
I n this Article
Edit
Gets a collection that contains the hub sections that moved into view.
public : IVector<HubSection> AddedSections { get; }
IVector<HubSection> AddedSections();
public IList<HubSection> AddedSections { get; }

Returns
IList<HubSection>
A collection that contains the hub sections that moved into view.
SectionsInViewChangedEventArgs.RemovedSections
SectionsInViewChangedEventArgs.RemovedSections
SectionsInViewChangedEventArgs.RemovedSections
I n this Article
Edit
Gets a collection that contains the hub sections that moved out of view.
public : IVector<HubSection> RemovedSections { get; }
IVector<HubSection> RemovedSections();
public IList<HubSection> RemovedSections { get; }

Returns
IList<HubSection>
A collection that contains the hub sections that moved into view.
SectionsInViewChangedEventHandler SectionsInView
ChangedEventHandler SectionsInViewChangedEvent
Handler Delegate
Represents the method that will handle a SectionsInViewChanged event.

D eclaration
public : delegate void SectionsInViewChangedEventHandler(Platform::Object sender,
SectionsInViewChangedEventArgs e)
struct SectionsInViewChangedEventHandler : winrt::Windows::Foundation::IUnknown
{
SectionsInViewChangedEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> SectionsInViewChangedEventHandler(L lambda);
template <typename F> SectionsInViewChangedEventHandler(F* function);
template <typename O, typename M> SectionsInViewChangedEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::SectionsInViewChangedEventArgs const& e) const;
};
public delegate void SectionsInViewChangedEventHandler(Object sender,
SectionsInViewChangedEventArgs e)

I nheritance H ierarchy
None
SelectionChangedEventArgs SelectionChangedEventArgs
SelectionChangedEventArgs Class
Provides data for the SelectionChanged event.

D eclaration
public : class SelectionChangedEventArgs : RoutedEventArgs, ISelectionChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::SelectionChangedEventArgs : RoutedEventArgs,
ISelectionChangedEventArgs
public class SelectionChangedEventArgs : RoutedEventArgs, ISelectionChangedEventArgs

I nheritance H ierarchy
RoutedEventArgs

Remarks
Note

For ListView and GridView: If the ItemsSource implements IItemsRangeInfo, and selection is modified using
SelectRange or DeselectRange, the AddedItems and RemovedItems properties are not set. Setting these properties
requires devirtualizing the item object. Use the SelectedRanges property to get the items instead.

Constructors
SelectionChangedEventArgs(IVector<Object>, IVector<Object>)
SelectionChangedEventArgs(IVector<Object>, IVector<Object>)
SelectionChangedEventArgs(IVector<Object>, IVector<Object>)

Initializes a new instance of the SelectionChangedEventArgs class.

Properties
AddedItems
AddedItems
AddedItems

Gets a list that contains the items that were selected.

RemovedItems
RemovedItems
RemovedItems

Gets a list that contains the items that were unselected.

See Also
RoutedEventArgs
SelectionChangedEventArgs.AddedItems Selection
ChangedEventArgs.AddedItems SelectionChangedEvent
Args.AddedItems
I n this Article
Edit
Gets a list that contains the items that were selected.
public : IVector<Platform::Object> AddedItems { get; }
IVector<winrt::Windows::Foundation::IInspectable> AddedItems();
public IList<object> AddedItems { get; }

Returns
IList<object>
The loosely typed collection of items that were selected in this event.

Remarks
Note

For ListView and GridView: If the ItemsSource implements IItemsRangeInfo, and selection is modified using
SelectRange or DeselectRange, the AddedItems and RemovedItems properties are not set. Setting these properties
requires devirtualizing the item object. Use the SelectedRanges property to get the items instead.
SelectionChangedEventArgs.RemovedItems Selection
ChangedEventArgs.RemovedItems SelectionChanged
EventArgs.RemovedItems
I n this Article
Edit
Gets a list that contains the items that were unselected.
public : IVector<Platform::Object> RemovedItems { get; }
IVector<winrt::Windows::Foundation::IInspectable> RemovedItems();
public IList<object> RemovedItems { get; }

Returns
IList<object>
The loosely typed list of items that were unselected in this event.

Remarks
Note

For ListView and GridView: If the ItemsSource implements IItemsRangeInfo, and selection is modified using
SelectRange or DeselectRange, the AddedItems and RemovedItems properties are not set. Setting these properties
requires devirtualizing the item object. Use the SelectedRanges property to get the items instead.
SelectionChangedEventArgs SelectionChangedEventArgs
SelectionChangedEventArgs
I n this Article
Edit
Initializes a new instance of the SelectionChangedEventArgs class.
public : SelectionChangedEventArgs(IVector<Platform::Object> removedItems, IVector<Platform::Object>
addedItems)
SelectionChangedEventArgs(IVector<winrt::Windows::Foundation::IInspectable> removedItems,
IVector<winrt::Windows::Foundation::IInspectable> addedItems) const;
public SelectionChangedEventArgs(IList<Object> removedItems, IList<Object> addedItems)

Parameters
removedItems IList<Object>
Sets the initial AddedItems value. May be null.
addedItems IList<Object>
Sets the initial RemovedItems value. May be null.
SelectionChangedEventHandler SelectionChangedEvent
Handler SelectionChangedEventHandler Delegate
Represents the method that will handle the SelectionChanged event.

D eclaration
public : delegate void SelectionChangedEventHandler(Platform::Object sender,
SelectionChangedEventArgs e)
struct SelectionChangedEventHandler : winrt::Windows::Foundation::IUnknown
{
SelectionChangedEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> SelectionChangedEventHandler(L lambda);
template <typename F> SelectionChangedEventHandler(F* function);
template <typename O, typename M> SelectionChangedEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::SelectionChangedEventArgs const& e) const;
};
public delegate void SelectionChangedEventHandler(Object sender, SelectionChangedEventArgs e)

I nheritance H ierarchy
None
SelectionMode SelectionMode SelectionMode Enum
Defines constants that specify the selection behavior for a ListBox.

D eclaration
public : enum class SelectionMode
enum class winrt::Windows::UI::Xaml::Controls::SelectionMode : int32_t
public enum SelectionMode

I nheritance H ierarchy
None

Fields
Extended Extended The user can select multiple items by entering a special mode, for example when depressing a
Extended modifier key.

Multiple Multiple The user can select multiple items without entering a special mode.
Multiple

Single Single Single The user can select only one item at a time.
SemanticZoom SemanticZoom SemanticZoom Class
Represents a scrollable control that incorporates two views that have a semantic relationship. For example, the
ZoomedOutView might be an index of titles, and the ZoomedInView might include details and summaries for each of
the title entries. Views can be changed using zoom or other interactions.

D eclaration
public : sealed class SemanticZoom : Control, ISemanticZoom
struct winrt::Windows::UI::Xaml::Controls::SemanticZoom : Control, ISemanticZoom
public sealed class SemanticZoom : Control, ISemanticZoom

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
The SemanticZoom control enables the user to zoom between two different views of the same content so that they can
quickly navigate through a large data set. The zoomed -in view is the main view of the content. You show the complete
data set in this view. The zoomed -out view is a higher-level view of the same content. You typically show the group
headers for a grouped data set in this view. For example, when viewing an address book, the user could zoom in on a
letter and see the names associated with that letter.
To define the zoomed-in view and the zoomed-out view of the SemanticZoom control, you can use any two controls
that implement the ISemanticZoomInformation interface. The Extensible Application Markup Language (XAML )
framework provides several controls that implement this interface: ListView, GridView, and Hub. You set these controls
to the ZoomedInView and ZoomedOutView properties of the SemanticZoom.
The user can switch between views with touch using the pinch-in and pinch-out gestures. By default, the zoomed-in
view also shows a button that the user can press to activate the zoomed-out view. You can hide the zoom-out button by
setting the IsZoomOutButtonEnabled property to false. You can switch between views programmatically by setting the
IsZoomedInViewActive property.
The ZoomedInView and ZoomedOutView should be synchronized, so if a user selects a group in the ZoomedOutView,
the details of that group are shown in the ZoomedInView. You can use a CollectionViewSource or add code to
synchronize the views. Any controls that you bind to the same CollectionViewSource will always have the same current
item. If both views use the same CollectionViewSource as the their data source, the CollectionViewSource will
synchronize the views automatically. Otherwise, you can handle the ViewChangeStarted event and synchronize the
items in the event handler like this.
private void SemanticZoom_ViewChangeStarted(object sender, SemanticZoomViewChangedEventArgs e)
{
if (e.IsSourceZoomedInView == false)
{
e.DestinationItem.Item = e.SourceItem.Item;
}
}

When you use a GridView in a SemanticZoom control, always set the ScrollViewer.IsHorizontalScrollChainingEnabled
attached property to false on the ScrollViewer that's in the GridView 's control template, like this:
<GridView ScrollViewer.IsHorizontalScrollChainingEnabled="False"> . When you use a ListView in a
SemanticZoom control, always set the ScrollViewer.IsVerticalScrollChainingEnabled attached property to false, like
this: <ListView ScrollViewer.IsVerticalScrollChainingEnabled="False"> .

Constructors
SemanticZoom()
SemanticZoom()
SemanticZoom()

Initializes a new instance of the SemanticZoom class.

Properties
CanChangeViews
CanChangeViews
CanChangeViews

Gets or sets a value that declares whether the SemanticZoom can change display views.

CanChangeViewsProperty
CanChangeViewsProperty
CanChangeViewsProperty

Identifies the CanChangeViews dependency property.

IsZoomedInViewActive
IsZoomedInViewActive
IsZoomedInViewActive

Gets or sets a value that determines whether the ZoomedInView is the active view.

IsZoomedInViewActiveProperty
IsZoomedInViewActiveProperty
IsZoomedInViewActiveProperty

Identifies the IsZoomedInViewActive dependency property.

IsZoomOutButtonEnabled
IsZoomOutButtonEnabled
IsZoomOutButtonEnabled

Gets or sets a value that indicates whether the ZoomedInView shows a button that activates the ZoomedOutView.

IsZoomOutButtonEnabledProperty
IsZoomOutButtonEnabledProperty
IsZoomOutButtonEnabledProperty
Identifies the IsZoomOutButtonEnabled dependency property.

ZoomedInView
ZoomedInView
ZoomedInView

Gets or sets the semantically more complete zoomed-in view of the SemanticZoom.

ZoomedInViewProperty
ZoomedInViewProperty
ZoomedInViewProperty

Identifies the ZoomedInView dependency property.

ZoomedOutView
ZoomedOutView
ZoomedOutView

Gets or sets the zoomed-out view of the SemanticZoom.

ZoomedOutViewProperty
ZoomedOutViewProperty
ZoomedOutViewProperty

Identifies the ZoomedOutView dependency property.

Methods
ToggleActiveView()
ToggleActiveView()
ToggleActiveView()

Changes from the current active view to the other possible view. For example, if IsZoomedInViewActive is true,
calling this method changes to zoomed-out view.

Events
ViewChangeCompleted
ViewChangeCompleted
ViewChangeCompleted

Occurs when a view change is complete and the view is displayed.

ViewChangeStarted
ViewChangeStarted
ViewChangeStarted

Occurs when a view change is requested.

See Also
Control
Control
Control
SemanticZoom.CanChangeViews SemanticZoom.Can
ChangeViews SemanticZoom.CanChangeViews
I n this Article
Edit
Gets or sets a value that declares whether the SemanticZoom can change display views.
public : Platform::Boolean CanChangeViews { get; set; }
bool CanChangeViews();

void CanChangeViews(bool canchangeviews);


public bool CanChangeViews { get; set; }

<SemanticZoom CanChangeViews="bool" />

Returns
bool
true if views can be changed; otherwise, false. The default is true.
SemanticZoom.CanChangeViewsProperty Semantic
Zoom.CanChangeViewsProperty SemanticZoom.Can
ChangeViewsProperty
I n this Article
Edit
Identifies the CanChangeViews dependency property.
public : static DependencyProperty CanChangeViewsProperty { get; }
static DependencyProperty CanChangeViewsProperty();
public static DependencyProperty CanChangeViewsProperty { get; }

Returns
DependencyProperty
The identifier for the CanChangeViews dependency property.
SemanticZoom.IsZoomedInViewActive SemanticZoom.Is
ZoomedInViewActive SemanticZoom.IsZoomedInView
Active
I n this Article
Edit
Gets or sets a value that determines whether the ZoomedInView is the active view.
public : Platform::Boolean IsZoomedInViewActive { get; set; }
bool IsZoomedInViewActive();

void IsZoomedInViewActive(bool iszoomedinviewactive);


public bool IsZoomedInViewActive { get; set; }

<SemanticZoom IsZoomedInViewActive="bool" />

Returns
bool
true if the ZoomedInView is the active view. false if the ZoomedOutView is the active view.
SemanticZoom.IsZoomedInViewActiveProperty Semantic
Zoom.IsZoomedInViewActiveProperty SemanticZoom.Is
ZoomedInViewActiveProperty
I n this Article
Edit
Identifies the IsZoomedInViewActive dependency property.
public : static DependencyProperty IsZoomedInViewActiveProperty { get; }
static DependencyProperty IsZoomedInViewActiveProperty();
public static DependencyProperty IsZoomedInViewActiveProperty { get; }

Returns
DependencyProperty
The identifier for the IsZoomedInViewActive dependency property.
SemanticZoom.IsZoomOutButtonEnabled Semantic
Zoom.IsZoomOutButtonEnabled SemanticZoom.IsZoom
OutButtonEnabled
I n this Article
Edit
Gets or sets a value that indicates whether the ZoomedInView shows a button that activates the ZoomedOutView.
public : Platform::Boolean IsZoomOutButtonEnabled { get; set; }
bool IsZoomOutButtonEnabled();

void IsZoomOutButtonEnabled(bool iszoomoutbuttonenabled);


public bool IsZoomOutButtonEnabled { get; set; }

<SemanticZoom IsZoomOutButtonEnabled="bool" />

Returns
bool
True if the ZoomedInView shows a button that activates the ZoomedOutView; otherwise, false. The default is true.

Remarks
By default, when the zoomed in view is active and receives mouse or keyboard input, the SemanticZoom control shows
a button the user can click to activate the zoomed out view. To hide this button, set the IsZoomOutButtonEnabled
property to false.
SemanticZoom.IsZoomOutButtonEnabledProperty
SemanticZoom.IsZoomOutButtonEnabledProperty
SemanticZoom.IsZoomOutButtonEnabledProperty
I n this Article
Edit
Identifies the IsZoomOutButtonEnabled dependency property.
public : static DependencyProperty IsZoomOutButtonEnabledProperty { get; }
static DependencyProperty IsZoomOutButtonEnabledProperty();
public static DependencyProperty IsZoomOutButtonEnabledProperty { get; }

Returns
DependencyProperty
The identifier of the IsZoomOutButtonEnabled dependency property.
SemanticZoom SemanticZoom SemanticZoom
I n this Article
Edit
Initializes a new instance of the SemanticZoom class.

public : SemanticZoom()
SemanticZoom() const;
public SemanticZoom()
SemanticZoom.ToggleActiveView SemanticZoom.Toggle
ActiveView SemanticZoom.ToggleActiveView
I n this Article
Edit
Changes from the current active view to the other possible view. For example, if IsZoomedInViewActive is true, calling
this method changes to zoomed-out view.
public : void ToggleActiveView()
void ToggleActiveView() const;
public void ToggleActiveView()
SemanticZoom.ViewChangeCompleted SemanticZoom.
ViewChangeCompleted SemanticZoom.ViewChange
Completed
I n this Article
Edit
Occurs when a view change is complete and the view is displayed.
public : event SemanticZoomViewChangedEventHandler ViewChangeCompleted
// Register
event_token ViewChangeCompleted(SemanticZoomViewChangedEventHandler const& handler) const;

// Revoke with event_token


void ViewChangeCompleted(event_token const& cookie) const;

// Revoke with event_revoker


ViewChangeCompleted_revoker ViewChangeCompleted(auto_revoke_t, SemanticZoomViewChangedEventHandler
const& handler) const;
public event SemanticZoomViewChangedEventHandler ViewChangeCompleted

<SemanticZoom ViewChangeCompleted="eventhandler" />


SemanticZoom.ViewChangeStarted SemanticZoom.View
ChangeStarted SemanticZoom.ViewChangeStarted
I n this Article
Edit
Occurs when a view change is requested.
public : event SemanticZoomViewChangedEventHandler ViewChangeStarted
// Register
event_token ViewChangeStarted(SemanticZoomViewChangedEventHandler const& handler) const;

// Revoke with event_token


void ViewChangeStarted(event_token const& cookie) const;

// Revoke with event_revoker


ViewChangeStarted_revoker ViewChangeStarted(auto_revoke_t, SemanticZoomViewChangedEventHandler
const& handler) const;
public event SemanticZoomViewChangedEventHandler ViewChangeStarted

<SemanticZoom ViewChangeStarted="eventhandler" />


SemanticZoom.ZoomedInView SemanticZoom.ZoomedIn
View SemanticZoom.ZoomedInView
I n this Article
Edit
Gets or sets the semantically more complete zoomed-in view of the SemanticZoom.
public : ISemanticZoomInformation ZoomedInView { get; set; }
ISemanticZoomInformation ZoomedInView();

void ZoomedInView(ISemanticZoomInformation zoomedinview);


public ISemanticZoomInformation ZoomedInView { get; set; }

<SemanticZoom ...>
<SemanticZoom.ZoomedInView>
zoomedInViewContent
</SemanticZoom.ZoomedInView>
</SemanticZoom>

Returns
ISemanticZoomInformation
An object that implements ISemanticZoomInfo. Typically this is a practical ListViewBase implementation such as
GridView.
SemanticZoom.ZoomedInViewProperty SemanticZoom.
ZoomedInViewProperty SemanticZoom.ZoomedInView
Property
I n this Article
Edit
Identifies the ZoomedInView dependency property.
public : static DependencyProperty ZoomedInViewProperty { get; }
static DependencyProperty ZoomedInViewProperty();
public static DependencyProperty ZoomedInViewProperty { get; }

Returns
DependencyProperty
The identifier for the ZoomedInView dependency property.
SemanticZoom.ZoomedOutView SemanticZoom.Zoomed
OutView SemanticZoom.ZoomedOutView
I n this Article
Edit
Gets or sets the zoomed-out view of the SemanticZoom.
public : ISemanticZoomInformation ZoomedOutView { get; set; }
ISemanticZoomInformation ZoomedOutView();

void ZoomedOutView(ISemanticZoomInformation zoomedoutview);


public ISemanticZoomInformation ZoomedOutView { get; set; }

<SemanticZoom ...>
<SemanticZoom.ZoomedOutView>
zoomedOutViewContent
</SemanticZoom.ZoomedOut>
</SemanticZoom>

Returns
ISemanticZoomInformation
An object that implements ISemanticZoomInfo. Typically this is a practical ListViewBase implementation such as
GridView.
SemanticZoom.ZoomedOutViewProperty Semantic
Zoom.ZoomedOutViewProperty SemanticZoom.Zoomed
OutViewProperty
I n this Article
Edit
Identifies the ZoomedOutView dependency property.
public : static DependencyProperty ZoomedOutViewProperty { get; }
static DependencyProperty ZoomedOutViewProperty();
public static DependencyProperty ZoomedOutViewProperty { get; }

Returns
DependencyProperty
The identifier for the ZoomedOutView dependency property.
SemanticZoomLocation SemanticZoomLocation
SemanticZoomLocation Class
Communicates information for items and view state in a SemanticZoom, such that hosts for scrolling and virtualization
(such as ListViewBase ) can get correct item and bounds information.

D eclaration
public : sealed class SemanticZoomLocation : ISemanticZoomLocation
struct winrt::Windows::UI::Xaml::Controls::SemanticZoomLocation : ISemanticZoomLocation
public sealed class SemanticZoomLocation : ISemanticZoomLocation

I nheritance H ierarchy
None

Constructors
SemanticZoomLocation()
SemanticZoomLocation()
SemanticZoomLocation()

Initializes a new instance of the SemanticZoomLocation class.

Properties
Bounds
Bounds
Bounds

Gets or sets the sizing bounds of the item as it exists in the current view of a SemanticZoom.

Item
Item
Item

Gets or sets the display item as it exists in the current view of a SemanticZoom.
SemanticZoomLocation.Bounds SemanticZoomLocation.
Bounds SemanticZoomLocation.Bounds
I n this Article
Edit
Gets or sets the sizing bounds of the item as it exists in the current view of a SemanticZoom.
public : Rect Bounds { get; set; }
Rect Bounds();

void Bounds(Rect bounds);


public Rect Bounds { get; set; }

Returns
Rect
The sizing bounds of the item.
SemanticZoomLocation.Item SemanticZoomLocation.
Item SemanticZoomLocation.Item
I n this Article
Edit
Gets or sets the display item as it exists in the current view of a SemanticZoom.
public : Platform::Object Item { get; set; }
winrt::Windows::Foundation::IInspectable Item();

void Item(winrt::Windows::Foundation::IInspectable item);


public object Item { get; set; }

Returns
object
The specific item in the SemanticZoom.
SemanticZoomLocation SemanticZoomLocation
SemanticZoomLocation
I n this Article
Edit
Initializes a new instance of the SemanticZoomLocation class.
public : SemanticZoomLocation()
SemanticZoomLocation() const;
public SemanticZoomLocation()
SemanticZoomViewChangedEventArgs SemanticZoom
ViewChangedEventArgs SemanticZoomViewChanged
EventArgs Class
Provides event data for the ViewChangeStarted and ViewChangeCompleted events.

D eclaration
public : sealed class SemanticZoomViewChangedEventArgs : ISemanticZoomViewChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::SemanticZoomViewChangedEventArgs :
ISemanticZoomViewChangedEventArgs
public sealed class SemanticZoomViewChangedEventArgs : ISemanticZoomViewChangedEventArgs

I nheritance H ierarchy
None

Constructors
SemanticZoomViewChangedEventArgs()
SemanticZoomViewChangedEventArgs()
SemanticZoomViewChangedEventArgs()

Initializes a new instance of the SemanticZoomViewChangedEventArgs class.

Properties
DestinationItem
DestinationItem
DestinationItem

Provides information about the item and its bounds, once the view change is complete.

IsSourceZoomedInView
IsSourceZoomedInView
IsSourceZoomedInView

Gets or sets a value that indicates whether the starting view is the ZoomedInView.

SourceItem
SourceItem
SourceItem

Provides information about the item and its bounds, for the item as represented in the previous view.
SemanticZoomViewChangedEventArgs.DestinationItem
SemanticZoomViewChangedEventArgs.DestinationItem
SemanticZoomViewChangedEventArgs.DestinationItem
I n this Article
Edit
Provides information about the item and its bounds, once the view change is complete.
public : SemanticZoomLocation DestinationItem { get; set; }
SemanticZoomLocation DestinationItem();

void DestinationItem(SemanticZoomLocation destinationitem);


public SemanticZoomLocation DestinationItem { get; set; }

Returns
SemanticZoomLocation
Information about the item and its bounds.
SemanticZoomViewChangedEventArgs.IsSourceZoomed
InView SemanticZoomViewChangedEventArgs.IsSource
ZoomedInView SemanticZoomViewChangedEventArgs.Is
SourceZoomedInView
I n this Article
Edit
Gets or sets a value that indicates whether the starting view is the ZoomedInView.
public : Platform::Boolean IsSourceZoomedInView { get; set; }
bool IsSourceZoomedInView();

void IsSourceZoomedInView(bool issourcezoomedinview);


public bool IsSourceZoomedInView { get; set; }

Returns
bool
true if the starting view is the ZoomedInView; otherwise, false.
SemanticZoomViewChangedEventArgs SemanticZoom
ViewChangedEventArgs SemanticZoomViewChanged
EventArgs
I n this Article
Edit
Initializes a new instance of the SemanticZoomViewChangedEventArgs class.
public : SemanticZoomViewChangedEventArgs()
SemanticZoomViewChangedEventArgs() const;
public SemanticZoomViewChangedEventArgs()
SemanticZoomViewChangedEventArgs.SourceItem
SemanticZoomViewChangedEventArgs.SourceItem
SemanticZoomViewChangedEventArgs.SourceItem
I n this Article
Edit
Provides information about the item and its bounds, for the item as represented in the previous view.
public : SemanticZoomLocation SourceItem { get; set; }
SemanticZoomLocation SourceItem();

void SourceItem(SemanticZoomLocation sourceitem);


public SemanticZoomLocation SourceItem { get; set; }

Returns
SemanticZoomLocation
Information about the item and its bounds.
SemanticZoomViewChangedEventHandler Semantic
ZoomViewChangedEventHandler SemanticZoomView
ChangedEventHandler Delegate
Represents the method that will handle the ViewChangeStarted and ViewChangeCompleted events.

D eclaration
public : delegate void SemanticZoomViewChangedEventHandler(Platform::Object sender,
SemanticZoomViewChangedEventArgs e)
struct SemanticZoomViewChangedEventHandler : winrt::Windows::Foundation::IUnknown
{
SemanticZoomViewChangedEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> SemanticZoomViewChangedEventHandler(L lambda);
template <typename F> SemanticZoomViewChangedEventHandler(F* function);
template <typename O, typename M> SemanticZoomViewChangedEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::SemanticZoomViewChangedEventArgs const& e) const;
};
public delegate void SemanticZoomViewChangedEventHandler(Object sender,
SemanticZoomViewChangedEventArgs e)

I nheritance H ierarchy
None
SettingsFlyout SettingsFlyout SettingsFlyout Class
Note

SettingsFlyout is not supported for use in Universal Windows Platform (UWP ) app for Windows 10. Instead, use a
Flyout.
Note

SettingsFlyout is supported only for use with the SettingsPane in Windows 8. While the SettingsFlyout type is visible
in Windows Phone projects, SettingsPane is not present on Windows Phone, so use of SettingsFlyout is not supported.
Represents a control that provides in-context access to settings that affect the current app. (Not recommended for
Universal Windows Platform (UWP ) app.)

D eclaration
public : class SettingsFlyout : ContentControl, ISettingsFlyout
struct winrt::Windows::UI::Xaml::Controls::SettingsFlyout : ContentControl, ISettingsFlyout
public class SettingsFlyout : ContentControl, ISettingsFlyout

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
A SettingsFlyout control isn't intended to be a composite part of a page or general app UI. Instead, a SettingsFlyout
control is typically defined as a separate XAML file, where the class you're defining is a SettingsFlyout subclass that's
unique to your project, using a SettingsFlyout object element as a XAML file root. In Microsoft Visual Studio, you can
use the Add New Item menu options for a project to add the files to your project using a basic starting template. This
starting template sets styles for items contained by the SettingsFlyout control that reference existing pre-defined styles.
For example, there's a style for a section header that references the TitleTextBlockStyle style that's defined by the
Windows Runtime as a XAML resource. The generated XAML also provides some initial attribute values that are
intended to be replaced. For example it sets the initial Title value to use the class name. You'll also want to add controls
or other UI to the content section to replace the templated UI it starts with.
Showing and dismissing a Settings flyout
Users can access your SettingsFlyout control through the Settings charm. You can programmatically show a
SettingsFlyout control by calling the Show or ShowIndependent methods, and dismiss it by calling Hide. A
SettingsFlyout always includes a back button in its header area that uses the typical arrow glyph (this button isn't part
of the adjustable XAML template, it's always there and is added by default control logic). By default, the back button
dismisses the flyout.
If a SettingsFlyout control is shown by calling Show, clicking the back button dismisses the flyout and reopens the
settings pane. If a SettingsFlyout is shown by calling ShowIndependent, clicking the back button dismisses the flyout
and returns the user to the app. For example, if you open a SettingsFlyout control from a "Settings" button in your app,
you will typically call ShowIndependent so users are returned directly to your app when they dismiss the flyout.
Only one SettingsFlyout control can be shown at a time. Calling Show on any SettingsFlyout instance hides any other
SettingsFlyout instance currently shown.
You can override the default back button behavior by handling the BackClick event. This event is raised whenever the
user clicks the back button. To override the default behavior, wire an event handler for the event and set the
BackClickEventArgs.Handled property to true. This is useful when you have a SettingsFlyout that opens a second
SettingsFlyout. By default, when the user taps the Back button on the second flyout, it will open the SettingsPane. You
should handle the BackClick event and open the first flyout instead.
Connecting to the SettingsPane
You must manually associate the SettingsFlyout control with the app’s SettingsPane object. Do this by handling the
SettingsPane.CommandsRequested event and adding a SettingsCommand to the ApplicationCommands collection.
The SettingsCommand has a label for your SettingsFlyout control that’s shown in the Settings charm, and specifies a
method that's executed when a user selects the command in the Settings charm. In this method, you create an
instance of the SettingsFlyout control and show it.
We recommend that you add the CommandsRequested event handler in the overridden OnWindowCreated method,
and remove it in theSuspending Application.Suspending event handler method. See the examples section for more
info.
D efining a Settings flyout
To add a SettingsFlyout control to an app project in Microsoft Visual Studio:
1. Right-click your project in Solution Explorer. Select Project > Add New Item.
2. In the Add New Item dialog, select Settings Flyout from the middle pane.
3. Type a name for the SettingsFlyout control subclass in the Name field and click Add.
Note

When you add a SettingsFlyout control, you're creating a new class with a name you choose. When you look at the
generated code-behind file, you'll see that the class you define is subclassing from SettingsFlyout.
To instantiate your SettingsFlyout control, use the class name you specified and the default constructor for it. For
example, if you named your SettingsFlyout class as UpdateSettingsFlyout , you'd call new UpdateSettingsFlyout() .

For more information and detailed steps, see Quickstart: Add app settings and Quickstart: Add app help.

Constructors
SettingsFlyout()
SettingsFlyout()
SettingsFlyout()

Initializes a new instance of the SettingsFlyout class.

Properties
HeaderBackground
HeaderBackground
HeaderBackground

Gets or sets the Brush that fills the background of the SettingsFlyout header.

HeaderBackgroundProperty
HeaderBackgroundProperty
HeaderBackgroundProperty
Identifies the HeaderBackground dependency property.

HeaderForeground
HeaderForeground
HeaderForeground

Gets or sets the Brush that fills the foreground of the SettingsFlyout header.

HeaderForegroundProperty
HeaderForegroundProperty
HeaderForegroundProperty

Identifies the HeaderForeground dependency property.

IconSource
IconSource
IconSource

Gets or sets the icon image displayed in the SettingsFlyout header.

IconSourceProperty
IconSourceProperty
IconSourceProperty

Identifies the IconSource dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a SettingsFlyout control.

Title
Title
Title

Gets or sets the title of the SettingsFlyout control when displayed.

TitleProperty
TitleProperty
TitleProperty

Identifies the Title dependency property.


Methods
Hide()
Hide()
Hide()

Closes the Settings flyout.

Show()
Show()
Show()

Opens the Settings flyout, and returns the user to the Settings pane after the flyout is dismissed.

ShowIndependent()
ShowIndependent()
ShowIndependent()

Opens the Settings flyout, and returns the user to the app after the flyout is dismissed.

Events
BackClick
BackClick
BackClick

Occurs when the user clicks the back button on a SettingsFlyout control.

See Also
ContentControl
ContentControl
ContentControl
ContentControl
SettingsFlyout.BackClick SettingsFlyout.BackClick
SettingsFlyout.BackClick
I n this Article
Edit
Occurs when the user clicks the back button on a SettingsFlyout control.
public : event BackClickEventHandler BackClick
// Register
event_token BackClick(BackClickEventHandler const& handler) const;

// Revoke with event_token


void BackClick(event_token const& cookie) const;

// Revoke with event_revoker


BackClick_revoker BackClick(auto_revoke_t, BackClickEventHandler const& handler) const;
public event BackClickEventHandler BackClick

<SettingsFlyout BackClick="eventhandler"/>

Examples
In this scenario, the Settings charm is used to open a SettingsFlyout that contains a list of accounts. When the user
picks an account, a new SettingsFlyout is shown with options for the selected account.
Here, you handle the BackClick event of the second flyout so that when the user clicks the Back button, you show the
account list again instead of the SettingsPane.
void AccountSettingsFlyout_BackClick(object sender, BackClickEventArgs e)
{
e.Handled = true;
AccountListSettingsFlyout accountList = new AccountListSettingsFlyout();
accountList.Show();
}

For more code in context, see Scenario 5 of the App settings sample.

Remarks
By default, clicking the back button on a SettingsFlyout control hides the control. Handle the BackClick event and set
BackClickEventArgs.Handled to true to override this behavior and introduce your own logic.
This is useful when you have a SettingsFlyout that opens a second SettingsFlyout. By default, when the user taps the
Back button on the second flyout, it will reopen the SettingsPane. You should handle the BackClick event and reopen
the first flyout instead.
SettingsFlyout.HeaderBackground SettingsFlyout.Header
Background SettingsFlyout.HeaderBackground
I n this Article
Edit
Gets or sets the Brush that fills the background of the SettingsFlyout header.
public : Brush HeaderBackground { get; set; }
Brush HeaderBackground();

void HeaderBackground(Brush headerbackground);


public Brush HeaderBackground { get; set; }

<SettingsFlyout HeaderBackground="{StaticResource resourceName}"/>

Returns
Brush
The brush that provides the background of the SettingsFlyout header. The default is a null brush from a pure code
perspective, but the default control template for SettingsFlyout applies a theme resource brush
(SettingsFlyoutHeaderBackgroundThemeBrush) for this in a runtime instance of a SettingsFlyout control.

See Use brushes


Also
SettingsFlyout.HeaderBackgroundProperty Settings
Flyout.HeaderBackgroundProperty SettingsFlyout.
HeaderBackgroundProperty
I n this Article
Edit
Identifies the HeaderBackground dependency property.
public : static DependencyProperty HeaderBackgroundProperty { get; }
static DependencyProperty HeaderBackgroundProperty();
public static DependencyProperty HeaderBackgroundProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderBackground dependency property.
SettingsFlyout.HeaderForeground SettingsFlyout.Header
Foreground SettingsFlyout.HeaderForeground
I n this Article
Edit
Gets or sets the Brush that fills the foreground of the SettingsFlyout header.
public : Brush HeaderForeground { get; set; }
Brush HeaderForeground();

void HeaderForeground(Brush headerforeground);


public Brush HeaderForeground { get; set; }

<SettingsFlyout HeaderForeground="{StaticResource resourceName}"/>

Returns
Brush
The brush that provides the foreground of the SettingsFlyout header. The default is a null brush from a pure code
perspective, but the default control template for SettingsFlyout applies a theme resource brush
(SettingsFlyoutHeaderForegroundThemeBrush) for this in a runtime instance of a SettingsFlyout control.

See Use brushes


Also
SettingsFlyout.HeaderForegroundProperty Settings
Flyout.HeaderForegroundProperty SettingsFlyout.Header
ForegroundProperty
I n this Article
Edit
Identifies the HeaderForeground dependency property.
public : static DependencyProperty HeaderForegroundProperty { get; }
static DependencyProperty HeaderForegroundProperty();
public static DependencyProperty HeaderForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderForeground dependency property.
SettingsFlyout.Hide SettingsFlyout.Hide SettingsFlyout.
Hide
I n this Article
Edit
Closes the Settings flyout.
public : void Hide()
void Hide() const;
public void Hide()

Remarks
By default, the settings flyout is dismissed when the user presses the back button, and is always light-dismissed when
the user taps outside of it. In most cases, you will not need to call the Hide method to dismiss the settings flyout.
Calling the Hide method has the same behavior as light dismiss. It always returns the user to your app and closes the
settings pane, regardless of whether the settings flyout was opened by calling Show or ShowIndependent.
SettingsFlyout.IconSource SettingsFlyout.IconSource
SettingsFlyout.IconSource
I n this Article
Edit
Gets or sets the icon image displayed in the SettingsFlyout header.
public : ImageSource IconSource { get; set; }
ImageSource IconSource();

void IconSource(ImageSource iconsource);


public ImageSource IconSource { get; set; }

<SettingsFlyout IconSource="uri"/>

Returns
ImageSource
The icon image displayed in the SettingsFlyout header area, typically to the right of the Title. The default is null, which
results in no displayed image.

Remarks
Note

Even though the default property value is null, the Microsoft Visual Studio Settings Flyout item template sets the
IconSource to your app’s small logo ( IconSource="Assets/SmallLogo.png" ).
The IconSource property is typically set in XAML to take advantage of the built-in conversion from string.
If you do set the IconSource property in code, you can use a BitmapImage object, constructed with the Uniform
Resource Identifier (URI) that describes the path to a valid image source file. You can also initialize a BitmapSource
with a stream, perhaps a stream from a storage file, but that's not typical for a SettingsFlyout UI scenario.
Setting I conSource in X A ML
If you set the IconSource property as an attribute in XAML, you are setting the IconSource property using a Uniform
Resource Identifier (URI). This behavior relies on underlying type conversion that processes the string as a Uniform
Resource Identifier (URI), and calls the equivalent of the BitmapImage(Uri) constructor. The XAML parser interprets
any strings that represent a relative Uniform Resource Identifier (URI), using the base Uniform Resource Identifier
(URI) of the XAML page that is being parsed. For example, if you specify a value "Images/myimage.png" in XAML, that
string is interpreted as a relative path suffix that is appended to the base Uniform Resource Identifier (URI) location
within the app package where the XAML page itself exists.
<SettingsFlyout Width="346" IconSource="Images/myimage.png" />

A property element syntax in XAML is also possible, specifying a BitmapImage object element with valid source as the
property value.
SettingsFlyout.IconSourceProperty SettingsFlyout.Icon
SourceProperty SettingsFlyout.IconSourceProperty
I n this Article
Edit
Identifies the IconSource dependency property.
public : static DependencyProperty IconSourceProperty { get; }
static DependencyProperty IconSourceProperty();
public static DependencyProperty IconSourceProperty { get; }

Returns
DependencyProperty
The identifier for the IconSource dependency property.
SettingsFlyout SettingsFlyout SettingsFlyout
I n this Article
Edit
Initializes a new instance of the SettingsFlyout class.

public : SettingsFlyout()
SettingsFlyout() const;
public SettingsFlyout()
SettingsFlyout.Show SettingsFlyout.Show SettingsFlyout.
Show
I n this Article
Edit
Opens the Settings flyout, and returns the user to the Settings pane after the flyout is dismissed.
public : void Show()
void Show() const;
public void Show()

Examples
private void App_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
{
// Add update settings.
Windows.UI.ApplicationSettings.SettingsCommand updateSetting =
new Windows.UI.ApplicationSettings.SettingsCommand("AppUpdateSettings", "App updates",
(handler) =>
{
UpdateSettingsFlyout updatesFlyout = new UpdateSettingsFlyout();
updatesFlyout.Show();
});

args.Request.ApplicationCommands.Add(updateSetting);

// Add account list.


Windows.UI.ApplicationSettings.SettingsCommand accountListSetting =
new Windows.UI.ApplicationSettings.SettingsCommand("AppAccountListSettings", "Accounts",
(handler) =>
{
AccountListSettingsFlyout accountsListFlyout = new AccountListSettingsFlyout();
accountsListFlyout.Show();
});

args.Request.ApplicationCommands.Add(accountListSetting);
}

For more code in context, see Scenario 3 of the App settings sample.

Remarks
If a SettingsFlyout is shown by calling the Show method, then clicking the Back button reopens the SettingsPane after
the SettingsFlyout dismisses. If a SettingsFlyout is shown by calling ShowIndependent, then clicking the Back button
dismisses the SettingsFlyout and returns the user to the app; the SettingsPane is not reopened.
Call the Show method in your CommandsRequested event handler. This code is invoked when the user opens the
SettingsFlyout from the SettingsPane, so you should return the user to the SettingsPane when they click the Back
button.
Only one SettingsFlyout is shown at a time. Calling Show on a SettingsFlyout closes any other SettingsFlyout currently
shown. The SettingsFlyout being closed completes its close animation before the new SettingsFlyout begins its show
animation.
See Quickstart: Add app settings
Also Quickstart: Add app help
SettingsFlyout.ShowIndependent SettingsFlyout.Show
Independent SettingsFlyout.ShowIndependent
I n this Article
Edit
Opens the Settings flyout, and returns the user to the app after the flyout is dismissed.
public : void ShowIndependent()
void ShowIndependent() const;
public void ShowIndependent()

Examples
This example shows how to use the ShowIndependent method to open a SettingsFlyout from a button in your app.
<Button Content="App update settings" Click="UpdateSettingsButton_Click"/>

private void UpdateSettingsButton_Click(object sender, RoutedEventArgs e)


{
UpdateSettingsFlyout updatesFlyout = new UpdateSettingsFlyout();
updatesFlyout.ShowIndependent();
}

For more code in context, see Scenario 4 of the App settings sample and Quickstart: Add app help.

Remarks
If a SettingsFlyout is shown by calling the Show method, then clicking the Back button reopens the SettingsPane after
the SettingsFlyout dismisses. If a SettingsFlyout is shown by calling ShowIndependent, then clicking the Back button
dismisses the SettingsFlyout and returns the user to the app; the SettingsPane is not reopened.
Call the ShowIndependent method to open the SettingsFlyout from a button in your app. In this case, because the user
did not open the SettingsFlyout from the SettingsPane, they should return to your app when they click the Back button.
Only one SettingsFlyout is shown at a time. Calling ShowIndependent on a SettingsFlyout closes any other
SettingsFlyout currently shown. The SettingsFlyout being closed completes its close animation before the new
SettingsFlyout begins its show animation.
See Quickstart: Add app settings
Also Quickstart: Add app help
SettingsFlyout.TemplateSettings SettingsFlyout.Template
Settings SettingsFlyout.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a SettingsFlyout control.
public : SettingsFlyoutTemplateSettings TemplateSettings { get; }
SettingsFlyoutTemplateSettings TemplateSettings();
public SettingsFlyoutTemplateSettings TemplateSettings { get; }

Returns
SettingsFlyoutTemplateSettings
An object that provides calculated values for templates.
SettingsFlyout.Title SettingsFlyout.Title SettingsFlyout.
Title
I n this Article
Edit
Gets or sets the title of the SettingsFlyout control when displayed.
public : Platform::String Title { get; set; }
winrt::hstring Title();

void Title(winrt::hstring title);


public string Title { get; set; }

<SettingsFlyout Title="string"/>

Returns
string
The title of the SettingsFlyout control. This typically appears in the SettingsFlyout control header area. The default is an
empty string.

Remarks
Note

Even though the default property value is an empty string, the Microsoft Visual Studio Settings Flyout item template
sets the Title to the name of your settings flyout class (for example, Title="AccountSettingsFlyout" ).
SettingsFlyout.TitleProperty SettingsFlyout.TitleProperty
SettingsFlyout.TitleProperty
I n this Article
Edit
Identifies the Title dependency property.
public : static DependencyProperty TitleProperty { get; }
static DependencyProperty TitleProperty();
public static DependencyProperty TitleProperty { get; }

Returns
DependencyProperty
The identifier for the Title dependency property.
Slider Slider Slider Class
Represents a control that lets the user select from a range of values by moving a Thumb control along a track.

D eclaration
public : class Slider : RangeBase, ISlider, ISlider2
struct winrt::Windows::UI::Xaml::Controls::Slider : RangeBase, ISlider, ISlider2
public class Slider : RangeBase, ISlider, ISlider2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
RangeBase

Remarks
 Tip

For more info, design guidance, and code examples, see Sliders.
Slider is a control that lets the user select from a range of values by moving a Thumb control along a track.

Use a Slider control when you want your users to be able to set defined, contiguous values (such as volume or
brightness) or a range of discrete values (such as screen resolution settings). Slider s are for user interaction. If a user
can't ever change the value, use read-only text instead. For more information on when to use a Slider, see Guidelines
for sliders.
B inding Minimum and Maximum values
Note

When binding Minimum and Maximum values in Extensible Application Markup Language (XAML ), declare the
Binding for Maximum first. If the Binding for Maximum is declared after Minimum, the bound value for Maximum is
ignored and the following situations can occur: + If the bound Minimum value is negative, the Maximum value is set to
0.
If the bound Minimum value is greater than the default Maximum (100 for Slider and ProgressBar ), the Maximum
value is set equal to the Minimum value. To avoid this behavior, declare the Binding for Maximum first in your
Extensible Application Markup Language (XAML ).
These behaviors can also occur if you set the Minimum value without also explicitly setting the Maximum value.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. To change certain
aspects of the slider’s appearance, such as the Thumb color, you need to retemplate the control (or use the resources in
the table below on Windows 10, version 1607 or later). For information about modifying a control's style and template,
see Styling controls. The default style, template, and resources that define the look of the control are included in the
generic.xaml file. For design purposes, generic.xaml is available in the (Program Files)\Windows
Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a Windows Software
Development Kit (SDK) installation. Styles and resources from different versions of the SDK might have different
values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the Slider control.

R ES O U R CE K EY D ES CR IPTIO N

SliderContainerBackground Background color at rest

SliderContainerBackgroundPointerOver Background color on hover

SliderContainerBackgroundPressed Background color when pressed

SliderContainerBackgroundDisabled Background color when disabled

SliderThumbBackground Background color of the thumb at rest

SliderThumbBackgroundPointerOver Background color of the thumb on hover

SliderThumbBackgroundPressed Background color of the thumb when pressed

SliderThumbBackgroundDisabled Background color of the thumb when disabled

SliderTrackFill Color of unfilled portion of track

SliderTrackFillPointerOver Color of unfilled portion of track on hover

SliderTrackFillPressed Color of unfilled portion of track when pressed

SliderTrackFillDisabled Color of unfilled portion of track when disabled

SliderTrackValueFill Color of filled portion of track

SliderTrackValueFillPointerOver Color of filled portion of track on hover

SliderTrackValueFillPressed Color of filled portion of track when pressed

SliderTrackValueFillDisabled Color of filled portion of track when disabled

SliderHeaderForeground Foreground color of the label

SliderHeaderForegroundDisabled Foreground color of the label when disabled

SliderTickBarFill Color of the tick marks


SliderTickBarFillDisabled Color of the tick marks when disabled

SliderInlineTickBarFill Color of inline tick marks

Constructors
Slider()
Slider()
Slider()

Initializes a new instance of the Slider class.

Properties
Header
Header
Header

Gets or sets the content for the control's header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the control's header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

IntermediateValue
IntermediateValue
IntermediateValue

Gets or sets the value of the Slider while the user is interacting with it, before the value is snapped to either the tick
or step value. The value the Slider snaps to is specified by the SnapsTo property.

IntermediateValueProperty
IntermediateValueProperty
IntermediateValueProperty

Identifies the IntermediateValue dependency property.

IsDirectionReversed
IsDirectionReversed
IsDirectionReversed

Gets or sets a value that indicates the direction of increasing value.

IsDirectionReversedProperty
IsDirectionReversedProperty
IsDirectionReversedProperty

Identifies the IsDirectionReversed dependency property.

IsThumbToolTipEnabled
IsThumbToolTipEnabled
IsThumbToolTipEnabled

Gets or sets a value that determines whether the slider value is shown in a tool tip for the Thumb component of
the Slider.

IsThumbToolTipEnabledProperty
IsThumbToolTipEnabledProperty
IsThumbToolTipEnabledProperty

Identifies the IsThumbToolTipEnabled dependency property.

Orientation
Orientation
Orientation

Gets or sets the orientation of a Slider.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the Orientation dependency property.

SnapsTo
SnapsTo
SnapsTo
Gets or sets a value that indicates how the Slider conforms the thumb position to its steps or tick marks.

SnapsToProperty
SnapsToProperty
SnapsToProperty

Identifies the SnapsTo dependency property.

StepFrequency
StepFrequency
StepFrequency

Gets or sets the value part of a value range that steps should be created for.

StepFrequencyProperty
StepFrequencyProperty
StepFrequencyProperty

Identifies the StepFrequency dependency property.

ThumbToolTipValueConverter
ThumbToolTipValueConverter
ThumbToolTipValueConverter

Gets or sets the converter logic that converts the range value of the Slider into tool tip content.

ThumbToolTipValueConverterProperty
ThumbToolTipValueConverterProperty
ThumbToolTipValueConverterProperty

Identifies the ThumbToolTipValueConverter dependency property.

TickFrequency
TickFrequency
TickFrequency

Gets or sets the increment of the value range that ticks should be created for.

TickFrequencyProperty
TickFrequencyProperty
TickFrequencyProperty

Identifies the TickFrequency dependency property.


TickPlacement
TickPlacement
TickPlacement

Gets or sets a value that indicates where to draw tick marks in relation to the track.

TickPlacementProperty
TickPlacementProperty
TickPlacementProperty

Identifies the TickPlacement dependency property.

See Also
RangeBase
Slider.Header Slider.Header Slider.Header
I n this Article
Edit
Gets or sets the content for the control's header.

public : Platform::Object Header { get; set; }


winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<Slider Header="headerString"/>

Returns
object
The content of the control's header. The default is null.

Remarks
You can set a data template for the Header by using the HeaderTemplate property.
Slider.HeaderProperty Slider.HeaderProperty Slider.
HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
Slider.HeaderTemplate Slider.HeaderTemplate Slider.
HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the control's header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<Slider>
<Slider.HeaderTemplate>
singleDataTemplate
</Slider.HeaderTemplate>
</Slider>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
Slider.HeaderTemplateProperty Slider.HeaderTemplate
Property Slider.HeaderTemplateProperty
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
Slider.IntermediateValue Slider.IntermediateValue Slider.
IntermediateValue
I n this Article
Edit
Gets or sets the value of the Slider while the user is interacting with it, before the value is snapped to either the tick or
step value. The value the Slider snaps to is specified by the SnapsTo property.
public : double IntermediateValue { get; set; }
double IntermediateValue();

void IntermediateValue(double intermediatevalue);


public double IntermediateValue { get; set; }

Returns
double
A temporary value.

Remarks
Set the SnapsTo property to specify whether the Slider snaps to tick marks or step values. Set the TickFrequency or
StepFrequency property to specify the interval between snap points.
This property isn't typically set in XAML. It could be useful though as an element binding source for another XAML UI
element that displays the IntermediateValue value.
Slider.IntermediateValueProperty Slider.Intermediate
ValueProperty Slider.IntermediateValueProperty
I n this Article
Edit
Identifies the IntermediateValue dependency property.
public : static DependencyProperty IntermediateValueProperty { get; }
static DependencyProperty IntermediateValueProperty();
public static DependencyProperty IntermediateValueProperty { get; }

Returns
DependencyProperty
The identifier for the IntermediateValue dependency property.
Slider.IsDirectionReversed Slider.IsDirectionReversed
Slider.IsDirectionReversed
I n this Article
Edit
Gets or sets a value that indicates the direction of increasing value.
public : Platform::Boolean IsDirectionReversed { get; set; }
bool IsDirectionReversed();

void IsDirectionReversed(bool isdirectionreversed);


public bool IsDirectionReversed { get; set; }

<Slider IsDirectionReversed="bool"/>

Returns
bool
true if the direction of increasing value is to the left for a horizontal slider or down for a vertical slider; otherwise, false.
The default is false.
Slider.IsDirectionReversedProperty Slider.IsDirection
ReversedProperty Slider.IsDirectionReversedProperty
I n this Article
Edit
Identifies the IsDirectionReversed dependency property.
public : static DependencyProperty IsDirectionReversedProperty { get; }
static DependencyProperty IsDirectionReversedProperty();
public static DependencyProperty IsDirectionReversedProperty { get; }

Returns
DependencyProperty
The identifier for the IsDirectionReversed dependency property.
Slider.IsThumbToolTipEnabled Slider.IsThumbToolTip
Enabled Slider.IsThumbToolTipEnabled
I n this Article
Edit
Gets or sets a value that determines whether the slider value is shown in a tool tip for the Thumb component of the
Slider.
public : Platform::Boolean IsThumbToolTipEnabled { get; set; }
bool IsThumbToolTipEnabled();

void IsThumbToolTipEnabled(bool isthumbtooltipenabled);


public bool IsThumbToolTipEnabled { get; set; }

<Slider IsThumbToolTipEnabled="bool" />

Returns
bool
True if a tool tip is shown for the Thumb component; otherwise, false. The default is true.
Slider.IsThumbToolTipEnabledProperty Slider.IsThumb
ToolTipEnabledProperty Slider.IsThumbToolTipEnabled
Property
I n this Article
Edit
Identifies the IsThumbToolTipEnabled dependency property.
public : static DependencyProperty IsThumbToolTipEnabledProperty { get; }
static DependencyProperty IsThumbToolTipEnabledProperty();
public static DependencyProperty IsThumbToolTipEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsThumbToolTipEnabled dependency property.
Slider.Orientation Slider.Orientation Slider.Orientation
I n this Article
Edit
Gets or sets the orientation of a Slider.

public : Orientation Orientation { get; set; }


Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

<Slider Orientation="Horizontal"/>
-or-
<Slider Orientation="Vertical"/>

Returns
Orientation
One of the Orientation values. The default is Horizontal.
Slider.OrientationProperty Slider.OrientationProperty
Slider.OrientationProperty
I n this Article
Edit
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
Slider Slider Slider
I n this Article
Edit
Initializes a new instance of the Slider class.

public : Slider()
Slider() const;
public Slider()
Slider.SnapsTo Slider.SnapsTo Slider.SnapsTo
I n this Article
Edit
Gets or sets a value that indicates how the Slider conforms the thumb position to its steps or tick marks.

public : SliderSnapsTo SnapsTo { get; set; }


SliderSnapsTo SnapsTo();

void SnapsTo(SliderSnapsTo snapsto);


public SliderSnapsTo SnapsTo { get; set; }

<Slider SnapsTo="sliderSnapsToMemberName" />

Returns
SliderSnapsTo
An enumeration value that specifies whether the Slider snaps to steps or tick marks. The default is StepValues.

Remarks
Set the SnapsTo property to specify whether the Slider snaps to tick marks or step values. Set the TickFrequency or
StepFrequency property to specify the interval between snap points.
Slider.SnapsToProperty Slider.SnapsToProperty Slider.
SnapsToProperty
I n this Article
Edit
Identifies the SnapsTo dependency property.
public : static DependencyProperty SnapsToProperty { get; }
static DependencyProperty SnapsToProperty();
public static DependencyProperty SnapsToProperty { get; }

Returns
DependencyProperty
The identifier for the SnapsTo dependency property.
Slider.StepFrequency Slider.StepFrequency Slider.Step
Frequency
I n this Article
Edit
Gets or sets the value part of a value range that steps should be created for.
public : double StepFrequency { get; set; }
double StepFrequency();

void StepFrequency(double stepfrequency);


public double StepFrequency { get; set; }

<Slider StepFrequency="double" />

Returns
double
The value part of a value range that steps should be created for.

Remarks
When the SnapsTo property is set to StepValues, set the StepFrequency property to specify the interval between snap
points.
See SliderSnapsTo
Also
Slider.StepFrequencyProperty Slider.StepFrequency
Property Slider.StepFrequencyProperty
I n this Article
Edit
Identifies the StepFrequency dependency property.
public : static DependencyProperty StepFrequencyProperty { get; }
static DependencyProperty StepFrequencyProperty();
public static DependencyProperty StepFrequencyProperty { get; }

Returns
DependencyProperty
The identifier for the StepFrequency dependency property.
Slider.ThumbToolTipValueConverter Slider.ThumbToolTip
ValueConverter Slider.ThumbToolTipValueConverter
I n this Article
Edit
Gets or sets the converter logic that converts the range value of the Slider into tool tip content.
public : IValueConverter ThumbToolTipValueConverter { get; set; }
IValueConverter ThumbToolTipValueConverter();

void ThumbToolTipValueConverter(IValueConverter thumbtooltipvalueconverter);


public IValueConverter ThumbToolTipValueConverter { get; set; }

<Slider ThumbToolTipValueConverter="referenceToValueConverter" />

Returns
IValueConverter
A converter implementation.

Remarks
By default, the Slider 's thumb tooltip shows the numeric value of the slider. To show other values in the thumb tooltip,
you create a custom value converter and assign it to the ThumbToolTipValueConverter property.
Slider.ThumbToolTipValueConverterProperty Slider.
ThumbToolTipValueConverterProperty Slider.ThumbTool
TipValueConverterProperty
I n this Article
Edit
Identifies the ThumbToolTipValueConverter dependency property.
public : static DependencyProperty ThumbToolTipValueConverterProperty { get; }
static DependencyProperty ThumbToolTipValueConverterProperty();
public static DependencyProperty ThumbToolTipValueConverterProperty { get; }

Returns
DependencyProperty
The identifier for the ThumbToolTipValueConverter dependency property.
Slider.TickFrequency Slider.TickFrequency Slider.Tick
Frequency
I n this Article
Edit
Gets or sets the increment of the value range that ticks should be created for.
public : double TickFrequency { get; set; }
double TickFrequency();

void TickFrequency(double tickfrequency);


public double TickFrequency { get; set; }

<Slider TickFrequency="double" />

Returns
double
The increment to create tick marks for. The default is 0.0.

Examples
Here's a slider with its TickFrequency set to 2 and its TickPlacement set to BottomRight.
<Slider x:Name="slider2"
Minimum="0"
Maximum="10"
TickFrequency="2"
TickPlacement="BottomRight"
ValueChanged="slider2_ValueChanged" />

Remarks
Set the TickFrequency property to specify at which values tick marks are drawn on a Slider. For example, if a Slider has
Minimum of 0, Maximum of 20, and TickFrequency of 2, tick marks are placed at every other step value, starting at 0
and ending at 20.
The drawing of tick marks on a slider depends on both the TickFrequency and TickPlacement properties. In order for
tick marks to be shown, you must set the TickFrequency property to a value greater than 0, and the TickPlacement
property to a value other than None.
To prevent tick marks from being packed too densely, the Slider will only show tick marks that are a minimum of 20
pixels apart. If a combination of Slider size, value range, and tick frequency results in tick marks that are too close
together, some tick marks are not shown.
When the SnapsTo property is set to Ticks, the TickFrequency property also specifies the interval between snap points.
See SliderSnapsTo
Also
Slider.TickFrequencyProperty Slider.TickFrequency
Property Slider.TickFrequencyProperty
I n this Article
Edit
Identifies the TickFrequency dependency property.
public : static DependencyProperty TickFrequencyProperty { get; }
static DependencyProperty TickFrequencyProperty();
public static DependencyProperty TickFrequencyProperty { get; }

Returns
DependencyProperty
The identifier for the TickFrequency dependency property.
Slider.TickPlacement Slider.TickPlacement Slider.Tick
Placement
I n this Article
Edit
Gets or sets a value that indicates where to draw tick marks in relation to the track.
public : TickPlacement TickPlacement { get; set; }
TickPlacement TickPlacement();

void TickPlacement(TickPlacement tickplacement);


public TickPlacement TickPlacement { get; set; }

<Slider TickPlacement="tickPlacementMemberName" />

Returns
TickPlacement
An enumeration value that specifies where to draw tick marks in relation to the track. The default is Inline.

Examples
Here's a slider with its TickFrequency set to 2 and its TickPlacement set to BottomRight.
<Slider x:Name="slider2"
Minimum="0"
Maximum="10"
TickFrequency="2"
TickPlacement="BottomRight"
ValueChanged="slider2_ValueChanged" />

Remarks
The drawing of tick marks on a slider depends on both the TickFrequency and TickPlacement properties. In order for
tick marks to be shown, you must set the TickFrequency property to a value greater than 0, and the TickPlacement
property to a value other than None.
Slider.TickPlacementProperty Slider.TickPlacement
Property Slider.TickPlacementProperty
I n this Article
Edit
Identifies the TickPlacement dependency property.
public : static DependencyProperty TickPlacementProperty { get; }
static DependencyProperty TickPlacementProperty();
public static DependencyProperty TickPlacementProperty { get; }

Returns
DependencyProperty
The identifier for the TickPlacement dependency property.
SnapPointsType SnapPointsType SnapPointsType Enum
Defines constants that specify how panning snap points are processed for gesture/manipulation input.

D eclaration
public : enum class SnapPointsType
enum class winrt::Windows::UI::Xaml::Controls::SnapPointsType : int32_t
public enum SnapPointsType

I nheritance H ierarchy
None

Remarks
For panning actions, there are often natural stopping places. Snap points provide a way to indicate where these places
are. Then, when a user swipes, the manipulation result favors that natural point using behavior as expressed by a
SnapPointsType value. The proximity determination is made by the Direct Manipulation subsystem that supports the
manipulation handling for a XAML ScrollViewer. The Single variations factor in both the inertia and the release point.
**Proximity points (Optional and OptionalSingle): ** When a user is going to naturally stop the manipulation in the
proximity of a snap point, proximity points help the user land at the natural stopping place. Because the user has to
land in proximity to the snap point to cause it to stop there, the user will sometimes have to perform another swipe to
reach a snap point.
**Mandatory snap points (Mandatory and MandatorySingle): ** In contrast to proximity, mandatory snap points
ensure that the content is adjusted to always land on a snap point. Even if the user releases the manipulation halfway
between two snap-points, it will always move to one of the snap points.
The SnapPointsType enumeration is used as a value for the ScrollViewer.HorizontalSnapPointsType and
ScrollViewer.VerticalSnapPointsType properties.
To see the effects of snap points on ScrollViewer behavior yourself, get the XAML scrolling, panning and zooming
sample. Run the sample on a touch device (not the simulator). Try out the SnapPointsType values when you view the
"Panning with snap-points" example page of the sample.

Fields
Mandatory Mandatory Content always stops at the snap point closest to where inertia would naturally stop
Mandatory along the direction of inertia.

MandatorySingle Content always stops at the snap point closest to the release point along the direction
MandatorySingle of inertia.
MandatorySingle

None None None No snapping behavior. Only the manipulation influences the final location.
Optional Optional Optional Content stops at a snap point closest to where inertia would naturally stop along the
direction of inertia, depending on how close the snap point is.

OptionalSingle Content stops at the next snap point, if the motion starts far from it.
OptionalSingle
OptionalSingle

See Also
SplitButton SplitButton SplitButton Class
Represents a button with two parts that can be invoked separately. One part behaves like a standard button and the
other part invokes a flyout.

D eclaration
public : class SplitButton : ContentControl, ISplitButton
struct winrt::Windows::UI::Xaml::Controls::SplitButton : ContentControl, ISplitButton
public class SplitButton : ContentControl, ISplitButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Constructors
SplitButton()
SplitButton()
SplitButton()

Initializes a new instance of the SplitButton class.

Properties
Command
Command
Command

Gets or sets the command to invoke when this button is pressed.

CommandParameter
CommandParameter
CommandParameter

Gets or sets the parameter to pass to the Command property.

CommandParameterProperty
CommandParameterProperty
CommandParameterProperty

Identifies the CommandParameter dependency property.

CommandProperty
CommandProperty
CommandProperty

Identifies the Command dependency property.

Flyout
Flyout
Flyout

Gets or sets the flyout associated with this button.

FlyoutProperty
FlyoutProperty
FlyoutProperty

Identifies the Flyout dependency property.

Events
Click
Click
Click

Occurs when a button control is clicked.


SplitButton.Click SplitButton.Click SplitButton.Click
I n this Article
Edit
Occurs when a button control is clicked.

public : event TypedEventHandler<SplitButton, SplitButtonClickEventArgs> Click


// Register
event_token Click(TypedEventHandler<SplitButton, SplitButtonClickEventArgs> const& handler) const;

// Revoke with event_token


void Click(event_token const& cookie) const;

// Revoke with event_revoker


Click_revoker Click(auto_revoke_t, TypedEventHandler<SplitButton, SplitButtonClickEventArgs> const&
handler) const;
public event TypedEventHandler<SplitButton, SplitButtonClickEventArgs> Click
SplitButton.Command SplitButton.Command SplitButton.
Command
I n this Article
Edit
Gets or sets the command to invoke when this button is pressed.
public : ICommand Command { get; set; }
ICommand Command();

void Command(ICommand command);


public ICommand Command { get; set; }

Returns
ICommand
The command to invoke when this button is pressed. The default is null.
SplitButton.CommandParameter SplitButton.Command
Parameter SplitButton.CommandParameter
I n this Article
Edit
Gets or sets the parameter to pass to the Command property.
public : Platform::Object CommandParameter { get; set; }
winrt::Windows::Foundation::IInspectable CommandParameter();

void CommandParameter(winrt::Windows::Foundation::IInspectable commandparameter);


public object CommandParameter { get; set; }

Returns
object
The parameter to pass to the Command property. The default is null.
SplitButton.CommandParameterProperty SplitButton.
CommandParameterProperty SplitButton.Command
ParameterProperty
I n this Article
Edit
Identifies the CommandParameter dependency property.
public : static DependencyProperty CommandParameterProperty { get; }
static DependencyProperty CommandParameterProperty();
public static DependencyProperty CommandParameterProperty { get; }

Returns
DependencyProperty
The identifier for the CommandParameter dependency property.
SplitButton.CommandProperty SplitButton.Command
Property SplitButton.CommandProperty
I n this Article
Edit
Identifies the Command dependency property.
public : static DependencyProperty CommandProperty { get; }
static DependencyProperty CommandProperty();
public static DependencyProperty CommandProperty { get; }

Returns
DependencyProperty
The identifier for the Command dependency property.
SplitButton.Flyout SplitButton.Flyout SplitButton.Flyout
I n this Article
Edit
Gets or sets the flyout associated with this button.

public : FlyoutBase Flyout { get; set; }


FlyoutBase Flyout();

void Flyout(FlyoutBase flyout);


public FlyoutBase Flyout { get; set; }

Returns
FlyoutBase
The flyout associated with this button. The default is null.
SplitButton.FlyoutProperty SplitButton.FlyoutProperty
SplitButton.FlyoutProperty
I n this Article
Edit
Identifies the Flyout dependency property.
public : static DependencyProperty FlyoutProperty { get; }
static DependencyProperty FlyoutProperty();
public static DependencyProperty FlyoutProperty { get; }

Returns
DependencyProperty
The identifier for the Flyout dependency property.
SplitButton SplitButton SplitButton
I n this Article
Edit
Initializes a new instance of the SplitButton class.

public : SplitButton()
SplitButton() const;
public SplitButton()
SplitButtonAutomationPeer SplitButtonAutomationPeer
SplitButtonAutomationPeer Class
Exposes SplitButton types to Microsoft UI Automation.

D eclaration
public : class SplitButtonAutomationPeer : FrameworkElementAutomationPeer,
IExpandCollapseProvider, IInvokeProvider, ISplitButtonAutomationPeer
struct winrt::Windows::UI::Xaml::Controls::SplitButtonAutomationPeer :
FrameworkElementAutomationPeer, IExpandCollapseProvider, IInvokeProvider,
ISplitButtonAutomationPeer
public class SplitButtonAutomationPeer : FrameworkElementAutomationPeer,
IExpandCollapseProvider, IInvokeProvider, ISplitButtonAutomationPeer

I nheritance H ierarchy
DependencyObject
AutomationPeer
FrameworkElementAutomationPeer

Constructors
SplitButtonAutomationPeer(SplitButton)
SplitButtonAutomationPeer(SplitButton)
SplitButtonAutomationPeer(SplitButton)

Initializes a new instance of the SplitButtonAutomationPeer class.

Properties
ExpandCollapseState
ExpandCollapseState
ExpandCollapseState

Gets the state, expanded or collapsed, of the control.

Methods
Collapse()
Collapse()
Collapse()

Hides the control's drop down menu.

Expand()
Expand()
Expand()

Displays the control's drop down menu.


Invoke()
Invoke()
Invoke()

Sends a request to click the button associated with the automation peer.
SplitButtonAutomationPeer.Collapse SplitButton
AutomationPeer.Collapse SplitButtonAutomationPeer.
Collapse
I n this Article
Edit
Hides the control's drop down menu.
public : void Collapse()
void Collapse() const;
public void Collapse()
SplitButtonAutomationPeer.Expand SplitButton
AutomationPeer.Expand SplitButtonAutomationPeer.
Expand
I n this Article
Edit
Displays the control's drop down menu.
public : void Expand()
void Expand() const;
public void Expand()
SplitButtonAutomationPeer.ExpandCollapseState Split
ButtonAutomationPeer.ExpandCollapseState SplitButton
AutomationPeer.ExpandCollapseState
I n this Article
Edit
Gets the state, expanded or collapsed, of the control.
public : ExpandCollapseState ExpandCollapseState { get; }
ExpandCollapseState ExpandCollapseState();
public ExpandCollapseState ExpandCollapseState { get; }

Returns
ExpandCollapseState
A value of the enumeration.
SplitButtonAutomationPeer.Invoke SplitButton
AutomationPeer.Invoke SplitButtonAutomationPeer.
Invoke
I n this Article
Edit
Sends a request to click the button associated with the automation peer.
public : void Invoke()
void Invoke() const;
public void Invoke()
SplitButtonAutomationPeer SplitButtonAutomationPeer
SplitButtonAutomationPeer
I n this Article
Edit
Initializes a new instance of the SplitButtonAutomationPeer class.
public : SplitButtonAutomationPeer(SplitButton owner)
SplitButtonAutomationPeer(SplitButton owner) const;
public SplitButtonAutomationPeer(SplitButton owner)

Parameters
owner SplitButton
The SplitButton control instance to create the peer for.
SplitButtonClickEventArgs SplitButtonClickEventArgs
SplitButtonClickEventArgs Class
Provides event data for the SplitButton.Click event.

D eclaration
public : sealed class SplitButtonClickEventArgs : ISplitButtonClickEventArgs
struct winrt::Windows::UI::Xaml::Controls::SplitButtonClickEventArgs :
ISplitButtonClickEventArgs
public sealed class SplitButtonClickEventArgs : ISplitButtonClickEventArgs

I nheritance H ierarchy
None
SplitView SplitView SplitView Class
Represents a container with two views; one view for the main content and another view that is typically used for
navigation commands.

D eclaration
public : class SplitView : Control, ISplitView, ISplitView2, ISplitView3
struct winrt::Windows::UI::Xaml::Controls::SplitView : Control, ISplitView, ISplitView2,
ISplitView3
public class SplitView : Control, ISplitView, ISplitView2, ISplitView3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Split view.
The SplitView control presents two areas of content: a Pane and the main Content. You typically use a SplitView to
create a top-level navigation experience that adapts to different screen widths following the nav pane pattern or the
master/details pattern, but it's not strictly limited to use for navigation.
The XAML for this SplitView is shown in the Examples section.

The Content area is always present and can contain a single child element, which is typically a Panel derived container
that contains additional child elements. Although the Content is always present, it can be completely covered by the
Pane.
There are several properties you can set to control the appearance and behavior of the Pane. Set the IsPaneOpen
property to open or close the Pane. The SplitView does not include a built-in affordance for users to toggle the state of
the Pane, like a menu (or “hamburger”) button. You must provide this affordance and the code to toggle the
IsPaneOpen property.
To specify the length of the open pane, set the OpenPaneLength property. You can set the PanePlacement property to
have the Pane appear on either the left or right side of the Content.
Although the appearance of the control is largely based on the elements assigned to the Pane and Content, you can
change the default background color of the Pane by setting the PaneBackground.
Set the DisplayMode property to configure the interaction of the Pane with the Content. By default, the Pane overlays
the Content and disappears completely when closed. You can use one of the "inline" modes to show the Pane side-by-
side with the Content. You can use the "compact" modes to make a narrow section of the Pane remain visible even
when the Pane is closed. See the SplitViewDisplayMode enumeration for more info about the supported modes.

Constructors
SplitView()
SplitView()
SplitView()

Initializes a new instance of the SplitView class.

Properties
CompactPaneLength
CompactPaneLength
CompactPaneLength

Gets or sets the width of the SplitView pane in its compact display mode.

CompactPaneLengthProperty
CompactPaneLengthProperty
CompactPaneLengthProperty

Identifies the CompactPaneLength dependency property.

Content
Content
Content

Gets or sets the contents of the main panel of a SplitView.

ContentProperty
ContentProperty
ContentProperty

Identifies the Content dependency property.

DisplayMode
DisplayMode
DisplayMode

Gets of sets a value that specifies how the pane and content areas of a SplitView are shown.

DisplayModeProperty
DisplayModeProperty
DisplayModeProperty

Identifies the DisplayMode dependency property.

IsPaneOpen
IsPaneOpen
IsPaneOpen

Gets or sets a value that specifies whether the SplitView pane is expanded to its full width.

IsPaneOpenProperty
IsPaneOpenProperty
IsPaneOpenProperty

Identifies the IsPaneOpen dependency property.

LightDismissOverlayMode
LightDismissOverlayMode
LightDismissOverlayMode

Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.

LightDismissOverlayModeProperty
LightDismissOverlayModeProperty
LightDismissOverlayModeProperty

Identifies the LightDismissOverlayMode dependency property.

OpenPaneLength
OpenPaneLength
OpenPaneLength

Gets or sets the width of the SplitView pane when it's fully expanded.

OpenPaneLengthProperty
OpenPaneLengthProperty
OpenPaneLengthProperty

Identifies the OpenPaneLength dependency property.


Pane
Pane
Pane

Gets or sets the contents of the pane of a SplitView.

PaneBackground
PaneBackground
PaneBackground

Gets or sets the Brush to apply to the background of the Pane area of the control.

PaneBackgroundProperty
PaneBackgroundProperty
PaneBackgroundProperty

Identifies the PaneBackground dependency property.

PanePlacement
PanePlacement
PanePlacement

Gets or sets a value that specifies whether the pane is shown on the right or left side of the SplitView.

PanePlacementProperty
PanePlacementProperty
PanePlacementProperty

Identifies the PanePlacement dependency property.

PaneProperty
PaneProperty
PaneProperty

Identifies the Pane dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a SplitView control.

TemplateSettingsProperty
TemplateSettingsProperty
TemplateSettingsProperty

Identifies the TemplateSettings dependency property.

Events
PaneClosed
PaneClosed
PaneClosed

Occurs when the SplitView pane is closed.

PaneClosing
PaneClosing
PaneClosing

Occurs when the SplitView pane is closing.

PaneOpened
PaneOpened
PaneOpened

Occurs when the SplitView pane is opened.

PaneOpening
PaneOpening
PaneOpening

Occurs when the SplitView pane is opening.

See Also
SplitView.CompactPaneLength SplitView.CompactPane
Length SplitView.CompactPaneLength
I n this Article
Edit
Gets or sets the width of the SplitView pane in its compact display mode.
public : double CompactPaneLength { get; set; }
double CompactPaneLength();

void CompactPaneLength(double compactpanelength);


public double CompactPaneLength { get; set; }

<SplitView CompactPaneLength="double" .../>

Returns
double
The width of the pane in it's compact display mode. The default is 48 device-independent pixel (DIP ) (defined by the
SplitViewCompactPaneThemeLength resource).

Remarks
This property specifies the width of the pane when DisplayMode is Compact and IsPaneOpen is false.
SplitView.CompactPaneLengthProperty SplitView.
CompactPaneLengthProperty SplitView.CompactPane
LengthProperty
I n this Article
Edit
Identifies the CompactPaneLength dependency property.
public : static DependencyProperty CompactPaneLengthProperty { get; }
static DependencyProperty CompactPaneLengthProperty();
public static DependencyProperty CompactPaneLengthProperty { get; }

Returns
DependencyProperty
The identifier for the CompactPaneLength dependency property.
See Dependency properties overview
Also
SplitView.Content SplitView.Content SplitView.Content
I n this Article
Edit
Gets or sets the contents of the main panel of a SplitView.

public : UIElement Content { get; set; }


UIElement Content();

void Content(UIElement content);


public UIElement Content { get; set; }

<SplitView>
singleObject
</SplitView>

Returns
UIElement
The contents of the main panel of a SplitView. The default is null.
SplitView.ContentProperty SplitView.ContentProperty
SplitView.ContentProperty
I n this Article
Edit
Identifies the Content dependency property.
public : static DependencyProperty ContentProperty { get; }
static DependencyProperty ContentProperty();
public static DependencyProperty ContentProperty { get; }

Returns
DependencyProperty
The identifier for the Content dependency property.
See Dependency properties overview
Also
SplitView.DisplayMode SplitView.DisplayMode SplitView.
DisplayMode
I n this Article
Edit
Gets of sets a value that specifies how the pane and content areas of a SplitView are shown.
public : SplitViewDisplayMode DisplayMode { get; set; }
SplitViewDisplayMode DisplayMode();

void DisplayMode(SplitViewDisplayMode displaymode);


public SplitViewDisplayMode DisplayMode { get; set; }

<SplitView DisplayMode="splitViewDisplayModeMemberName" />

Returns
SplitViewDisplayMode
A value of the enumeration that specifies how the pane and content areas of a SplitView are shown. The default is
Overlay.
SplitView.DisplayModeProperty SplitView.DisplayMode
Property SplitView.DisplayModeProperty
I n this Article
Edit
Identifies the DisplayMode dependency property.
public : static DependencyProperty DisplayModeProperty { get; }
static DependencyProperty DisplayModeProperty();
public static DependencyProperty DisplayModeProperty { get; }

Returns
DependencyProperty
The identifier for the DisplayMode dependency property.
See Dependency properties overview
Also
SplitView.IsPaneOpen SplitView.IsPaneOpen SplitView.Is
PaneOpen
I n this Article
Edit
Gets or sets a value that specifies whether the SplitView pane is expanded to its full width.
public : Platform::Boolean IsPaneOpen { get; set; }
bool IsPaneOpen();

void IsPaneOpen(bool ispaneopen);


public bool IsPaneOpen { get; set; }

<SplitView IsPaneOpen="bool" .../>

Returns
bool
true if the pane is expanded to its full width; otherwise, false. The default is true.

Remarks
The effects of this property are influenced by the value of the DisplayMode property.

D IS PL AYMO D E EFFECT

**Inline** @Windows.UI.Xaml.Controls.SplitView.IsPaneOpen?
text=IsPaneOpen is **true**.

**Overlay** When @Windows.UI.Xaml.Controls.SplitView.IsPaneOpen?


text=IsPaneOpen is **false**, the pane is hidden.

**Compact** When @Windows.UI.Xaml.Controls.SplitView.IsPaneOpen?


text=IsPaneOpen is **false**, the pane is shown in its compact
size (see
@Windows.UI.Xaml.Controls.SplitView.CompactPaneLength?
text=CompactPaneLength ).
SplitView.IsPaneOpenProperty SplitView.IsPaneOpen
Property SplitView.IsPaneOpenProperty
I n this Article
Edit
Identifies the IsPaneOpen dependency property.
public : static DependencyProperty IsPaneOpenProperty { get; }
static DependencyProperty IsPaneOpenProperty();
public static DependencyProperty IsPaneOpenProperty { get; }

Returns
DependencyProperty
The identifier for the IsPaneOpen dependency property.
See Dependency properties overview
Also
SplitView.LightDismissOverlayMode SplitView.Light
DismissOverlayMode SplitView.LightDismissOverlay
Mode
I n this Article
Edit
Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.
public : LightDismissOverlayMode LightDismissOverlayMode { get; set; }
LightDismissOverlayMode LightDismissOverlayMode();

void LightDismissOverlayMode(LightDismissOverlayMode lightdismissoverlaymode);


public LightDismissOverlayMode LightDismissOverlayMode { get; set; }

Returns
LightDismissOverlayMode
A value of the enumeration that specifies whether the area outside of a light-dismiss UI is darkened. The default is
Auto.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Transient UI, such as open pane of a SplitView, closes when you click or tap outside of it. This is called light-dismiss.
"Overlay" refers to the area outside of a light-dismiss UI.
By default, the "overlay" is darkened on the Xbox, and not darkened on other devices families. You can set
LightDismissOverlayMode to On to make your app darken the "overlay" area on all device families, or set it to Off to
not darken the "overlay" area on all device families.
Version compatibility
The LightDismissOverlayMode property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.SplitView",
"LightDismissOverlayMode"))
{
splitView1.LightDismissOverlayMode = LightDismissOverlayMode.On;
}
}
SplitView.LightDismissOverlayModeProperty SplitView.
LightDismissOverlayModeProperty SplitView.Light
DismissOverlayModeProperty
I n this Article
Edit
Identifies the LightDismissOverlayMode dependency property.
public : static DependencyProperty LightDismissOverlayModeProperty { get; }
static DependencyProperty LightDismissOverlayModeProperty();
public static DependencyProperty LightDismissOverlayModeProperty { get; }

Returns
DependencyProperty
The identifier for the LightDismissOverlayMode dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


SplitView.OpenPaneLength SplitView.OpenPaneLength
SplitView.OpenPaneLength
I n this Article
Edit
Gets or sets the width of the SplitView pane when it's fully expanded.
public : double OpenPaneLength { get; set; }
double OpenPaneLength();

void OpenPaneLength(double openpanelength);


public double OpenPaneLength { get; set; }

<SplitView OpenPaneLength="double" .../>

Returns
double
The width of the SplitView pane when it's fully expanded. The default is 320 device-independent pixel (DIP ).
SplitView.OpenPaneLengthProperty SplitView.OpenPane
LengthProperty SplitView.OpenPaneLengthProperty
I n this Article
Edit
Identifies the OpenPaneLength dependency property.
public : static DependencyProperty OpenPaneLengthProperty { get; }
static DependencyProperty OpenPaneLengthProperty();
public static DependencyProperty OpenPaneLengthProperty { get; }

Returns
DependencyProperty
The identifier for the OpenPaneLength dependency property.
See Dependency properties overview
Also
SplitView.Pane SplitView.Pane SplitView.Pane
I n this Article
Edit
Gets or sets the contents of the pane of a SplitView.

public : UIElement Pane { get; set; }


UIElement Pane();

void Pane(UIElement pane);


public UIElement Pane { get; set; }

<SplitView>
singleObject
<SplitView.Pane>
singleObject
</SplitView.Pane
</SplitView>

Returns
UIElement
The contents of the pane of a SplitView. The default is null.
SplitView.PaneBackground SplitView.PaneBackground
SplitView.PaneBackground
I n this Article
Edit
Gets or sets the Brush to apply to the background of the Pane area of the control.
public : Brush PaneBackground { get; set; }
Brush PaneBackground();

void PaneBackground(Brush panebackground);


public Brush PaneBackground { get; set; }

<SplitView PaneBackground="{StaticResource resourceName}"/>

Returns
Brush
The Brush to apply to the background of the Pane area of the control.
SplitView.PaneBackgroundProperty SplitView.Pane
BackgroundProperty SplitView.PaneBackgroundProperty
I n this Article
Edit
Identifies the PaneBackground dependency property.
public : static DependencyProperty PaneBackgroundProperty { get; }
static DependencyProperty PaneBackgroundProperty();
public static DependencyProperty PaneBackgroundProperty { get; }

Returns
DependencyProperty
The identifier for the PaneBackground dependency property.
See Dependency properties overview
Also
SplitView.PaneClosed SplitView.PaneClosed SplitView.
PaneClosed
I n this Article
Edit
Occurs when the SplitView pane is closed.
public : event TypedEventHandler<SplitView, object> PaneClosed
// Register
event_token PaneClosed(TypedEventHandler<SplitView, object> const& handler) const;

// Revoke with event_token


void PaneClosed(event_token const& cookie) const;

// Revoke with event_revoker


PaneClosed_revoker PaneClosed(auto_revoke_t, TypedEventHandler<SplitView, object> const& handler)
const;
public event TypedEventHandler<SplitView, object> PaneClosed

<SplitView PaneClosed="eventhandler"/>

See PaneClosingPaneClosingPaneClosing
Also
SplitView.PaneClosing SplitView.PaneClosing SplitView.
PaneClosing
I n this Article
Edit
Occurs when the SplitView pane is closing.
public : event TypedEventHandler<SplitView, SplitViewPaneClosingEventArgs> PaneClosing
// Register
event_token PaneClosing(TypedEventHandler<SplitView, SplitViewPaneClosingEventArgs> const& handler)
const;

// Revoke with event_token


void PaneClosing(event_token const& cookie) const;

// Revoke with event_revoker


PaneClosing_revoker PaneClosing(auto_revoke_t, TypedEventHandler<SplitView,
SplitViewPaneClosingEventArgs> const& handler) const;
public event TypedEventHandler<SplitView, SplitViewPaneClosingEventArgs> PaneClosing

<SplitView PaneClosing="eventhandler"/>

Remarks
Set the SplitViewPaneClosingEventArgs.Cancel property to true in a handler for this event in order to cancel a
SplitView pane closing action.
See PaneClosedPaneClosedPaneClosed
Also
SplitView.PaneOpened SplitView.PaneOpened SplitView.
PaneOpened
I n this Article
Edit
Occurs when the SplitView pane is opened.
public : event TypedEventHandler<SplitView, object> PaneOpened
// Register
event_token PaneOpened(TypedEventHandler<SplitView, object> const& handler) const;

// Revoke with event_token


void PaneOpened(event_token const& cookie) const;

// Revoke with event_revoker


PaneOpened_revoker PaneOpened(auto_revoke_t, TypedEventHandler<SplitView, object> const& handler)
const;
public event TypedEventHandler<SplitView, object> PaneOpened

<SplitView PaneOpened="eventhandler"/>
SplitView.PaneOpening SplitView.PaneOpening Split
View.PaneOpening
I n this Article
Edit
Occurs when the SplitView pane is opening.
public : event TypedEventHandler<SplitView, object> PaneOpening
// Register
event_token PaneOpening(TypedEventHandler<SplitView, object> const& handler) const;

// Revoke with event_token


void PaneOpening(event_token const& cookie) const;

// Revoke with event_revoker


PaneOpening_revoker PaneOpening(auto_revoke_t, TypedEventHandler<SplitView, object> const& handler)
const;
public event TypedEventHandler<SplitView, object> PaneOpening

<SplitView PaneOpening="eventhandler"/>
SplitView.PanePlacement SplitView.PanePlacement Split
View.PanePlacement
I n this Article
Edit
Gets or sets a value that specifies whether the pane is shown on the right or left side of the SplitView.
public : SplitViewPanePlacement PanePlacement { get; set; }
SplitViewPanePlacement PanePlacement();

void PanePlacement(SplitViewPanePlacement paneplacement);


public SplitViewPanePlacement PanePlacement { get; set; }

<SplitView PanePlacement="splitViewPanePlacementMemberName" />

Returns
SplitViewPanePlacement
A value of the enumeration that specifies whether the pane is shown on the right or left side of the SplitView. The
default is Left.
SplitView.PanePlacementProperty SplitView.Pane
PlacementProperty SplitView.PanePlacementProperty
I n this Article
Edit
Identifies the PanePlacement dependency property.
public : static DependencyProperty PanePlacementProperty { get; }
static DependencyProperty PanePlacementProperty();
public static DependencyProperty PanePlacementProperty { get; }

Returns
DependencyProperty
The identifier for the PanePlacement dependency property.
See Dependency properties overview
Also
SplitView.PaneProperty SplitView.PaneProperty Split
View.PaneProperty
I n this Article
Edit
Identifies the Pane dependency property.
public : static DependencyProperty PaneProperty { get; }
static DependencyProperty PaneProperty();
public static DependencyProperty PaneProperty { get; }

Returns
DependencyProperty
The identifier for the Pane dependency property.
See Dependency properties overview
Also
SplitView SplitView SplitView
I n this Article
Edit
Initializes a new instance of the SplitView class.

public : SplitView()
SplitView() const;
public SplitView()
SplitView.TemplateSettings SplitView.TemplateSettings
SplitView.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a SplitView control.
public : SplitViewTemplateSettings TemplateSettings { get; }
SplitViewTemplateSettings TemplateSettings();
public SplitViewTemplateSettings TemplateSettings { get; }

Returns
SplitViewTemplateSettings
An object that provides calculated values for templates.
SplitView.TemplateSettingsProperty SplitView.Template
SettingsProperty SplitView.TemplateSettingsProperty
I n this Article
Edit
Identifies the TemplateSettings dependency property.
public : static DependencyProperty TemplateSettingsProperty { get; }
static DependencyProperty TemplateSettingsProperty();
public static DependencyProperty TemplateSettingsProperty { get; }

Returns
DependencyProperty
The identifier for the TemplateSettings dependency property.
See Dependency properties overview
Also
SplitViewDisplayMode SplitViewDisplayMode SplitView
DisplayMode Enum
Defines constants that specify how the pane is shown in a SplitView.

D eclaration
public : enum class SplitViewDisplayMode
enum class winrt::Windows::UI::Xaml::Controls::SplitViewDisplayMode : int32_t
public enum SplitViewDisplayMode

I nheritance H ierarchy
None

Remarks
These enumeration values are used with the SplitView.DisplayMode property.

Fields
CompactInline The amount of the pane defined by the CompactPaneLength property is shown side-by-side with the
CompactInline content and takes up space in the control layout. The remaining part of the pane pushes the content to
CompactInline the side when it's open and takes up space in the control layout. The pane does not close when the user
taps outside of it.

CompactOverlay The amount of the pane defined by the CompactPaneLength property is shown side-by-side with the
CompactOverlay content and takes up space in the control layout. The remaining part of the pane covers the content when
CompactOverlay it's open and does not take up space in the control layout. The pane closes when the user taps outside of
it.

Inline Inline The pane is shown side-by-side with the content and takes up space in the control layout. The pane does
Inline not close when the user taps outside of it.

Overlay The pane covers the content when it's open and does not take up space in the control layout. The pane
Overlay closes when the user taps outside of it.
Overlay
SplitViewPaneClosingEventArgs SplitViewPaneClosing
EventArgs SplitViewPaneClosingEventArgs Class
Provides event data for the SplitView.PaneClosing event.

D eclaration
public : sealed class SplitViewPaneClosingEventArgs : ISplitViewPaneClosingEventArgs
struct winrt::Windows::UI::Xaml::Controls::SplitViewPaneClosingEventArgs :
ISplitViewPaneClosingEventArgs
public sealed class SplitViewPaneClosingEventArgs : ISplitViewPaneClosingEventArgs

I nheritance H ierarchy
None

Properties
Cancel
Cancel
Cancel

Gets or sets a value that indicates whether the pane closing action should be canceled.
SplitViewPaneClosingEventArgs.Cancel SplitViewPane
ClosingEventArgs.Cancel SplitViewPaneClosingEvent
Args.Cancel
I n this Article
Edit
Gets or sets a value that indicates whether the pane closing action should be canceled.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
true to cancel the pane closing action; otherwise, false.

Remarks
Set this property to true in an event handler in order to cancel a SplitView pane closing action.
SplitViewPanePlacement SplitViewPanePlacement Split
ViewPanePlacement Enum
Defines constants that specify whether the pane is to the left or right of the content in a SplitView.

D eclaration
public : enum class SplitViewPanePlacement
enum class winrt::Windows::UI::Xaml::Controls::SplitViewPanePlacement : int32_t
public enum SplitViewPanePlacement

I nheritance H ierarchy
None

Remarks
These enumeration values are used with the SplitView.PanePlacement property. For more info, see PanePlacement.

Fields
Left Left Left The pane is shown to the left of the SplitView content .

Right Right Right The pane is shown to the right of the SplitView content .
StackPanel StackPanel StackPanel Class
Arranges child elements into a single line that can be oriented horizontally or vertically.

D eclaration
public : class StackPanel : Panel, IInsertionPanel, IStackPanel, IStackPanel2, IStackPanel4,
IStackPanel5, IScrollSnapPointsInfo
struct winrt::Windows::UI::Xaml::Controls::StackPanel : Panel, IInsertionPanel, IStackPanel,
IStackPanel2, IStackPanel4, IStackPanel5, IScrollSnapPointsInfo
public class StackPanel : Panel, IInsertionPanel, IStackPanel, IStackPanel2, IStackPanel4,
IStackPanel5, IScrollSnapPointsInfo

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel

Remarks
 Tip

For more info, design guidance, and code examples, see Layout panels.
StackPanel is a layout panel that arranges child elements into a single line that can be oriented horizontally or vertically.

By default, StackPanel stacks items vertically from top to bottom in the order they are declared. You can set the
Orientation property to Horizontal to stack items from left to right.
You can insert items into a StackPanel at a specific location using the Insert method in code-behind.
 Tip

Starting in Windows 10, StackPanel defines new border properties that let you draw a border around the StackPanel
without using an additional Border element. The new properties are StackPanel.BorderBrush,
StackPanel.BorderThickness, StackPanel.CornerRadius, and StackPanel.Padding.
<StackPanel BorderBrush="Red" BorderThickness="2" CornerRadius="10" Padding="12">
<TextBlock Text="Hello World!"/>
</StackPanel>

Constructors
StackPanel()
StackPanel()
StackPanel()

Initializes a new instance of the StackPanel class.

Properties
AreHorizontalSnapPointsRegular
AreHorizontalSnapPointsRegular
AreHorizontalSnapPointsRegular

Gets a value that indicates whether the horizontal snap points for the StackPanel are equidistant from each other.

AreScrollSnapPointsRegular
AreScrollSnapPointsRegular
AreScrollSnapPointsRegular

Gets or sets a value that indicates whether the generated snap points used for panning in the StackPanel are
equidistant from each other.

AreScrollSnapPointsRegularProperty
AreScrollSnapPointsRegularProperty
AreScrollSnapPointsRegularProperty

Identifies the AreScrollSnapPointsRegular dependency property.

AreVerticalSnapPointsRegular
AreVerticalSnapPointsRegular
AreVerticalSnapPointsRegular

Gets a value that indicates whether the vertical snap points for the StackPanel are equidistant from each other.

BackgroundSizing
BackgroundSizing
BackgroundSizing

Gets or sets a value that indicates how far the background extends in relation to this element's border.

BackgroundSizingProperty
BackgroundSizingProperty
BackgroundSizingProperty

Identifies the BackgroundSizing dependency property.

BorderBrush
BorderBrush
BorderBrush
Gets or sets a brush that describes the border fill of the panel.

BorderBrushProperty
BorderBrushProperty
BorderBrushProperty

Identifies the BorderBrush dependency property.

BorderThickness
BorderThickness
BorderThickness

Gets or sets the border thickness of the panel.

BorderThicknessProperty
BorderThicknessProperty
BorderThicknessProperty

Identifies the BorderThickness dependency property.

CornerRadius
CornerRadius
CornerRadius

Gets or sets the radius for the corners of the panel's border.

CornerRadiusProperty
CornerRadiusProperty
CornerRadiusProperty

Identifies the CornerRadius dependency property.

Orientation
Orientation
Orientation

Gets or sets the dimension by which child elements are stacked.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the Orientation dependency property.


Padding
Padding
Padding

Gets or sets the distance between the border and its child object.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.

Spacing
Spacing
Spacing

Gets or sets a uniform distance (in pixels) between stacked items. It is applied in the direction of the StackPanel's
Orientation.

SpacingProperty
SpacingProperty
SpacingProperty

Identifies the Spacing dependency property.

Methods
GetInsertionIndexes(Point, Int32, Int32)
GetInsertionIndexes(Point, Int32, Int32)
GetInsertionIndexes(Point, Int32, Int32)

Returns the index values of the items that the specified point is between.

GetIrregularSnapPoints(Orientation, SnapPointsAlignment)
GetIrregularSnapPoints(Orientation, SnapPointsAlignment)
GetIrregularSnapPoints(Orientation, SnapPointsAlignment)

Returns the set of distances between irregular snap points for a specified orientation and alignment.

GetRegularSnapPoints(Orientation, SnapPointsAlignment, Single)


GetRegularSnapPoints(Orientation, SnapPointsAlignment, Single)
GetRegularSnapPoints(Orientation, SnapPointsAlignment, Single)

Gets the distance between regular snap points for a specified orientation and alignment.
Events
HorizontalSnapPointsChanged
HorizontalSnapPointsChanged
HorizontalSnapPointsChanged

Occurs when the measurements for horizontal snap points change.

VerticalSnapPointsChanged
VerticalSnapPointsChanged
VerticalSnapPointsChanged

Occurs when the measurements for vertical snap points change.

See Also
Panel
Panel
Panel
Panel
Panel
StackPanel.AreHorizontalSnapPointsRegular StackPanel.
AreHorizontalSnapPointsRegular StackPanel.Are
HorizontalSnapPointsRegular
I n this Article
Edit
Gets a value that indicates whether the horizontal snap points for the StackPanel are equidistant from each other.
public : Platform::Boolean AreHorizontalSnapPointsRegular { get; }
bool AreHorizontalSnapPointsRegular();
public bool AreHorizontalSnapPointsRegular { get; }

Returns
bool
true if the horizontal snap points for the StackPanel are equidistant from each other; otherwise, false.
StackPanel.AreScrollSnapPointsRegular StackPanel.Are
ScrollSnapPointsRegular StackPanel.AreScrollSnapPoints
Regular
I n this Article
Edit
Gets or sets a value that indicates whether the generated snap points used for panning in the StackPanel are
equidistant from each other.
public : Platform::Boolean AreScrollSnapPointsRegular { get; set; }
bool AreScrollSnapPointsRegular();

void AreScrollSnapPointsRegular(bool arescrollsnappointsregular);


public bool AreScrollSnapPointsRegular { get; set; }

<StackPanel AreScrollSnapPointsRegular="bool" .../>

Returns
bool
true if the snap points in the StackPanel are equidistant from each other; otherwise, false.
StackPanel.AreScrollSnapPointsRegularProperty Stack
Panel.AreScrollSnapPointsRegularProperty StackPanel.
AreScrollSnapPointsRegularProperty
I n this Article
Edit
Identifies the AreScrollSnapPointsRegular dependency property.
public : static DependencyProperty AreScrollSnapPointsRegularProperty { get; }
static DependencyProperty AreScrollSnapPointsRegularProperty();
public static DependencyProperty AreScrollSnapPointsRegularProperty { get; }

Returns
DependencyProperty
The identifier for the AreScrollSnapPointsRegular dependency property.
StackPanel.AreVerticalSnapPointsRegular StackPanel.Are
VerticalSnapPointsRegular StackPanel.AreVerticalSnap
PointsRegular
I n this Article
Edit
Gets a value that indicates whether the vertical snap points for the StackPanel are equidistant from each other.
public : Platform::Boolean AreVerticalSnapPointsRegular { get; }
bool AreVerticalSnapPointsRegular();
public bool AreVerticalSnapPointsRegular { get; }

Returns
bool
true if the vertical snap points for the StackPanel are equidistant from each other; otherwise, false.
StackPanel.BackgroundSizing StackPanel.Background
Sizing StackPanel.BackgroundSizing
I n this Article
Edit
Gets or sets a value that indicates how far the background extends in relation to this element's border.
public : BackgroundSizing BackgroundSizing { get; set; }
BackgroundSizing BackgroundSizing();

void BackgroundSizing(BackgroundSizing backgroundsizing);


public BackgroundSizing BackgroundSizing { get; set; }

Returns
BackgroundSizing
A value of the enumeration that indicates how far the background extends. The default is InnerBorderEdge.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
You can set this property to OuterBorderEdge to make the element's background extend under the border. If the
border is transparent, the background will show through it.
See BackgroundSizing
Also BackgroundSizing
StackPanel.BackgroundSizingProperty StackPanel.
BackgroundSizingProperty StackPanel.BackgroundSizing
Property
I n this Article
Edit
Identifies the BackgroundSizing dependency property.
public : static DependencyProperty BackgroundSizingProperty { get; }
static DependencyProperty BackgroundSizingProperty();
public static DependencyProperty BackgroundSizingProperty { get; }

Returns
DependencyProperty
The identifier for the BackgroundSizing dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


StackPanel.BorderBrush StackPanel.BorderBrush Stack
Panel.BorderBrush
I n this Article
Edit
Gets or sets a brush that describes the border fill of the panel.
public : Brush BorderBrush { get; set; }
Brush BorderBrush();

void BorderBrush(Brush borderbrush);


public Brush BorderBrush { get; set; }

<Border BorderBrush="{StaticResource resourceName}"/>

Returns
Brush
The brush that is used to fill the panel's border. The default is null, (a null brush) which is evaluated as Transparent for
rendering.

Remarks
The BorderThickness value must be greater than 0 in order to see the BorderBrush value take effect.
StackPanel.BorderBrushProperty StackPanel.BorderBrush
Property StackPanel.BorderBrushProperty
I n this Article
Edit
Identifies the BorderBrush dependency property.
public : static DependencyProperty BorderBrushProperty { get; }
static DependencyProperty BorderBrushProperty();
public static DependencyProperty BorderBrushProperty { get; }

Returns
DependencyProperty
The identifier for the BorderBrush dependency property.
See Dependency properties overview
Also
StackPanel.BorderThickness StackPanel.BorderThickness
StackPanel.BorderThickness
I n this Article
Edit
Gets or sets the border thickness of the panel.
public : Thickness BorderThickness { get; set; }
Thickness BorderThickness();

void BorderThickness(Thickness borderthickness);


public Thickness BorderThickness { get; set; }

<StackPanel BorderThickness="uniform"/>
- or -
<StackPanel BorderThickness="left&right,top&bottom"/>
- or -
<StackPanel BorderThickness="left,top,right,bottom"/>

Returns
Thickness
The border thickness of the panel, as a Thickness value.
StackPanel.BorderThicknessProperty StackPanel.Border
ThicknessProperty StackPanel.BorderThicknessProperty
I n this Article
Edit
Identifies the BorderThickness dependency property.
public : static DependencyProperty BorderThicknessProperty { get; }
static DependencyProperty BorderThicknessProperty();
public static DependencyProperty BorderThicknessProperty { get; }

Returns
DependencyProperty
The identifier for the BorderThickness dependency property.
See Dependency properties overview
Also
StackPanel.CornerRadius StackPanel.CornerRadius Stack
Panel.CornerRadius
I n this Article
Edit
Gets or sets the radius for the corners of the panel's border.
public : CornerRadius CornerRadius { get; set; }
CornerRadius CornerRadius();

void CornerRadius(CornerRadius cornerradius);


public CornerRadius CornerRadius { get; set; }

<StackPanel CornerRadius="uniformRadius"/>
- or -
<StackPanel CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>

Returns
CornerRadius
The degree to which the corners are rounded, expressed as values of the CornerRadius structure.

Remarks
Member components of a CornerRadius value cannot be negative.
StackPanel.CornerRadiusProperty StackPanel.Corner
RadiusProperty StackPanel.CornerRadiusProperty
I n this Article
Edit
Identifies the CornerRadius dependency property.
public : static DependencyProperty CornerRadiusProperty { get; }
static DependencyProperty CornerRadiusProperty();
public static DependencyProperty CornerRadiusProperty { get; }

Returns
DependencyProperty
The identifier for the CornerRadius dependency property.
See Dependency properties overview
Also
StackPanel.GetInsertionIndexes StackPanel.GetInsertion
Indexes StackPanel.GetInsertionIndexes
I n this Article
Edit
Returns the index values of the items that the specified point is between.
public : void GetInsertionIndexes(Point position, int first, int second)
void GetInsertionIndexes(Point position, int32_t const& first, int32_t const& second) const;
public void GetInsertionIndexes(Point position, Int32 first, Int32 second)

Parameters
position Point
The point for which to get insertion indexes.
first Int32
The index of the item before the specified point.
second Int32
The index of the item after the specified point.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Call this method when handling a DragOver event to return the indices of the two items between which the DragOver
is happening and where a potential drop and insertion would happen.
Version compatibility
The GetInsertionIndexes method is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not call this method without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
method before you use it.
<StackPanel AllowDrop="True" DragOver="StackPanel_DragOver">
private void StackPanel_DragOver(object sender, DragEventArgs e)
{
if (ApiInformation.IsMethodPresent("Windows.UI.Xaml.Controls.StackPanel",
"GetInsertionIndexes"))
{
StackPanel stackPanel = sender as StackPanel;
if (stackPanel != null)
{
int preceedingIndex;
int subsequentIndex;
stackPanel.GetInsertionIndexes(e.GetPosition(stackPanel), out preceedingIndex, out
subsequentIndex);
}
}
}
StackPanel.GetIrregularSnapPoints StackPanel.Get
IrregularSnapPoints StackPanel.GetIrregularSnapPoints
I n this Article
Edit
Returns the set of distances between irregular snap points for a specified orientation and alignment.
public : IVectorView<float> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment
alignment)
IVectorView<float> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment alignment)
const;
public IReadOnlyList<float> GetIrregularSnapPoints(Orientation orientation, SnapPointsAlignment
alignment)

Parameters
orientation Orientation
The orientation (dimension) for the desired snap point set.
alignment SnapPointsAlignment
The alignment to use when applying the snap points.
Returns
IReadOnlyList<float>
The read only collection of snap point distances. Returns an empty collection when no snap points are present.
StackPanel.GetRegularSnapPoints StackPanel.GetRegular
SnapPoints StackPanel.GetRegularSnapPoints
I n this Article
Edit
Gets the distance between regular snap points for a specified orientation and alignment.
public : float GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment alignment, float
offset)
float GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment alignment, Single const&
offset) const;
public float GetRegularSnapPoints(Orientation orientation, SnapPointsAlignment alignment, Single
offset)

Parameters
orientation Orientation
The orientation/dimension for the desired snap point set.
alignment SnapPointsAlignment
The alignment to use when applying the snap points.
offset Single
Out parameter. The offset of the first snap point.
Returns
float
The distance between the equidistant snap points. Returns 0 when no snap points are present.
StackPanel.HorizontalSnapPointsChanged StackPanel.
HorizontalSnapPointsChanged StackPanel.Horizontal
SnapPointsChanged
I n this Article
Edit
Occurs when the measurements for horizontal snap points change.
public : event EventHandler<Platform::Object> HorizontalSnapPointsChanged
// Register
event_token HorizontalSnapPointsChanged(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void HorizontalSnapPointsChanged(event_token const& cookie) const;

// Revoke with event_revoker


HorizontalSnapPointsChanged_revoker HorizontalSnapPointsChanged(auto_revoke_t,
EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> HorizontalSnapPointsChanged

<StackPanel HorizontalSnapPointsChanged="eventhandler" />


StackPanel.Orientation StackPanel.Orientation Stack
Panel.Orientation
I n this Article
Edit
Gets or sets the dimension by which child elements are stacked.
public : Orientation Orientation { get; set; }
Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

<StackPanel Orientation="Horizontal"/>
-or-
<StackPanel Orientation="Vertical"/>

Returns
Orientation
One of the enumeration values that specifies the orientation of child elements. The default is Vertical.

Examples
The following example creates a horizontal list of items by setting the Orientation property to Horizontal.
<StackPanel Orientation="Horizontal" Margin="20">
<Rectangle Fill="Red" Width="50" Height="50" Margin="5" />
<Rectangle Fill="Blue" Width="50" Height="50" Margin="5" />
<Rectangle Fill="Green" Width="50" Height="50" Margin="5" />
<Rectangle Fill="Purple" Width="50" Height="50" Margin="5" />
</StackPanel>

-->
StackPanel.OrientationProperty StackPanel.Orientation
Property StackPanel.OrientationProperty
I n this Article
Edit
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
StackPanel.Padding StackPanel.Padding StackPanel.
Padding
I n this Article
Edit
Gets or sets the distance between the border and its child object.
public : Thickness Padding { get; set; }
Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<StackPanel Padding="uniform"/>
- or -
<StackPanel Padding="left&right,top&bottom"/>
- or -
<StackPanel Padding="left,top,right,bottom"/>

Returns
Thickness
The dimensions of the space between the border and its child as a Thickness value. Thickness is a structure that stores
dimension values using pixel measures.

Remarks
A related property is Margin (a property of FrameworkElement ). For more info about the relationship between margin
and padding, see Alignment, margin, and padding or Define layouts with XAML.
StackPanel.PaddingProperty StackPanel.PaddingProperty
StackPanel.PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
See Dependency properties overview
Also
StackPanel.Spacing StackPanel.Spacing StackPanel.
Spacing
I n this Article
Edit
Gets or sets a uniform distance (in pixels) between stacked items. It is applied in the direction of the StackPanel's
Orientation.
public : double Spacing { get; set; }
double Spacing();

void Spacing(double spacing);


public double Spacing { get; set; }

<StackPanel Spacing="double"/>

Returns
double
The uniform distance (in pixels) between stacked items.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


StackPanel.SpacingProperty StackPanel.SpacingProperty
StackPanel.SpacingProperty
I n this Article
Edit
Identifies the Spacing dependency property.
public : static DependencyProperty SpacingProperty { get; }
static DependencyProperty SpacingProperty();
public static DependencyProperty SpacingProperty { get; }

Returns
DependencyProperty
The identifier for the Spacing dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


StackPanel StackPanel StackPanel
I n this Article
Edit
Initializes a new instance of the StackPanel class.

public : StackPanel()
StackPanel() const;
public StackPanel()
StackPanel.VerticalSnapPointsChanged StackPanel.
VerticalSnapPointsChanged StackPanel.VerticalSnap
PointsChanged
I n this Article
Edit
Occurs when the measurements for vertical snap points change.
public : event EventHandler<Platform::Object> VerticalSnapPointsChanged
// Register
event_token VerticalSnapPointsChanged(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token


void VerticalSnapPointsChanged(event_token const& cookie) const;

// Revoke with event_revoker


VerticalSnapPointsChanged_revoker VerticalSnapPointsChanged(auto_revoke_t,
EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> VerticalSnapPointsChanged

<StackPanel VerticalSnapPointsChanged="eventhandler" />


StretchDirection StretchDirection StretchDirection Enum
Defines constants that specify the direction that content is scaled.

D eclaration
public : enum class StretchDirection
enum class winrt::Windows::UI::Xaml::Controls::StretchDirection : int32_t
public enum StretchDirection

I nheritance H ierarchy
None

Fields
Both Both Both The content stretches to fit the parent according to the Stretch property.

DownOnly DownOnly The content scales downward only when it is larger than the parent. If the content is smaller, no
DownOnly scaling upward is performed.

UpOnly UpOnly The content scales upward only when it is smaller than the parent. If the content is larger, no
UpOnly scaling downward is performed.
StyleSelector StyleSelector StyleSelector Class
Enables custom item style selection logic as a function of the content data and its specific item container.

D eclaration
public : class StyleSelector : IStyleSelector, IStyleSelectorOverrides
struct winrt::Windows::UI::Xaml::Controls::StyleSelector : IStyleSelector,
IStyleSelectorOverrides
public class StyleSelector : IStyleSelector, IStyleSelectorOverrides

I nheritance H ierarchy
None

Remarks
The base StyleSelector class is not used as an object element in XAML. However, it is a common scenario to derive a
custom StyleSelector, map a xmlns prefix for the custom class and its namespace/assembly, and then refer to an
instance of the custom class as defined in a Resources block in XAML. This makes it possible to refer to the custom
template selector class by x:Key, and use that reference to set the value of properties such as
ItemContainerStyleSelector in XAML templates and particular visual states.

Constructors
StyleSelector()
StyleSelector()
StyleSelector()

Initializes a new instance of the StyleSelector class.

Methods
SelectStyle(Object, DependencyObject)
SelectStyle(Object, DependencyObject)
SelectStyle(Object, DependencyObject)

Returns a specific Style based on custom logic.

SelectStyleCore(Object, DependencyObject)
SelectStyleCore(Object, DependencyObject)
SelectStyleCore(Object, DependencyObject)

When implemented by a derived class, returns a specific Style based on custom logic.
StyleSelector.SelectStyle StyleSelector.SelectStyle Style
Selector.SelectStyle
I n this Article
Edit
Returns a specific Style based on custom logic.
public : Style SelectStyle(Platform::Object item, DependencyObject container)
Style SelectStyle(winrt::Windows::Foundation::IInspectable item, DependencyObject container) const;
public Style SelectStyle(Object item, DependencyObject container)

Parameters
item Object
The content.
container DependencyObject
The element to which the style is applied.
Returns
Style
An application-specific style to apply; may also return null.

Remarks
To provide a specific style in a derived class, override the SelectStyleCore method.
StyleSelector.SelectStyleCore StyleSelector.SelectStyle
Core StyleSelector.SelectStyleCore
I n this Article
Edit
When implemented by a derived class, returns a specific Style based on custom logic.
protected : virtual Style SelectStyleCore(Platform::Object item, DependencyObject container)
virtual Style SelectStyleCore(winrt::Windows::Foundation::IInspectable item, DependencyObject
container) const;
protected virtual Style SelectStyleCore(Object item, DependencyObject container)

Parameters
item Object
The content.
container DependencyObject
The element to which the style is applied.
Returns
Style
An application-specific style to apply; may also return null.
StyleSelector StyleSelector StyleSelector
I n this Article
Edit
Initializes a new instance of the StyleSelector class.

public : StyleSelector()
StyleSelector() const;
public StyleSelector()
SwapChainBackgroundPanel SwapChainBackground
Panel SwapChainBackgroundPanel Class
Implements a XAML layout surface target for Microsoft DirectX interoperation scenarios. This panel has some atypical
restrictions on its usage within an app window; see Remarks.
Im p o rt a nt

SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use
SwapChainPanel.

D eclaration
public : class SwapChainBackgroundPanel : Grid, ISwapChainBackgroundPanel,
ISwapChainBackgroundPanel2
struct winrt::Windows::UI::Xaml::Controls::SwapChainBackgroundPanel : Grid,
ISwapChainBackgroundPanel, ISwapChainBackgroundPanel2
public class SwapChainBackgroundPanel : Grid, ISwapChainBackgroundPanel,
ISwapChainBackgroundPanel2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel
Grid

Remarks
Im p o rt a nt

SwapChainBackgroundPanel is deprecated and may not be supported in future releases. Change any existing code that
used SwapChainBackgroundPanel to use SwapChainPanel instead. There's no downside to using SwapChainPanel, the
API is new because it relies upon an upgrade in the internal rendering and composition systems that were introduced
starting with Windows 8.1.
For most scenarios a SwapChainPanel will provide a more versatile Microsoft DirectX interop render surface than a
SwapChainBackgroundPanel does. That's because a SwapChainPanel doesn't have many of the XAML -side
composition limitations that are listed in the "Composition limitations" section below. For example you can apply a
RenderTransform to a SwapChainPanel. For more info, see DirectX and XAML interop and SwapChainPanel.
A SwapChainBackgroundPanel is a Grid subclass, so you can use ColumnDefinitions and RowDefinitions properties to
declare the panel's characteristics, and the attached properties of Grid such as Grid.Row and Grid.Column on child
elements to position those child elements in the layout.
For more info on how to use SwapChainBackgroundPanel, including sample code, see DirectX and XAML interop.
The SwapChainBackgroundPanel class does not inherit from the Control class, and you cannot force focus to this
element. Events that rely on having focus, such as KeyUp and KeyDown, may have no effect.
I nitializing a SwapChainPanel element
Before a SwapChainBackgroundPanel can render content, you must initialize it from the Microsoft DirectX side.
Cast the SwapChainBackgroundPanel instance to IInspectable or IUnknown, then call QueryInterface to obtain a
reference to the ISwapChainBackgroundPanelNative interface (this is the native interface implementation that is the
complement to the SwapChainBackgroundPanel and enables the interop bridge). Then, call
ISwapChainBackgroundPanelNative.SetSwapChain on that reference to associate your implemented swap chain with
the SwapChainBackgroundPanel instance.
It's common to put the code that queries the interface and sets the swap chain as part of a Create*Resources method.
The Create*Resources methods are an implementation pattern that's seen in the Microsoft DirectX Renderer class
templates/examples.
The API that enables you to add a SwapChain to an existing SwapChainBackgroundPanel is not a runtime class API, it
is a Microsoft DirectX API. You implement the swap chain input as a Microsoft DirectX interface (IDXGISwapChain).
Composition limitations
A SwapChainBackgroundPanel element can only appear as the root element of a XAML element tree, or cannot have a
parent element if the object tree is established through code.
The SwapChainBackgroundPanel exists as a discrete layout element mainly so that you can satisfy some of the existing
restrictions on Microsoft DirectX SwapChain integration within a Windows UI. In particular, there can only be one
SwapChain per window, and the visuals in that overlay appear last in any possible z-order displayed in the window.
Although SwapChainBackgroundPanel is a UIElement derived class, projection and transformation API have no effect
upon its rendering presentation.
Some of the non-layout properties that are inherited from Grid or from base classes such as FrameworkElement have
no effect when set on a SwapChainBackgroundPanel. This is because it is the Microsoft DirectX SwapChain that
should have the greater influence over what appears within the panel.

Constructors
SwapChainBackgroundPanel()
SwapChainBackgroundPanel()
SwapChainBackgroundPanel()
Note

SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use
SwapChainPanel.
Initializes a new instance of the SwapChainBackgroundPanel class.

Methods
CreateCoreIndependentInputSource(CoreInputDeviceTypes)
CreateCoreIndependentInputSource(CoreInputDeviceTypes)
CreateCoreIndependentInputSource(CoreInputDeviceTypes)
Note

SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use
SwapChainPanel.
Creates a core input object that handles the input types as specified by the deviceTypes parameter.

See Also
Grid
Grid
SwapChainBackgroundPanel.CreateCoreIndependent
InputSource SwapChainBackgroundPanel.CreateCore
IndependentInputSource SwapChainBackgroundPanel.
CreateCoreIndependentInputSource
I n this Article
Edit
Note

SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use
SwapChainPanel.
Creates a core input object that handles the input types as specified by the deviceTypes parameter.
public : CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes
deviceTypes)
CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes) const;
public CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes)

Parameters
deviceTypes CoreInputDeviceTypes
A combined value of the enumeration.
Returns
CoreIndependentInputSource
An object that represents the input subsystem for interoperation purposes and can be used for input event connection
points.

Remarks
Im p o rt a nt

You must call CreateCoreIndependentInputSource from a non-UI thread, otherwise this method will fail.
See CoreIndependentInputSource
Also
SwapChainBackgroundPanel SwapChainBackground
Panel SwapChainBackgroundPanel
I n this Article
Edit
Note

SwapChainBackgroundPanel may be altered or unavailable for releases after Windows 8.1 Instead, use
SwapChainPanel.
Initializes a new instance of the SwapChainBackgroundPanel class.
public : SwapChainBackgroundPanel()
SwapChainBackgroundPanel() const;
public SwapChainBackgroundPanel()
SwapChainPanel SwapChainPanel SwapChainPanel Class
Provides a hosting surface, where Microsoft DirectX swap chains provide content that can be rendered into a XAML UI.
A SwapChainPanel element is a key component for an app that renders Microsoft DirectX graphics and then presents
those visuals within a XAML page.

D eclaration
public : class SwapChainPanel : Grid, ISwapChainPanel
struct winrt::Windows::UI::Xaml::Controls::SwapChainPanel : Grid, ISwapChainPanel
public class SwapChainPanel : Grid, ISwapChainPanel

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel
Grid

Remarks
A SwapChainPanel is a Grid subclass, so you can use ColumnDefinitions and RowDefinitions properties to declare the
panel's characteristics, and the attached properties of Grid such as Grid.Row and Grid.Column on child elements to
position those child elements in the layout.
For code examples that use SwapChainPanel, see XAML SwapChainPanel DirectX interop sample.
The SwapChainPanel class does not inherit from the Control class, so you can't programmatically focus it directly for
purposes of capturing key events. Consider setting the focus to a focusable element inside the panel and letting the key
event bubble.
In order to maintain crisp vector rendering, you should listen for the CompositionScaleChanged event and query the
CompositionScaleX and CompositionScaleY property values to account for the current UI scale, and potentially render
again from DirectX. Otherwise XAML layout might do the scaling and your visuals might be degraded.
I nitializing a SwapChainPanel element
Before a SwapChainPanel can render content, you must initialize it from the Microsoft DirectX side.
Cast the SwapChainPanel instance to IInspectable or IUnknown, then call QueryInterface to obtain a reference to the
ISwapChainPanelNative interface (this is the native interface implementation that is the complement to the
SwapChainPanel and enables the interop bridge). Then, call ISwapChainPanelNative.SetSwapChain on that reference
to associate your implemented swap chain with the SwapChainPanel instance.
It's common to put the code that queries the interface and sets the swap chain as part of a Create*Resources method.
The Create*Resources methods are an implementation pattern that's seen in the Microsoft DirectX Renderer class
templates/examples, and you'll also see this implementation pattern in the SDK samples, and in the code you get from
the DirectX (XAML ) project template in Microsoft Visual Studio. Specifically, in the DirectX (XAML ) project
template, you'll see the QueryInterface call and the call to ISwapChainPanelNative.SetSwapChain in the
DeviceResources::CreateWindowSizeDependentResources method implementation in DeviceResources.cpp.

The API that enables you to add a SwapChain to an existing SwapChainPanel is not a runtime class API, it is a
Microsoft DirectX API. You implement the swap chain input as a Microsoft DirectX interface (IDXGISwapChain).
SwapChainPanel and SwapChainB ackgroundPanel
SwapChainPanel has less restrictions on its interactions and placement in UI than does SwapChainBackgroundPanel.
SwapChainPanel can be used as a control anywhere in a visual tree of a page. SwapChainBackgroundPanel can only be
the root element.
The typical XAML UI API that are inherited from the Grid base class can be used on a SwapChainPanel.
SwapChainBackgroundPanel doesn't permit you to set most Grid inherited API.
For new apps you should generally use SwapChainPanel and should consider SwapChainBackgroundPanel to be a
legacy technique for Windows 8 apps that weren't updated for Windows 8.1.
Swap chains
Swap chains must run on the main UI thread. This is usually accomplished by calling SetSwapChain on a reference
that was initialized as a XAML object element.
A single swap chain can be associated with multiple SwapChainPanel elements. Or, your app can have multiple swap
chains, with each providing the presentation for a separate SwapChainPanel.
However, performance can decline if many swap chains are updated simultaneously. We recommend that your app use
no more than four swap chains.
Content that's rendered via the swap chain is not stretched when it's resized by the user; instead, the resizing behavior
is similar to setting Stretch="None" on an Image element.
There are other techniques for rendering swap chain content that goes directly to the app's core window rather than a
XAML -composed element. See CreateSwapChainForCoreWindow.
P rocessing input on background threads
Using the CreateCoreIndependentInputSource method, apps can process input and render to a SwapChainPanel
entirely on one or more background threads. This enables high performance input and rendering independent of the
XAML UI thread.

Constructors
SwapChainPanel()
SwapChainPanel()
SwapChainPanel()

Initializes a new instance of the SwapChainPanel class.

Properties
CompositionScaleX
CompositionScaleX
CompositionScaleX

Gets the x-axis scale factor of the SwapChainPanel.

CompositionScaleXProperty
CompositionScaleXProperty
CompositionScaleXProperty

Identifies the CompositionScaleX dependency property.


CompositionScaleY
CompositionScaleY
CompositionScaleY

Gets the y-axis scale factor of the SwapChainPanel.

CompositionScaleYProperty
CompositionScaleYProperty
CompositionScaleYProperty

Identifies the CompositionScaleY dependency property.

Methods
CreateCoreIndependentInputSource(CoreInputDeviceTypes)
CreateCoreIndependentInputSource(CoreInputDeviceTypes)
CreateCoreIndependentInputSource(CoreInputDeviceTypes)

Creates a core input object that handles the input types as specified by the deviceTypes parameter. This core input
object can process input events on a background thread.

Events
CompositionScaleChanged
CompositionScaleChanged
CompositionScaleChanged

Occurs when the composition scale factor of the SwapChainPanel has changed.

See Also
Grid
Grid
Grid
Grid
Grid
Grid
Grid
Grid
SwapChainPanel.CompositionScaleChanged SwapChain
Panel.CompositionScaleChanged SwapChainPanel.
CompositionScaleChanged
I n this Article
Edit
Occurs when the composition scale factor of the SwapChainPanel has changed.
public : event TypedEventHandler<SwapChainPanel, object> CompositionScaleChanged
// Register
event_token CompositionScaleChanged(TypedEventHandler<SwapChainPanel, object> const& handler) const;

// Revoke with event_token


void CompositionScaleChanged(event_token const& cookie) const;

// Revoke with event_revoker


CompositionScaleChanged_revoker CompositionScaleChanged(auto_revoke_t,
TypedEventHandler<SwapChainPanel, object> const& handler) const;
public event TypedEventHandler<SwapChainPanel, object> CompositionScaleChanged

<SwapChainPanel CompositionScaleChanged="eventhandler"/>

Remarks
The supplier of the swap chain content might need to resize their content if a layout pass determines a new size for the
panel or containers it's within, or if a RenderTransform is applied on the SwapChainPanel or any of its ancestors.
Changes of this nature aren't always originated by app logic that's easy to detect from other events (for example the
user might change a device orientation or a view state that causes layout to rerun), so this event provides a notification
specifically for the scenario of changing the swap chain content size, which would typically invert the scale factors
applied.
Check CompositionScaleX and CompositionScaleY any time you are handling CompositionScaleChanged
(CompositionScaleChanged doesn't have event data, but if it fires it means that one or both properties have changed
values on this SwapChainPanel ).
This event fires asynchronously versus the originating change. For example, dynamic animations or manipulations
might affect the scale factor, and the event is raised when those dynamic changes are completed.
SwapChainPanel.CompositionScaleX SwapChainPanel.
CompositionScaleX SwapChainPanel.CompositionScaleX
I n this Article
Edit
Gets the x-axis scale factor of the SwapChainPanel.
public : float CompositionScaleX { get; }
float CompositionScaleX();
public float CompositionScaleX { get; }

Returns
float
The x-axis scale factor of the SwapChainPanel. A value of 1.0 means no scaling is applied.

Remarks
The CompositionScaleX scale factor is applied to the swap chain content when it's rendered to the screen and
composited into the XAML content. The scale factor is derived from calculating the render transformations (implicit or
explicit) applied to the SwapChainPanel and its ancestors.
The scale factor will be an estimate if a Projection property value is present on the SwapChainPanel or one of its
ancestors.
Check this property any time you are handling CompositionScaleChanged (CompositionScaleChanged doesn't have
event data, but if it fires it means that CompositionScaleX, CompositionScaleY, or both have changed values on this
SwapChainPanel ).
See CompositionScaleChangedCompositionScaleChangedCompositionScaleChanged
Also
SwapChainPanel.CompositionScaleXProperty SwapChain
Panel.CompositionScaleXProperty SwapChainPanel.
CompositionScaleXProperty
I n this Article
Edit
Identifies the CompositionScaleX dependency property.
public : static DependencyProperty CompositionScaleXProperty { get; }
static DependencyProperty CompositionScaleXProperty();
public static DependencyProperty CompositionScaleXProperty { get; }

Returns
DependencyProperty
The identifier for the CompositionScaleX dependency property.
SwapChainPanel.CompositionScaleY SwapChainPanel.
CompositionScaleY SwapChainPanel.CompositionScaleY
I n this Article
Edit
Gets the y-axis scale factor of the SwapChainPanel.
public : float CompositionScaleY { get; }
float CompositionScaleY();
public float CompositionScaleY { get; }

Returns
float
The y-axis scale factor of the SwapChainPanel. A value of 1.0 means no scaling is applied.

Remarks
The CompositionScaleY scale factor is applied to the swap chain content when it's rendered to the screen and
composited into the XAML content. The scale factor is derived from calculating the render transformations (implicit or
explicit) applied to the SwapChainPanel and its ancestors.
The scale factor will be an estimate if a Projection property value is present on the SwapChainPanel or one of its
ancestors.
Check this property any time you are handling CompositionScaleChanged (CompositionScaleChanged doesn't have
event data, but if it fires it means that CompositionScaleX, CompositionScaleY, or both have changed values on this
SwapChainPanel ).
See CompositionScaleChangedCompositionScaleChangedCompositionScaleChanged
Also
SwapChainPanel.CompositionScaleYProperty SwapChain
Panel.CompositionScaleYProperty SwapChainPanel.
CompositionScaleYProperty
I n this Article
Edit
Identifies the CompositionScaleY dependency property.
public : static DependencyProperty CompositionScaleYProperty { get; }
static DependencyProperty CompositionScaleYProperty();
public static DependencyProperty CompositionScaleYProperty { get; }

Returns
DependencyProperty
The identifier for the CompositionScaleY dependency property.
SwapChainPanel.CreateCoreIndependentInputSource
SwapChainPanel.CreateCoreIndependentInputSource
SwapChainPanel.CreateCoreIndependentInputSource
I n this Article
Edit
Creates a core input object that handles the input types as specified by the deviceTypes parameter. This core input
object can process input events on a background thread.
public : CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes
deviceTypes)
CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes) const;
public CoreIndependentInputSource CreateCoreIndependentInputSource(CoreInputDeviceTypes deviceTypes)

Parameters
deviceTypes CoreInputDeviceTypes
A combined value of the enumeration.
Returns
CoreIndependentInputSource
An object that represents the input subsystem for interoperation purposes and can be used for input event connection
points.

Remarks
This method enables an app that includes a SwapChainPanel to handle input and rendering independent of the XAML
UI thread, because you're deliberately providing the input processing logic on a background thread. You must call
CreateCoreIndependentInputSource from a non-UI thread, otherwise this method will fail.
Use the CreateCoreIndependentInputSource method to create a core input object and associate it with your
SwapChainPanel. Upon successful creation, user input of the specified device types that accesses SwapChainPanel
contents will be redirected to the thread that CreateCoreIndependentInputSource was called from. Your app can
handle this input by registering for input events and processing those events on a background thread. In order to
receive input messages through the CoreIndependentInputSource object, the app code must set a swap chain on the
SwapChainPanel, and render (at a Microsoft DirectX level) from this swap chain at least once. That provides the
rendering that makes hit testing possible.
You typically use CoreDispatcher.ProcessEvents as part of the event handling. Get a CoreDispatcher reference from
CoreIndependentInputSource.Dispatcher. For more info on how to use background threads, see ThreadPool or
Threading and async programming.
You can call CreateCoreIndependentInputSource multiple times. Each time CreateCoreIndependentInputSource is
called, the previous CoreIndependentInputSource object is disassociated with the SwapChainPanel. In other words,
only one CoreIndependentInputSource object can get events at a time.
For example code of how to use CreateCoreIndependentInputSource, see the DrawingPanel class definition that is
part of the XAML SwapChainPanel DirectX interop sample.
CreateCoreIndependentInputSource d can return null if deviceTypes was passed as CoreInputDeviceTypes.None
(that's not a typical way to call CreateCoreIndependentInputSource though).
See CoreIndependentInputSource
Also Threading and async programming
DirectX and XAML interop
XAML SwapChainPanel DirectX interop sample
Low latency input sample (Windows 10)
SwapChainPanel SwapChainPanel SwapChainPanel
I n this Article
Edit
Initializes a new instance of the SwapChainPanel class.

public : SwapChainPanel()
SwapChainPanel() const;
public SwapChainPanel()

Remarks
Im p o rt a nt

Initialization through the constructor is not enough to enable the SwapChainPanel element to render the swap chain.
You must use a native interface and Microsoft DirectX code. For more info see the "Initializing a SwapChainPanel
element" section in the SwapChainPanel class topic.
SwipeBehaviorOnInvoked SwipeBehaviorOnInvoked
SwipeBehaviorOnInvoked Enum
Defines constants that specify how a SwipeControl behaves after a command is invoked.

D eclaration
public : enum class SwipeBehaviorOnInvoked
enum class winrt::Windows::UI::Xaml::Controls::SwipeBehaviorOnInvoked : int32_t
public enum SwipeBehaviorOnInvoked

I nheritance H ierarchy
None

Fields
Auto Auto Auto In Reveal mode, the SwipeControl closes after an item is invoked. In Execute mode, the
SwipeControl remains open.

Close Close Close The SwipeControl closes after an item is invoked.

RemainOpen RemainOpen The SwipeControl remains open after an item is invoked.


RemainOpen
SwipeControl SwipeControl SwipeControl Class
Represents a container that provides access to contextual commands through touch interactions.

D eclaration
public : class SwipeControl : ContentControl, ISwipeControl
struct winrt::Windows::UI::Xaml::Controls::SwipeControl : ContentControl, ISwipeControl
public class SwipeControl : ContentControl, ISwipeControl

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Constructors
SwipeControl()
SwipeControl()
SwipeControl()

Initializes a new instance of the SwipeControl class.

Properties
BottomItems
BottomItems
BottomItems

Gets or sets the items that can be invoked when the control is swiped from the bottom up.

BottomItemsProperty
BottomItemsProperty
BottomItemsProperty

Identifies the BottomItems dependency property.

LeftItems
LeftItems
LeftItems

Gets or sets the items that can be invoked when the control is swiped from the left side.

LeftItemsProperty
LeftItemsProperty
LeftItemsProperty

Identifies the LeftItems dependency property.

RightItems
RightItems
RightItems

Gets or sets the items that can be invoked when the control is swiped from the right side.

RightItemsProperty
RightItemsProperty
RightItemsProperty

Identifies the RightItems dependency property.

TopItems
TopItems
TopItems

Gets or sets the items that can be invoked when the control is swiped from the top down.

TopItemsProperty
TopItemsProperty
TopItemsProperty

Identifies the TopItems dependency property.

Methods
Close()
Close()
Close()

Closes the swipe control.

See Also
SwipeControl.BottomItems SwipeControl.BottomItems
SwipeControl.BottomItems
I n this Article
Edit
Gets or sets the items that can be invoked when the control is swiped from the bottom up.
public : SwipeItems BottomItems { get; set; }
SwipeItems BottomItems();

void BottomItems(SwipeItems bottomitems);


public SwipeItems BottomItems { get; set; }

<SwipeControl>
<SwipeControl.BottomItems>
oneOrMoreSwipeItemDefinitions
</SwipeControl.BottomItems>
</SwipeControl>

Returns
SwipeItems
The items that can be invoked when the control is swiped from the bottom up.
SwipeControl.BottomItemsProperty SwipeControl.
BottomItemsProperty SwipeControl.BottomItems
Property
I n this Article
Edit
Identifies the BottomItems dependency property.
public : static DependencyProperty BottomItemsProperty { get; }
static DependencyProperty BottomItemsProperty();
public static DependencyProperty BottomItemsProperty { get; }

Returns
DependencyProperty
The identifier for the BottomItems dependency property.
SwipeControl.Close SwipeControl.Close SwipeControl.
Close
I n this Article
Edit
Closes the swipe control.
public : void Close()
void Close() const;
public void Close()
SwipeControl.LeftItems SwipeControl.LeftItems Swipe
Control.LeftItems
I n this Article
Edit
Gets or sets the items that can be invoked when the control is swiped from the left side.
public : SwipeItems LeftItems { get; set; }
SwipeItems LeftItems();

void LeftItems(SwipeItems leftitems);


public SwipeItems LeftItems { get; set; }

<SwipeControl>
<SwipeControl.LeftItems>
oneOrMoreSwipeItemDefinitions
</SwipeControl.LeftItems>
</SwipeControl>

Returns
SwipeItems
The items that can be invoked when the control is swiped from the left side.
SwipeControl.LeftItemsProperty SwipeControl.LeftItems
Property SwipeControl.LeftItemsProperty
I n this Article
Edit
Identifies the LeftItems dependency property.
public : static DependencyProperty LeftItemsProperty { get; }
static DependencyProperty LeftItemsProperty();
public static DependencyProperty LeftItemsProperty { get; }

Returns
DependencyProperty
The identifier for the LeftItems dependency property.
SwipeControl.RightItems SwipeControl.RightItems Swipe
Control.RightItems
I n this Article
Edit
Gets or sets the items that can be invoked when the control is swiped from the right side.
public : SwipeItems RightItems { get; set; }
SwipeItems RightItems();

void RightItems(SwipeItems rightitems);


public SwipeItems RightItems { get; set; }

<SwipeControl>
<SwipeControl.RightItems>
oneOrMoreSwipeItemDefinitions
</SwipeControl.RightItems>
</SwipeControl>

Returns
SwipeItems
The items that can be invoked when the control is swiped from the right side.
SwipeControl.RightItemsProperty SwipeControl.Right
ItemsProperty SwipeControl.RightItemsProperty
I n this Article
Edit
Identifies the RightItems dependency property.
public : static DependencyProperty RightItemsProperty { get; }
static DependencyProperty RightItemsProperty();
public static DependencyProperty RightItemsProperty { get; }

Returns
DependencyProperty
The identifier for the RightItems dependency property.
SwipeControl SwipeControl SwipeControl
I n this Article
Edit
Initializes a new instance of the SwipeControl class.

public : SwipeControl()
SwipeControl() const;
public SwipeControl()
SwipeControl.TopItems SwipeControl.TopItems Swipe
Control.TopItems
I n this Article
Edit
Gets or sets the items that can be invoked when the control is swiped from the top down.
public : SwipeItems TopItems { get; set; }
SwipeItems TopItems();

void TopItems(SwipeItems topitems);


public SwipeItems TopItems { get; set; }

<SwipeControl>
<SwipeControl.TopItems>
oneOrMoreSwipeItemDefinitions
</SwipeControl.TopItems>
</SwipeControl>

Returns
SwipeItems
The items that can be invoked when the control is swiped from the top down.
SwipeControl.TopItemsProperty SwipeControl.TopItems
Property SwipeControl.TopItemsProperty
I n this Article
Edit
Identifies the TopItems dependency property.
public : static DependencyProperty TopItemsProperty { get; }
static DependencyProperty TopItemsProperty();
public static DependencyProperty TopItemsProperty { get; }

Returns
DependencyProperty
The identifier for the TopItems dependency property.
SwipeItem SwipeItem SwipeItem Class
Represents an individual command in a SwipeControl.

D eclaration
public : class SwipeItem : DependencyObject, ISwipeItem
struct winrt::Windows::UI::Xaml::Controls::SwipeItem : DependencyObject, ISwipeItem
public class SwipeItem : DependencyObject, ISwipeItem

I nheritance H ierarchy
DependencyObject

Constructors
SwipeItem()
SwipeItem()
SwipeItem()

Initializes a new instance of the SwipeItem class.

Properties
Background
Background
Background

Gets or sets a brush that provides the background of the control.

BackgroundProperty
BackgroundProperty
BackgroundProperty

Identifies the Background dependency property.

BehaviorOnInvoked
BehaviorOnInvoked
BehaviorOnInvoked

Gets or sets a value that indicates how a SwipeControl behaves after this item is invoked.

BehaviorOnInvokedProperty
BehaviorOnInvokedProperty
BehaviorOnInvokedProperty

Identifies the BehaviorOnInvoked dependency property.


Command
Command
Command

Gets or sets the command to execute when this item is invoked.

CommandParameter
CommandParameter
CommandParameter

Gets or sets the parameter to pass to the Command property.

CommandParameterProperty
CommandParameterProperty
CommandParameterProperty

Identifies the CommandParameter dependency property.

CommandProperty
CommandProperty
CommandProperty

Identifies the Command dependency property.

Foreground
Foreground
Foreground

Gets or sets the brush that paints the text and icon of the item.

ForegroundProperty
ForegroundProperty
ForegroundProperty

Identifies the Foreground dependency property.

IconSource
IconSource
IconSource

Gets or sets the graphic content of the item.

IconSourceProperty
IconSourceProperty
IconSourceProperty
Identifies the IconSource dependency property.

Text
Text
Text

Gets or sets the text description displayed on the item.

TextProperty
TextProperty
TextProperty

Identifies the Text dependency property.

Events
Invoked
Invoked
Invoked

Occurs when user interaction indicates that the command represented by this item should execute.
SwipeItem.Background SwipeItem.Background Swipe
Item.Background
I n this Article
Edit
Gets or sets a brush that provides the background of the control.
public : Brush Background { get; set; }
Brush Background();

void Background(Brush background);


public Brush Background { get; set; }

<SwipeItem Background="{StaticResource resourceName}"/>

Returns
Brush
The brush that provides the background of the control.
SwipeItem.BackgroundProperty SwipeItem.Background
Property SwipeItem.BackgroundProperty
I n this Article
Edit
Identifies the Background dependency property.
public : static DependencyProperty BackgroundProperty { get; }
static DependencyProperty BackgroundProperty();
public static DependencyProperty BackgroundProperty { get; }

Returns
DependencyProperty
The identifier for the Background dependency property.
SwipeItem.BehaviorOnInvoked SwipeItem.BehaviorOn
Invoked SwipeItem.BehaviorOnInvoked
I n this Article
Edit
Gets or sets a value that indicates how a SwipeControl behaves after this item is invoked.
public : SwipeBehaviorOnInvoked BehaviorOnInvoked { get; set; }
SwipeBehaviorOnInvoked BehaviorOnInvoked();

void BehaviorOnInvoked(SwipeBehaviorOnInvoked behavioroninvoked);


public SwipeBehaviorOnInvoked BehaviorOnInvoked { get; set; }

<SwipeItem BehaviorOnInvoked="swipeBehaviorOnInvokedMemberName" />

Returns
SwipeBehaviorOnInvoked
A value that indicates how a SwipeControl behaves after this item is invoked. The default is Auto.
SwipeItem.BehaviorOnInvokedProperty SwipeItem.
BehaviorOnInvokedProperty SwipeItem.BehaviorOn
InvokedProperty
I n this Article
Edit
Identifies the BehaviorOnInvoked dependency property.
public : static DependencyProperty BehaviorOnInvokedProperty { get; }
static DependencyProperty BehaviorOnInvokedProperty();
public static DependencyProperty BehaviorOnInvokedProperty { get; }

Returns
DependencyProperty
The identifier for the BehaviorOnInvoked dependency property.
SwipeItem.Command SwipeItem.Command SwipeItem.
Command
I n this Article
Edit
Gets or sets the command to execute when this item is invoked.
public : ICommand Command { get; set; }
ICommand Command();

void Command(ICommand command);


public ICommand Command { get; set; }

<SwipeItem Command="commandReference"/>

Returns
ICommand
The command to execute when this item is invoked. The default is null.
SwipeItem.CommandParameter SwipeItem.Command
Parameter SwipeItem.CommandParameter
I n this Article
Edit
Gets or sets the parameter to pass to the Command property.
public : Platform::Object CommandParameter { get; set; }
winrt::Windows::Foundation::IInspectable CommandParameter();

void CommandParameter(winrt::Windows::Foundation::IInspectable commandparameter);


public object CommandParameter { get; set; }

<SwipeItem>
<SwipeItem.CommandParameter>
object
</SwipeItem.CommandParameter>
</SwipeItem>

Returns
object
The parameter to pass to the Command property. The default is null.
SwipeItem.CommandParameterProperty SwipeItem.
CommandParameterProperty SwipeItem.Command
ParameterProperty
I n this Article
Edit
Identifies the CommandParameter dependency property.
public : static DependencyProperty CommandParameterProperty { get; }
static DependencyProperty CommandParameterProperty();
public static DependencyProperty CommandParameterProperty { get; }

Returns
DependencyProperty
The identifier for the CommandParameter dependency property.
SwipeItem.CommandProperty SwipeItem.Command
Property SwipeItem.CommandProperty
I n this Article
Edit
Identifies the Command dependency property.
public : static DependencyProperty CommandProperty { get; }
static DependencyProperty CommandProperty();
public static DependencyProperty CommandProperty { get; }

Returns
DependencyProperty
The identifier for the Command dependency property.
SwipeItem.Foreground SwipeItem.Foreground Swipe
Item.Foreground
I n this Article
Edit
Gets or sets the brush that paints the text and icon of the item.
public : Brush Foreground { get; set; }
Brush Foreground();

void Foreground(Brush foreground);


public Brush Foreground { get; set; }

<SwipeItem Foreground="{StaticResource resourceName}"/>

Returns
Brush
The brush that paints the text and icon of the item.
SwipeItem.ForegroundProperty SwipeItem.Foreground
Property SwipeItem.ForegroundProperty
I n this Article
Edit
Identifies the Foreground dependency property.
public : static DependencyProperty ForegroundProperty { get; }
static DependencyProperty ForegroundProperty();
public static DependencyProperty ForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the Foreground dependency property.
SwipeItem.IconSource SwipeItem.IconSource SwipeItem.
IconSource
I n this Article
Edit
Gets or sets the graphic content of the item.
public : IconSource IconSource { get; set; }
IconSource IconSource();

void IconSource(IconSource iconsource);


public IconSource IconSource { get; set; }

<SwipeItem>
<SwipeItem.IconSource>
iconSourceElement
</SwipeItem.IconSource>
</SwipeItem>

Returns
IconSource
The graphic content of the item. The default is null.
SwipeItem.IconSourceProperty SwipeItem.IconSource
Property SwipeItem.IconSourceProperty
I n this Article
Edit
Identifies the IconSource dependency property.
public : static DependencyProperty IconSourceProperty { get; }
static DependencyProperty IconSourceProperty();
public static DependencyProperty IconSourceProperty { get; }

Returns
DependencyProperty
The identifier for the IconSource dependency property.
SwipeItem.Invoked SwipeItem.Invoked SwipeItem.
Invoked
I n this Article
Edit
Occurs when user interaction indicates that the command represented by this item should execute.
public : event TypedEventHandler<SwipeItem, SwipeItemInvokedEventArgs> Invoked
// Register
event_token Invoked(TypedEventHandler<SwipeItem, SwipeItemInvokedEventArgs> const& handler) const;

// Revoke with event_token


void Invoked(event_token const& cookie) const;

// Revoke with event_revoker


Invoked_revoker Invoked(auto_revoke_t, TypedEventHandler<SwipeItem, SwipeItemInvokedEventArgs>
const& handler) const;
public event TypedEventHandler<SwipeItem, SwipeItemInvokedEventArgs> Invoked

<SwipeItem Invoked="eventhandler"/>
SwipeItem SwipeItem SwipeItem
I n this Article
Edit
Initializes a new instance of the SwipeItem class.

public : SwipeItem()
SwipeItem() const;
public SwipeItem()
SwipeItem.Text SwipeItem.Text SwipeItem.Text
I n this Article
Edit
Gets or sets the text description displayed on the item.

public : Platform::String Text { get; set; }


winrt::hstring Text();

void Text(winrt::hstring text);


public string Text { get; set; }

<SwipeItem Text="string"/>

Returns
string
The text description displayed on the item. The default is an empty string.
SwipeItem.TextProperty SwipeItem.TextProperty Swipe
Item.TextProperty
I n this Article
Edit
Identifies the Text dependency property.
public : static DependencyProperty TextProperty { get; }
static DependencyProperty TextProperty();
public static DependencyProperty TextProperty { get; }

Returns
DependencyProperty
The identifier for the Text dependency property.
SwipeItemInvokedEventArgs SwipeItemInvokedEventArgs
SwipeItemInvokedEventArgs Class
Provides event data for the SwipeItem.Invoked event.

D eclaration
public : sealed class SwipeItemInvokedEventArgs : ISwipeItemInvokedEventArgs
struct winrt::Windows::UI::Xaml::Controls::SwipeItemInvokedEventArgs :
ISwipeItemInvokedEventArgs
public sealed class SwipeItemInvokedEventArgs : ISwipeItemInvokedEventArgs

I nheritance H ierarchy
None

Properties
SwipeControl
SwipeControl
SwipeControl

Gets the SwipeControl that owns the invoked item.


SwipeItemInvokedEventArgs.SwipeControl SwipeItem
InvokedEventArgs.SwipeControl SwipeItemInvokedEvent
Args.SwipeControl
I n this Article
Edit
Gets the SwipeControl that owns the invoked item.
public : SwipeControl SwipeControl { get; }
SwipeControl SwipeControl();
public SwipeControl SwipeControl { get; }

Returns
SwipeControl
The SwipeControl that owns the invoked item.
SwipeItems SwipeItems SwipeItems Class
Represents a collection of SwipeItem objects.

D eclaration
public : class SwipeItems : DependencyObject, IIterable<SwipeItem>, IVector<SwipeItem>,
ISwipeItems
struct winrt::Windows::UI::Xaml::Controls::SwipeItems : DependencyObject, IIterable<SwipeItem>,
IVector<SwipeItem>, ISwipeItems
public class SwipeItems : DependencyObject, IEnumerable<SwipeItem>, IList<SwipeItem>,
ISwipeItems

I nheritance H ierarchy
DependencyObject

Constructors
SwipeItems()
SwipeItems()
SwipeItems()

Initializes a new instance of the SwipeItems class.

Properties
Item[Int32]
Item[Int32]
Item[Int32]

Gets or sets the element at the specified index.

Mode
Mode
Mode

Gets or sets a value that indicates the effect of a swipe interaction.

ModeProperty
ModeProperty
ModeProperty

Identifies the Mode dependency property.

Size
Size
Size

Gets the size (count) of the collection.


Methods
Append(SwipeItem)
Append(SwipeItem)
Append(SwipeItem)

Adds a new item to the collection.

Clear()
Clear()
Clear()

Removes all items from the collection.

First()
First()
First()

Returns an iterator for the items in the collection.

GetAt(UInt32)
GetAt(UInt32)
GetAt(UInt32)

Returns the item located at the specified index.

GetEnumerator()
GetEnumerator()
GetEnumerator()

Returns an enumerator that iterates through the collection.

GetMany(UInt32, SwipeItem[])
GetMany(UInt32, SwipeItem[])
GetMany(UInt32, SwipeItem[])

Retrieves multiple elements in a single pass through the iterator.

GetView()
GetView()
GetView()

Gets an immutable view into the collection.

IndexOf(T)
IndexOf(T)
IndexOf(T)

Determines the index of a specific item in the System.Collections.Generic.IList`1.

IndexOf(SwipeItem, UInt32)
IndexOf(SwipeItem, UInt32)
IndexOf(SwipeItem, UInt32)

Retrieves the index of the specified item.

Insert(Int32, T)
Insert(Int32, T)
Insert(Int32, T)

Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

InsertAt(UInt32, SwipeItem)
InsertAt(UInt32, SwipeItem)
InsertAt(UInt32, SwipeItem)

Inserts the specified item at the specified index.

RemoveAt(Int32)
RemoveAt(Int32)
RemoveAt(Int32)

Removes the System.Collections.Generic.IList`1 item at the specified index.

RemoveAt(UInt32)
RemoveAt(UInt32)
RemoveAt(UInt32)

Removes the item at the specified index.

RemoveAtEnd()
RemoveAtEnd()
RemoveAtEnd()

Removes the last item in the collection.

ReplaceAll(SwipeItem[])
ReplaceAll(SwipeItem[])
ReplaceAll(SwipeItem[])

Initially clears the collection, then inserts the provided array as new items.
SetAt(UInt32, SwipeItem)
SetAt(UInt32, SwipeItem)
SetAt(UInt32, SwipeItem)

Sets the value at the specified index to the value specified.


SwipeItems.Append SwipeItems.Append SwipeItems.
Append
I n this Article
Edit
Adds a new item to the collection.
public : void Append(SwipeItem value)
void Append(SwipeItem value) const;
// This member is not implemented in C#

Parameters
value SwipeItem
The new item to add.
SwipeItems.Clear SwipeItems.Clear SwipeItems.Clear
I n this Article
Edit
Removes all items from the collection.

public : void Clear()


void Clear() const;
// This member is not implemented in C#
SwipeItems.First SwipeItems.First SwipeItems.First
I n this Article
Edit
Returns an iterator for the items in the collection.

public : IIterator<SwipeItem> First()


IIterator<SwipeItem> First() const;
// This member is not implemented in C#

Returns
IIterator<SwipeItem>
The iterator object. The iterator's current position is the 0-index position, or at the collection end if the collection is
empty.
SwipeItems.GetAt SwipeItems.GetAt SwipeItems.GetAt
I n this Article
Edit
Returns the item located at the specified index.

public : SwipeItem GetAt(unsigned int index)


SwipeItem GetAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The integer index for the value to retrieve.
Returns
SwipeItem
IEnumerable<T>.GetEnumerator IEnumerable<T>.Get
Enumerator
I n this Article
Edit
Returns an enumerator that iterates through the collection.
// This member is not implemented in C++/CX
IEnumerator<T> GetEnumerator()

Returns
An enumerator that can be used to iterate through the collection.
SwipeItems.GetMany SwipeItems.GetMany SwipeItems.
GetMany
I n this Article
Edit
Retrieves multiple elements in a single pass through the iterator.
public : unsigned int GetMany(unsigned int startIndex, SwipeItem[] items)
uint32_t GetMany(uint32_t startIndex, SwipeItem[] items) const;
// This member is not implemented in C#

Parameters
startIndex UInt32
The index from which to start retrieval.
items SwipeItem[]
Provides the destination for the result. Size the initial array size as a "capacity" in order to specify how many results
should be retrieved.
Returns
uint
The number of items retrieved.
SwipeItems.GetView SwipeItems.GetView SwipeItems.Get
View
I n this Article
Edit
Gets an immutable view into the collection.
public : IVectorView<SwipeItem> GetView()
IVectorView<SwipeItem> GetView() const;
// This member is not implemented in C#

Returns
IReadOnlyList<SwipeItem>
An object representing the immutable collection view.
SwipeItems.IndexOf SwipeItems.IndexOf SwipeItems.
IndexOf
I n this Article

Overloads
IndexOf(T) IndexOf(T)
Determines the index of a specific item in the
System.Collections.Generic.IList`1.

IndexOf(SwipeItem, UInt32) IndexOf(SwipeItem, UInt32) Index


Of(SwipeItem, UInt32) Retrieves the index of the specified item.

IndexOf(T) IndexOf(T)
Edit
Determines the index of a specific item in the System.Collections.Generic.IList`1.
// This member is not implemented in C++/CX
int IndexOf(T item)

Parameters
item TTT
The object to locate in the System.Collections.Generic.IList`1.
Returns
The index of item if found in the list; otherwise, -1.

IndexOf(SwipeItem, UInt32) IndexOf(SwipeItem, UInt32)


IndexOf(SwipeItem, UInt32)
Edit
Retrieves the index of the specified item.
public : Platform::Boolean IndexOf(SwipeItem value, unsigned int index)
bool IndexOf(SwipeItem value, uint32_t const& index) const;
// This member is not implemented in C#

Parameters
value SwipeItem
The value to find in the collection.
index UInt32
The index of the item to find, if found.
Returns
bool
true if an item with the specified value was found; otherwise, false.
IList<T>.Insert IList<T>.Insert
I n this Article
Edit
Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

// This member is not implemented in C++/CX


void Insert(int index, T item)

Parameters
index
The zero-based index at which item should be inserted.
item TT
The object to insert into the System.Collections.Generic.IList`1.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.
SwipeItems.InsertAt SwipeItems.InsertAt SwipeItems.
InsertAt
I n this Article
Edit
Inserts the specified item at the specified index.
public : void InsertAt(unsigned int index, SwipeItem value)
void InsertAt(uint32_t index, SwipeItem value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value SwipeItem
The value to set.
IList<T>.Item IList<T>.Item
I n this Article
Edit
Gets or sets the element at the specified index.

// This member is not implemented in C++/CX


T this[int index] { get; set; }

Parameters
index
The zero-based index of the element to get or set.
Returns
TT
The element at the specified index.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The property is set and the System.Collections.Generic.IList`1 is read-only.
SwipeItems.Mode SwipeItems.Mode SwipeItems.Mode
I n this Article
Edit
Gets or sets a value that indicates the effect of a swipe interaction.

public : SwipeMode Mode { get; set; }


SwipeMode Mode();

void Mode(SwipeMode mode);


public SwipeMode Mode { get; set; }

Returns
SwipeMode
A value of the enumeration that indicates the effect of a swipe interaction. The default is Reveal.
SwipeItems.ModeProperty SwipeItems.ModeProperty
SwipeItems.ModeProperty
I n this Article
Edit
Identifies the Mode dependency property.
public : static DependencyProperty ModeProperty { get; }
static DependencyProperty ModeProperty();
public static DependencyProperty ModeProperty { get; }

Returns
DependencyProperty
The identifier for the Mode dependency property.
SwipeItems.RemoveAt SwipeItems.RemoveAt Swipe
Items.RemoveAt
I n this Article

Overloads
RemoveAt(Int32) RemoveAt(Int32)
Removes the System.Collections.Generic.IList`1 item at the
specified index.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Removes the item at the specified index.

RemoveAt(Int32) RemoveAt(Int32)
Edit
Removes the System.Collections.Generic.IList`1 item at the specified index.
// This member is not implemented in C++/CX
void RemoveAt(int index)

Parameters
index
The zero-based index of the item to remove.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Edit
Removes the item at the specified index.
public : void RemoveAt(unsigned int index)
void RemoveAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The index position of the item to remove.
SwipeItems.RemoveAtEnd SwipeItems.RemoveAtEnd
SwipeItems.RemoveAtEnd
I n this Article
Edit
Removes the last item in the collection.
public : void RemoveAtEnd()
void RemoveAtEnd() const;
// This member is not implemented in C#

Remarks
If successful, calling this method reduces the collection size by one.
SwipeItems.ReplaceAll SwipeItems.ReplaceAll Swipe
Items.ReplaceAll
I n this Article
Edit
Initially clears the collection, then inserts the provided array as new items.
public : void ReplaceAll(SwipeItem[] items)
void ReplaceAll(SwipeItem[] items) const;
// This member is not implemented in C#

Parameters
items SwipeItem[]
The new collection items.
SwipeItems.SetAt SwipeItems.SetAt SwipeItems.SetAt
I n this Article
Edit
Sets the value at the specified index to the value specified.

public : void SetAt(unsigned int index, SwipeItem value)


void SetAt(uint32_t index, SwipeItem value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value SwipeItem
The value to set.
SwipeItems.Size SwipeItems.Size SwipeItems.Size
I n this Article
Edit
Gets the size (count) of the collection.

public : unsigned int Size { get; }


uint32_t Size();
// This member is not implemented in C#

Returns
uint
The count of items in the collection.
SwipeItems SwipeItems SwipeItems
I n this Article
Edit
Initializes a new instance of the SwipeItems class.

public : SwipeItems()
SwipeItems() const;
public SwipeItems()
SwipeMode SwipeMode SwipeMode Enum
Defines constants that specify the effect of a swipe interaction.

D eclaration
public : enum class SwipeMode
enum class winrt::Windows::UI::Xaml::Controls::SwipeMode : int32_t
public enum SwipeMode

I nheritance H ierarchy
None

Remarks
This enumeration is used by the SwipeItems.Mode property.

Fields
Execute Execute Execute A swipe executes a command.

Reveal Reveal Reveal A swipe reveals a menu of commands.


Symbol Symbol Symbol Enum
Defines constants that specify a glyph from the Segoe MDL2 Assets font to use as the content of a SymbolIcon.

D eclaration
public : enum class Symbol
enum class winrt::Windows::UI::Xaml::Controls::Symbol : int32_t
public enum Symbol

I nheritance H ierarchy
None

Remarks
The Symbol enumeration is typically used to set the value of the AppBarButton.Icon property or the
SymbolIcon.Symbol property. For more info and examples, see the documentation for AppBarButton and SymbolIcon.
If you would like to use a glyph from the Segoe MDL2 Assets font that is not included in the Symbol enum, then use
a FontIcon.
Notes for previous versions
Universal Windows 8 app For Universal Windows 8 app, the standard glyphs are provided by the Segoe UI
Symbol font. See AppBar button style images to see these glyphs.

Version history
V ER S IO N S D K V ER S IO N V ALU E AD D ED

1709 16299 GlobalNavigationButton

1709 16299 Print

1709 16299 Share

1709 16299 XboxOneConsole

Fields
Accept Accept Accept
E10B

Account Account Account


E168

Add Add Add


E109
AddFriend AddFriend AddFriend
E1E2

Admin Admin Admin


E1A7

AlignCenter AlignCenter AlignCenter


E1A1

AlignLeft AlignLeft AlignLeft


E1A2

AlignRight AlignRight AlignRight


E1A0

AllApps AllApps AllApps


E179

Attach Attach Attach


E16C

AttachCamera AttachCamera AttachCamera


E12D

Audio Audio Audio


E189

Back Back Back


E112

BackToWindow BackToWindow BackToWindow


E1D8

BlockContact BlockContact BlockContact


E1E0

Bold Bold Bold


E19B

Bookmarks Bookmarks Bookmarks


E12F
BrowsePhotos BrowsePhotos BrowsePhotos
E155

Bullets Bullets Bullets


E133

Calculator Calculator Calculator


E1D0

Calendar Calendar Calendar


E163

CalendarDay CalendarDay CalendarDay


E161

CalendarReply CalendarReply CalendarReply


E1DB

CalendarWeek CalendarWeek CalendarWeek


E162

Camera Camera Camera


E114

Cancel Cancel Cancel


E10A

Caption Caption Caption


E15A

CellPhone CellPhone CellPhone


E1C9

Character Character Character


E164

Clear Clear Clear


E106
ClearSelection ClearSelection ClearSelection
E1C5

Clock Clock Clock


E121

ClosedCaption ClosedCaption ClosedCaption


E190

ClosePane ClosePane ClosePane


E127

Comment Comment Comment


E134

Contact Contact Contact


E13D

Contact2 Contact2 Contact2


E187

ContactInfo ContactInfo ContactInfo


E136

ContactPresence ContactPresence ContactPresence


E181

Copy Copy Copy


E16F

Crop Crop Crop


E123

Cut Cut Cut


E16B

Delete Delete Delete


E107
Directions Directions Directions
E1D1

DisableUpdates DisableUpdates DisableUpdates


E194

DisconnectDrive DisconnectDrive DisconnectDrive


E17A

Dislike Dislike Dislike


E19E

DockBottom DockBottom DockBottom


E147

DockLeft DockLeft DockLeft


E145

DockRight DockRight DockRight


E146

Document Document Document


E130

Download Download Download


E118

Edit Edit Edit


E104

Emoji Emoji Emoji


E11D

Emoji2 Emoji2 Emoji2


E170

Favorite Favorite Favorite


E113
Filter Filter Filter
E16E

Find Find Find


E11A

Flag Flag Flag


E129

Folder Folder Folder


E188

Font Font Font


E185

FontColor FontColor FontColor


E186

FontDecrease FontDecrease FontDecrease


E1C6

FontIncrease FontIncrease FontIncrease


E1C7

FontSize FontSize FontSize


E1C8

Forward Forward Forward


E111

FourBars FourBars FourBars


E1E9

FullScreen FullScreen FullScreen


E1D9

GlobalNavigationButton GlobalNavigationButton GlobalNavigationButton


E700
Globe Globe Globe
E12B

Go Go Go
E143

GoToStart GoToStart GoToStart


E1E4

GoToToday GoToToday GoToToday


E184

HangUp HangUp HangUp


E137

Help Help Help


E11B

HideBcc HideBcc HideBcc


E16A

Highlight Highlight Highlight


E193

Home Home Home


E10F

Import Import Import


E150

ImportAll ImportAll ImportAll


E151

Important Important Important


E171

Italic Italic Italic


E199
Keyboard Keyboard Keyboard
E144

LeaveChat LeaveChat LeaveChat


E11F

Library Library Library


E1D3

Like Like Like


E19F

LikeDislike LikeDislike LikeDislike


E19D

Link Link Link


E167

List List List


E14C

Mail Mail Mail


E119

MailFilled MailFilled MailFilled


E135

MailForward MailForward MailForward


E120

MailReply MailReply MailReply


E172

MailReplyAll MailReplyAll MailReplyAll


E165

Manage Manage Manage


E178

Map Map Map


E1C4
MapDrive MapDrive MapDrive
E17B

MapPin MapPin MapPin


E139

Memo Memo Memo


E1D5

Message Message Message


E15F

Microphone Microphone Microphone


E1D6

More More More


E10C

MoveToFolder MoveToFolder MoveToFolder


E19C

MusicInfo MusicInfo MusicInfo


E142

Mute Mute Mute


E198

NewFolder NewFolder NewFolder


E1DA

NewWindow NewWindow NewWindow


E17C

Next Next Next


E101

OneBar OneBar OneBar


E1E6

OpenFile OpenFile OpenFile


E1A5
OpenLocal OpenLocal OpenLocal
E197

OpenPane OpenPane OpenPane


E126

OpenWith OpenWith OpenWith


E17D

Orientation Orientation Orientation


E14F

OtherUser OtherUser OtherUser


E1A6

OutlineStar OutlineStar OutlineStar


E1CE

Page Page Page


E132

Page2 Page2 Page2


E160

Paste Paste Paste


E16D

Pause Pause Pause


E103

People People People


E125

Permissions Permissions Permissions


E192

Phone Phone Phone


E13A

PhoneBook PhoneBook PhoneBook


E1D4
Pictures Pictures Pictures
E158

Pin Pin Pin


E141

Placeholder Placeholder Placeholder


E18A

Play Play Play


E102

PostUpdate PostUpdate PostUpdate


E1D7

Preview Preview Preview


E295

PreviewLink PreviewLink PreviewLink


E12A

Previous Previous Previous E100

Print Print Print


E749

Priority Priority Priority


E182

ProtectedDocument ProtectedDocument ProtectedDocument


E131

Read Read Read


E166

Redo Redo Redo


E10D

Refresh Refresh Refresh


E149
Remote Remote Remote
E148

Remove Remove Remove


E108

Rename Rename Rename


E13E

Repair Repair Repair


E15E

RepeatAll RepeatAll RepeatAll


E1CD

RepeatOne RepeatOne RepeatOne


E1CC

ReportHacked ReportHacked ReportHacked


E1DE

ReShare ReShare ReShare


E1CA

Rotate Rotate Rotate


E14A

RotateCamera RotateCamera RotateCamera


E124

Save Save Save


E105

SaveLocal SaveLocal SaveLocal


E159

Scan Scan Scan


E294

SelectAll SelectAll SelectAll


E14E
Send Send Send
E122

SetLockScreen SetLockScreen SetLockScreen


E18C

SetTile SetTile SetTile


E18D

Setting Setting Setting


E115

Share Share Share


E72D

Shop Shop Shop


E14D

ShowBcc ShowBcc ShowBcc


E169

ShowResults ShowResults ShowResults


E15C

Shuffle Shuffle Shuffle


E14B

SlideShow SlideShow SlideShow


E173

SolidStar SolidStar SolidStar


E1CF

Sort Sort Sort


E174

Stop Stop Stop


E15B

StopSlideShow StopSlideShow StopSlideShow


E191
Street Street Street
E1C3

Switch Switch Switch


E13C

SwitchApps SwitchApps SwitchApps


E1E1

Sync Sync Sync


E117

SyncFolder SyncFolder SyncFolder


E1DF

Tag Tag Tag


E1CB

Target Target Target


E1D2

ThreeBars ThreeBars ThreeBars


E1E8

TouchPointer TouchPointer TouchPointer


E1E3

Trim Trim Trim


E12C

TwoBars TwoBars TwoBars


E1E7

TwoPage TwoPage TwoPage


E11E

Underline Underline Underline


E19A

Undo Undo Undo


E10E
UnFavorite UnFavorite UnFavorite
E195

UnPin UnPin UnPin


E196

UnSyncFolder UnSyncFolder UnSyncFolder


E1DD

Up Up Up
E110

Upload Upload Upload


E11C

Video Video Video


E116

VideoChat VideoChat VideoChat


E13B

View View View


E18B

ViewAll ViewAll ViewAll


E138

Volume Volume Volume


E15D

WebCam WebCam WebCam


E156

World World World


E128

XboxOneConsole XboxOneConsole XboxOneConsole


E990

ZeroBars ZeroBars ZeroBars


E1E5
Zoom Zoom Zoom
E1A3

ZoomIn ZoomIn ZoomIn


E12E

ZoomOut ZoomOut ZoomOut


E1A4

See Also
SymbolIcon SymbolIcon SymbolIcon Class
Represents an icon that uses a glyph from the Segoe MDL2 Assets font as its content.

D eclaration
public : sealed class SymbolIcon : IconElement, ISymbolIcon
struct winrt::Windows::UI::Xaml::Controls::SymbolIcon : IconElement, ISymbolIcon
public sealed class SymbolIcon : IconElement, ISymbolIcon

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
IconElement

Remarks
The most common way to specify the icon for an app bar button is to use one of the standard glyphs provided by the
Segoe MDL2 Assets font, as specified in the Symbol enumeration. You can use a SymbolIcon by setting the Icon
property of an AppBarButton directly to a value of the Symbol enumeration.
Note

You can set the Foreground property on the AppBarButton or on the SymbolIcon. If you set the Foreground on the
AppBarButton, it's applied only to the default visual state. It's not applied to the other visual states defined in the
AppBarButton template, like MouseOver . If you set the Foreground on the SymbolIcon, the color is applied to all visual
states.

Windows 8/8.1 On Windows 8, the standard glyphs are provided by the Segoe UI Symbol font.

Constructors
SymbolIcon()
SymbolIcon()
SymbolIcon()

Initializes a new instance of the SymbolIcon class.

SymbolIcon(Symbol)
SymbolIcon(Symbol)
SymbolIcon(Symbol)

Initializes a new instance of the SymbolIcon class using the specified symbol.

Properties
Symbol
Symbol
Symbol
Gets or sets the Segoe MDL2 Assets glyph used as the icon content.

SymbolProperty
SymbolProperty
SymbolProperty

Identifies the Symbol dependency property.

See Also
IconElement
Symbol
IconElement
IconElement
IconElement
SymbolIcon.Symbol SymbolIcon.Symbol SymbolIcon.
Symbol
I n this Article
Edit
Gets or sets the Segoe MDL2 Assets glyph used as the icon content.
public : Symbol Symbol { get; set; }
Symbol Symbol();

void Symbol(Symbol symbol);


public Symbol Symbol { get; set; }

<SymbolIcon Symbol="symbolName"/>

Returns
Symbol
A named constant of the numeration that specifies the Segoe MDL2 Assets glyph to use.

Examples
<AppBarButton Label="Accept">
<AppBarButton.Icon>
<SymbolIcon Symbol="Accept"/>
</AppBarButton.Icon>
</AppBarButton>

Remarks
Windows 8/8.1 On Windows 8, the standard glyphs are provided by the Segoe UI Symbol font.
SymbolIcon SymbolIcon SymbolIcon
I n this Article

Overloads
SymbolIcon() SymbolIcon() SymbolIcon()
Initializes a new instance of the SymbolIcon class.

SymbolIcon(Symbol) SymbolIcon(Symbol) SymbolIcon(Symbol)


Initializes a new instance of the SymbolIcon class using the
specified symbol.

SymbolIcon() SymbolIcon() SymbolIcon()


Edit
Initializes a new instance of the SymbolIcon class.
public : SymbolIcon()
SymbolIcon() const;
public SymbolIcon()

See SymbolIcon(Symbol)SymbolIcon(Symbol)SymbolIcon(Symbol)
Also

SymbolIcon(Symbol) SymbolIcon(Symbol) SymbolIcon(Symbol)


Edit
Initializes a new instance of the SymbolIcon class using the specified symbol.
public : SymbolIcon(Symbol symbol)
SymbolIcon(Symbol symbol) const;
public SymbolIcon(Symbol symbol)

Parameters
symbol Symbol
A named constant of the enumeration that specifies the Segoe MDL2 Assets glyph to use. The default is null.
Remarks
Windows 8/8.1 On Windows 8, the standard glyphs are provided by the Segoe UI Symbol font.
SymbolIcon.SymbolProperty SymbolIcon.Symbol
Property SymbolIcon.SymbolProperty
I n this Article
Edit
Identifies the Symbol dependency property.
public : static DependencyProperty SymbolProperty { get; }
static DependencyProperty SymbolProperty();
public static DependencyProperty SymbolProperty { get; }

Returns
DependencyProperty
The identifier for the Symbol dependency property.
SymbolIconSource SymbolIconSource SymbolIconSource
Class
Represents an icon source that uses a glyph from the Segoe MDL2 Assets font as its content.

D eclaration
public : class SymbolIconSource : IconSource, ISymbolIconSource
struct winrt::Windows::UI::Xaml::Controls::SymbolIconSource : IconSource, ISymbolIconSource
public class SymbolIconSource : IconSource, ISymbolIconSource

I nheritance H ierarchy
DependencyObject
IconSource

Remarks
SymbolIconSource is similar to SymbolIcon. However, because it is not a FrameworkElement, it can be shared.

Constructors
SymbolIconSource()
SymbolIconSource()
SymbolIconSource()

Initializes a new instance of the SymbolIconSource class.

Properties
Symbol
Symbol
Symbol

Gets or sets the Segoe MDL2 Assets glyph used as the icon content.

SymbolProperty
SymbolProperty
SymbolProperty

Identifies the Symbol dependency property.


SymbolIconSource.Symbol SymbolIconSource.Symbol
SymbolIconSource.Symbol
I n this Article
Edit
Gets or sets the Segoe MDL2 Assets glyph used as the icon content.
public : Symbol Symbol { get; set; }
Symbol Symbol();

void Symbol(Symbol symbol);


public Symbol Symbol { get; set; }

<SymbolIconSource Symbol="symbolName"/>

Returns
Symbol
A named constant of the numeration that specifies the Segoe MDL2 Assets glyph to use.
SymbolIconSource SymbolIconSource SymbolIconSource
I n this Article
Edit
Initializes a new instance of the SymbolIconSource class.

public : SymbolIconSource()
SymbolIconSource() const;
public SymbolIconSource()
SymbolIconSource.SymbolProperty SymbolIconSource.
SymbolProperty SymbolIconSource.SymbolProperty
I n this Article
Edit
Identifies the Symbol dependency property.
public : static DependencyProperty SymbolProperty { get; }
static DependencyProperty SymbolProperty();
public static DependencyProperty SymbolProperty { get; }

Returns
DependencyProperty
The identifier for the Symbol dependency property.
TextBlock TextBlock TextBlock Class
Provides a lightweight control for displaying small amounts of text.

D eclaration
public : sealed class TextBlock : FrameworkElement, ITextBlock, ITextBlock2, ITextBlock3,
ITextBlock4, ITextBlock5, ITextBlock6, ITextBlock7
struct winrt::Windows::UI::Xaml::Controls::TextBlock : FrameworkElement, ITextBlock,
ITextBlock2, ITextBlock3, ITextBlock4, ITextBlock5, ITextBlock6, ITextBlock7
public sealed class TextBlock : FrameworkElement, ITextBlock, ITextBlock2, ITextBlock3,
ITextBlock4, ITextBlock5, ITextBlock6, ITextBlock7

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
 Tip

For more info, design guidance, and code examples, see Text block.
TextBlock is the primary control for displaying read-only text in apps. You can use it to display single-line or multi-line
text, inline hyperlinks, and text with formatting like bold, italic, or underlined.

TextBlock is typically easier to use and provides better text rendering performance than RichTextBlock, so it's preferred
for most app UI text. It also provides many of the same formatting options for customizing how your text is rendered.
Although you can put line breaks in the text, TextBlock is designed to display a single paragraph and doesn’t support
text indentation. Consider a RichTextBlock if you need support for multiple paragraphs, multi-column text, or inline UI
elements like images.
Text performance
Starting in Windows 10, performance improvements were made to TextBlock that decrease overall memory use and
greatly reduce the CPU time to do text measuring and arranging. To find out more about these performance
improvements and how to make sure you are using them, see the Performance considerations section of the TextBlock
control guide.
B uilt- in text styles
You can use Windows 10 text styles that ship with the platform to align the style of your text with the text used in the
system. Here's how to use built-in styles to align with the Windows 10 type ramp. For more info, see XAML theme
resources.
<TextBlock Text="Header" Style="{StaticResource HeaderTextBlockStyle}"/>
<TextBlock Text="SubHeader" Style="{StaticResource SubheaderTextBlockStyle}"/>
<TextBlock Text="Title" Style="{StaticResource TitleTextBlockStyle}"/>
<TextBlock Text="SubTitle" Style="{StaticResource SubtitleTextBlockStyle}"/>
<TextBlock Text="Base" Style="{StaticResource BaseTextBlockStyle}"/>
<TextBlock Text="Body" Style="{StaticResource BodyTextBlockStyle}"/>
<TextBlock Text="Caption" Style="{StaticResource CaptionTextBlockStyle}"/>
The rendered text looks like this:

Color fonts
By default TextBlock supports display color fonts. The default color font on the system is Segoe UI Emoji and the
TextBlock will fall back to this font to display the glyphs in color. For more info, see the IsColorFontEnabled property.

<TextBlock FontSize="30">Hello ☺ ☂♨ </TextBlock>

The rendered text looks like this:

Constructors
TextBlock()
TextBlock()
TextBlock()

Initializes a new instance of the TextBlock class.

Properties
BaselineOffset
BaselineOffset
BaselineOffset

Returns a value by which each line of text is offset from a baseline.

CharacterSpacing
CharacterSpacing
CharacterSpacing

Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.

CharacterSpacingProperty
CharacterSpacingProperty
CharacterSpacingProperty

Identifies the CharacterSpacing dependency property.

ContentEnd
ContentEnd
ContentEnd

Gets a TextPointer object for the end of text content in the TextBlock.

ContentStart
ContentStart
ContentStart

Gets a TextPointer object for the start of text content in the TextBlock.

FontFamily
FontFamily
FontFamily

Gets or sets the preferred top-level font family for the text content in this element.

FontFamilyProperty
FontFamilyProperty
FontFamilyProperty

Identifies the FontFamily dependency property.

FontSize
FontSize
FontSize

Gets or sets the font size for the text content in this element.

FontSizeProperty
FontSizeProperty
FontSizeProperty

Identifies the FontSize dependency property.

FontStretch
FontStretch
FontStretch

Gets or sets the font stretch for the text content in this element.
FontStretchProperty
FontStretchProperty
FontStretchProperty

Identifies the FontStretch dependency property.

FontStyle
FontStyle
FontStyle

Gets or sets the font style for the content in this element.

FontStyleProperty
FontStyleProperty
FontStyleProperty

Identifies the FontStyle dependency property.

FontWeight
FontWeight
FontWeight

Gets or sets the top-level font weight for the TextBlock.

FontWeightProperty
FontWeightProperty
FontWeightProperty

Identifies the FontWeight dependency property.

Foreground
Foreground
Foreground

Gets or sets the Brush to apply to the text contents of the TextBlock.

ForegroundProperty
ForegroundProperty
ForegroundProperty

Identifies the Foreground dependency property.

HorizontalTextAlignment
HorizontalTextAlignment
HorizontalTextAlignment
Gets or sets a value that indicates how text is aligned in the TextBlock.

HorizontalTextAlignmentProperty
HorizontalTextAlignmentProperty
HorizontalTextAlignmentProperty

Identifies the HorizontalTextAlignment dependency property.

Inlines
Inlines
Inlines

Gets the collection of inline text elements within a TextBlock.

IsColorFontEnabled
IsColorFontEnabled
IsColorFontEnabled

Gets or sets a value that determines whether font glyphs that contain color layers, such as Segoe UI Emoji, are
rendered in color.

IsColorFontEnabledProperty
IsColorFontEnabledProperty
IsColorFontEnabledProperty

Identifies the IsColorFontEnabled dependency property.

IsTextScaleFactorEnabled
IsTextScaleFactorEnabled
IsTextScaleFactorEnabled

Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.

IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty
IsTextScaleFactorEnabledProperty

Identifies the IsTextScaleFactorEnabled dependency property.

IsTextSelectionEnabled
IsTextSelectionEnabled
IsTextSelectionEnabled

Gets or sets a value that indicates whether text selection is enabled in the TextBlock, either through user action or
calling selection-related API.
IsTextSelectionEnabledProperty
IsTextSelectionEnabledProperty
IsTextSelectionEnabledProperty

Identifies the IsTextSelectionEnabled dependency property.

IsTextTrimmed
IsTextTrimmed
IsTextTrimmed

Gets a value that indicates whether the control has trimmed text that overflows the content area.

IsTextTrimmedProperty
IsTextTrimmedProperty
IsTextTrimmedProperty

Identifies the IsTextTrimmed dependency property.

LineHeight
LineHeight
LineHeight

Gets or sets the height of each line of content.

LineHeightProperty
LineHeightProperty
LineHeightProperty

Identifies the LineHeight dependency property.

LineStackingStrategy
LineStackingStrategy
LineStackingStrategy

Gets or sets a value that indicates how a line box is determined for each line of text in the TextBlock.

LineStackingStrategyProperty
LineStackingStrategyProperty
LineStackingStrategyProperty

Identifies the LineStackingStrategy dependency property.

MaxLines
MaxLines
MaxLines
Gets or sets the maximum number of lines of text shown in the TextBlock.

MaxLinesProperty
MaxLinesProperty
MaxLinesProperty

Identifies the MaxLines dependency property.

OpticalMarginAlignment
OpticalMarginAlignment
OpticalMarginAlignment

Get or sets a value that indicates how the font is modified to align with fonts of different sizes.

OpticalMarginAlignmentProperty
OpticalMarginAlignmentProperty
OpticalMarginAlignmentProperty

Identifies the OpticalMarginAlignment dependency property.

Padding
Padding
Padding

Gets or sets a value that indicates the thickness of padding space between the boundaries of the content area and
the content displayed by a TextBlock.

PaddingProperty
PaddingProperty
PaddingProperty

Identifies the Padding dependency property.

SelectedText
SelectedText
SelectedText

Gets a text range of selected text.

SelectedTextProperty
SelectedTextProperty
SelectedTextProperty

Identifies the SelectedText dependency property.


SelectionEnd
SelectionEnd
SelectionEnd

Gets the end position of the text selected in the TextBlock.

SelectionFlyout
SelectionFlyout
SelectionFlyout

Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.

SelectionFlyoutProperty
SelectionFlyoutProperty
SelectionFlyoutProperty

Identifies the SelectionFlyout dependency property.

SelectionHighlightColor
SelectionHighlightColor
SelectionHighlightColor

Gets or sets the brush used to highlight the selected text.

SelectionHighlightColorProperty
SelectionHighlightColorProperty
SelectionHighlightColorProperty

Identifies the SelectionHighlightColor dependency property.

SelectionStart
SelectionStart
SelectionStart

Gets the starting position of the text selected in the TextBlock.

Text
Text
Text

Gets or sets the text contents of a TextBlock.

TextAlignment
TextAlignment
TextAlignment
Gets or sets a value that indicates the horizontal alignment of text content.

TextAlignmentProperty
TextAlignmentProperty
TextAlignmentProperty

Identifies the TextAlignment dependency property.

TextDecorations
TextDecorations
TextDecorations

Gets or sets a value that indicates what decorations are applied to the text.

TextDecorationsProperty
TextDecorationsProperty
TextDecorationsProperty

Identifies the TextDecorations dependency property.

TextHighlighters
TextHighlighters
TextHighlighters

Gets the collection of text highlights.

TextLineBounds
TextLineBounds
TextLineBounds

Gets or sets a value that indicates how the line box height is determined for each line of text in the TextBlock.

TextLineBoundsProperty
TextLineBoundsProperty
TextLineBoundsProperty

Identifies the TextLineBounds dependency property.

TextProperty
TextProperty
TextProperty

Identifies the Text dependency property.


TextReadingOrder
TextReadingOrder
TextReadingOrder

Gets or sets a value that indicates how the reading order is determined for the TextBlock.

TextReadingOrderProperty
TextReadingOrderProperty
TextReadingOrderProperty

Identifies the TextReadingOrder dependency property.

TextTrimming
TextTrimming
TextTrimming

Gets or sets the text trimming behavior to employ when content overflows the content area.

TextTrimmingProperty
TextTrimmingProperty
TextTrimmingProperty

Identifies the TextTrimming dependency property.

TextWrapping
TextWrapping
TextWrapping

Gets or sets how the TextBlock wraps text.

TextWrappingProperty
TextWrappingProperty
TextWrappingProperty

Identifies the TextWrapping dependency property.

Methods
CopySelectionToClipboard()
CopySelectionToClipboard()
CopySelectionToClipboard()

Copies the selected content to the Windows clipboard.

Focus(FocusState)
Focus(FocusState)
Focus(FocusState)

Focuses the TextBlock, as if it were a conventionally focusable control.

GetAlphaMask()
GetAlphaMask()
GetAlphaMask()

Returns a mask that represents the alpha channel of the text as a CompositionBrush.

Select(TextPointer, TextPointer)
Select(TextPointer, TextPointer)
Select(TextPointer, TextPointer)

Selects a range of text in the TextBlock.

SelectAll()
SelectAll()
SelectAll()

Selects the entire contents in the TextBlock.

Events
ContextMenuOpening
ContextMenuOpening
ContextMenuOpening

Occurs when the system processes an interaction that displays a context menu.

IsTextTrimmedChanged
IsTextTrimmedChanged
IsTextTrimmedChanged

Occurs when the IsTextTrimmed property value has changed.

SelectionChanged
SelectionChanged
SelectionChanged

Occurs when the text selection has changed.

See Also
TextBlock.BaselineOffset TextBlock.BaselineOffset Text
Block.BaselineOffset
I n this Article
Edit
Returns a value by which each line of text is offset from a baseline.
public : double BaselineOffset { get; }
double BaselineOffset();
public double BaselineOffset { get; }

Returns
double
The amount by which each line of text is offset from the baseline, in device independent pixels. System.Double.NaN
indicates that an optimal baseline offset is automatically calculated from the current font characteristics. The default is
System.Double.NaN.

Remarks
Note

Visual C++ component extensions (C++/CX) doesn't have a constant for NaN, it uses a value, which appears as "-
1.#IND" followed by zeros.
TextBlock.CharacterSpacing TextBlock.CharacterSpacing
TextBlock.CharacterSpacing
I n this Article
Edit
Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.
public : int CharacterSpacing { get; set; }
int32_t CharacterSpacing();

void CharacterSpacing(int32_t characterspacing);


public int CharacterSpacing { get; set; }

<TextBlock CharacterSpacing="int"/>

Returns
int
The uniform spacing between characters, in units of 1/1000 of an em. The default is 0. Positive values increase tracking
and loosen character spacing. Negative values decrease tracking and tighten the character spacing.
TextBlock.CharacterSpacingProperty TextBlock.Character
SpacingProperty TextBlock.CharacterSpacingProperty
I n this Article
Edit
Identifies the CharacterSpacing dependency property.
public : static DependencyProperty CharacterSpacingProperty { get; }
static DependencyProperty CharacterSpacingProperty();
public static DependencyProperty CharacterSpacingProperty { get; }

Returns
DependencyProperty
The identifier for the CharacterSpacing dependency property.
TextBlock.ContentEnd TextBlock.ContentEnd TextBlock.
ContentEnd
I n this Article
Edit
Gets a TextPointer object for the end of text content in the TextBlock.
public : TextPointer ContentEnd { get; }
TextPointer ContentEnd();
public TextPointer ContentEnd { get; }

Returns
TextPointer
A TextPointer object for the end of text content in the TextBlock.
TextBlock.ContentStart TextBlock.ContentStart TextBlock.
ContentStart
I n this Article
Edit
Gets a TextPointer object for the start of text content in the TextBlock.
public : TextPointer ContentStart { get; }
TextPointer ContentStart();
public TextPointer ContentStart { get; }

Returns
TextPointer
A TextPointer object for the start of text content in the TextBlock.
TextBlock.ContextMenuOpening TextBlock.ContextMenu
Opening TextBlock.ContextMenuOpening
I n this Article
Edit
Occurs when the system processes an interaction that displays a context menu.
public : event ContextMenuOpeningEventHandler ContextMenuOpening
// Register
event_token ContextMenuOpening(ContextMenuOpeningEventHandler const& handler) const;

// Revoke with event_token


void ContextMenuOpening(event_token const& cookie) const;

// Revoke with event_revoker


ContextMenuOpening_revoker ContextMenuOpening(auto_revoke_t, ContextMenuOpeningEventHandler const&
handler) const;
public event ContextMenuOpeningEventHandler ContextMenuOpening

<TextBlock ContextMenuOpening="eventhandler" />


TextBlock.CopySelectionToClipboard TextBlock.Copy
SelectionToClipboard TextBlock.CopySelectionTo
Clipboard
I n this Article
Edit
Copies the selected content to the Windows clipboard.
public : void CopySelectionToClipboard()
void CopySelectionToClipboard() const;
public void CopySelectionToClipboard()

Additional features and requirements


Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBlock.Focus TextBlock.Focus TextBlock.Focus
I n this Article
Edit
Focuses the TextBlock, as if it were a conventionally focusable control.

public : Platform::Boolean Focus(FocusState value)


bool Focus(FocusState value) const;
public bool Focus(FocusState value)

Parameters
value FocusState
Specifies the desired target for focus state, as a value of the enumeration.
Returns
bool
true if focus was set to the TextBlock, or focus was already there. false if the TextBlock is not focusable.

Remarks
TextBlock.FontFamily TextBlock.FontFamily TextBlock.Font
Family
I n this Article
Edit
Gets or sets the preferred top-level font family for the text content in this element.
public : FontFamily FontFamily { get; set; }
FontFamily FontFamily();

void FontFamily(FontFamily fontfamily);


public FontFamily FontFamily { get; set; }

<TextBlock FontFamily="fontFamily" />


-or-
<TextBlock FontFamily="fontFamilyName[,fallbackFontFamilyName]" />
-or-
<TextBlock FontFamily="fontURI#fontFamily" />

Returns
FontFamily
A FontFamily object that specifies the preferred font family, or a primary preferred font family with one or more
fallback font families. For information about defaults, see the FontFamily class topic.
TextBlock.FontFamilyProperty TextBlock.FontFamily
Property TextBlock.FontFamilyProperty
I n this Article
Edit
Identifies the FontFamily dependency property.
public : static DependencyProperty FontFamilyProperty { get; }
static DependencyProperty FontFamilyProperty();
public static DependencyProperty FontFamilyProperty { get; }

Returns
DependencyProperty
The identifier for the FontFamily dependency property.
TextBlock.FontSize TextBlock.FontSize TextBlock.FontSize
I n this Article
Edit
Gets or sets the font size for the text content in this element.

public : double FontSize { get; set; }


double FontSize();

void FontSize(double fontsize);


public double FontSize { get; set; }

<TextBlock FontSize="double" .../>

Returns
double
A non-negative value that specifies the font size, measured in pixels. The default is 11.
TextBlock.FontSizeProperty TextBlock.FontSizeProperty
TextBlock.FontSizeProperty
I n this Article
Edit
Identifies the FontSize dependency property.
public : static DependencyProperty FontSizeProperty { get; }
static DependencyProperty FontSizeProperty();
public static DependencyProperty FontSizeProperty { get; }

Returns
DependencyProperty
The identifier for the FontSize dependency property.
TextBlock.FontStretch TextBlock.FontStretch TextBlock.
FontStretch
I n this Article
Edit
Gets or sets the font stretch for the text content in this element.
public : FontStretch FontStretch { get; set; }
FontStretch FontStretch();

void FontStretch(FontStretch fontstretch);


public FontStretch FontStretch { get; set; }

<TextBlock FontStretch="fontStretchMemberName"/>

Returns
FontStretch
The requested font stretch, as a FontStretch constant. The default is Normal.
TextBlock.FontStretchProperty TextBlock.FontStretch
Property TextBlock.FontStretchProperty
I n this Article
Edit
Identifies the FontStretch dependency property.
public : static DependencyProperty FontStretchProperty { get; }
static DependencyProperty FontStretchProperty();
public static DependencyProperty FontStretchProperty { get; }

Returns
DependencyProperty
The identifier for the FontStretch dependency property.
TextBlock.FontStyle TextBlock.FontStyle TextBlock.Font
Style
I n this Article
Edit
Gets or sets the font style for the content in this element.
public : FontStyle FontStyle { get; set; }
FontStyle FontStyle();

void FontStyle(FontStyle fontstyle);


public FontStyle FontStyle { get; set; }

<TextBlock FontStyle="fontStyleMemberName"/>

Returns
FontStyle
The requested font style, which is a FontStyle enumeration value. The default is Normal.
TextBlock.FontStyleProperty TextBlock.FontStyleProperty
TextBlock.FontStyleProperty
I n this Article
Edit
Identifies the FontStyle dependency property.
public : static DependencyProperty FontStyleProperty { get; }
static DependencyProperty FontStyleProperty();
public static DependencyProperty FontStyleProperty { get; }

Returns
DependencyProperty
The identifier for the FontStyle dependency property.
TextBlock.FontWeight TextBlock.FontWeight TextBlock.
FontWeight
I n this Article
Edit
Gets or sets the top-level font weight for the TextBlock.
public : FontWeight FontWeight { get; set; }
FontWeight FontWeight();

void FontWeight(FontWeight fontweight);


public FontWeight FontWeight { get; set; }

<TextBlock FontWeight="fontWeightsMemberName"/>

Returns
FontWeight
The requested font weight, which is a FontWeight that is obtained from one of the FontWeights property values. The
default is Normal.
TextBlock.FontWeightProperty TextBlock.FontWeight
Property TextBlock.FontWeightProperty
I n this Article
Edit
Identifies the FontWeight dependency property.
public : static DependencyProperty FontWeightProperty { get; }
static DependencyProperty FontWeightProperty();
public static DependencyProperty FontWeightProperty { get; }

Returns
DependencyProperty
The identifier for the FontWeight dependency property.
TextBlock.Foreground TextBlock.Foreground TextBlock.
Foreground
I n this Article
Edit
Gets or sets the Brush to apply to the text contents of the TextBlock.
public : Brush Foreground { get; set; }
Brush Foreground();

void Foreground(Brush foreground);


public Brush Foreground { get; set; }

<TextBlock Foreground="{StaticResource resourceName}"/>

Returns
Brush
The brush used to apply to the text content. The default is a null brush from a pure code perspective, but the default
text styles set this to Black (for Light theme) or White (for Dark theme) for a TextBlock element in UI.

Examples
The following XAML example shows how to set the Foreground property to a solid color using an inline-defined
attribute value "Maroon". The XAML parser uses this "Maroon" value to refer to the named color Colors.Maroon, and
to create the SolidColorBrush instance that supplies the runtime value.
<TextBlock
FontSize="32"
FontWeight="Bold"
Foreground="Maroon">
Maroon
</TextBlock>

Remarks
TextBlock isn't a control so you don't use templates to change its appearance. Instead you can use styles. It's more
common (and a better practice) to use named styles for TextBlock appearance than it is to set inline attributes for each
TextBlock instance, particularly if you are using common values in many elements. For more info on styles, see
Quickstart: Styling controls.
The default appearance of text and text styles depends heavily on the active theme and other settings. The theme and
various styles and behaviors that are using default system settings or user preferences are the source of the effective
runtime appearance of TextBlock foreground color of text as well as other text characteristics. You can change these
defaults by changing the property values, or by applying a different style to specific TextBlock instances. You can
change the foreground value for all default text by overriding the resource named
DefaultTextForegroundThemeBrush in App.xaml.
See Quickstart: Displaying text
Also Use brushes
TextBlock.ForegroundProperty TextBlock.Foreground
Property TextBlock.ForegroundProperty
I n this Article
Edit
Identifies the Foreground dependency property.
public : static DependencyProperty ForegroundProperty { get; }
static DependencyProperty ForegroundProperty();
public static DependencyProperty ForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the Foreground dependency property.
TextBlock.GetAlphaMask TextBlock.GetAlphaMask Text
Block.GetAlphaMask
I n this Article
Edit
Returns a mask that represents the alpha channel of the text as a CompositionBrush.
public : CompositionBrush GetAlphaMask()
CompositionBrush GetAlphaMask() const;
public CompositionBrush GetAlphaMask()

Returns
CompositionBrush
A mask that represents the alpha channel of the text in a TextBlock.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
This method gets an alpha mask from the text as a CompositionBrush that you can use as an input to composition
shadows and effects. The alpha mask CompositionBrush has the same alignment and stretch property values that the
source XAML element applies to its rendered content so that you can use those values to correctly position shadows or
effects relative to the XAML element.
Version compatibility
The GetAlphaMask method is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not call this method without first
performing a runtime check. This example shows how to use the ApiInformation class to check for the presence of this
method before you use it.
if (ApiInformation.IsMethodPresent("Windows.UI.Xaml.Controls.TextBlock", "GetAlphaMask"))
{
var compositionBrush = textBlock1.GetAlphaMask();
}
TextBlock.HorizontalTextAlignment TextBlock.Horizontal
TextAlignment TextBlock.HorizontalTextAlignment
I n this Article
Edit
Gets or sets a value that indicates how text is aligned in the TextBlock.
public : TextAlignment HorizontalTextAlignment { get; set; }
TextAlignment HorizontalTextAlignment();

void HorizontalTextAlignment(TextAlignment horizontaltextalignment);


public TextAlignment HorizontalTextAlignment { get; set; }

<TextBlock HorizontalTextAlignment="textAlignmentValue"/>

Returns
TextAlignment
One of the TextAlignment enumeration values that specifies how text is aligned. The default is Left.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
This property provides the same functionality as the TextAlignment property. If both properties are set to conflicting
values, the last one set is used.
Apps that target the Fall Creators Update (SDK 16299) or later should use this property instead of TextAlignment. If
your app also supports previous versions, see Version adaptive apps: Use new APIs while maintaining compatibility
with previous versions for more info.
TextBlock.HorizontalTextAlignmentProperty TextBlock.
HorizontalTextAlignmentProperty TextBlock.Horizontal
TextAlignmentProperty
I n this Article
Edit
Identifies the HorizontalTextAlignment dependency property.
public : static DependencyProperty HorizontalTextAlignmentProperty { get; }
static DependencyProperty HorizontalTextAlignmentProperty();
public static DependencyProperty HorizontalTextAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalTextAlignment dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


TextBlock.Inlines TextBlock.Inlines TextBlock.Inlines
I n this Article
Edit
Gets the collection of inline text elements within a TextBlock.

public : InlineCollection Inlines { get; }


InlineCollection Inlines();
public InlineCollection Inlines { get; }

<TextBlock
oneOrMoreInlineElements
</TextBlock>

Returns
InlineCollection
A collection that holds all inline text elements from the TextBlock. The default is an empty collection.
TextBlock.IsColorFontEnabled TextBlock.IsColorFont
Enabled TextBlock.IsColorFontEnabled
I n this Article
Edit
Gets or sets a value that determines whether font glyphs that contain color layers, such as Segoe UI Emoji, are
rendered in color.
public : Platform::Boolean IsColorFontEnabled { get; set; }
bool IsColorFontEnabled();

void IsColorFontEnabled(bool iscolorfontenabled);


public bool IsColorFontEnabled { get; set; }

<TextBlock IsColorFontEnabled="bool" />

Returns
bool
true if color glyphs show in color; otherwise, false. The default is true.

Remarks
Windows 8.1 introduces the ability for fonts to include multiple colored layers for each glyph. For example, the Segoe
UI Emoji font defines color versions of the Emoticon and other Emoji characters. By default, the IsColorFontEnabled
property is true and fonts with these additional layers are rendered in color.
In Windows 8, Extensible Application Markup Language (XAML ) text controls don't render multi-color fonts in color.
When an app that was compiled for Windows 8 is recompiled for Windows 8.1, color rendering of multi-color fonts is
enabled by default. Some glyphs in multi-color fonts have different layout metrics when rendered in color. This could
cause different layout in apps when they are recompiled for Windows 8.1. To retain the Windows 8 behavior when
your app is recompiled for Windows 8.1, set IsColorFontEnabled to false.
TextBlock.IsColorFontEnabledProperty TextBlock.IsColor
FontEnabledProperty TextBlock.IsColorFontEnabled
Property
I n this Article
Edit
Identifies the IsColorFontEnabled dependency property.
public : static DependencyProperty IsColorFontEnabledProperty { get; }
static DependencyProperty IsColorFontEnabledProperty();
public static DependencyProperty IsColorFontEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsColorFontEnabled dependency property.
TextBlock.IsTextScaleFactorEnabled TextBlock.IsTextScale
FactorEnabled TextBlock.IsTextScaleFactorEnabled
I n this Article
Edit
Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.
public : Platform::Boolean IsTextScaleFactorEnabled { get; set; }
bool IsTextScaleFactorEnabled();

void IsTextScaleFactorEnabled(bool istextscalefactorenabled);


public bool IsTextScaleFactorEnabled { get; set; }

<TextBlock IsTextScaleFactorEnabled="bool"/>

Returns
bool
true if automatic text enlargement is enabled; otherwise, false.
See Accessible text requirements
Also
TextBlock.IsTextScaleFactorEnabledProperty TextBlock.Is
TextScaleFactorEnabledProperty TextBlock.IsTextScale
FactorEnabledProperty
I n this Article
Edit
Identifies the IsTextScaleFactorEnabled dependency property.
public : static DependencyProperty IsTextScaleFactorEnabledProperty { get; }
static DependencyProperty IsTextScaleFactorEnabledProperty();
public static DependencyProperty IsTextScaleFactorEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextScaleFactorEnabled dependency property.
TextBlock.IsTextSelectionEnabled TextBlock.IsTextSelection
Enabled TextBlock.IsTextSelectionEnabled
I n this Article
Edit
Gets or sets a value that indicates whether text selection is enabled in the TextBlock, either through user action or
calling selection-related API.
public : Platform::Boolean IsTextSelectionEnabled { get; set; }
bool IsTextSelectionEnabled();

void IsTextSelectionEnabled(bool istextselectionenabled);


public bool IsTextSelectionEnabled { get; set; }

<TextBlock IsTextSelectionEnabled="bool" />

Returns
bool
true if text selection is enabled; otherwise, false.
TextBlock.IsTextSelectionEnabledProperty TextBlock.IsText
SelectionEnabledProperty TextBlock.IsTextSelection
EnabledProperty
I n this Article
Edit
Identifies the IsTextSelectionEnabled dependency property.
public : static DependencyProperty IsTextSelectionEnabledProperty { get; }
static DependencyProperty IsTextSelectionEnabledProperty();
public static DependencyProperty IsTextSelectionEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextSelectionEnabled dependency property.
TextBlock.IsTextTrimmed TextBlock.IsTextTrimmed Text
Block.IsTextTrimmed
I n this Article
Edit
Gets a value that indicates whether the control has trimmed text that overflows the content area.
public : Platform::Boolean IsTextTrimmed { get; }
bool IsTextTrimmed();
public bool IsTextTrimmed { get; }

Returns
bool
true if text is trimmed; otherwise, false.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
See the TextTrimming property and TextTrimming enumeration for more info about how text is trimmed.
TextBlock.IsTextTrimmedChanged TextBlock.IsTextTrimmed
Changed TextBlock.IsTextTrimmedChanged
I n this Article
Edit
Occurs when the IsTextTrimmed property value has changed.
public : event TypedEventHandler<TextBlock, IsTextTrimmedChangedEventArgs> IsTextTrimmedChanged
// Register
event_token IsTextTrimmedChanged(TypedEventHandler<TextBlock, IsTextTrimmedChangedEventArgs> const&
handler) const;

// Revoke with event_token


void IsTextTrimmedChanged(event_token const& cookie) const;

// Revoke with event_revoker


IsTextTrimmedChanged_revoker IsTextTrimmedChanged(auto_revoke_t, TypedEventHandler<TextBlock,
IsTextTrimmedChangedEventArgs> const& handler) const;
public event TypedEventHandler<TextBlock, IsTextTrimmedChangedEventArgs> IsTextTrimmedChanged

<TextBlock IsTextTrimmedChanged="eventhandler"/>
TextBlock.IsTextTrimmedProperty TextBlock.IsTextTrimmed
Property TextBlock.IsTextTrimmedProperty
I n this Article
Edit
Identifies the IsTextTrimmed dependency property.
public : static DependencyProperty IsTextTrimmedProperty { get; }
static DependencyProperty IsTextTrimmedProperty();
public static DependencyProperty IsTextTrimmedProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextTrimmed dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


TextBlock.LineHeight TextBlock.LineHeight TextBlock.Line
Height
I n this Article
Edit
Gets or sets the height of each line of content.
public : double LineHeight { get; set; }
double LineHeight();

void LineHeight(double lineheight);


public double LineHeight { get; set; }

<TextBlock LineHeight="double"/>

Returns
double
The height of each line in pixels. A value of 0 indicates that the line height is determined automatically from the current
font characteristics. The default is 0.
TextBlock.LineHeightProperty TextBlock.LineHeight
Property TextBlock.LineHeightProperty
I n this Article
Edit
Identifies the LineHeight dependency property.
public : static DependencyProperty LineHeightProperty { get; }
static DependencyProperty LineHeightProperty();
public static DependencyProperty LineHeightProperty { get; }

Returns
DependencyProperty
The identifier for the LineHeight dependency property.
TextBlock.LineStackingStrategy TextBlock.LineStacking
Strategy TextBlock.LineStackingStrategy
I n this Article
Edit
Gets or sets a value that indicates how a line box is determined for each line of text in the TextBlock.
public : LineStackingStrategy LineStackingStrategy { get; set; }
LineStackingStrategy LineStackingStrategy();

void LineStackingStrategy(LineStackingStrategy linestackingstrategy);


public LineStackingStrategy LineStackingStrategy { get; set; }

<TextBlock LineStackingStrategy="BlockLineHeight"/>
-or-
<TextBlock LineStackingStrategy="MaxHeight"/>

Returns
LineStackingStrategy
A value that indicates how a line box is determined for each line of text in the TextBlock. The default is MaxHeight.
TextBlock.LineStackingStrategyProperty TextBlock.Line
StackingStrategyProperty TextBlock.LineStackingStrategy
Property
I n this Article
Edit
Identifies the LineStackingStrategy dependency property.
public : static DependencyProperty LineStackingStrategyProperty { get; }
static DependencyProperty LineStackingStrategyProperty();
public static DependencyProperty LineStackingStrategyProperty { get; }

Returns
DependencyProperty
The identifier for the LineStackingStrategy dependency property.
TextBlock.MaxLines TextBlock.MaxLines TextBlock.Max
Lines
I n this Article
Edit
Gets or sets the maximum number of lines of text shown in the TextBlock.
public : int MaxLines { get; set; }
int32_t MaxLines();

void MaxLines(int32_t maxlines);


public int MaxLines { get; set; }

<TextBlock MaxLines="int"/>

Returns
int
The maximum number of lines of text shown in the TextBlock. The default is 0, which is a special value that represents
"Auto" behavior. The value cannot be negative.

Remarks
Use the MaxLines property to specify the maximum number of lines of text shown in a text block. The text control will
adjust its height to show no more than the specified number of lines, regardless of the font size, font style, or text
length.
Negative integer values are invalid, and will cause a run-time exception.
TextBlock.MaxLinesProperty TextBlock.MaxLinesProperty
TextBlock.MaxLinesProperty
I n this Article
Edit
Identifies the MaxLines dependency property.
public : static DependencyProperty MaxLinesProperty { get; }
static DependencyProperty MaxLinesProperty();
public static DependencyProperty MaxLinesProperty { get; }

Returns
DependencyProperty
The identifier for the MaxLines dependency property.
TextBlock.OpticalMarginAlignment TextBlock.Optical
MarginAlignment TextBlock.OpticalMarginAlignment
I n this Article
Edit
Get or sets a value that indicates how the font is modified to align with fonts of different sizes.
public : OpticalMarginAlignment OpticalMarginAlignment { get; set; }
OpticalMarginAlignment OpticalMarginAlignment();

void OpticalMarginAlignment(OpticalMarginAlignment opticalmarginalignment);


public OpticalMarginAlignment OpticalMarginAlignment { get; set; }

<TextBlock OpticalMarginAlignment="None"/>
-or-
<TextBlock OpticalMarginAlignment="TrimSideBearings"/>

Returns
OpticalMarginAlignment
A value of the enumeration that indicates how the font is modified to align at different sizes. The default is None.

Remarks
When OpticalMarginAlignment is set to TrimSideBearings, the text is trimmed to the leftmost stroke of the first
character and the rightmost stroke of the last character on a line. For example, an "L" has a small amount of space to
the left of the vertical stroke, which scales with font size. When TrimSideBearings is set, the left of the vertical stroke is
directly aligned without the spacing. This enables easier alignment to the Windows grid system as explained in Laying
out an app page.
TextBlock.OpticalMarginAlignmentProperty TextBlock.
OpticalMarginAlignmentProperty TextBlock.Optical
MarginAlignmentProperty
I n this Article
Edit
Identifies the OpticalMarginAlignment dependency property.
public : static DependencyProperty OpticalMarginAlignmentProperty { get; }
static DependencyProperty OpticalMarginAlignmentProperty();
public static DependencyProperty OpticalMarginAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the OpticalMarginAlignment dependency property.
TextBlock.Padding TextBlock.Padding TextBlock.Padding
I n this Article
Edit
Gets or sets a value that indicates the thickness of padding space between the boundaries of the content area and the
content displayed by a TextBlock.
public : Thickness Padding { get; set; }
Thickness Padding();

void Padding(Thickness padding);


public Thickness Padding { get; set; }

<TextBlock Padding="uniform"/>
- or -
<TextBlock Padding="left&Right,top&Bottom"/>
- or -
<TextBlock Padding="left,top,right,bottom"/>

Returns
Thickness
A Thickness structure that specifies the amount of padding to apply.

Remarks
A related property is Margin (a property of FrameworkElement ). For more info about the relationship between margin
and padding, see Alignment, margin, and padding or Define layouts with XAML.
See Thickness
Also
TextBlock.PaddingProperty TextBlock.PaddingProperty
TextBlock.PaddingProperty
I n this Article
Edit
Identifies the Padding dependency property.
public : static DependencyProperty PaddingProperty { get; }
static DependencyProperty PaddingProperty();
public static DependencyProperty PaddingProperty { get; }

Returns
DependencyProperty
The identifier for the Padding dependency property.
TextBlock.Select TextBlock.Select TextBlock.Select
I n this Article
Edit
Selects a range of text in the TextBlock.

public : void Select(TextPointer start, TextPointer end)


void Select(TextPointer start, TextPointer end) const;
public void Select(TextPointer start, TextPointer end)

Parameters
start TextPointer
An object that represents the start of the range to select.
end TextPointer
An object that represents the end of the range to select.

Remarks
In WPF and Silverlight the equivalent API uses integer for start and end positions. This implementation uses
TextPointer objects to specify the selection.
TextBlock.SelectAll TextBlock.SelectAll TextBlock.SelectAll
I n this Article
Edit
Selects the entire contents in the TextBlock.

public : void SelectAll()


void SelectAll() const;
public void SelectAll()
TextBlock.SelectedText TextBlock.SelectedText TextBlock.
SelectedText
I n this Article
Edit
Gets a text range of selected text.
public : Platform::String SelectedText { get; }
winrt::hstring SelectedText();
public string SelectedText { get; }

Returns
string
A text range of the selected text.
TextBlock.SelectedTextProperty TextBlock.SelectedText
Property TextBlock.SelectedTextProperty
I n this Article
Edit
Identifies the SelectedText dependency property.
public : static DependencyProperty SelectedTextProperty { get; }
static DependencyProperty SelectedTextProperty();
public static DependencyProperty SelectedTextProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedText dependency property.
TextBlock.SelectionChanged TextBlock.SelectionChanged
TextBlock.SelectionChanged
I n this Article
Edit
Occurs when the text selection has changed.
public : event RoutedEventHandler SelectionChanged
// Register
event_token SelectionChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void SelectionChanged(event_token const& cookie) const;

// Revoke with event_revoker


SelectionChanged_revoker SelectionChanged(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler SelectionChanged

<TextBlock SelectionChanged="eventhandler"/>
TextBlock.SelectionEnd TextBlock.SelectionEnd TextBlock.
SelectionEnd
I n this Article
Edit
Gets the end position of the text selected in the TextBlock.
public : TextPointer SelectionEnd { get; }
TextPointer SelectionEnd();
public TextPointer SelectionEnd { get; }

Returns
TextPointer
An object that represents the selection end, or null if no selection exists.

Remarks
Use Select to set the selection start and end.
TextBlock.SelectionFlyout TextBlock.SelectionFlyout Text
Block.SelectionFlyout
I n this Article
Edit
Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.
public : FlyoutBase SelectionFlyout { get; set; }
FlyoutBase SelectionFlyout();

void SelectionFlyout(FlyoutBase selectionflyout);


public FlyoutBase SelectionFlyout { get; set; }

Returns
FlyoutBase
The flyout that is shown when text is selected, or null if no flyout is shown. The default is an instance of
TextCommandBarFlyout.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBlock.SelectionFlyoutProperty TextBlock.Selection
FlyoutProperty TextBlock.SelectionFlyoutProperty
I n this Article
Edit
Identifies the SelectionFlyout dependency property.
public : static DependencyProperty SelectionFlyoutProperty { get; }
static DependencyProperty SelectionFlyoutProperty();
public static DependencyProperty SelectionFlyoutProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionFlyout dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBlock.SelectionHighlightColor TextBlock.Selection
HighlightColor TextBlock.SelectionHighlightColor
I n this Article
Edit
Gets or sets the brush used to highlight the selected text.
public : SolidColorBrush SelectionHighlightColor { get; set; }
SolidColorBrush SelectionHighlightColor();

void SelectionHighlightColor(SolidColorBrush selectionhighlightcolor);


public SolidColorBrush SelectionHighlightColor { get; set; }

<TextBlock SelectionHighlightColor="{StaticResource resourceName}"/>

Returns
SolidColorBrush
The brush used to highlight the selected text. The default is a null brush from a pure code perspective, but the system
uses base text styles to supply a runtime value for apps (unless you specifically override that style). The practical default
is a brush using the theme resource TextSelectionHighlightThemeColor.
See Use brushes
Also
TextBlock.SelectionHighlightColorProperty TextBlock.
SelectionHighlightColorProperty TextBlock.Selection
HighlightColorProperty
I n this Article
Edit
Identifies the SelectionHighlightColor dependency property.
public : static DependencyProperty SelectionHighlightColorProperty { get; }
static DependencyProperty SelectionHighlightColorProperty();
public static DependencyProperty SelectionHighlightColorProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionHighlightColor dependency property.
TextBlock.SelectionStart TextBlock.SelectionStart Text
Block.SelectionStart
I n this Article
Edit
Gets the starting position of the text selected in the TextBlock.
public : TextPointer SelectionStart { get; }
TextPointer SelectionStart();
public TextPointer SelectionStart { get; }

Returns
TextPointer
An object that represents the selection start, or null if no selection exists.

Remarks
Use Select to set the selection start and end.
TextBlock.Text TextBlock.Text TextBlock.Text
I n this Article
Edit
Gets or sets the text contents of a TextBlock.

public : Platform::String Text { get; set; }


winrt::hstring Text();

void Text(winrt::hstring text);


public string Text { get; set; }

<TextBlock Text="string"/>

Returns
string
A string that specifies the text contents of this TextBlock. The default is an empty string.
TextBlock.TextAlignment TextBlock.TextAlignment Text
Block.TextAlignment
I n this Article
Edit
Gets or sets a value that indicates the horizontal alignment of text content.
public : TextAlignment TextAlignment { get; set; }
TextAlignment TextAlignment();

void TextAlignment(TextAlignment textalignment);


public TextAlignment TextAlignment { get; set; }

<TextBlock TextAlignment="textAlignmentMemberName"/>

Returns
TextAlignment
The text alignment. The default is Left.
TextBlock.TextAlignmentProperty TextBlock.TextAlignment
Property TextBlock.TextAlignmentProperty
I n this Article
Edit
Identifies the TextAlignment dependency property.
public : static DependencyProperty TextAlignmentProperty { get; }
static DependencyProperty TextAlignmentProperty();
public static DependencyProperty TextAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the TextAlignment dependency property.
TextBlock TextBlock TextBlock
I n this Article
Edit
Initializes a new instance of the TextBlock class.

public : TextBlock()
TextBlock() const;
public TextBlock()
TextBlock.TextDecorations TextBlock.TextDecorations Text
Block.TextDecorations
I n this Article
Edit
Gets or sets a value that indicates what decorations are applied to the text.
public : TextDecorations TextDecorations { get; set; }
TextDecorations TextDecorations();

void TextDecorations(TextDecorations textdecorations);


public TextDecorations TextDecorations { get; set; }

<TextBlock TextDecorations="textDecorationsMemberName"/>

Returns
TextDecorations
A value of the enumeration. The default is None.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Examples
This example shows how to apply decorations to text.
<!-- Apply underline. -->
<TextBlock Text="Sample text" TextDecorations="Underline"/>

<!-- Apply underline and strikethrough. -->


<TextBlock Text="Sample text" TextDecorations="Underline, Strikethrough"/>

<!-- Apply decorations in code. -->


<TextBlock x:Name="TextBlock3" Text="Sample Text"
Loaded="TextBlock_Loaded" />

private void TextBlock_Loaded(object sender, RoutedEventArgs e)


{
// Apply both strikethough and underline to TextBlock3.
TextBlock3.TextDecorations =
TextDecorations.Strikethrough | TextDecorations.Underline;
}

Remarks
Starting with the Windows 10 Creators Update (SDK version 15063), this property is the preferred way to
strikethrough or underline text.
For earlier versions of Windows, you can underline text with the Underline class.
TextBlock.TextDecorationsProperty TextBlock.Text
DecorationsProperty TextBlock.TextDecorationsProperty
I n this Article
Edit
Identifies the TextDecorations dependency property.
public : static DependencyProperty TextDecorationsProperty { get; }
static DependencyProperty TextDecorationsProperty();
public static DependencyProperty TextDecorationsProperty { get; }

Returns
DependencyProperty
The identifier for the TextDecorations dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


TextBlock.TextHighlighters TextBlock.TextHighlighters Text
Block.TextHighlighters
I n this Article
Edit
Gets the collection of text highlights.
public : IVector<TextHighlighter> TextHighlighters { get; }
IVector<TextHighlighter> TextHighlighters();
public IList<TextHighlighter> TextHighlighters { get; }

Returns
IList<TextHighlighter>
The collection of text highlights.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


TextBlock.TextLineBounds TextBlock.TextLineBounds Text
Block.TextLineBounds
I n this Article
Edit
Gets or sets a value that indicates how the line box height is determined for each line of text in the TextBlock.
public : TextLineBounds TextLineBounds { get; set; }
TextLineBounds TextLineBounds();

void TextLineBounds(TextLineBounds textlinebounds);


public TextLineBounds TextLineBounds { get; set; }

<TextBlock TextLineBounds="textLineBoundsValue"/>

Returns
TextLineBounds
A value that indicates how the line box height is determined for each line of text in the TextBlock. The default is Full.

Remarks
For illustrations of how the different values for TextLineBounds affect adjacent lines of text, see TextLineBounds.
TextBlock.TextLineBoundsProperty TextBlock.TextLine
BoundsProperty TextBlock.TextLineBoundsProperty
I n this Article
Edit
Identifies the TextLineBounds dependency property.
public : static DependencyProperty TextLineBoundsProperty { get; }
static DependencyProperty TextLineBoundsProperty();
public static DependencyProperty TextLineBoundsProperty { get; }

Returns
DependencyProperty
The identifier for the TextLineBounds dependency property.
TextBlock.TextProperty TextBlock.TextProperty TextBlock.
TextProperty
I n this Article
Edit
Identifies the Text dependency property.
public : static DependencyProperty TextProperty { get; }
static DependencyProperty TextProperty();
public static DependencyProperty TextProperty { get; }

Returns
DependencyProperty
The identifier of the Text dependency property.
TextBlock.TextReadingOrder TextBlock.TextReadingOrder
TextBlock.TextReadingOrder
I n this Article
Edit
Gets or sets a value that indicates how the reading order is determined for the TextBlock.
public : TextReadingOrder TextReadingOrder { get; set; }
TextReadingOrder TextReadingOrder();

void TextReadingOrder(TextReadingOrder textreadingorder);


public TextReadingOrder TextReadingOrder { get; set; }

<TextBlock TextReadingOrder="textReadingOrderValue"/>

Returns
TextReadingOrder
A value that indicates how the reading order is determined for the TextBlock. The default is DetectFromContent.

Remarks
This property can be useful when the base direction of the text is unknown, and may not match the user's language or
direction. For more info, see the Remarks section of the TextReadingOrder enumeration or How to support
bidirectional UI.
Note

In Windows 8.1, the default value is 0, Default. Starting with Windows 10, the enumeration value 0 has the constant
name UseFlowDirection, and is not the default value.
See TextReadingOrder
Also How to support bidirectional UI
TextBlock.TextReadingOrderProperty TextBlock.Text
ReadingOrderProperty TextBlock.TextReadingOrder
Property
I n this Article
Edit
Identifies the TextReadingOrder dependency property.
public : static DependencyProperty TextReadingOrderProperty { get; }
static DependencyProperty TextReadingOrderProperty();
public static DependencyProperty TextReadingOrderProperty { get; }

Returns
DependencyProperty
The identifier for the TextReadingOrder dependency property.
TextBlock.TextTrimming TextBlock.TextTrimming TextBlock.
TextTrimming
I n this Article
Edit
Gets or sets the text trimming behavior to employ when content overflows the content area.
public : TextTrimming TextTrimming { get; set; }
TextTrimming TextTrimming();

void TextTrimming(TextTrimming texttrimming);


public TextTrimming TextTrimming { get; set; }

<TextBlock TextTrimming="None"/>
-or-
<TextBlock TextTrimming="WordEllipsis"/>

Returns
TextTrimming
One of the TextTrimming values that specifies the text trimming behavior to employ. The default is None.
TextBlock.TextTrimmingProperty TextBlock.TextTrimming
Property TextBlock.TextTrimmingProperty
I n this Article
Edit
Identifies the TextTrimming dependency property.
public : static DependencyProperty TextTrimmingProperty { get; }
static DependencyProperty TextTrimmingProperty();
public static DependencyProperty TextTrimmingProperty { get; }

Returns
DependencyProperty
The identifier of the TextTrimming dependency property.
TextBlock.TextWrapping TextBlock.TextWrapping Text
Block.TextWrapping
I n this Article
Edit
Gets or sets how the TextBlock wraps text.
public : TextWrapping TextWrapping { get; set; }
TextWrapping TextWrapping();

void TextWrapping(TextWrapping textwrapping);


public TextWrapping TextWrapping { get; set; }

<TextBlock TextWrapping="Wrap"/>
-or-
<TextBlock TextWrapping="NoWrap"/>

Returns
TextWrapping
A value that indicates how the TextBlock wraps text. The default is NoWrap.
TextBlock.TextWrappingProperty TextBlock.TextWrapping
Property TextBlock.TextWrappingProperty
I n this Article
Edit
Identifies the TextWrapping dependency property.
public : static DependencyProperty TextWrappingProperty { get; }
static DependencyProperty TextWrappingProperty();
public static DependencyProperty TextWrappingProperty { get; }

Returns
DependencyProperty
The identifier of the TextWrapping dependency property.
TextBox TextBox TextBox Class
Represents a control that can be used to display and edit plain text (single or multi-line).

D eclaration
public : class TextBox : Control, ITextBox, ITextBox2, ITextBox3, ITextBox4, ITextBox5,
ITextBox6, ITextBox7, ITextBox8
struct winrt::Windows::UI::Xaml::Controls::TextBox : Control, ITextBox, ITextBox2, ITextBox3,
ITextBox4, ITextBox5, ITextBox6, ITextBox7, ITextBox8
public class TextBox : Control, ITextBox, ITextBox2, ITextBox3, ITextBox4, ITextBox5, ITextBox6,
ITextBox7, ITextBox8

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Text box.

The TextBox control enables a user to enter text into an app. It's typically used to capture a single line of text, but can be
configured to capture multiple lines of text. The text displays on the screen in a simple uniform plaintext format.
TextBox has a number of features that can simplify text entry:
It supports text input from a keyboard or a pen (using ink and handwriting recognition).
It comes with a familiar, built-in context menu with support for copying and pasting text.
A "clear all" button lets a user quickly delete all text that has been entered.
It also has spell checking capabilities built in and enabled by default.
Here's how to create a TextBox in XAML and in code.
<TextBox Width="500" Header="Notes" PlaceholderText="Type your notes here"/>

TextBox textBox = new TextBox();


textBox.Width = 500;
textBox.Header = "Notes";
textBox.PlaceholderText = "Type your notes here";
// Add the TextBox to the visual tree.
rootGrid.Children.Add(textBox);

The resulting TextBox looks like this. The blue border indicates that the TextBox has focus.
I s TextB ox the right control to use?
You can use a TextBox control to display and edit unformatted text. If you need an editable text box that accepts
passwords or other sensitive input, see PasswordBox. If you need a text box to enter search terms, see
AutoSuggestBox. If you need to enter or edit formatted text, see RichEditBox.
Use TextB ox for data input in a form
It’s common to use a TextBox to accept data input on a form, and use the Text property to get the complete text string
from the TextBox. You typically use an event like a submit button Click to access the Text property, but you can handle
the TextChanged or TextChanging event if you need to do something when the text changes. You can add a Header (or
label) and PlaceholderText (or watermark) to the TextBox to give the user an indication of what the TextBox is for. To
customize the look of the header, you can set the HeaderTemplate property instead of Header. For design info, see
Guidelines for labels.
You can restrict the number of characters the user can type by setting the MaxLength property. However, MaxLength
does not restrict the length of pasted text. Use the Paste event to modify pasted text if this is important for your app.
TextBox includes a clear all button ("x") that appears when text is entered in the box. When a user clicks the "x", the text
in the TextBox is cleared. It looks like this.

The *clear all* button is shown only for editable, single-line text
boxes that contain text and have focus. The *clear all* button is not shown in any of these cases:
IsReadOnly is true
AcceptsReturn is true
TextWrapping is Wrap
Make a TextB ox read - only
You can make a TextBox read-only by setting the IsReadOnly property to true. For example, you might have a TextBox
for a user to enter comments that is enabled only under certain conditions. You can make the TextBox read-only until
the conditions are met. If you need only to display text, consider using a TextBlock or RichTextBlock instead.
Enable multi - line input
There are two properties that control whether the TextBox displays text on more than one line.
To let the text box allow and display the newline or return characters, set the AcceptsReturn property to true.
To enable text wrapping, set the TextWrapping property to Wrap. (TextBox doesn't support the
TextWrapping.WrapWholeWords enumeration value.) A multi-line TextBox will continue to grow vertically as text is
entered unless it’s constrained by its Height or MaxHeight property, or by a parent container. You should test that a
multi-line TextBox doesn’t grow beyond its visible area, and constrain its growth if it does. Scrolling using a scroll-
wheel or touch is automatically enabled when needed. However, vertical scrollbars are not shown by default. You can
show the vertical scrollbars by setting the ScrollViewer.VerticalScrollBarVisibility to Auto on the embedded
ScrollViewer, as shown here.
<TextBox AcceptsReturn="True" TextWrapping="Wrap"
MaxHeight="172" Width="300" Header="Description"
ScrollViewer.VerticalScrollBarVisibility="Auto"/>

TextBox textBox = new TextBox();


textBox.AcceptsReturn = true;
textBox.TextWrapping = TextWrapping.Wrap;
textBox.MaxHeight = 172;
textBox.Width = 300;
textBox.Header = "Description";
ScrollViewer.SetVerticalScrollBarVisibility(textBox, ScrollBarVisibility.Auto);
Here's what the TextBox looks like after text is added.

Format the text display


Use the TextAlignment property to align text within a TextBox. To align the TextBox within the layout of the page, use
the HorizontalAlignment and VerticalAlignment properties.
While the TextBox supports only unformatted text, you can customize how the text is displayed in the TextBox to match
your branding. You can set standard Control properties like FontFamily, FontSize, FontStyle, Background, Foreground,
and CharacterSpacing to change the look of the text. These properties affect only how the TextBox displays the text
locally, so if you were to copy and paste the text into a rich text control, for example, no formatting would be applied.
This example shows a read-only TextBox with several properties set to customize the appearance of the text.
<TextBox Text="Sample Text" IsReadOnly="True"
FontFamily="Verdana" FontSize="24"
FontWeight="Bold" FontStyle="Italic"
CharacterSpacing="200" Width="300"
Foreground="Blue" Background="Beige"/>

TextBox textBox = new TextBox();


textBox.Text = "Sample Text";
textBox.IsReadOnly = true;
textBox.FontFamily = new FontFamily("Verdana");
textBox.FontSize = 24;
textBox.FontWeight = Windows.UI.Text.FontWeights.Bold;
textBox.FontStyle = Windows.UI.Text.FontStyle.Italic;
textBox.CharacterSpacing = 200;
textBox.Width = 300;
textBox.Background = new SolidColorBrush(Windows.UI.Colors.Beige);
textBox.Foreground = new SolidColorBrush(Windows.UI.Colors.Blue);
// Add the TextBox to the visual tree.
rootGrid.Children.Add(textBox);

The resulting TextBox looks like this.

Pen input
Starting with Windows 10, version 1803, XAML text input boxes feature embedded support for pen input using
Windows Ink. When a user taps into a text input box using a Windows pen, the text box transforms to let the user write
directly into it with a pen, rather than opening a separate input panel.
For more info, see Text input with the handwriting view.
Modify the context menu
By default, the commands shown in the TextBox context menu depend on the state of the TextBox. For example, the
following commands can be shown when the TextBox is editable.

CO MMAND S HO W N W HEN...

Copy text is selected.

Cut text is selected.

Paste the clipboard contains text.

Select all the @Windows.UI.Xaml.Controls.TextBox?text=TextBox


contains text.

Undo text has been changed.

To modify the commands shown in the context menu, handle the ContextMenuOpening event. For an example of this,
see Scenario 2 of the ContextMenu sample. For design info, see Guidelines for context menus.
Selection, copy, and paste
You can get or set the selected text in a TextBox using the SelectedText property. Use the SelectionStart and
SelectionLength properties, and the Select and SelectAll methods, to manipulate the text selection. Handle the
SelectionChanged event to do something when the user selects or de-selects text. You can change the color used to
highlight the selected text by setting the SelectionHighlightColor property.
TextBox supports copy and paste by default. You can provide custom handling of the Paste event on editable text
controls in your app. For example, you might remove the line breaks from a multi-line address when pasting it into a
single-line search box. Or, you might check the length of the pasted text and warn the user if it exceeds the maximum
length that can be saved to a database. For more info and examples, see the Paste event.
Use a text box with the touch keyboard
The touch keyboard can be used for text entry when your app runs on a device with a touch screen. TextBox provides
properties you can set to make it much faster and easier for users to enter data in your app using the touch keyboard.
Set the InputScope property to match the kind of data the user is expected to enter. For example, if a TextBox is used
only to enter a 4-digit PIN, set the InputScope property to Number. This tells the system to show the number keypad
layout, which makes it easier for the user to enter the PIN.
Other properties that affect the touch keyboard are IsSpellCheckEnabled, IsTextPredictionEnabled, and
PreventKeyboardDisplayOnProgrammaticFocus. (IsSpellCheckEnabled also affects the TextBox when a hardware
keyboard is used.) For more info and examples, see Use input scope to change the touch keyboard, and the property
documentation.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the TextBox control. Resources that start with "TextControl" are shared by
TextBox, PasswordBox, RichEditBox, and AutoSuggestBox.

R ES O U R CE K EY D ES CR IPTIO N

TextControlForeground Text color at rest and not focused

TextControlForegroundPointerOver Text color on hover

TextControlForegroundFocused Text color when focused

TextControlForegroundDisabled Text color when disabled

TextControlBackground Background color at rest and not focused

TextControlBackgroundPointerOver Background color on hover

TextControlBackgroundFocused Background color when focused

TextControlBackgroundDisabled Background color when disabled

TextControlBorderBrush Border color at rest and not focused

TextControlBorderBrushPointerOver Border color on hover

TextControlBorderBrushFocused Border color when focused

TextControlBorderBrushDisabled Border color when disabled

TextControlPlaceholderForeground Placeholder text color at rest and not focused

TextControlPlaceholderForegroundPointerOver Placeholder text color on hover

TextControlPlaceholderForegroundFocused Placeholder text color when focused

TextControlPlaceholderForegroundDisabled Placeholder text color when disabled

TextControlHeaderForeground Header text color


TextControlHeaderForegroundDisabled Header text color when disabled

TextControlSelectionHighlightColor Highlight color of selected text

TextControlButtonBackground Background color of delete button at rest

TextControlButtonBackgroundPointerOver Background color of delete button on hover

TextControlButtonBackgroundPressed Background color of delete button when pressed

TextControlButtonBorderBrush Border color of delete button at rest

TextControlButtonBorderBrushPointerOver Border color of delete button on hover

TextControlButtonBorderBrushPressed Border color of delete button when pressed

TextControlButtonForeground Foreground color of delete button at rest

TextControlButtonForegroundPointerOver Foreground color of delete button on hover

TextControlButtonForegroundPressed Foreground color of delete button when pressed

Constructors
TextBox()
TextBox()
TextBox()

Initializes a new instance of the TextBox class.

Properties
AcceptsReturn
AcceptsReturn
AcceptsReturn

Gets or sets the value that determines whether the text box allows and displays the newline or return characters.

AcceptsReturnProperty
AcceptsReturnProperty
AcceptsReturnProperty

Identifies the AcceptsReturn dependency property.

CanPasteClipboardContent
CanPasteClipboardContent
CanPasteClipboardContent

Gets a value that indicates whether clipboard content can be pasted into the control.
CanPasteClipboardContentProperty
CanPasteClipboardContentProperty
CanPasteClipboardContentProperty

Identifies the CanPasteClipboardContent dependency property.

CanRedo
CanRedo
CanRedo

Gets a value that indicates whether the redo buffer contains an action that can be redone.

CanRedoProperty
CanRedoProperty
CanRedoProperty

Identifies the CanRedo dependency property.

CanUndo
CanUndo
CanUndo

Gets a value that indicates whether the undo buffer contains an action that can be undone.

CanUndoProperty
CanUndoProperty
CanUndoProperty

Identifies the CanUndo dependency property.

CharacterCasing
CharacterCasing
CharacterCasing

Gets or sets a value that indicates how the control modifies the case of characters as they are typed.

CharacterCasingProperty
CharacterCasingProperty
CharacterCasingProperty

Identifies the CharacterCasing dependency property.

Description
Description
Description
Gets or sets content that is shown below the control. The content should provide guidance about the input
expected by the control.

DescriptionProperty
DescriptionProperty
DescriptionProperty

Identifies the Description dependency property.

DesiredCandidateWindowAlignment
DesiredCandidateWindowAlignment
DesiredCandidateWindowAlignment

Gets or sets a value that indicates the preferred alignment of the Input Method Editor (IME ).

DesiredCandidateWindowAlignmentProperty
DesiredCandidateWindowAlignmentProperty
DesiredCandidateWindowAlignmentProperty

Identifies the DesiredCandidateWindowAlignment dependency property.

HandwritingView
HandwritingView
HandwritingView

Gets or sets the HandwritingView associated with this text control.

HandwritingViewProperty
HandwritingViewProperty
HandwritingViewProperty

Identifies the HandwritingView dependency property.

Header
Header
Header

Gets or sets the content for the control's header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.


HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the control's header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

HorizontalTextAlignment
HorizontalTextAlignment
HorizontalTextAlignment

Gets or sets a value that indicates how text is aligned in the TextBox.

HorizontalTextAlignmentProperty
HorizontalTextAlignmentProperty
HorizontalTextAlignmentProperty

Identifies the HorizontalTextAlignment dependency property.

InputScope
InputScope
InputScope

Gets or sets the context for input used by this TextBox.

InputScopeProperty
InputScopeProperty
InputScopeProperty

Identifies the InputScope dependency property.

IsColorFontEnabled
IsColorFontEnabled
IsColorFontEnabled

Gets or sets a value that determines whether font glyphs that contain color layers, such as Segoe UI Emoji, are
rendered in color.

IsColorFontEnabledProperty
IsColorFontEnabledProperty
IsColorFontEnabledProperty

Identifies the IsColorFontEnabled dependency property.

IsHandwritingViewEnabled
IsHandwritingViewEnabled
IsHandwritingViewEnabled

Gets or sets a value that indicates whether a user can enter text in the handwriting view.

IsHandwritingViewEnabledProperty
IsHandwritingViewEnabledProperty
IsHandwritingViewEnabledProperty

Identifies the IsHandwritingViewEnabled dependency property.

IsReadOnly
IsReadOnly
IsReadOnly

Gets or sets the value that determines if the user can change the text in the text box.

IsReadOnlyProperty
IsReadOnlyProperty
IsReadOnlyProperty

Identifies the IsReadOnly dependency property.

IsSpellCheckEnabled
IsSpellCheckEnabled
IsSpellCheckEnabled

Gets or sets a value that specifies whether the TextBox input interacts with a spell check engine.

IsSpellCheckEnabledProperty
IsSpellCheckEnabledProperty
IsSpellCheckEnabledProperty

Identifies the IsSpellCheckEnabled dependency property.

IsTextPredictionEnabled
IsTextPredictionEnabled
IsTextPredictionEnabled

Gets or sets a value that determines whether text prediction features ("autocomplete") should be enabled for this
TextBox.
IsTextPredictionEnabledProperty
IsTextPredictionEnabledProperty
IsTextPredictionEnabledProperty

Identifies the IsTextPredictionEnabled dependency property.

MaxLength
MaxLength
MaxLength

Gets or sets the value that specifies the maximum number of characters allowed for user input.

MaxLengthProperty
MaxLengthProperty
MaxLengthProperty

Identifies the MaxLength dependency property.

PlaceholderForeground
PlaceholderForeground
PlaceholderForeground

Gets or sets a brush that describes the color of placeholder text.

PlaceholderForegroundProperty
PlaceholderForegroundProperty
PlaceholderForegroundProperty

Identifies the PlaceholderForeground dependency property.

PlaceholderText
PlaceholderText
PlaceholderText

Gets or sets the text that is displayed in the control until the value is changed by a user action or some other
operation.

PlaceholderTextProperty
PlaceholderTextProperty
PlaceholderTextProperty

Identifies the PlaceholderText dependency property.

PreventKeyboardDisplayOnProgrammaticFocus
PreventKeyboardDisplayOnProgrammaticFocus
PreventKeyboardDisplayOnProgrammaticFocus

Gets or sets a value that indicates whether the on-screen keyboard is shown when the control receives focus
programmatically.

PreventKeyboardDisplayOnProgrammaticFocusProperty
PreventKeyboardDisplayOnProgrammaticFocusProperty
PreventKeyboardDisplayOnProgrammaticFocusProperty

Identifies the PreventKeyboardDisplayOnProgrammaticFocus dependency property.

ProofingMenuFlyout
ProofingMenuFlyout
ProofingMenuFlyout

Gets the flyout that shows proofing commands.

ProofingMenuFlyoutProperty
ProofingMenuFlyoutProperty
ProofingMenuFlyoutProperty

Identifies the ProofingMenuFlyout dependency property.

SelectedText
SelectedText
SelectedText

Gets or sets the content of the current selection in the text box.

SelectionFlyout
SelectionFlyout
SelectionFlyout

Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.

SelectionFlyoutProperty
SelectionFlyoutProperty
SelectionFlyoutProperty

Identifies the SelectionFlyout dependency property.

SelectionHighlightColor
SelectionHighlightColor
SelectionHighlightColor

Gets or sets the brush used to highlight the selected text.


SelectionHighlightColorProperty
SelectionHighlightColorProperty
SelectionHighlightColorProperty

Identifies the SelectionHighlightColor dependency property.

SelectionHighlightColorWhenNotFocused
SelectionHighlightColorWhenNotFocused
SelectionHighlightColorWhenNotFocused

Gets or sets the brush used to highlight the selected text when the TextBox does not have focus.

SelectionHighlightColorWhenNotFocusedProperty
SelectionHighlightColorWhenNotFocusedProperty
SelectionHighlightColorWhenNotFocusedProperty

Identifies the SelectionHighlightColorWhenNotFocused dependency property.

SelectionLength
SelectionLength
SelectionLength

Gets or sets the number of characters in the current selection in the text box.

SelectionStart
SelectionStart
SelectionStart

Gets or sets the starting position of the text selected in the text box. When the SelectionLength is 0 (there is no
selected text), the SelectionStart property corresponds to the cursor position.

Text
Text
Text

Gets or sets the text contents of the text box.

TextAlignment
TextAlignment
TextAlignment

Gets or sets how the text should be horizontally aligned in the text box.

TextAlignmentProperty
TextAlignmentProperty
TextAlignmentProperty

Identifies the TextAlignment dependency property.

TextProperty
TextProperty
TextProperty

Identifies the Text dependency property.

TextReadingOrder
TextReadingOrder
TextReadingOrder

Gets or sets a value that indicates how the reading order is determined for the TextBox.

TextReadingOrderProperty
TextReadingOrderProperty
TextReadingOrderProperty

Identifies the TextReadingOrder dependency property.

TextWrapping
TextWrapping
TextWrapping

Gets or sets how line breaking occurs if a line of text extends beyond the available width of the text box.

TextWrappingProperty
TextWrappingProperty
TextWrappingProperty

Identifies the TextWrapping dependency property.

Methods
ClearUndoRedoHistory()
ClearUndoRedoHistory()
ClearUndoRedoHistory()

Empties the undo and redo buffers.

CopySelectionToClipboard()
CopySelectionToClipboard()
CopySelectionToClipboard()
Copies the selected content to the Windows clipboard.

CutSelectionToClipboard()
CutSelectionToClipboard()
CutSelectionToClipboard()

Moves the selected content to the Windows clipboard and removes it from the text control.

GetLinguisticAlternativesAsync()
GetLinguisticAlternativesAsync()
GetLinguisticAlternativesAsync()

Asynchronously gets a list of candidate words based on the provided phonetic characters in an Input Method
Editor (IME ).

GetRectFromCharacterIndex(Int32, Boolean)
GetRectFromCharacterIndex(Int32, Boolean)
GetRectFromCharacterIndex(Int32, Boolean)

Returns a rectangular region for the leading or trailing edge of a character at a specific character index.

PasteFromClipboard()
PasteFromClipboard()
PasteFromClipboard()

Copies content from the Windows clipboard into the text control.

Redo()
Redo()
Redo()

Reapplies the first action in the redo buffer.

Select(Int32, Int32)
Select(Int32, Int32)
Select(Int32, Int32)

Selects a range of text in the text box.

SelectAll()
SelectAll()
SelectAll()

Selects the entire contents of the text box.


Undo()
Undo()
Undo()

Undoes the first action in the undo buffer.

Events
BeforeTextChanging
BeforeTextChanging
BeforeTextChanging

Occurs synchronously when the text in the text box starts to change, but before the Text property is updated.

CandidateWindowBoundsChanged
CandidateWindowBoundsChanged
CandidateWindowBoundsChanged

Occurs when the Input Method Editor (IME ) window open, updates, or closes.

ContextMenuOpening
ContextMenuOpening
ContextMenuOpening

Occurs when the system processes an interaction that displays a context menu.

CopyingToClipboard
CopyingToClipboard
CopyingToClipboard

Occurs before copied text is moved to the clipboard.

CuttingToClipboard
CuttingToClipboard
CuttingToClipboard

Occurs before cut text is moved to the clipboard.

Paste
Paste
Paste

Occurs when text is pasted into the control.

SelectionChanged
SelectionChanged
SelectionChanged

Occurs when the text selection has changed.

SelectionChanging
SelectionChanging
SelectionChanging

Occurs when the text selection starts to change.

TextChanged
TextChanged
TextChanged

Occurs when content changes in the text box.

TextChanging
TextChanging
TextChanging

Occurs synchronously when the text in the text box starts to change, but before it is rendered.

TextCompositionChanged
TextCompositionChanged
TextCompositionChanged

Occurs when text being composed through an Input Method Editor (IME ) changes.

TextCompositionEnded
TextCompositionEnded
TextCompositionEnded

Occurs when a user stops composing text through an Input Method Editor (IME ).

TextCompositionStarted
TextCompositionStarted
TextCompositionStarted

Occurs when a user starts composing text through an Input Method Editor (IME ).

See Also
TextBox.AcceptsReturn TextBox.AcceptsReturn TextBox.
AcceptsReturn
I n this Article
Edit
Gets or sets the value that determines whether the text box allows and displays the newline or return characters.
public : Platform::Boolean AcceptsReturn { get; set; }
bool AcceptsReturn();

void AcceptsReturn(bool acceptsreturn);


public bool AcceptsReturn { get; set; }

<TextBox AcceptsReturn="bool"/>

Returns
bool
true if the text box allows newline characters; otherwise, false. The default is false.

Remarks
If you change the AcceptsReturn property to true, text might be displayed differently due to text containing newline
characters.
You can enable multi-line text in a TextBox control by using the AcceptsReturn property. Use the
ScrollViewer.HorizontalScrollBarVisibility or ScrollViewer.VerticalScrollBarVisibility attached properties to change
scrollbar behavior. By default the scrollbars appear when the layout system calculates that the text exceeds the
dimensions of the viewport for the TextBox.
See Display and edit text
Also
TextBox.AcceptsReturnProperty TextBox.AcceptsReturn
Property TextBox.AcceptsReturnProperty
I n this Article
Edit
Identifies the AcceptsReturn dependency property.
public : static DependencyProperty AcceptsReturnProperty { get; }
static DependencyProperty AcceptsReturnProperty();
public static DependencyProperty AcceptsReturnProperty { get; }

Returns
DependencyProperty
The identifier for the AcceptsReturn dependency property.
TextBox.BeforeTextChanging TextBox.BeforeTextChanging
TextBox.BeforeTextChanging
I n this Article
Edit
Occurs synchronously when the text in the text box starts to change, but before the Text property is updated.
public : event TypedEventHandler<TextBox, TextBoxBeforeTextChangingEventArgs> BeforeTextChanging
// Register
event_token BeforeTextChanging(TypedEventHandler<TextBox, TextBoxBeforeTextChangingEventArgs> const&
handler) const;

// Revoke with event_token


void BeforeTextChanging(event_token const& cookie) const;

// Revoke with event_revoker


BeforeTextChanging_revoker BeforeTextChanging(auto_revoke_t, TypedEventHandler<TextBox,
TextBoxBeforeTextChangingEventArgs> const& handler) const;
public event TypedEventHandler<TextBox, TextBoxBeforeTextChangingEventArgs> BeforeTextChanging

<TextBox BeforeTextChanging="eventhandler"/>
TextBox.CandidateWindowBoundsChanged TextBox.
CandidateWindowBoundsChanged TextBox.Candidate
WindowBoundsChanged
I n this Article
Edit
Occurs when the Input Method Editor (IME ) window open, updates, or closes.
public : event TypedEventHandler<TextBox, CandidateWindowBoundsChangedEventArgs>
CandidateWindowBoundsChanged
// Register
event_token CandidateWindowBoundsChanged(TypedEventHandler<TextBox,
CandidateWindowBoundsChangedEventArgs> const& handler) const;

// Revoke with event_token


void CandidateWindowBoundsChanged(event_token const& cookie) const;

// Revoke with event_revoker


CandidateWindowBoundsChanged_revoker CandidateWindowBoundsChanged(auto_revoke_t,
TypedEventHandler<TextBox, CandidateWindowBoundsChangedEventArgs> const& handler) const;
public event TypedEventHandler<TextBox, CandidateWindowBoundsChangedEventArgs>
CandidateWindowBoundsChanged

<TextBox CandidateWindowBoundsChanged="eventhandler" />

Examples
Here, a rectangle is placed below a TextBox. When the Input Method Editor (IME ) window bounds change, the bottom
Margin of the TextBox is increased by the height of the Input Method Editor (IME ) candidate window. As a result, the
rectangle is pushed down by that amount and is not covered by the candidate window.
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel>
<TextBox x:Name="textBox1" Width="300" HorizontalAlignment="Left"
DesiredCandidateWindowAlignment="BottomEdge"
CandidateWindowBoundsChanged="OnCandidateWindowBoundsChanged"/>
<Rectangle Height="100" Width="100" Fill="Red"
HorizontalAlignment="Left"/>
</StackPanel>
</Grid>

private void OnCandidateWindowBoundsChanged(TextBox sender, CandidateWindowBoundsChangedEventArgs


args)
{
textBox1.Margin = new Thickness
{
Left = 0,
Top = 0,
Right = 0,
Bottom = Math.Max(0, args.Bounds.Bottom - textBox1.ActualHeight)
};
}
Remarks
For event data, see CandidateWindowBoundsChangedEventArgs.
Users sometimes enter text through an Input Method Editor (IME ) that shows in a window just below a text input box
(typically for East Asian languages). The Input Method Editor (IME ) window can cover important parts of your app UI
that the user might need to see while entering text. This event notifies your app of the coordinates where the Input
Method Editor (IME ) window is currently displayed. You can use this info to draw your UI in a location that doesn't
conflict with the Input Method Editor (IME ) window.
You can also use the DesiredCandidateWindowAlignment property to specify a preferred placement of the Input
Method Editor (IME ) window in relation to the text input box.
TextBox.CanPasteClipboardContent TextBox.CanPaste
ClipboardContent TextBox.CanPasteClipboardContent
I n this Article
Edit
Gets a value that indicates whether clipboard content can be pasted into the control.
public : Platform::Boolean CanPasteClipboardContent { get; }
bool CanPasteClipboardContent();
public bool CanPasteClipboardContent { get; }

Returns
bool
true if clipboard content can be pasted into the control; otherwise, false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.CanPasteClipboardContentProperty TextBox.Can
PasteClipboardContentProperty TextBox.CanPaste
ClipboardContentProperty
I n this Article
Edit
Identifies the CanPasteClipboardContent dependency property.
public : static DependencyProperty CanPasteClipboardContentProperty { get; }
static DependencyProperty CanPasteClipboardContentProperty();
public static DependencyProperty CanPasteClipboardContentProperty { get; }

Returns
DependencyProperty
The identifier for the CanPasteClipboardContent dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.CanRedo TextBox.CanRedo TextBox.CanRedo
I n this Article
Edit
Gets a value that indicates whether the redo buffer contains an action that can be redone.

public : Platform::Boolean CanRedo { get; }


bool CanRedo();
public bool CanRedo { get; }

Returns
bool
true if the redo buffer contains an action that can be redone; otherwise, false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.CanRedoProperty TextBox.CanRedoProperty Text
Box.CanRedoProperty
I n this Article
Edit
Identifies the CanRedo dependency property.
public : static DependencyProperty CanRedoProperty { get; }
static DependencyProperty CanRedoProperty();
public static DependencyProperty CanRedoProperty { get; }

Returns
DependencyProperty
The identifier for the CanRedo dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.CanUndo TextBox.CanUndo TextBox.CanUndo
I n this Article
Edit
Gets a value that indicates whether the undo buffer contains an action that can be undone.

public : Platform::Boolean CanUndo { get; }


bool CanUndo();
public bool CanUndo { get; }

Returns
bool
true if the undo buffer contains an action that can be undone; otherwise, false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.CanUndoProperty TextBox.CanUndoProperty
TextBox.CanUndoProperty
I n this Article
Edit
Identifies the CanUndo dependency property.
public : static DependencyProperty CanUndoProperty { get; }
static DependencyProperty CanUndoProperty();
public static DependencyProperty CanUndoProperty { get; }

Returns
DependencyProperty
The identifier for the CanUndo dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.CharacterCasing TextBox.CharacterCasing Text
Box.CharacterCasing
I n this Article
Edit
Gets or sets a value that indicates how the control modifies the case of characters as they are typed.
public : CharacterCasing CharacterCasing { get; set; }
CharacterCasing CharacterCasing();

void CharacterCasing(CharacterCasing charactercasing);


public CharacterCasing CharacterCasing { get; set; }

<TextBox CharacterCasing="characterCasingValue"/>

Returns
CharacterCasing
A value of the enumeration that indicates how the control modifies the case of characters as they are typed. The default
is Normal, which indicates that the charcters are not changed.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
Note

This property modifies the case of characters as they are typed. It doesn’t modify characters that are entered in other
ways, like paste or ink.
TextBox.CharacterCasingProperty TextBox.Character
CasingProperty TextBox.CharacterCasingProperty
I n this Article
Edit
Identifies the CharacterCasing dependency property.
public : static DependencyProperty CharacterCasingProperty { get; }
static DependencyProperty CharacterCasingProperty();
public static DependencyProperty CharacterCasingProperty { get; }

Returns
DependencyProperty
The identifier for the CharacterCasing dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


TextBox.ClearUndoRedoHistory TextBox.ClearUndoRedo
History TextBox.ClearUndoRedoHistory
I n this Article
Edit
Empties the undo and redo buffers.
public : void ClearUndoRedoHistory()
void ClearUndoRedoHistory() const;
public void ClearUndoRedoHistory()

Additional features and requirements


Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.ContextMenuOpening TextBox.ContextMenu
Opening TextBox.ContextMenuOpening
I n this Article
Edit
Occurs when the system processes an interaction that displays a context menu.
public : event ContextMenuOpeningEventHandler ContextMenuOpening
// Register
event_token ContextMenuOpening(ContextMenuOpeningEventHandler const& handler) const;

// Revoke with event_token


void ContextMenuOpening(event_token const& cookie) const;

// Revoke with event_revoker


ContextMenuOpening_revoker ContextMenuOpening(auto_revoke_t, ContextMenuOpeningEventHandler const&
handler) const;
public event ContextMenuOpeningEventHandler ContextMenuOpening

<TextBox ContextMenuOpening="eventhandler" />

Remarks
To override the context menu, you can handle the ContextMenuOpening event and replace the default menu with a
custom menu. For an example of this, see Scenario 2 of the ContextMenu sample. For design info, see Guidelines for
context menus.
See Guidelines for context menus
Also ContextMenu sample
TextBox.CopyingToClipboard TextBox.CopyingTo
Clipboard TextBox.CopyingToClipboard
I n this Article
Edit
Occurs before copied text is moved to the clipboard.
public : event TypedEventHandler<TextBox, TextControlCopyingToClipboardEventArgs> CopyingToClipboard
// Register
event_token CopyingToClipboard(TypedEventHandler<TextBox, TextControlCopyingToClipboardEventArgs>
const& handler) const;

// Revoke with event_token


void CopyingToClipboard(event_token const& cookie) const;

// Revoke with event_revoker


CopyingToClipboard_revoker CopyingToClipboard(auto_revoke_t, TypedEventHandler<TextBox,
TextControlCopyingToClipboardEventArgs> const& handler) const;
public event TypedEventHandler<TextBox, TextControlCopyingToClipboardEventArgs> CopyingToClipboard

<TextBox CopyingToClipboard="eventhandler"/>
TextBox.CopySelectionToClipboard TextBox.Copy
SelectionToClipboard TextBox.CopySelectionToClipboard
I n this Article
Edit
Copies the selected content to the Windows clipboard.
public : void CopySelectionToClipboard()
void CopySelectionToClipboard() const;
public void CopySelectionToClipboard()

Additional features and requirements


Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.CutSelectionToClipboard TextBox.CutSelectionTo
Clipboard TextBox.CutSelectionToClipboard
I n this Article
Edit
Moves the selected content to the Windows clipboard and removes it from the text control.
public : void CutSelectionToClipboard()
void CutSelectionToClipboard() const;
public void CutSelectionToClipboard()

Additional features and requirements


Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.CuttingToClipboard TextBox.CuttingToClipboard
TextBox.CuttingToClipboard
I n this Article
Edit
Occurs before cut text is moved to the clipboard.
public : event TypedEventHandler<TextBox, TextControlCuttingToClipboardEventArgs> CuttingToClipboard
// Register
event_token CuttingToClipboard(TypedEventHandler<TextBox, TextControlCuttingToClipboardEventArgs>
const& handler) const;

// Revoke with event_token


void CuttingToClipboard(event_token const& cookie) const;

// Revoke with event_revoker


CuttingToClipboard_revoker CuttingToClipboard(auto_revoke_t, TypedEventHandler<TextBox,
TextControlCuttingToClipboardEventArgs> const& handler) const;
public event TypedEventHandler<TextBox, TextControlCuttingToClipboardEventArgs> CuttingToClipboard

<TextBox CuttingToClipboard="eventhandler"/>
TextBox.Description TextBox.Description TextBox.
Description
I n this Article
Edit
Gets or sets content that is shown below the control. The content should provide guidance about the input expected by
the control.
public : Platform::Object Description { get; set; }
winrt::Windows::Foundation::IInspectable Description();

void Description(winrt::Windows::Foundation::IInspectable description);


public object Description { get; set; }

Returns
object
The content to be displayed below the control. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.DescriptionProperty TextBox.DescriptionProperty
TextBox.DescriptionProperty
I n this Article
Edit
Identifies the Description dependency property.
public : static DependencyProperty DescriptionProperty { get; }
static DependencyProperty DescriptionProperty();
public static DependencyProperty DescriptionProperty { get; }

Returns
DependencyProperty
The identifier for the Description dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.DesiredCandidateWindowAlignment TextBox.
DesiredCandidateWindowAlignment TextBox.Desired
CandidateWindowAlignment
I n this Article
Edit
Gets or sets a value that indicates the preferred alignment of the Input Method Editor (IME ).
public : CandidateWindowAlignment DesiredCandidateWindowAlignment { get; set; }
CandidateWindowAlignment DesiredCandidateWindowAlignment();

void DesiredCandidateWindowAlignment(CandidateWindowAlignment desiredcandidatewindowalignment);


public CandidateWindowAlignment DesiredCandidateWindowAlignment { get; set; }

<TextBox DesiredCandidateWindowAlignment="candidateWindowAlignmentMemberName"/>

Returns
CandidateWindowAlignment
A value of the enumeration that indicates the preferred alignment of the Input Method Editor (IME ). The default is
Default.

Remarks
Users sometimes enter text through an Input Method Editor (IME ) that shows in a window just below a text input box
(typically for East Asian languages). The Input Method Editor (IME ) window can cover important parts of your app UI
that the user might need to see while entering text. Use the DesiredCandidateWindowAlignment property to specify a
preferred placement of the Input Method Editor (IME ) window in relation to the text input box.
By default, when the hardware keyboard is used, the Input Method Editor (IME ) follows the cursor. You can set
DesiredCandidateWindowAlignment to BottomEdge to align the Input Method Editor (IME ) to the bottom edge and
left side of the text edit control.
When the Soft Input Panel (SIP ) is used, DesiredCandidateWindowAlignment doesn't have any effect. The Input
Method Editor (IME ) remains docked to the Soft Input Panel (SIP ) whenever the Soft Input Panel (SIP ) is used.
You can also handle the CandidateWindowBoundsChanged event to adapt your UI to the placement of the Input
Method Editor (IME ).
See CandidateWindowBoundsChangedCandidateWindowBoundsChangedCandidateWindowBoundsChanged
Also
TextBox.DesiredCandidateWindowAlignmentProperty
TextBox.DesiredCandidateWindowAlignmentProperty
TextBox.DesiredCandidateWindowAlignmentProperty
I n this Article
Edit
Identifies the DesiredCandidateWindowAlignment dependency property.
public : static DependencyProperty DesiredCandidateWindowAlignmentProperty { get; }
static DependencyProperty DesiredCandidateWindowAlignmentProperty();
public static DependencyProperty DesiredCandidateWindowAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the DesiredCandidateWindowAlignment dependency property.
See Dependency properties overview
Also
TextBox.GetLinguisticAlternativesAsync TextBox.Get
LinguisticAlternativesAsync TextBox.GetLinguistic
AlternativesAsync
I n this Article
Edit
Asynchronously gets a list of candidate words based on the provided phonetic characters in an Input Method Editor
(IME ).

public : IAsyncOperation<IVectorView<Platform::String>> GetLinguisticAlternativesAsync()


IAsyncOperation<IVectorView<winrt::hstring>> GetLinguisticAlternativesAsync() const;
public IAsyncOperation<IReadOnlyList<string>> GetLinguisticAlternativesAsync()

Returns
IAsyncOperation<IReadOnlyList<string>>
A list of candidate words based on the provided phonetic characters in an Input Method Editor (IME ).
Attributes RemoteAsyncAttribute
Additional features and requirements
Device family Windows 10 (introduced v10.0.10586.0)

API contract Windows.Foundation.UniversalApiContract (introduced v2)


TextBox.GetRectFromCharacterIndex TextBox.GetRect
FromCharacterIndex TextBox.GetRectFromCharacterIndex
I n this Article
Edit
Returns a rectangular region for the leading or trailing edge of a character at a specific character index.
public : Rect GetRectFromCharacterIndex(int charIndex, bool trailingEdge)
Rect GetRectFromCharacterIndex(int32_t charIndex, bool trailingEdge) const;
public Rect GetRectFromCharacterIndex(Int32 charIndex, Boolean trailingEdge)

Parameters
charIndex Int32
A zero-based index of the character for which to retrieve the rectangle.
trailingEdge Boolean
true to get the trailing edge; false to get the leading edge of the character.
Returns
Rect
A rectangle for the edge of the character at the specified index.

Examples
This example shows how to use GetRectFromCharacterIndex to determine the rectangle for the selected text. For the
complete example, see Scenario 2 of the ContextMenu sample.
// Returns a rect for selected text.
// If no text is selected, returns caret location.
// Text box should not be empty.
private Rect GetTextboxSelectionRect(TextBox textbox)
{
Rect rectFirst, rectLast;
if (textbox.SelectionStart == textbox.Text.Length)
{
rectFirst = textbox.GetRectFromCharacterIndex(textbox.SelectionStart - 1, true);
}
else
{
rectFirst = textbox.GetRectFromCharacterIndex(textbox.SelectionStart, false);
}

int lastIndex = textbox.SelectionStart + textbox.SelectionLength;


if (lastIndex == textbox.Text.Length)
{
rectLast = textbox.GetRectFromCharacterIndex(lastIndex - 1, true);
}
else
{
rectLast = textbox.GetRectFromCharacterIndex(lastIndex, false);
}

GeneralTransform buttonTransform = textbox.TransformToVisual(null);


Point point = buttonTransform.TransformPoint(new Point());

// Make sure that we return a valid rect if selection is on multiple lines


// and end of the selection is to the left of the start of the selection.
double x, y, dx, dy;
y = point.Y + rectFirst.Top;
dy = rectLast.Bottom - rectFirst.Top;
if (rectLast.Right > rectFirst.Left)
{
x = point.X + rectFirst.Left;
dx = rectLast.Right - rectFirst.Left;
}
else
{
x = point.X + rectLast.Right;
dx = rectFirst.Left - rectLast.Right;
}

return new Rect(x, y, dx, dy);


}

Remarks
To override the context menu, you can handle the ContextMenuOpening event and replace the default menu with a
custom menu. Use GetRectFromCharacterIndex to determine where to position the custom menu. For an example of
this, see Scenario 2 of the ContextMenu sample. For design info, see Guidelines for context menus.
Because this method returns a rectangle that represents a character edge, the width of the rectangle that's returned is
always 0. To get the width of a character, you must subtract the X value of the leading Rect from the X value of the
trailing Rect.
TextBox.HandwritingView TextBox.HandwritingView Text
Box.HandwritingView
I n this Article
Edit
Gets or sets the HandwritingView associated with this text control.
public : HandwritingView HandwritingView { get; set; }
HandwritingView HandwritingView();

void HandwritingView(HandwritingView handwritingview);


public HandwritingView HandwritingView { get; set; }

Returns
HandwritingView
The HandwritingView associated with this text control.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

See Text input with the handwriting view


Also
TextBox.HandwritingViewProperty TextBox.Handwriting
ViewProperty TextBox.HandwritingViewProperty
I n this Article
Edit
Identifies the HandwritingView dependency property.
public : static DependencyProperty HandwritingViewProperty { get; }
static DependencyProperty HandwritingViewProperty();
public static DependencyProperty HandwritingViewProperty { get; }

Returns
DependencyProperty
The identifier for the HandwritingView dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


TextBox.Header TextBox.Header TextBox.Header
I n this Article
Edit
Gets or sets the content for the control's header.

public : Platform::Object Header { get; set; }


winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<TextBox Header="headerString"/>

Returns
object
The content of the control's header. The default is null.

Remarks
You can set a data template for the Header by using the HeaderTemplate property.
TextBox.HeaderProperty TextBox.HeaderProperty TextBox.
HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
TextBox.HeaderTemplate TextBox.HeaderTemplate Text
Box.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the control's header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<TextBox>
<TextBox.HeaderTemplate>
singleDataTemplate
</TextBox.HeaderTemplate>
</TextBox>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
TextBox.HeaderTemplateProperty TextBox.Header
TemplateProperty TextBox.HeaderTemplateProperty
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
TextBox.HorizontalTextAlignment TextBox.HorizontalText
Alignment TextBox.HorizontalTextAlignment
I n this Article
Edit
Gets or sets a value that indicates how text is aligned in the TextBox.
public : TextAlignment HorizontalTextAlignment { get; set; }
TextAlignment HorizontalTextAlignment();

void HorizontalTextAlignment(TextAlignment horizontaltextalignment);


public TextAlignment HorizontalTextAlignment { get; set; }

<TextBox HorizontalTextAlignment="textAlignmentValue"/>

Returns
TextAlignment
One of the TextAlignment enumeration values that specifies how text is aligned. The default is Left.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)

Remarks
This property provides the same functionality as the TextAlignment property. If both properties are set to conflicting
values, the last one set is used.
Apps that target the Fall Creators Update (SDK 16299) or later should use this property instead of TextAlignment. If
your app also supports previous versions, see Version adaptive apps: Use new APIs while maintaining compatibility
with previous versions for more info.
TextBox.HorizontalTextAlignmentProperty TextBox.
HorizontalTextAlignmentProperty TextBox.HorizontalText
AlignmentProperty
I n this Article
Edit
Identifies the HorizontalTextAlignment dependency property.
public : static DependencyProperty HorizontalTextAlignmentProperty { get; }
static DependencyProperty HorizontalTextAlignmentProperty();
public static DependencyProperty HorizontalTextAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalTextAlignment dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


TextBox.InputScope TextBox.InputScope TextBox.Input
Scope
I n this Article
Edit
Gets or sets the context for input used by this TextBox.
public : InputScope InputScope { get; set; }
InputScope InputScope();

void InputScope(InputScope inputscope);


public InputScope InputScope { get; set; }

<TextBox InputScope="inputScopeName" .../>

Returns
InputScope
The input scope, which provides a hint at the type of text input expected by the control.

Examples
Here's how to set the InputScope in XAML and in code.
<TextBox Header="Telephone Number" InputScope="TelephoneNumber"/>

TextBox phoneNumberTextBox = new TextBox();


phoneNumberTextBox.Header="Telephone Number";

InputScope scope = new InputScope();


InputScopeName scopeName = new InputScopeName();
scopeName.NameValue = InputScopeNameValue.TelephoneNumber;
scope.Names.Add(scopeName);
phoneNumberTextBox.InputScope = scope;

Remarks
The input scope provides a hint at the type of text input expected by the control. Various elements of the system can
respond to the hint provided by the input scope and provide a specialized UI for the input type. For example, the touch
keyboard might show a number pad for text input when the control has its InputScope set to Number.
The control might also interpret the data being entered differently (typically for East Asian related input scopes). The
input scope does not perform any validation, and does not prevent the user from providing any input through a
hardware keyboard or other input device.
Other properties that affect the touch keyboard are IsSpellCheckEnabled, IsTextPredictionEnabled, and
PreventKeyboardDisplayOnProgrammaticFocus. For more info and examples, see Use input scope to change the touch
keyboard.
Note

While this property can hold a collection of InputeNameScope values, only the first is used, and the rest are ignored.
See Use input scope to change the touch keyboard
Also
TextBox.InputScopeProperty TextBox.InputScopeProperty
TextBox.InputScopeProperty
I n this Article
Edit
Identifies the InputScope dependency property.
public : static DependencyProperty InputScopeProperty { get; }
static DependencyProperty InputScopeProperty();
public static DependencyProperty InputScopeProperty { get; }

Returns
DependencyProperty
The identifier for the InputScope dependency property.
TextBox.IsColorFontEnabled TextBox.IsColorFontEnabled
TextBox.IsColorFontEnabled
I n this Article
Edit
Gets or sets a value that determines whether font glyphs that contain color layers, such as Segoe UI Emoji, are
rendered in color.
public : Platform::Boolean IsColorFontEnabled { get; set; }
bool IsColorFontEnabled();

void IsColorFontEnabled(bool iscolorfontenabled);


public bool IsColorFontEnabled { get; set; }

<TextBox IsColorFontEnabled="bool" />

Returns
bool
true if color glyphs show in color; otherwise, false. The default is true.

Remarks
Windows 8.1 introduces the ability for fonts to include multiple colored layers for each glyph. For example, the Segoe
UI Emoji font defines color versions of the Emoticon and other Emoji characters. By default, the IsColorFontEnabled
property is true and fonts with these additional layers are rendered in color.
In Windows 8, Extensible Application Markup Language (XAML ) text controls don't render multi-color fonts in color.
When an app that was compiled for Windows 8 is recompiled for Windows 8.1, color rendering of multi-color fonts is
enabled by default. Some glyphs in multi-color fonts have different layout metrics when rendered in color. This could
cause different layout in apps when they are recompiled for Windows 8.1. To retain the Windows 8 behavior when
your app is recompiled for Windows 8.1, set IsColorFontEnabled to false.
TextBox.IsColorFontEnabledProperty TextBox.IsColorFont
EnabledProperty TextBox.IsColorFontEnabledProperty
I n this Article
Edit
Identifies the IsColorFontEnabled dependency property.
public : static DependencyProperty IsColorFontEnabledProperty { get; }
static DependencyProperty IsColorFontEnabledProperty();
public static DependencyProperty IsColorFontEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsColorFontEnabled dependency property.
TextBox.IsHandwritingViewEnabled TextBox.IsHandwriting
ViewEnabled TextBox.IsHandwritingViewEnabled
I n this Article
Edit
Gets or sets a value that indicates whether a user can enter text in the handwriting view.
public : Platform::Boolean IsHandwritingViewEnabled { get; set; }
bool IsHandwritingViewEnabled();

void IsHandwritingViewEnabled(bool ishandwritingviewenabled);


public bool IsHandwritingViewEnabled { get; set; }

Returns
bool
true to allow the user to enter text in the handwriting view; otherwise, false.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)

Examples
In this example, we disable the handwriting view by setting the IsHandwritingViewEnabled property of the TextBox
control to false. All text controls that support the handwriting view support a similar property.
<TextBox Name="SampleTextBox"
Height="50" Width="500"
FontSize="36" FontFamily="Segoe UI"
PlaceholderText="Try taping with your pen"
IsHandwritingViewEnabled="False">
</TextBox>

Remarks
When a user taps into a text input box using a Windows pen, the text box transforms to let the user write directly into it
with a pen, rather than opening a separate input panel.

See Text input with the handwriting view


Also
TextBox.IsHandwritingViewEnabledProperty TextBox.Is
HandwritingViewEnabledProperty TextBox.IsHandwriting
ViewEnabledProperty
I n this Article
Edit
Identifies the IsHandwritingViewEnabled dependency property.
public : static DependencyProperty IsHandwritingViewEnabledProperty { get; }
static DependencyProperty IsHandwritingViewEnabledProperty();
public static DependencyProperty IsHandwritingViewEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsHandwritingViewEnabled dependency property.
Additional features and requirements
Device family Windows 10, version 1803 (introduced v10.0.17134.0)

API contract Windows.Foundation.UniversalApiContract (introduced v6)


TextBox.IsReadOnly TextBox.IsReadOnly TextBox.IsRead
Only
I n this Article
Edit
Gets or sets the value that determines if the user can change the text in the text box.
public : Platform::Boolean IsReadOnly { get; set; }
bool IsReadOnly();

void IsReadOnly(bool isreadonly);


public bool IsReadOnly { get; set; }

<TextBox IsReadOnly="bool"/>

Returns
bool
true if the text box is read-only; otherwise, false. The default is false.

Remarks
The default control template for TextBox has a visual state that tracks whether the TextBox is read-only. If the TextBox is
read-only, it appears in a gray color in most themes. This also tracks if Control.IsEnabled is false.
See IsEnabled
Also
TextBox.IsReadOnlyProperty TextBox.IsReadOnlyProperty
TextBox.IsReadOnlyProperty
I n this Article
Edit
Identifies the IsReadOnly dependency property.
public : static DependencyProperty IsReadOnlyProperty { get; }
static DependencyProperty IsReadOnlyProperty();
public static DependencyProperty IsReadOnlyProperty { get; }

Returns
DependencyProperty
The identifier for the IsReadOnly dependency property.
TextBox.IsSpellCheckEnabled TextBox.IsSpellCheck
Enabled TextBox.IsSpellCheckEnabled
I n this Article
Edit
Gets or sets a value that specifies whether the TextBox input interacts with a spell check engine.
public : Platform::Boolean IsSpellCheckEnabled { get; set; }
bool IsSpellCheckEnabled();

void IsSpellCheckEnabled(bool isspellcheckenabled);


public bool IsSpellCheckEnabled { get; set; }

<TextBox IsSpellCheckEnabled="bool" />

Returns
bool
true if the TextBox input interacts with a spell check engine; otherwise, false. The default is true.

Remarks
When using the Soft Input Panel (SIP ), this property enables the following features:
auto-cap (Mobile only)
spell check
auto-correction
spelling candidates on-demand when the user taps on a misspelled word

Windows 8 For Universal Windows 8 app, the default is false.

See Touch keyboard text input sample (Windows 10)


Also
TextBox.IsSpellCheckEnabledProperty TextBox.IsSpell
CheckEnabledProperty TextBox.IsSpellCheckEnabled
Property
I n this Article
Edit
Identifies the IsSpellCheckEnabled dependency property.
public : static DependencyProperty IsSpellCheckEnabledProperty { get; }
static DependencyProperty IsSpellCheckEnabledProperty();
public static DependencyProperty IsSpellCheckEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsSpellCheckEnabled dependency property.
TextBox.IsTextPredictionEnabled TextBox.IsTextPrediction
Enabled TextBox.IsTextPredictionEnabled
I n this Article
Edit
Gets or sets a value that determines whether text prediction features ("autocomplete") should be enabled for this
TextBox.
public : Platform::Boolean IsTextPredictionEnabled { get; set; }
bool IsTextPredictionEnabled();

void IsTextPredictionEnabled(bool istextpredictionenabled);


public bool IsTextPredictionEnabled { get; set; }

<TextBox IsTextPredictionEnabled="bool" />

Returns
bool
true to enable text prediction features, otherwise, false. The default is true.

Remarks
Text prediction is not enabled if the user is using a physical keyboard device.
Text prediction is built-in for theTextBox control, using language-specific dictionaries. Setting the value to true doesn't
automatically enable the feature on a custom class.
This property doesn't affect Input Method Editor (IME ) for Japanese or Chinese languages. Text prediction for these
languages is shown even if this property is false.
See Touch keyboard text input sample (Windows 10)
Also
TextBox.IsTextPredictionEnabledProperty TextBox.IsText
PredictionEnabledProperty TextBox.IsTextPrediction
EnabledProperty
I n this Article
Edit
Identifies the IsTextPredictionEnabled dependency property.
public : static DependencyProperty IsTextPredictionEnabledProperty { get; }
static DependencyProperty IsTextPredictionEnabledProperty();
public static DependencyProperty IsTextPredictionEnabledProperty { get; }

Returns
DependencyProperty
The identifier for the IsTextPredictionEnabled dependency property.
TextBox.MaxLength TextBox.MaxLength TextBox.Max
Length
I n this Article
Edit
Gets or sets the value that specifies the maximum number of characters allowed for user input.
public : int MaxLength { get; set; }
int32_t MaxLength();

void MaxLength(int32_t maxlength);


public int MaxLength { get; set; }

<TextBox MaxLength="int"/>

Returns
int
The maximum number of characters allowed for user input. The default is 0 (no limit).

Remarks
A MaxLength value of 0 specifies that there is no limit on the number of characters allowed for user input.
TextBox.MaxLengthProperty TextBox.MaxLengthProperty
TextBox.MaxLengthProperty
I n this Article
Edit
Identifies the MaxLength dependency property.
public : static DependencyProperty MaxLengthProperty { get; }
static DependencyProperty MaxLengthProperty();
public static DependencyProperty MaxLengthProperty { get; }

Returns
DependencyProperty
The identifier for the MaxLength dependency property.
TextBox.Paste TextBox.Paste TextBox.Paste
I n this Article
Edit
Occurs when text is pasted into the control.

public : event TextControlPasteEventHandler Paste


// Register
event_token Paste(TextControlPasteEventHandler const& handler) const;

// Revoke with event_token


void Paste(event_token const& cookie) const;

// Revoke with event_revoker


Paste_revoker Paste(auto_revoke_t, TextControlPasteEventHandler const& handler) const;
public event TextControlPasteEventHandler Paste

<TextBox Paste="eventhandler"/>

Examples
This example shows how to handle the Paste event to replace line breaks with commas when pasting into an address
field. Otherwise, pasting an address copied from multiple lines would cause data loss.
<TextBox Header="Address" Paste="AddressTextBox_Paste"/>
private async void AddressTextBox_Paste(object sender, TextControlPasteEventArgs e)
{
TextBox addressBox = sender as TextBox;
if (addressBox != null)
{
// Mark the event as handled first. Otherwise, the
// default paste action will happen, then the custom paste
// action, and the user will see the text box content change.
e.Handled = true;

// Get content from the clipboard.


var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent();
if
(dataPackageView.Contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.Text))
{
try
{
var text = await dataPackageView.GetTextAsync();

// Remove line breaks from multi-line text and


// replace with comma(,).
string singleLineText = text.Replace("\r\n", ", ");

// Replace any text currently in the text box.


addressBox.Text = singleLineText;
}
catch (Exception)
{
// Ignore or handle exception as needed.
}
}
}
}

This example shows how to handle the Paste event to limit the number of characters pasted into the TextBox. If the
length of the text on the clipboard exceeds the MaxLength of the TextBox, a message is shown to the user. The user has
the option to continue with the text truncated, or cancel the paste operation.

<TextBox Paste="TextBox_Paste" MaxLength="10"/>


private async void TextBox_Paste(object sender, TextControlPasteEventArgs e)
{
TextBox tb = sender as TextBox;
if (tb != null)
{
// Mark the event as handled first. Otherwise, the
// default paste action will happen, then the custom paste
// action, and the user will see the text box content change.
e.Handled = true;

// Get content from the clipboard.


var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.GetContent();
if
(dataPackageView.Contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.Text))
{
try
{
var text = await dataPackageView.GetTextAsync();
if (text.Length > tb.MaxLength)
{
// Pasted text is too long. Show a message to the user.
// Create the message dialog and set its content
var messageDialog =
new Windows.UI.Popups.MessageDialog(
"Pasted text excedes maximum allowed ("
+ tb.MaxLength.ToString() +
" characters). The text will be truncated.");

// Add commands to the message dialog.


messageDialog.Commands.Add(new UICommand("Continue", (command) =>
{
// Truncate the text to be pasted to the MaxLength of the text box.
string truncatedText = text.Substring(0, tb.MaxLength);
tb.Text = truncatedText;
}));
messageDialog.Commands.Add(new UICommand("Cancel", (command) =>
{
// Cancelled. Do nothing.
}));

// Set the command that will be invoked by default.


messageDialog.DefaultCommandIndex = 0;

// Set the command to be invoked when escape is pressed.


messageDialog.CancelCommandIndex = 1;

// Show the message dialog.


await messageDialog.ShowAsync();
}
else
{
tb.Text = text;
}
}
catch (Exception)
{
// Ignore or handle exception as needed.
}
}
}
}

Remarks
The Paste event occurs before any content is inserted into the control. You can handle this event to check the contents
of the clipboard and perform any actions on the content before it's inserted. If you perform any action, set the Handled
property of the event args to true; otherwise, the default paste action is performed. If you mark the event as handled,
then it's assumed the app has handled the paste operation, and no default action is performed. You are responsible for
determining the insertion point and clipboard content to insert, and inserting the content.
You should set the Handled property to true in your handler before the code to perform a custom paste action.
Otherwise, the default paste action is performed, and then the custom action is performed. The user can see the
content changing in the TextBox.
TextBox.PasteFromClipboard TextBox.PasteFromClipboard
TextBox.PasteFromClipboard
I n this Article
Edit
Copies content from the Windows clipboard into the text control.
public : void PasteFromClipboard()
void PasteFromClipboard() const;
public void PasteFromClipboard()

Additional features and requirements


Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.PlaceholderForeground TextBox.Placeholder
Foreground TextBox.PlaceholderForeground
I n this Article
Edit
Gets or sets a brush that describes the color of placeholder text.
public : Brush PlaceholderForeground { get; set; }
Brush PlaceholderForeground();

void PlaceholderForeground(Brush placeholderforeground);


public Brush PlaceholderForeground { get; set; }

<TextBox PlaceholderForeground="{StaticResource resourceName}"/>

Returns
Brush
The brush that describes the color of placeholder text.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


TextBox.PlaceholderForegroundProperty TextBox.
PlaceholderForegroundProperty TextBox.Placeholder
ForegroundProperty
I n this Article
Edit
Identifies the PlaceholderForeground dependency property.
public : static DependencyProperty PlaceholderForegroundProperty { get; }
static DependencyProperty PlaceholderForegroundProperty();
public static DependencyProperty PlaceholderForegroundProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderForeground dependency property.
Additional features and requirements
Device family Windows 10 Fall Creators Update (introduced v10.0.16299.0)

API contract Windows.Foundation.UniversalApiContract (introduced v5)


TextBox.PlaceholderText TextBox.PlaceholderText TextBox.
PlaceholderText
I n this Article
Edit
Gets or sets the text that is displayed in the control until the value is changed by a user action or some other operation.
public : Platform::String PlaceholderText { get; set; }
winrt::hstring PlaceholderText();

void PlaceholderText(winrt::hstring placeholdertext);


public string PlaceholderText { get; set; }

<TextBox PlaceholderText="placeholderString"/>

Returns
string
The text that is displayed in the control when no value is entered. The default is an empty string ("").
TextBox.PlaceholderTextProperty TextBox.PlaceholderText
Property TextBox.PlaceholderTextProperty
I n this Article
Edit
Identifies the PlaceholderText dependency property.
public : static DependencyProperty PlaceholderTextProperty { get; }
static DependencyProperty PlaceholderTextProperty();
public static DependencyProperty PlaceholderTextProperty { get; }

Returns
DependencyProperty
The identifier for the PlaceholderText dependency property.
TextBox.PreventKeyboardDisplayOnProgrammaticFocus
TextBox.PreventKeyboardDisplayOnProgrammaticFocus
TextBox.PreventKeyboardDisplayOnProgrammaticFocus
I n this Article
Edit
Gets or sets a value that indicates whether the on-screen keyboard is shown when the control receives focus
programmatically.
public : Platform::Boolean PreventKeyboardDisplayOnProgrammaticFocus { get; set; }
bool PreventKeyboardDisplayOnProgrammaticFocus();

void PreventKeyboardDisplayOnProgrammaticFocus(bool preventkeyboarddisplayonprogrammaticfocus);


public bool PreventKeyboardDisplayOnProgrammaticFocus { get; set; }

<TextBox PreventKeyboardDisplayOnProgrammaticFocus="bool"/>

Returns
bool
true if the on-screen keyboard is not shown when the control receives focus programmatically; otherwise, false. The
default is false.

Remarks
Set this property to true to prevent the onscreen touch keyboard from showing when focus is programmatically set on
a text box. By default, the onscreen touch keyboard is displayed whenever focus moves to an editable text box and the
most recent input was generated by touch. This happens whether focus is set programmatically or by user interaction.
In some situations, you might not want the keyboard to show when focus is set programmatically. For example, you
might want to prevent the keyboard from covering part of your UI until the user is ready to continue their interaction.
TextBox.PreventKeyboardDisplayOnProgrammaticFocus
Property TextBox.PreventKeyboardDisplayOn
ProgrammaticFocusProperty TextBox.PreventKeyboard
DisplayOnProgrammaticFocusProperty
I n this Article
Edit
Identifies the PreventKeyboardDisplayOnProgrammaticFocus dependency property.
public : static DependencyProperty PreventKeyboardDisplayOnProgrammaticFocusProperty { get; }
static DependencyProperty PreventKeyboardDisplayOnProgrammaticFocusProperty();
public static DependencyProperty PreventKeyboardDisplayOnProgrammaticFocusProperty { get; }

Returns
DependencyProperty
The identifier for the PreventKeyboardDisplayOnProgrammaticFocus dependency property.
TextBox.ProofingMenuFlyout TextBox.ProofingMenuFlyout
TextBox.ProofingMenuFlyout
I n this Article
Edit
Gets the flyout that shows proofing commands.
public : FlyoutBase ProofingMenuFlyout { get; }
FlyoutBase ProofingMenuFlyout();
public FlyoutBase ProofingMenuFlyout { get; }

Returns
FlyoutBase
The flyout that shows proofing commands.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.ProofingMenuFlyoutProperty TextBox.Proofing
MenuFlyoutProperty TextBox.ProofingMenuFlyout
Property
I n this Article
Edit
Identifies the ProofingMenuFlyout dependency property.
public : static DependencyProperty ProofingMenuFlyoutProperty { get; }
static DependencyProperty ProofingMenuFlyoutProperty();
public static DependencyProperty ProofingMenuFlyoutProperty { get; }

Returns
DependencyProperty
The identifier for the ProofingMenuFlyout dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.Redo TextBox.Redo TextBox.Redo
I n this Article
Edit
Reapplies the first action in the redo buffer.

public : void Redo()


void Redo() const;
public void Redo()

Additional features and requirements


Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.Select TextBox.Select TextBox.Select
I n this Article
Edit
Selects a range of text in the text box.

public : void Select(int start, int length)


void Select(int32_t start, int32_t length) const;
public void Select(Int32 start, Int32 length)

Parameters
start Int32
The zero-based index of the first character in the selection.
length Int32
The length of the selection, in characters.
TextBox.SelectAll TextBox.SelectAll TextBox.SelectAll
I n this Article
Edit
Selects the entire contents of the text box.

public : void SelectAll()


void SelectAll() const;
public void SelectAll()
TextBox.SelectedText TextBox.SelectedText TextBox.
SelectedText
I n this Article
Edit
Gets or sets the content of the current selection in the text box.
public : Platform::String SelectedText { get; set; }
winrt::hstring SelectedText();

void SelectedText(winrt::hstring selectedtext);


public string SelectedText { get; set; }

<TextBox SelectedText="string"/>

Returns
string
The currently selected text in the text box. If no text is selected, the value is String.Empty.
TextBox.SelectionChanged TextBox.SelectionChanged
TextBox.SelectionChanged
I n this Article
Edit
Occurs when the text selection has changed.
public : event RoutedEventHandler SelectionChanged
// Register
event_token SelectionChanged(RoutedEventHandler const& handler) const;

// Revoke with event_token


void SelectionChanged(event_token const& cookie) const;

// Revoke with event_revoker


SelectionChanged_revoker SelectionChanged(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler SelectionChanged

<TextBox SelectionChanged="eventhandler"/>
TextBox.SelectionChanging TextBox.SelectionChanging
TextBox.SelectionChanging
I n this Article
Edit
Occurs when the text selection starts to change.
public : event TypedEventHandler<TextBox, TextBoxSelectionChangingEventArgs> SelectionChanging
// Register
event_token SelectionChanging(TypedEventHandler<TextBox, TextBoxSelectionChangingEventArgs> const&
handler) const;

// Revoke with event_token


void SelectionChanging(event_token const& cookie) const;

// Revoke with event_revoker


SelectionChanging_revoker SelectionChanging(auto_revoke_t, TypedEventHandler<TextBox,
TextBoxSelectionChangingEventArgs> const& handler) const;
public event TypedEventHandler<TextBox, TextBoxSelectionChangingEventArgs> SelectionChanging

<TextBox SelectionChanging="eventhandler"/>
TextBox.SelectionFlyout TextBox.SelectionFlyout TextBox.
SelectionFlyout
I n this Article
Edit
Gets or sets the flyout that is shown when text is selected, or null if no flyout is shown.
public : FlyoutBase SelectionFlyout { get; set; }
FlyoutBase SelectionFlyout();

void SelectionFlyout(FlyoutBase selectionflyout);


public FlyoutBase SelectionFlyout { get; set; }

Returns
FlyoutBase
The flyout that is shown when text is selected, or null if no flyout is shown. The default is an instance of
TextCommandBarFlyout.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.SelectionFlyoutProperty TextBox.SelectionFlyout
Property TextBox.SelectionFlyoutProperty
I n this Article
Edit
Identifies the SelectionFlyout dependency property.
public : static DependencyProperty SelectionFlyoutProperty { get; }
static DependencyProperty SelectionFlyoutProperty();
public static DependencyProperty SelectionFlyoutProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionFlyout dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBox.SelectionHighlightColor TextBox.Selection
HighlightColor TextBox.SelectionHighlightColor
I n this Article
Edit
Gets or sets the brush used to highlight the selected text.
public : SolidColorBrush SelectionHighlightColor { get; set; }
SolidColorBrush SelectionHighlightColor();

void SelectionHighlightColor(SolidColorBrush selectionhighlightcolor);


public SolidColorBrush SelectionHighlightColor { get; set; }

<TextBox SelectionHighlightColor="{StaticResource resourceName}"/>

Returns
SolidColorBrush
The brush used to highlight the selected text. The practical default is a brush using the theme resource
TextSelectionHighlightThemeColor.

Remarks
The control template sets the default selection highlight color to the system resource
TextSelectionHighlightColorThemeBrush. To change the selection highlight color for all editable text controls in
your app, you can override the TextSelectionHighlightColorThemeBrush system resource in App.xaml. This will
affect PasswordBox, TextBox, and RichEditBox controls.
See Use brushes
Also
TextBox.SelectionHighlightColorProperty TextBox.
SelectionHighlightColorProperty TextBox.Selection
HighlightColorProperty
I n this Article
Edit
Identifies the SelectionHighlightColor dependency property.
public : static DependencyProperty SelectionHighlightColorProperty { get; }
static DependencyProperty SelectionHighlightColorProperty();
public static DependencyProperty SelectionHighlightColorProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionHighlightColor dependency property.
TextBox.SelectionHighlightColorWhenNotFocused Text
Box.SelectionHighlightColorWhenNotFocused TextBox.
SelectionHighlightColorWhenNotFocused
I n this Article
Edit
Gets or sets the brush used to highlight the selected text when the TextBox does not have focus.
public : SolidColorBrush SelectionHighlightColorWhenNotFocused { get; set; }
SolidColorBrush SelectionHighlightColorWhenNotFocused();

void SelectionHighlightColorWhenNotFocused(SolidColorBrush selectionhighlightcolorwhennotfocused);


public SolidColorBrush SelectionHighlightColorWhenNotFocused { get; set; }

<TextBox SelectionHighlightColorWhenNotFocused="{StaticResource resourceName}"/>

Returns
SolidColorBrush
The brush used to highlight the selected text when TextBox loses focus. The default is a null brush from a pure code
perspective, but the default control template for TextBox applies a Transparent brush for this in a runtime instance of a
TextBox control. To disable the SelectionHighlightColorWhenNotFocused, set the brush to Transparent once again.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


TextBox.SelectionHighlightColorWhenNotFocused
Property TextBox.SelectionHighlightColorWhenNot
FocusedProperty TextBox.SelectionHighlightColorWhen
NotFocusedProperty
I n this Article
Edit
Identifies the SelectionHighlightColorWhenNotFocused dependency property.
public : static DependencyProperty SelectionHighlightColorWhenNotFocusedProperty { get; }
static DependencyProperty SelectionHighlightColorWhenNotFocusedProperty();
public static DependencyProperty SelectionHighlightColorWhenNotFocusedProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionHighlightColorWhenNotFocused dependency property.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)


TextBox.SelectionLength TextBox.SelectionLength TextBox.
SelectionLength
I n this Article
Edit
Gets or sets the number of characters in the current selection in the text box.
public : int SelectionLength { get; set; }
int32_t SelectionLength();

void SelectionLength(int32_t selectionlength);


public int SelectionLength { get; set; }

<TextBox SelectionLength="int"/>

Returns
int
The number of characters in the current selection in the text box, or 0 if there is no selection.
TextBox.SelectionStart TextBox.SelectionStart TextBox.
SelectionStart
I n this Article
Edit
Gets or sets the starting position of the text selected in the text box. When the SelectionLength is 0 (there is no selected
text), the SelectionStart property corresponds to the cursor position.
public : int SelectionStart { get; set; }
int32_t SelectionStart();

void SelectionStart(int32_t selectionstart);


public int SelectionStart { get; set; }

<TextBox SelectionStart="int"/>

Returns
int
The starting position of the current selection or the current cursor position.
TextBox.Text TextBox.Text TextBox.Text
I n this Article
Edit
Gets or sets the text contents of the text box.

public : Platform::String Text { get; set; }


winrt::hstring Text();

void Text(winrt::hstring text);


public string Text { get; set; }

<TextBox Text="string"/>

Returns
string
A string containing the text contents of the text box. The default is an empty string ("").
TextBox.TextAlignment TextBox.TextAlignment TextBox.Text
Alignment
I n this Article
Edit
Gets or sets how the text should be horizontally aligned in the text box.
public : TextAlignment TextAlignment { get; set; }
TextAlignment TextAlignment();

void TextAlignment(TextAlignment textalignment);


public TextAlignment TextAlignment { get; set; }

<TextBox TextAlignment="textAlignmentMemberName"/>

Returns
TextAlignment
One of the TextAlignment enumeration values. The default is Left.
TextBox.TextAlignmentProperty TextBox.TextAlignment
Property TextBox.TextAlignmentProperty
I n this Article
Edit
Identifies the TextAlignment dependency property.
public : static DependencyProperty TextAlignmentProperty { get; }
static DependencyProperty TextAlignmentProperty();
public static DependencyProperty TextAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the TextAlignment dependency property.
TextBox TextBox TextBox
I n this Article
Edit
Initializes a new instance of the TextBox class.

public : TextBox()
TextBox() const;
public TextBox()
TextBox.TextChanged TextBox.TextChanged TextBox.Text
Changed
I n this Article
Edit
Occurs when content changes in the text box.
public : event TextChangedEventHandler TextChanged
// Register
event_token TextChanged(TextChangedEventHandler const& handler) const;

// Revoke with event_token


void TextChanged(event_token const& cookie) const;

// Revoke with event_revoker


TextChanged_revoker TextChanged(auto_revoke_t, TextChangedEventHandler const& handler) const;
public event TextChangedEventHandler TextChanged

<TextBox TextChanged="eventhandler"/>
TextBox.TextChanging TextBox.TextChanging TextBox.Text
Changing
I n this Article
Edit
Occurs synchronously when the text in the text box starts to change, but before it is rendered.
public : event TypedEventHandler<TextBox, TextBoxTextChangingEventArgs> TextChanging
// Register
event_token TextChanging(TypedEventHandler<TextBox, TextBoxTextChangingEventArgs> const& handler)
const;

// Revoke with event_token


void TextChanging(event_token const& cookie) const;

// Revoke with event_revoker


TextChanging_revoker TextChanging(auto_revoke_t, TypedEventHandler<TextBox,
TextBoxTextChangingEventArgs> const& handler) const;
public event TypedEventHandler<TextBox, TextBoxTextChangingEventArgs> TextChanging

<TextBox TextChanging="eventhandler"/>

Examples
This example shows how to handle the TextChanging event to implement simple auto-complete for a TextBox.
<!-- Text box in MainPage.xaml -->
<TextBox x:Name="textBox" TextChanging="textBox_TextChanging"
Width="200" Height="32"/>
public sealed partial class MainPage : Page
{
// Boolean to keep track of whether or not you should ignore the next TextChanged event.
// This is needed to support the correct behavior when backspace is tapped.
public bool m_ignoreNextTextChanged = false;

// Sample list of strings to use in the autocomplete.


public string[] m_options = { "microsoft.com", "dev.windows.com", "msn.com", "office.com",
"msdn.microsoft.com" };

public MainPage()
{
this.InitializeComponent();
}

private void textBox_TextChanging(TextBox sender, TextBoxTextChangingEventArgs args)


{
// Needed for the backspace scenario.
if (m_ignoreNextTextChanged)
{
m_ignoreNextTextChanged = false;
return;
}
// All other scenarios other than the backspace scenario.
// Do the auto complete.
else
{
string s = textBox.Text;
if (s.Length > 0)
{
for (int i = 0; i < m_options.Length; i++)
{
if (m_options[i].IndexOf(s) >= 0)
{
if (s == m_options[i])
break;

textBox.Text = m_options[i];
textBox.Select(s.Length, m_options[i].Length - s.Length);
break;
}
}
}
}
}

protected override void OnKeyDown(KeyRoutedEventArgs e)


{
if (e.Key == Windows.System.VirtualKey.Back
|| e.Key == Windows.System.VirtualKey.Delete)
{
m_ignoreNextTextChanged = true;
}
base.OnKeyDown(e);
}
}

Remarks
For event data, see TextBoxTextChangingEventArgs.
The TextChanging event occurs synchronously before the new text is rendered. In contrast, the TextChanged event is
asynchronous and occurs after the new text is rendered.
When the TextChanging event occurs, the Text property already reflects the new value (but it's not rendered in the UI).
You typically handle this event to update the Text value and selection before the text is rendered. This prevents the text
flickering that can happen when text is rendered, updated, and re-rendered rapidly.
Note

This is a synchronous event that can occur at times when changes to the XAML visual tree are not allowed, such as
during layout. Therefore, you should limit code within the TextChanging event handler primarily to inspecting and
updating the Text property. Attempting to perform other actions, such as showing a popup or adding/removing
elements from the visual tree, might cause potentially fatal errors that can lead to a crash. We recommend that you
perform these other changes either in a TextChanged event handler, or run them as a separate asynchronous operation.
TextBox.TextCompositionChanged TextBox.Text
CompositionChanged TextBox.TextCompositionChanged
I n this Article
Edit
Occurs when text being composed through an Input Method Editor (IME ) changes.
public : event TypedEventHandler<TextBox, TextCompositionChangedEventArgs> TextCompositionChanged
// Register
event_token TextCompositionChanged(TypedEventHandler<TextBox, TextCompositionChangedEventArgs>
const& handler) const;

// Revoke with event_token


void TextCompositionChanged(event_token const& cookie) const;

// Revoke with event_revoker


TextCompositionChanged_revoker TextCompositionChanged(auto_revoke_t, TypedEventHandler<TextBox,
TextCompositionChangedEventArgs> const& handler) const;
public event TypedEventHandler<TextBox, TextCompositionChangedEventArgs> TextCompositionChanged

<TextBox TextCompositionChanged="eventhandler"/>

Remarks
For event data, see TextCompositionChangedEventArgs.
This event occurs only when text is composed through an Input Method Editor (IME ). Text composition events occur in
the following order:
TextCompositionStarted
TextChanging
TextChanged
TextCompositionChanged
TextCompositionEnded
After the TextCompositionStarted event, the TextChanging > TextChanged > TextCompositionChanged event cycle can
occur multiple times before the TextCompositionEnded event occurs.
See Input Method Editor (IME )
Also
TextBox.TextCompositionEnded TextBox.TextComposition
Ended TextBox.TextCompositionEnded
I n this Article
Edit
Occurs when a user stops composing text through an Input Method Editor (IME ).
public : event TypedEventHandler<TextBox, TextCompositionEndedEventArgs> TextCompositionEnded
// Register
event_token TextCompositionEnded(TypedEventHandler<TextBox, TextCompositionEndedEventArgs> const&
handler) const;

// Revoke with event_token


void TextCompositionEnded(event_token const& cookie) const;

// Revoke with event_revoker


TextCompositionEnded_revoker TextCompositionEnded(auto_revoke_t, TypedEventHandler<TextBox,
TextCompositionEndedEventArgs> const& handler) const;
public event TypedEventHandler<TextBox, TextCompositionEndedEventArgs> TextCompositionEnded

<TextBox TextCompositionEnded="eventhandler"/>

Remarks
For event data, see TextCompositionEndedEventArgs.
This event occurs only when text is composed through an Input Method Editor (IME ). Text composition events occur in
the following order:
TextCompositionStarted
TextChanging
TextChanged
TextCompositionChanged
TextCompositionEnded
After the TextCompositionStarted event, the TextChanging > TextChanged > TextCompositionChanged event cycle can
occur multiple times before the TextCompositionEnded event occurs.
See Input Method Editor (IME )
Also
TextBox.TextCompositionStarted TextBox.TextComposition
Started TextBox.TextCompositionStarted
I n this Article
Edit
Occurs when a user starts composing text through an Input Method Editor (IME ).
public : event TypedEventHandler<TextBox, TextCompositionStartedEventArgs> TextCompositionStarted
// Register
event_token TextCompositionStarted(TypedEventHandler<TextBox, TextCompositionStartedEventArgs>
const& handler) const;

// Revoke with event_token


void TextCompositionStarted(event_token const& cookie) const;

// Revoke with event_revoker


TextCompositionStarted_revoker TextCompositionStarted(auto_revoke_t, TypedEventHandler<TextBox,
TextCompositionStartedEventArgs> const& handler) const;
public event TypedEventHandler<TextBox, TextCompositionStartedEventArgs> TextCompositionStarted

<TextBox TextCompositionStarted="eventhandler"/>

Remarks
For event data, see TextCompositionStartedEventArgs.
This event occurs only when text is composed through an Input Method Editor (IME ). Text composition events occur in
the following order:
TextCompositionStarted
TextChanging
TextChanged
TextCompositionChanged
TextCompositionEnded
After the TextCompositionStarted event, the TextChanging > TextChanged > TextCompositionChanged event cycle can
occur multiple times before the TextCompositionEnded event occurs.
See Input Method Editor (IME )
Also
TextBox.TextProperty TextBox.TextProperty TextBox.Text
Property
I n this Article
Edit
Identifies the Text dependency property.
public : static DependencyProperty TextProperty { get; }
static DependencyProperty TextProperty();
public static DependencyProperty TextProperty { get; }

Returns
DependencyProperty
The identifier for the Text dependency property.
TextBox.TextReadingOrder TextBox.TextReadingOrder Text
Box.TextReadingOrder
I n this Article
Edit
Gets or sets a value that indicates how the reading order is determined for the TextBox.
public : TextReadingOrder TextReadingOrder { get; set; }
TextReadingOrder TextReadingOrder();

void TextReadingOrder(TextReadingOrder textreadingorder);


public TextReadingOrder TextReadingOrder { get; set; }

<TextBox TextReadingOrder="textReadingOrderValue"/>

Returns
TextReadingOrder
A value that indicates how the reading order is determined for the TextBox. The default is DetectFromContent.

Remarks
This property can be useful when the base direction of the text is unknown, and may not match the user's language or
direction. For more info, see the Remarks section of the TextReadingOrder enumeration or How to support
bidirectional UI.
See TextReadingOrder
Also How to support bidirectional UI
TextBox.TextReadingOrderProperty TextBox.TextReading
OrderProperty TextBox.TextReadingOrderProperty
I n this Article
Edit
Identifies the TextReadingOrder dependency property.
public : static DependencyProperty TextReadingOrderProperty { get; }
static DependencyProperty TextReadingOrderProperty();
public static DependencyProperty TextReadingOrderProperty { get; }

Returns
DependencyProperty
The identifier for the TextReadingOrder dependency property.
See Dependency properties overview
Also
TextBox.TextWrapping TextBox.TextWrapping TextBox.Text
Wrapping
I n this Article
Edit
Gets or sets how line breaking occurs if a line of text extends beyond the available width of the text box.
public : TextWrapping TextWrapping { get; set; }
TextWrapping TextWrapping();

void TextWrapping(TextWrapping textwrapping);


public TextWrapping TextWrapping { get; set; }

<TextBlock TextWrapping="Wrap"/>
-or-
<TextBlock TextWrapping="NoWrap"/>

Returns
TextWrapping
One of the TextWrapping values. The default is NoWrap.

Examples
The following example shows how you can use the TextWrapping property in XAML.
<StackPanel>
<TextBox Text="A text box that demonstrates TextWrapping, TextAlignment, MaxLength, and
AcceptsReturn"
TextWrapping="Wrap" TextAlignment="Center"
MaxLength="500" AcceptsReturn="True"
Margin="20,20,0,0" Width="300" Height="50"/>
</StackPanel>

Remarks
TextBox and RichEditBox don't support the WrapWholeWords value for their TextWrapping properties. If you try to
use WrapWholeWords as a value for TextBox.TextWrapping or RichEditBox.TextWrapping, an exception is thrown.
TextBox.TextWrappingProperty TextBox.TextWrapping
Property TextBox.TextWrappingProperty
I n this Article
Edit
Identifies the TextWrapping dependency property.
public : static DependencyProperty TextWrappingProperty { get; }
static DependencyProperty TextWrappingProperty();
public static DependencyProperty TextWrappingProperty { get; }

Returns
DependencyProperty
The identifier for the TextWrapping dependency property.
TextBox.Undo TextBox.Undo TextBox.Undo
I n this Article
Edit
Undoes the first action in the undo buffer.

public : void Undo()


void Undo() const;
public void Undo()

Additional features and requirements


Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TextBoxBeforeTextChangingEventArgs TextBoxBeforeText
ChangingEventArgs TextBoxBeforeTextChangingEvent
Args Class
Provides event data for the TextBox.BeforeTextChanging event.

D eclaration
public : sealed class TextBoxBeforeTextChangingEventArgs : ITextBoxBeforeTextChangingEventArgs
struct winrt::Windows::UI::Xaml::Controls::TextBoxBeforeTextChangingEventArgs :
ITextBoxBeforeTextChangingEventArgs
public sealed class TextBoxBeforeTextChangingEventArgs : ITextBoxBeforeTextChangingEventArgs

I nheritance H ierarchy
None

Remarks
An instance of this class is passed as a parameter to the BeforeTextChanging event handler.

Properties
Cancel
Cancel
Cancel

Gets or sets a value that indicates whether to cancel the text changes.

NewText
NewText
NewText

Gets the new text that is entered into the text box.
TextBoxBeforeTextChangingEventArgs.Cancel TextBox
BeforeTextChangingEventArgs.Cancel TextBoxBeforeText
ChangingEventArgs.Cancel
I n this Article
Edit
Gets or sets a value that indicates whether to cancel the text changes.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
true to cancel the text changes; otherwise, false. The default is false.
TextBoxBeforeTextChangingEventArgs.NewText TextBox
BeforeTextChangingEventArgs.NewText TextBoxBeforeText
ChangingEventArgs.NewText
I n this Article
Edit
Gets the new text that is entered into the text box.
public : Platform::String NewText { get; }
winrt::hstring NewText();
public string NewText { get; }

Returns
string
The new text value that is entered into the text box.
TextBoxSelectionChangingEventArgs TextBoxSelection
ChangingEventArgs TextBoxSelectionChangingEventArgs
Class
Provides event data for the TextBox.SelectionChanging event.

D eclaration
public : sealed class TextBoxSelectionChangingEventArgs : ITextBoxSelectionChangingEventArgs
struct winrt::Windows::UI::Xaml::Controls::TextBoxSelectionChangingEventArgs :
ITextBoxSelectionChangingEventArgs
public sealed class TextBoxSelectionChangingEventArgs : ITextBoxSelectionChangingEventArgs

I nheritance H ierarchy
None

Remarks
An instance of this class is passed as a parameter to the SelectionChanging event handler.

Properties
Cancel
Cancel
Cancel

Gets or sets a value that indicates whether the selection operation should be canceled.

SelectionLength
SelectionLength
SelectionLength

Gets the length of the text selection.

SelectionStart
SelectionStart
SelectionStart

Gets the starting index of the text selection.


TextBoxSelectionChangingEventArgs.Cancel TextBox
SelectionChangingEventArgs.Cancel TextBoxSelection
ChangingEventArgs.Cancel
I n this Article
Edit
Gets or sets a value that indicates whether the selection operation should be canceled.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
true to cancel the selection operation; otherwise, false. The default is false.
TextBoxSelectionChangingEventArgs.SelectionLength
TextBoxSelectionChangingEventArgs.SelectionLength
TextBoxSelectionChangingEventArgs.SelectionLength
I n this Article
Edit
Gets the length of the text selection.
public : int SelectionLength { get; }
int32_t SelectionLength();
public int SelectionLength { get; }

Returns
int
The length of the text selection.
TextBoxSelectionChangingEventArgs.SelectionStart Text
BoxSelectionChangingEventArgs.SelectionStart TextBox
SelectionChangingEventArgs.SelectionStart
I n this Article
Edit
Gets the starting index of the text selection.
public : int SelectionStart { get; }
int32_t SelectionStart();
public int SelectionStart { get; }

Returns
int
The starting index of the text selection.
TextBoxTextChangingEventArgs TextBoxTextChanging
EventArgs TextBoxTextChangingEventArgs Class
Provides event data for the TextBox.TextChanging event.

D eclaration
public : sealed class TextBoxTextChangingEventArgs : ITextBoxTextChangingEventArgs,
ITextBoxTextChangingEventArgs2
struct winrt::Windows::UI::Xaml::Controls::TextBoxTextChangingEventArgs :
ITextBoxTextChangingEventArgs, ITextBoxTextChangingEventArgs2
public sealed class TextBoxTextChangingEventArgs : ITextBoxTextChangingEventArgs,
ITextBoxTextChangingEventArgs2

I nheritance H ierarchy
None

Remarks
An instance of this class is passed as a parameter to the TextChanging event handler.

Properties
IsContentChanging
IsContentChanging
IsContentChanging

Gets a value that indicates whether the event occured due to a change in the text content.
TextBoxTextChangingEventArgs.IsContentChanging Text
BoxTextChangingEventArgs.IsContentChanging TextBox
TextChangingEventArgs.IsContentChanging
I n this Article
Edit
Gets a value that indicates whether the event occured due to a change in the text content.
public : Platform::Boolean IsContentChanging { get; }
bool IsContentChanging();
public bool IsContentChanging { get; }

Returns
bool
true if a change to the text content caused the event; otherwise, false.
Additional features and requirements
Device family Windows 10 Creators Update (introduced v10.0.15063.0)

API contract Windows.Foundation.UniversalApiContract (introduced v4)

Remarks
This event is fired for a format or content change. The IsContentChanging property helps to distinguish when text
content is changing.
TextChangedEventArgs TextChangedEventArgs Text
ChangedEventArgs Class
Provides data for the TextChanged event.

D eclaration
public : sealed class TextChangedEventArgs : RoutedEventArgs, ITextChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::TextChangedEventArgs : RoutedEventArgs,
ITextChangedEventArgs
public sealed class TextChangedEventArgs : RoutedEventArgs, ITextChangedEventArgs

I nheritance H ierarchy
RoutedEventArgs

See Also
RoutedEventArgs
TextChangedEventHandler TextChangedEventHandler
TextChangedEventHandler Delegate
Represents the method that will handle the TextChanged event.

D eclaration
public : delegate void TextChangedEventHandler(Platform::Object sender, TextChangedEventArgs e)
struct TextChangedEventHandler : winrt::Windows::Foundation::IUnknown
{
TextChangedEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> TextChangedEventHandler(L lambda);
template <typename F> TextChangedEventHandler(F* function);
template <typename O, typename M> TextChangedEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::TextChangedEventArgs const& e) const;
};
public delegate void TextChangedEventHandler(Object sender, TextChangedEventArgs e)

I nheritance H ierarchy
None
TextCommandBarFlyout TextCommandBarFlyout Text
CommandBarFlyout Class
Represents a specialized command bar flyout that contains commands for editing text.

D eclaration
public : class TextCommandBarFlyout : CommandBarFlyout, ITextCommandBarFlyout
struct winrt::Windows::UI::Xaml::Controls::TextCommandBarFlyout : CommandBarFlyout,
ITextCommandBarFlyout
public class TextCommandBarFlyout : CommandBarFlyout, ITextCommandBarFlyout

I nheritance H ierarchy
DependencyObject
FlyoutBase
CommandBarFlyout

Constructors
TextCommandBarFlyout()
TextCommandBarFlyout()
TextCommandBarFlyout()

Initializes a new instance of the TextCommandBarFlyout class.


TextCommandBarFlyout TextCommandBarFlyout Text
CommandBarFlyout
I n this Article
Edit
Initializes a new instance of the TextCommandBarFlyout class.
public : TextCommandBarFlyout()
TextCommandBarFlyout() const;
public TextCommandBarFlyout()
TextCompositionChangedEventArgs TextComposition
ChangedEventArgs TextCompositionChangedEventArgs
Class
Provides event data for the TextCompositionChanged event on TextBox and RichEditBox.

D eclaration
public : sealed class TextCompositionChangedEventArgs : ITextCompositionChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::TextCompositionChangedEventArgs :
ITextCompositionChangedEventArgs
public sealed class TextCompositionChangedEventArgs : ITextCompositionChangedEventArgs

I nheritance H ierarchy
None

Remarks
For more info, see the TextBox.TextCompositionChanged and RichEditBox.TextCompositionChanged events.

Properties
Length
Length
Length

Gets the length of the portion of the text that the user is composing with an Input Method Editor (IME ).

StartIndex
StartIndex
StartIndex

Gets the starting location of the text that the user is composing with an Input Method Editor (IME ).

See Also
TextCompositionChangedEventArgs.Length Text
CompositionChangedEventArgs.Length TextComposition
ChangedEventArgs.Length
I n this Article
Edit
Gets the length of the portion of the text that the user is composing with an Input Method Editor (IME ).
public : int Length { get; }
int32_t Length();
public int Length { get; }

Returns
int
The length of the portion of the text that the user is composing with an Input Method Editor (IME ).
See Input Method Editor (IME )
Also
TextCompositionChangedEventArgs.StartIndex Text
CompositionChangedEventArgs.StartIndex Text
CompositionChangedEventArgs.StartIndex
I n this Article
Edit
Gets the starting location of the text that the user is composing with an Input Method Editor (IME ).
public : int StartIndex { get; }
int32_t StartIndex();
public int StartIndex { get; }

Returns
int
The starting location of the text that the user is composing with an Input Method Editor (IME ).
See Input Method Editor (IME )
Also
TextCompositionEndedEventArgs TextCompositionEnded
EventArgs TextCompositionEndedEventArgs Class
Provides event data for the TextCompositionEnded event on TextBox and RichEditBox.

D eclaration
public : sealed class TextCompositionEndedEventArgs : ITextCompositionEndedEventArgs
struct winrt::Windows::UI::Xaml::Controls::TextCompositionEndedEventArgs :
ITextCompositionEndedEventArgs
public sealed class TextCompositionEndedEventArgs : ITextCompositionEndedEventArgs

I nheritance H ierarchy
None

Remarks
For more info, see the TextBox.TextCompositionEnded and RichEditBox.TextCompositionEnded events.

Properties
Length
Length
Length

Gets the length of the portion of the text that the user is composing with an Input Method Editor (IME ).

StartIndex
StartIndex
StartIndex

Gets the starting location of the text that the user is composing with an Input Method Editor (IME ).

See Also
TextCompositionEndedEventArgs.Length Text
CompositionEndedEventArgs.Length TextComposition
EndedEventArgs.Length
I n this Article
Edit
Gets the length of the portion of the text that the user is composing with an Input Method Editor (IME ).
public : int Length { get; }
int32_t Length();
public int Length { get; }

Returns
int
The length of the portion of the text that the user is composing with an Input Method Editor (IME ).
See Input Method Editor (IME )
Also
TextCompositionEndedEventArgs.StartIndex Text
CompositionEndedEventArgs.StartIndex TextComposition
EndedEventArgs.StartIndex
I n this Article
Edit
Gets the starting location of the text that the user is composing with an Input Method Editor (IME ).
public : int StartIndex { get; }
int32_t StartIndex();
public int StartIndex { get; }

Returns
int
The starting location of the text that the user is composing with an Input Method Editor (IME ).
See Input Method Editor (IME )
Also
TextCompositionStartedEventArgs TextComposition
StartedEventArgs TextCompositionStartedEventArgs
Class
Provides event data for the TextCompositionStarted event on TextBox and RichEditBox.

D eclaration
public : sealed class TextCompositionStartedEventArgs : ITextCompositionStartedEventArgs
struct winrt::Windows::UI::Xaml::Controls::TextCompositionStartedEventArgs :
ITextCompositionStartedEventArgs
public sealed class TextCompositionStartedEventArgs : ITextCompositionStartedEventArgs

I nheritance H ierarchy
None

Remarks
For more info, see the TextBox.TextCompositionStarted and RichEditBox.TextCompositionStarted events.

Properties
Length
Length
Length

Gets the length of the portion of the text that the user is composing with an Input Method Editor (IME ).

StartIndex
StartIndex
StartIndex

Gets the starting location of the text that the user is composing with an Input Method Editor (IME ).

See Also
TextCompositionStartedEventArgs.Length Text
CompositionStartedEventArgs.Length TextComposition
StartedEventArgs.Length
I n this Article
Edit
Gets the length of the portion of the text that the user is composing with an Input Method Editor (IME ).
public : int Length { get; }
int32_t Length();
public int Length { get; }

Returns
int
The length of the portion of the text that the user is composing with an Input Method Editor (IME ).
See Input Method Editor (IME )
Also
TextCompositionStartedEventArgs.StartIndex Text
CompositionStartedEventArgs.StartIndex Text
CompositionStartedEventArgs.StartIndex
I n this Article
Edit
Gets the starting location of the text that the user is composing with an Input Method Editor (IME ).
public : int StartIndex { get; }
int32_t StartIndex();
public int StartIndex { get; }

Returns
int
The starting location of the text that the user is composing with an Input Method Editor (IME ).
See Input Method Editor (IME )
Also
TextControlCopyingToClipboardEventArgs TextControl
CopyingToClipboardEventArgs TextControlCopyingTo
ClipboardEventArgs Class
Provides event data for the CopyingToClipboard event.

D eclaration
public : sealed class TextControlCopyingToClipboardEventArgs :
ITextControlCopyingToClipboardEventArgs
struct winrt::Windows::UI::Xaml::Controls::TextControlCopyingToClipboardEventArgs :
ITextControlCopyingToClipboardEventArgs
public sealed class TextControlCopyingToClipboardEventArgs :
ITextControlCopyingToClipboardEventArgs

I nheritance H ierarchy
None

Remarks
If you perform any action in the handler for a CopyingToClipboard event, set the Handled property to true; otherwise,
the default copy action is performed.

Properties
Handled
Handled
Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers
along the event route from handling the same event again.
TextControlCopyingToClipboardEventArgs.Handled Text
ControlCopyingToClipboardEventArgs.Handled Text
ControlCopyingToClipboardEventArgs.Handled
I n this Article
Edit
Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along
the event route from handling the same event again.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
true to mark the routed event handled. false to leave the routed event unhandled, which causes the default copy action
to be performed. The default is false.
TextControlCuttingToClipboardEventArgs TextControl
CuttingToClipboardEventArgs TextControlCuttingTo
ClipboardEventArgs Class
Provides event data for the CuttingToClipboard event.

D eclaration
public : sealed class TextControlCuttingToClipboardEventArgs :
ITextControlCuttingToClipboardEventArgs
struct winrt::Windows::UI::Xaml::Controls::TextControlCuttingToClipboardEventArgs :
ITextControlCuttingToClipboardEventArgs
public sealed class TextControlCuttingToClipboardEventArgs :
ITextControlCuttingToClipboardEventArgs

I nheritance H ierarchy
None

Remarks
If you perform any action in the handler for a CuttingToClipboard event, set the Handled property to true; otherwise,
the default cut action is performed.

Properties
Handled
Handled
Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers
along the event route from handling the same event again.
TextControlCuttingToClipboardEventArgs.Handled Text
ControlCuttingToClipboardEventArgs.Handled Text
ControlCuttingToClipboardEventArgs.Handled
I n this Article
Edit
Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along
the event route from handling the same event again.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
true to mark the routed event handled. false to leave the routed event unhandled, which causes the default cut action
to be performed. The default is false.
TextControlPasteEventArgs TextControlPasteEventArgs
TextControlPasteEventArgs Class
Provides data for the text control Paste event.

D eclaration
public : sealed class TextControlPasteEventArgs : ITextControlPasteEventArgs
struct winrt::Windows::UI::Xaml::Controls::TextControlPasteEventArgs :
ITextControlPasteEventArgs
public sealed class TextControlPasteEventArgs : ITextControlPasteEventArgs

I nheritance H ierarchy
None

Remarks
For more info, see the Paste event.

Properties
Handled
Handled
Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers
along the event route from handling the same event again.
TextControlPasteEventArgs.Handled TextControlPaste
EventArgs.Handled TextControlPasteEventArgs.Handled
I n this Article
Edit
Gets or sets a value that marks the routed event as handled. A true value for Handled prevents most handlers along
the event route from handling the same event again.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
true to mark the routed event handled. false to leave the routed event unhandled, which permits the event to
potentially route further and be acted on by other handlers. The default is false.

Remarks
For more info, see the Paste event.
TextControlPasteEventHandler TextControlPasteEvent
Handler TextControlPasteEventHandler Delegate
Represents the method that will handle a Paste event.

D eclaration
public : delegate void TextControlPasteEventHandler(Platform::Object sender,
TextControlPasteEventArgs e)
struct TextControlPasteEventHandler : winrt::Windows::Foundation::IUnknown
{
TextControlPasteEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> TextControlPasteEventHandler(L lambda);
template <typename F> TextControlPasteEventHandler(F* function);
template <typename O, typename M> TextControlPasteEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::TextControlPasteEventArgs const& e) const;
};
public delegate void TextControlPasteEventHandler(Object sender, TextControlPasteEventArgs e)

I nheritance H ierarchy
None
TimePickedEventArgs TimePickedEventArgs TimePicked
EventArgs Class
Provides data for the TimePicked event.

D eclaration
public : sealed class TimePickedEventArgs : DependencyObject, ITimePickedEventArgs
struct winrt::Windows::UI::Xaml::Controls::TimePickedEventArgs : DependencyObject,
ITimePickedEventArgs
public sealed class TimePickedEventArgs : DependencyObject, ITimePickedEventArgs

I nheritance H ierarchy
DependencyObject

Constructors
TimePickedEventArgs()
TimePickedEventArgs()
TimePickedEventArgs()

Initializes a new instance of the TimePickedEventArgs class.

Properties
NewTime
NewTime
NewTime

Gets the time that was selected by the user.

OldTime
OldTime
OldTime

Gets the old time value.

See Also
DependencyObject
TimePickedEventArgs.NewTime TimePickedEventArgs.
NewTime TimePickedEventArgs.NewTime
I n this Article
Edit
Gets the time that was selected by the user.
public : TimeSpan NewTime { get; }
TimeSpan NewTime();
public TimeSpan NewTime { get; }

Returns
TimeSpan
The time that was selected by the user.
TimePickedEventArgs.OldTime TimePickedEventArgs.Old
Time TimePickedEventArgs.OldTime
I n this Article
Edit
Gets the old time value.
public : TimeSpan OldTime { get; }
TimeSpan OldTime();
public TimeSpan OldTime { get; }

Returns
TimeSpan
The old time value.
TimePickedEventArgs TimePickedEventArgs TimePicked
EventArgs
I n this Article
Edit
Initializes a new instance of the TimePickedEventArgs class.
public : TimePickedEventArgs()
TimePickedEventArgs() const;
public TimePickedEventArgs()
TimePicker TimePicker TimePicker Class
Represents a control that allows a user to pick a time value.

D eclaration
public : class TimePicker : Control, ITimePicker, ITimePicker2, ITimePicker3
struct winrt::Windows::UI::Xaml::Controls::TimePicker : Control, ITimePicker, ITimePicker2,
ITimePicker3
public class TimePicker : Control, ITimePicker, ITimePicker2, ITimePicker3

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
TimePicker is a control that lets a user set a time value.

Control style and template


You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the TimePicker control.

R ES O U R CE K EY D ES CR IPTIO N

TimePickerSpacerFill Spacer color

TimePickerSpacerFillDisabled Spacer color when disabled

TimePickerHeaderForeground Header text color

TimePickerHeaderForegroundDisabled Header text color when disabled

TimePickerButtonForeground Button text color


TimePickerButtonForegroundPointerOver Button text color on hover

TimePickerButtonForegroundPressed Button text color when pressed

TimePickerButtonForegroundDisabled Button text color when disabled

TimePickerButtonForegroundFocused Button text color when focused

TimePickerButtonBackground Button background color at rest

TimePickerButtonBackgroundPointerOver Button background color on hover

TimePickerButtonBackgroundPressed Button background color when pressed

TimePickerButtonBackgroundDisabled Button background color when disabled

TimePickerButtonBackgroundFocused Button background color when focused

TimePickerButtonBorderBrush Button border color at rest

TimePickerButtonBorderBrushPointerOver Button border color on hover

TimePickerButtonBorderBrushPressed Button border color when pressed

TimePickerButtonBorderBrushDisabled Button border color when disabled

DateTimePickerFlyoutButtonForegroundPointerOver Flyout button foreground color on hover

DateTimePickerFlyoutButtonForegroundPressed Flyout button foreground color when pressed

DateTimePickerFlyoutButtonBackground Flyout button background color at rest

DateTimePickerFlyoutButtonBackgroundPointerOver Flyout button background color on hover

DateTimePickerFlyoutButtonBackgroundPressed Flyout button background color when pressed

DateTimePickerFlyoutButtonBorderBrush Flyout button border color at rest

DateTimePickerFlyoutButtonBorderBrushPointerOver Flyout button border color on hover

DateTimePickerFlyoutButtonBorderBrushPressed Flyout button border color when pressed

Constructors
TimePicker()
TimePicker()
TimePicker()

Initializes a new instance of the TimePicker class.

Properties
ClockIdentifier
ClockIdentifier
ClockIdentifier

Gets or sets the clock system to use.

ClockIdentifierProperty
ClockIdentifierProperty
ClockIdentifierProperty

Gets the identifier for the ClockIdentifier dependency property.

Header
Header
Header

Gets or sets the content for the control's header.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the content of the control's header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

LightDismissOverlayMode
LightDismissOverlayMode
LightDismissOverlayMode

Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.

LightDismissOverlayModeProperty
LightDismissOverlayModeProperty
LightDismissOverlayModeProperty
Identifies the LightDismissOverlayMode dependency property.

MinuteIncrement
MinuteIncrement
MinuteIncrement

Gets or sets a value that indicates the time increments shown in the minute picker. For example, 15 specifies that
the TimePicker minute control displays only the choices 00, 15, 30, 45.

MinuteIncrementProperty
MinuteIncrementProperty
MinuteIncrementProperty

Gets the identifier for the MinuteIncrement dependency property.

SelectedTime
SelectedTime
SelectedTime

Gets or sets the time currently selected in the time picker.

SelectedTimeProperty
SelectedTimeProperty
SelectedTimeProperty

Identifies the SelectedTime dependency property.

Time
Time
Time

Gets or sets the time currently set in the time picker.

TimeProperty
TimeProperty
TimeProperty

Gets the identifier for the Time dependency property.

Events
SelectedTimeChanged
SelectedTimeChanged
SelectedTimeChanged

Occurs when the selected time value is changed.


TimeChanged
TimeChanged
TimeChanged

Occurs when the time value is changed.

See Also
TimePicker.ClockIdentifier TimePicker.ClockIdentifier
TimePicker.ClockIdentifier
I n this Article
Edit
Gets or sets the clock system to use.
public : Platform::String ClockIdentifier { get; set; }
winrt::hstring ClockIdentifier();

void ClockIdentifier(winrt::hstring clockidentifier);


public string ClockIdentifier { get; set; }

<TimePicker ClockIdentifier="12HourClock"/>
-or-
<TimePicker ClockIdentifier="24HourClock"/>

Returns
string
The name of the clock system to use. See Remarks.

Remarks
The type of the property is String, but you must use values that correspond to the static string properties of
Windows.Globalization.ClockIdentifiers. These are: TwelveHour (the string "12HourClock")and TwentyFourHour (the
string "24HourClock"). "12HourClock" is the default value.
TimePicker.ClockIdentifierProperty TimePicker.Clock
IdentifierProperty TimePicker.ClockIdentifierProperty
I n this Article
Edit
Gets the identifier for the ClockIdentifier dependency property.
public : static DependencyProperty ClockIdentifierProperty { get; }
static DependencyProperty ClockIdentifierProperty();
public static DependencyProperty ClockIdentifierProperty { get; }

Returns
DependencyProperty
The identifier for the ClockIdentifier dependency property.
TimePicker.Header TimePicker.Header TimePicker.Header
I n this Article
Edit
Gets or sets the content for the control's header.

public : Platform::Object Header { get; set; }


winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<TimePicker Header="headerString"/>

Returns
object
The content of the control's header. The default is null.

Remarks
You can set a data template for the Header by using the HeaderTemplate property.
TimePicker.HeaderProperty TimePicker.HeaderProperty
TimePicker.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
TimePicker.HeaderTemplate TimePicker.HeaderTemplate
TimePicker.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the content of the control's header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<TimePicker HeaderTemplate="resourceReferenceToDataTemplate"/>

Returns
DataTemplate
The template that specifies the visualization of the header object. The default is null.
TimePicker.HeaderTemplateProperty TimePicker.Header
TemplateProperty TimePicker.HeaderTemplateProperty
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
TimePicker.LightDismissOverlayMode TimePicker.Light
DismissOverlayMode TimePicker.LightDismissOverlay
Mode
I n this Article
Edit
Gets or sets a value that specifies whether the area outside of a light-dismiss UI is darkened.
public : LightDismissOverlayMode LightDismissOverlayMode { get; set; }
LightDismissOverlayMode LightDismissOverlayMode();

void LightDismissOverlayMode(LightDismissOverlayMode lightdismissoverlaymode);


public LightDismissOverlayMode LightDismissOverlayMode { get; set; }

Returns
LightDismissOverlayMode
A value of the enumeration that specifies whether the area outside of a light-dismiss UI is darkened. The default is
Auto.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
Transient UI, such as the open TimePickerFlyout of a TimePicker, closes when you click or tap outside of it. This is
called light-dismiss. "Overlay" refers to the area outside of a light-dismiss UI.
By default, the "overlay" is darkened on the Xbox, and not darkened on other devices families. You can set
LightDismissOverlayMode to On to make your app darken the "overlay" area on all device families, or set it to Off to
not darken the "overlay" area on all device families.
Version compatibility
The LightDismissOverlayMode property is not available prior to Windows 10, version 1607. If your app’s 'minimum
platform version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements
block later in this page, you must design and test your app to account for this. For more info, see Version adaptive
code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.TimePicker",
"LightDismissOverlayMode"))
{
timePicker1.LightDismissOverlayMode = LightDismissOverlayMode.On;
}
}
TimePicker.LightDismissOverlayModeProperty Time
Picker.LightDismissOverlayModeProperty TimePicker.
LightDismissOverlayModeProperty
I n this Article
Edit
Identifies the LightDismissOverlayMode dependency property.
public : static DependencyProperty LightDismissOverlayModeProperty { get; }
static DependencyProperty LightDismissOverlayModeProperty();
public static DependencyProperty LightDismissOverlayModeProperty { get; }

Returns
DependencyProperty
The identifier for the LightDismissOverlayMode dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


TimePicker.MinuteIncrement TimePicker.MinuteIncrement
TimePicker.MinuteIncrement
I n this Article
Edit
Gets or sets a value that indicates the time increments shown in the minute picker. For example, 15 specifies that the
TimePicker minute control displays only the choices 00, 15, 30, 45.
public : int MinuteIncrement { get; set; }
int32_t MinuteIncrement();

void MinuteIncrement(int32_t minuteincrement);


public int MinuteIncrement { get; set; }

<TimePicker MinuteIncrement="int"/>

Returns
int
An integer from 0-59 that indicates the increments shown in the minute picker. The default is 1.
TimePicker.MinuteIncrementProperty TimePicker.Minute
IncrementProperty TimePicker.MinuteIncrementProperty
I n this Article
Edit
Gets the identifier for the MinuteIncrement dependency property.
public : static DependencyProperty MinuteIncrementProperty { get; }
static DependencyProperty MinuteIncrementProperty();
public static DependencyProperty MinuteIncrementProperty { get; }

Returns
DependencyProperty
The identifier for the MinuteIncrement dependency property.
TimePicker.SelectedTime TimePicker.SelectedTime Time
Picker.SelectedTime
I n this Article
Edit
Gets or sets the time currently selected in the time picker.
public : IReference<TimeSpan> SelectedTime { get; set; }
IReference<TimeSpan> SelectedTime();

void SelectedTime(IReference<TimeSpan> selectedtime);


public Nullable<TimeSpan> SelectedTime { get; set; }

Returns
Nullable<TimeSpan>
The time currently selected in the time picker.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TimePicker.SelectedTimeChanged TimePicker.Selected
TimeChanged TimePicker.SelectedTimeChanged
I n this Article
Edit
Occurs when the selected time value is changed.
public : event TypedEventHandler<TimePicker, TimePickerSelectedValueChangedEventArgs>
SelectedTimeChanged
// Register
event_token SelectedTimeChanged(TypedEventHandler<TimePicker,
TimePickerSelectedValueChangedEventArgs> const& handler) const;

// Revoke with event_token


void SelectedTimeChanged(event_token const& cookie) const;

// Revoke with event_revoker


SelectedTimeChanged_revoker SelectedTimeChanged(auto_revoke_t, TypedEventHandler<TimePicker,
TimePickerSelectedValueChangedEventArgs> const& handler) const;
public event TypedEventHandler<TimePicker, TimePickerSelectedValueChangedEventArgs>
SelectedTimeChanged

<TimePicker SelectedTimeChanged="eventhandler" />


TimePicker.SelectedTimeProperty TimePicker.Selected
TimeProperty TimePicker.SelectedTimeProperty
I n this Article
Edit
Identifies the SelectedTime dependency property.
public : static DependencyProperty SelectedTimeProperty { get; }
static DependencyProperty SelectedTimeProperty();
public static DependencyProperty SelectedTimeProperty { get; }

Returns
DependencyProperty
The identifier for the SelectedTime dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TimePicker.Time TimePicker.Time TimePicker.Time
I n this Article
Edit
Gets or sets the time currently set in the time picker.

public : TimeSpan Time { get; set; }


TimeSpan Time();

void Time(TimeSpan time);


public TimeSpan Time { get; set; }

<TimePicker Time="timeSpanString" />

Returns
TimeSpan
The time currently set in the time picker.

Remarks
The default value for Time is the time that the TimePicker object is instantiated when the app runs or loads that specific
object, as a one-time operation. The time won't increment in real-time (like a clock would) unless you provide a code
binding to some value that does track the current time while the app is running.
You can set the Time value as an attribute in XAML. This is probably easiest if you're already declaring the TimePicker
object in XAML and aren't using bindings for the Time value. Use a string in the form Hh:Mm where Hh is hours and
can be between 0 and 23 and Mm is minutes and can be between 0 and 59. A "0" can be the initial character in either
Hh or Mm and is typically included for clarity of any values 0 thru 9. For example, "9:5" and "09:05" are both valid and
represent the same time, but "09:05" is easier to read in markup.
To set Time in code, you have different techniques available depending on your programming language. The value is
represented as System.TimeSpan for C# and Visual Basic, or Windows.Foundation.TimeSpan for Visual C++
component extensions (C++/CX). Probably the easiest way to produce a System.TimeSpan value that's appropriate for
Time is to use the TimeSpan.Parsestatic method. Use a string in the form Hh:Mm (hours:minutes).
Whether set in code or XAML, the TimePicker class has coercion logic for the value it preserves when you attempt to
set it. Any days values are ignored. Seconds values are ignored (for example seconds over 30 are not rounded up to the
next minute). Fractional seconds are ignored. Values do not wrap around (for example a value of "24:00" is invalid.) The
minimum value within the TimeSpan is a time of 0 (00:00, midnight) and the maximum value is 23:59. Values outside
the range throw exceptions, but depending on the specifics the exceptions might originate in the TimeSpan
construction rather than from validation and coercion of Time.
To set the Time value in Visual C++ component extensions (C++/CX), you set the Duration field of the TimeSpan
structure. Duration specifies a time in 100 nanosecond units, write your own logic for converting to and from
hours:minutes representations.
Any value set for Time is specifying the starting value, but in the app at runtime that value is typically set by the user
either directly in the TimePicker control, or within a form-factor-specific flyout that enables the user to set hours and
minutes. A flyout's UI can be influenced by other properties of TimePicker (like ClockIdentifier and MinuteIncrement )
and will display the initial Time value. A flyout typically sets the Time value when the user makes a change and
dismisses the flyout.
TimePicker.TimeChanged TimePicker.TimeChanged Time
Picker.TimeChanged
I n this Article
Edit
Occurs when the time value is changed.
public : event EventHandler<TimePickerValueChangedEventArgs> TimeChanged
// Register
event_token TimeChanged(EventHandler<TimePickerValueChangedEventArgs> const& handler) const;

// Revoke with event_token


void TimeChanged(event_token const& cookie) const;

// Revoke with event_revoker


TimeChanged_revoker TimeChanged(auto_revoke_t, EventHandler<TimePickerValueChangedEventArgs> const&
handler) const;
public event EventHandler<TimePickerValueChangedEventArgs> TimeChanged

<TimePicker TimeChanged="eventhandler" />


TimePicker TimePicker TimePicker
I n this Article
Edit
Initializes a new instance of the TimePicker class.

public : TimePicker()
TimePicker() const;
public TimePicker()
TimePicker.TimeProperty TimePicker.TimeProperty Time
Picker.TimeProperty
I n this Article
Edit
Gets the identifier for the Time dependency property.
public : static DependencyProperty TimeProperty { get; }
static DependencyProperty TimeProperty();
public static DependencyProperty TimeProperty { get; }

Returns
DependencyProperty
The identifier for the Time dependency property.
TimePickerFlyout TimePickerFlyout TimePickerFlyout
Class
Represents a control that allows a user to pick a time value.

D eclaration
public : sealed class TimePickerFlyout : PickerFlyoutBase, ITimePickerFlyout
struct winrt::Windows::UI::Xaml::Controls::TimePickerFlyout : PickerFlyoutBase,
ITimePickerFlyout
public sealed class TimePickerFlyout : PickerFlyoutBase, ITimePickerFlyout

I nheritance H ierarchy
DependencyObject
FlyoutBase
PickerFlyoutBase

Constructors
TimePickerFlyout()
TimePickerFlyout()
TimePickerFlyout()

Initializes a new instance of the TimePickerFlyout class.

Properties
ClockIdentifier
ClockIdentifier
ClockIdentifier

Gets or sets the clock system to use.

ClockIdentifierProperty
ClockIdentifierProperty
ClockIdentifierProperty

Gets the identifier for the ClockIdentifier dependency property.

MinuteIncrement
MinuteIncrement
MinuteIncrement

Gets or sets a value that indicates the time increments shown in the minute picker. For example, 15 specifies that
minute picker displays only the choices 00, 15, 30, 45.

MinuteIncrementProperty
MinuteIncrementProperty
MinuteIncrementProperty

Gets the identifier for the MinuteIncrement dependency property.

Time
Time
Time

Gets or sets the time currently set in the time picker.

TimeProperty
TimeProperty
TimeProperty

Gets the identifier for the Time dependency property.

Methods
ShowAtAsync(FrameworkElement)
ShowAtAsync(FrameworkElement)
ShowAtAsync(FrameworkElement)

Begins an asynchronous operation to show the flyout placed in relation to the specified element.

Events
TimePicked
TimePicked
TimePicked

Occurs when the user has selected a time in the time picker flyout.

See Also
PickerFlyoutBase
TimePickerFlyout.ClockIdentifier TimePickerFlyout.Clock
Identifier TimePickerFlyout.ClockIdentifier
I n this Article
Edit
Gets or sets the clock system to use.
public : Platform::String ClockIdentifier { get; set; }
winrt::hstring ClockIdentifier();

void ClockIdentifier(winrt::hstring clockidentifier);


public string ClockIdentifier { get; set; }

Returns
string
The name of the clock system to use.
TimePickerFlyout.ClockIdentifierProperty TimePicker
Flyout.ClockIdentifierProperty TimePickerFlyout.Clock
IdentifierProperty
I n this Article
Edit
Gets the identifier for the ClockIdentifier dependency property.
public : static DependencyProperty ClockIdentifierProperty { get; }
static DependencyProperty ClockIdentifierProperty();
public static DependencyProperty ClockIdentifierProperty { get; }

Returns
DependencyProperty
The identifier for the ClockIdentifier dependency property.
TimePickerFlyout.MinuteIncrement TimePickerFlyout.
MinuteIncrement TimePickerFlyout.MinuteIncrement
I n this Article
Edit
Gets or sets a value that indicates the time increments shown in the minute picker. For example, 15 specifies that
minute picker displays only the choices 00, 15, 30, 45.
public : int MinuteIncrement { get; set; }
int32_t MinuteIncrement();

void MinuteIncrement(int32_t minuteincrement);


public int MinuteIncrement { get; set; }

Returns
int
An integer from 0-59 that indicates the increments shown in the minute picker. The default is 1.
TimePickerFlyout.MinuteIncrementProperty TimePicker
Flyout.MinuteIncrementProperty TimePickerFlyout.
MinuteIncrementProperty
I n this Article
Edit
Gets the identifier for the MinuteIncrement dependency property.
public : static DependencyProperty MinuteIncrementProperty { get; }
static DependencyProperty MinuteIncrementProperty();
public static DependencyProperty MinuteIncrementProperty { get; }

Returns
DependencyProperty
The identifier for the MinuteIncrement dependency property.
TimePickerFlyout.ShowAtAsync TimePickerFlyout.ShowAt
Async TimePickerFlyout.ShowAtAsync
I n this Article
Edit
Begins an asynchronous operation to show the flyout placed in relation to the specified element.
public : IAsyncOperation<IReference<TimeSpan>> ShowAtAsync(FrameworkElement target)
IAsyncOperation<IReference<TimeSpan>> ShowAtAsync(FrameworkElement target) const;
public IAsyncOperation<Nullable<TimeSpan>> ShowAtAsync(FrameworkElement target)

Parameters
target FrameworkElement
The element to use as the flyout's placement target.
Returns
IAsyncOperation<Nullable<TimeSpan>>
An asynchronous operation.
Attributes RemoteAsyncAttribute
TimePickerFlyout.Time TimePickerFlyout.Time TimePicker
Flyout.Time
I n this Article
Edit
Gets or sets the time currently set in the time picker.
public : TimeSpan Time { get; set; }
TimeSpan Time();

void Time(TimeSpan time);


public TimeSpan Time { get; set; }

Returns
TimeSpan
The time currently set in the time picker.
TimePickerFlyout.TimePicked TimePickerFlyout.Time
Picked TimePickerFlyout.TimePicked
I n this Article
Edit
Occurs when the user has selected a time in the time picker flyout.
public : event TypedEventHandler<TimePickerFlyout, TimePickedEventArgs> TimePicked
// Register
event_token TimePicked(TypedEventHandler<TimePickerFlyout, TimePickedEventArgs> const& handler)
const;

// Revoke with event_token


void TimePicked(event_token const& cookie) const;

// Revoke with event_revoker


TimePicked_revoker TimePicked(auto_revoke_t, TypedEventHandler<TimePickerFlyout,
TimePickedEventArgs> const& handler) const;
public event TypedEventHandler<TimePickerFlyout, TimePickedEventArgs> TimePicked
TimePickerFlyout TimePickerFlyout TimePickerFlyout
I n this Article
Edit
Initializes a new instance of the TimePickerFlyout class.

public : TimePickerFlyout()
TimePickerFlyout() const;
public TimePickerFlyout()
TimePickerFlyout.TimeProperty TimePickerFlyout.Time
Property TimePickerFlyout.TimeProperty
I n this Article
Edit
Gets the identifier for the Time dependency property.
public : static DependencyProperty TimeProperty { get; }
static DependencyProperty TimeProperty();
public static DependencyProperty TimeProperty { get; }

Returns
DependencyProperty
The identifier for the Time dependency property.
TimePickerFlyoutPresenter TimePickerFlyoutPresenter
TimePickerFlyoutPresenter Class
Represents the visual container for the TimePickerFlyout.

D eclaration
public : sealed class TimePickerFlyoutPresenter : Control, ITimePickerFlyoutPresenter
struct winrt::Windows::UI::Xaml::Controls::TimePickerFlyoutPresenter : Control,
ITimePickerFlyoutPresenter
public sealed class TimePickerFlyoutPresenter : Control, ITimePickerFlyoutPresenter

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the TimePickerFlyoutPresenter control.

R ES O U R CE K EY D ES CR IPTIO N

TimePickerFlyoutPresenterSpacerFill Spacer color

TimePickerFlyoutPresenterBackground Background color

TimePickerFlyoutPresenterBorderBrush Border color

TimePickerFlyoutPresenterHighlightFill Highlight color

See Also
Control
TimePickerSelectedValueChangedEventArgs TimePicker
SelectedValueChangedEventArgs TimePickerSelected
ValueChangedEventArgs Class
Provides event data for the TimePicker.SelectedTimeChanged event.

D eclaration
public : sealed class TimePickerSelectedValueChangedEventArgs :
ITimePickerSelectedValueChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::TimePickerSelectedValueChangedEventArgs :
ITimePickerSelectedValueChangedEventArgs
public sealed class TimePickerSelectedValueChangedEventArgs :
ITimePickerSelectedValueChangedEventArgs

I nheritance H ierarchy
None

Properties
NewTime
NewTime
NewTime

Gets the new time selected in the picker.

OldTime
OldTime
OldTime

Gets the time previously selected in the picker.


TimePickerSelectedValueChangedEventArgs.NewTime
TimePickerSelectedValueChangedEventArgs.NewTime
TimePickerSelectedValueChangedEventArgs.NewTime
I n this Article
Edit
Gets the new time selected in the picker.
public : IReference<TimeSpan> NewTime { get; }
IReference<TimeSpan> NewTime();
public Nullable<TimeSpan> NewTime { get; }

Returns
Nullable<TimeSpan>
The new time selected in the picker.
TimePickerSelectedValueChangedEventArgs.OldTime
TimePickerSelectedValueChangedEventArgs.OldTime
TimePickerSelectedValueChangedEventArgs.OldTime
I n this Article
Edit
Gets the time previously selected in the picker.
public : IReference<TimeSpan> OldTime { get; }
IReference<TimeSpan> OldTime();
public Nullable<TimeSpan> OldTime { get; }

Returns
Nullable<TimeSpan>
The time previously selected in the picker.
TimePickerValueChangedEventArgs TimePickerValue
ChangedEventArgs TimePickerValueChangedEventArgs
Class
Provides event data for the TimePicker.TimeChanged event.

D eclaration
public : sealed class TimePickerValueChangedEventArgs : ITimePickerValueChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::TimePickerValueChangedEventArgs :
ITimePickerValueChangedEventArgs
public sealed class TimePickerValueChangedEventArgs : ITimePickerValueChangedEventArgs

I nheritance H ierarchy
None

Properties
NewTime
NewTime
NewTime

Gets the new time selected in the picker.

OldTime
OldTime
OldTime

Gets the time previously selected in the picker.


TimePickerValueChangedEventArgs.NewTime TimePicker
ValueChangedEventArgs.NewTime TimePickerValue
ChangedEventArgs.NewTime
I n this Article
Edit
Gets the new time selected in the picker.
public : TimeSpan NewTime { get; }
TimeSpan NewTime();
public TimeSpan NewTime { get; }

Returns
TimeSpan
The new time selected in the picker.
TimePickerValueChangedEventArgs.OldTime TimePicker
ValueChangedEventArgs.OldTime TimePickerValue
ChangedEventArgs.OldTime
I n this Article
Edit
Gets the time previously selected in the picker.
public : TimeSpan OldTime { get; }
TimeSpan OldTime();
public TimeSpan OldTime { get; }

Returns
TimeSpan
The time previously selected in the picker.
ToggleMenuFlyoutItem ToggleMenuFlyoutItem Toggle
MenuFlyoutItem Class
Represents an item in a MenuFlyout that a user can change between two states, checked or unchecked.

D eclaration
public : class ToggleMenuFlyoutItem : MenuFlyoutItem, IToggleMenuFlyoutItem
struct winrt::Windows::UI::Xaml::Controls::ToggleMenuFlyoutItem : MenuFlyoutItem,
IToggleMenuFlyoutItem
public class ToggleMenuFlyoutItem : MenuFlyoutItem, IToggleMenuFlyoutItem

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
MenuFlyoutItemBase
MenuFlyoutItem

Remarks
There are three elements that you can use to compose the menu items in a MenuFlyout control: MenuFlyoutItem ,
ToggleMenuFlyoutItem, and MenuFlyoutSeparator. You can use these in any combination.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the ToggleMenuFlyoutItem control.

R ES O U R CE K EY D ES CR IPTIO N

ToggleMenuFlyoutItemBackground Background color of entire control bounds at rest

ToggleMenuFlyoutItemBackgroundPointerOver Background color on hover

ToggleMenuFlyoutItemBackgroundPressed Background color when pressed

ToggleMenuFlyoutItemBackgroundDisabled Background color when disabled


ToggleMenuFlyoutItemForeground Text color at rest

ToggleMenuFlyoutItemForegroundPointerOver Text color on hover

ToggleMenuFlyoutItemForegroundPressed Text color when pressed

ToggleMenuFlyoutItemForegroundDisabled Text color when disabled

ToggleMenuFlyoutItemCheckGlyphForeground Color of selected check mark

ToggleMenuFlyoutItemCheckGlyphForegroundPointerOver Color of selected check mark on hover

ToggleMenuFlyoutItemCheckGlyphForegroundPressed Color of selected check mark when pressed

ToggleMenuFlyoutItemCheckGlyphForegroundDisabled Color of selected check mark when disabled

Constructors
ToggleMenuFlyoutItem()
ToggleMenuFlyoutItem()
ToggleMenuFlyoutItem()

Initializes a new instance of the ToggleMenuFlyoutItem class.

Properties
IsChecked
IsChecked
IsChecked

Gets or sets whether the ToggleMenuFlyoutItem is checked.

IsCheckedProperty
IsCheckedProperty
IsCheckedProperty

Identifies the IsChecked dependency property.

See Also
MenuFlyoutItem
MenuFlyoutItem
ToggleMenuFlyoutItem.IsChecked ToggleMenuFlyout
Item.IsChecked ToggleMenuFlyoutItem.IsChecked
I n this Article
Edit
Gets or sets whether the ToggleMenuFlyoutItem is checked.
public : Platform::Boolean IsChecked { get; set; }
bool IsChecked();

void IsChecked(bool ischecked);


public bool IsChecked { get; set; }

<ToggleMenuFlyoutItem IsChecked="bool" />

Returns
bool
true if the ToggleMenuFlyoutItem is checked; false if the ToggleMenuFlyoutItem is unchecked. The default is false.
ToggleMenuFlyoutItem.IsCheckedProperty ToggleMenu
FlyoutItem.IsCheckedProperty ToggleMenuFlyoutItem.Is
CheckedProperty
I n this Article
Edit
Identifies the IsChecked dependency property.
public : static DependencyProperty IsCheckedProperty { get; }
static DependencyProperty IsCheckedProperty();
public static DependencyProperty IsCheckedProperty { get; }

Returns
DependencyProperty
The identifier for the IsChecked dependency property.
ToggleMenuFlyoutItem ToggleMenuFlyoutItem Toggle
MenuFlyoutItem
I n this Article
Edit
Initializes a new instance of the ToggleMenuFlyoutItem class.
public : ToggleMenuFlyoutItem()
ToggleMenuFlyoutItem() const;
public ToggleMenuFlyoutItem()
ToggleSplitButton ToggleSplitButton ToggleSplitButton
Class
Represents a button with two parts that can be invoked separately. One part behaves like a toggle button and the other
part invokes a flyout.

D eclaration
public : class ToggleSplitButton : SplitButton, IToggleSplitButton
struct winrt::Windows::UI::Xaml::Controls::ToggleSplitButton : SplitButton, IToggleSplitButton
public class ToggleSplitButton : SplitButton, IToggleSplitButton

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SplitButton

Constructors
ToggleSplitButton()
ToggleSplitButton()
ToggleSplitButton()

Initializes a new instance of the ToggleSplitButton class.

Properties
IsChecked
IsChecked
IsChecked

Gets or sets whether the ToggleSplitButton is checked.

Events
IsCheckedChanged
IsCheckedChanged
IsCheckedChanged

Occurs when the value of the IsChecked property is changed.


ToggleSplitButton.IsChecked ToggleSplitButton.Is
Checked ToggleSplitButton.IsChecked
I n this Article
Edit
Gets or sets whether the ToggleSplitButton is checked.
public : Platform::Boolean IsChecked { get; set; }
bool IsChecked();

void IsChecked(bool ischecked);


public bool IsChecked { get; set; }

<ToggleSplitButton IsChecked="bool" />

Returns
bool
true if the ToggleSplitButton is checked; false if the ToggleSplitButton is unchecked. The default is false.
ToggleSplitButton.IsCheckedChanged ToggleSplitButton.
IsCheckedChanged ToggleSplitButton.IsCheckedChanged
I n this Article
Edit
Occurs when the value of the IsChecked property is changed.
public : event TypedEventHandler<ToggleSplitButton, ToggleSplitButtonIsCheckedChangedEventArgs>
IsCheckedChanged
// Register
event_token IsCheckedChanged(TypedEventHandler<ToggleSplitButton,
ToggleSplitButtonIsCheckedChangedEventArgs> const& handler) const;

// Revoke with event_token


void IsCheckedChanged(event_token const& cookie) const;

// Revoke with event_revoker


IsCheckedChanged_revoker IsCheckedChanged(auto_revoke_t, TypedEventHandler<ToggleSplitButton,
ToggleSplitButtonIsCheckedChangedEventArgs> const& handler) const;
public event TypedEventHandler<ToggleSplitButton, ToggleSplitButtonIsCheckedChangedEventArgs>
IsCheckedChanged

See ToggleSplitButton.IsChecked
Also
ToggleSplitButton ToggleSplitButton ToggleSplitButton
I n this Article
Edit
Initializes a new instance of the ToggleSplitButton class.

public : ToggleSplitButton()
ToggleSplitButton() const;
public ToggleSplitButton()
ToggleSplitButtonAutomationPeer ToggleSplitButton
AutomationPeer ToggleSplitButtonAutomationPeer Class
Exposes ToggleSplitButton types to Microsoft UI Automation.

D eclaration
public : class ToggleSplitButtonAutomationPeer : FrameworkElementAutomationPeer,
IExpandCollapseProvider, IToggleProvider, IToggleSplitButtonAutomationPeer
struct winrt::Windows::UI::Xaml::Controls::ToggleSplitButtonAutomationPeer :
FrameworkElementAutomationPeer, IExpandCollapseProvider, IToggleProvider,
IToggleSplitButtonAutomationPeer
public class ToggleSplitButtonAutomationPeer : FrameworkElementAutomationPeer,
IExpandCollapseProvider, IToggleProvider, IToggleSplitButtonAutomationPeer

I nheritance H ierarchy
DependencyObject
AutomationPeer
FrameworkElementAutomationPeer

Constructors
ToggleSplitButtonAutomationPeer(ToggleSplitButton)
ToggleSplitButtonAutomationPeer(ToggleSplitButton)
ToggleSplitButtonAutomationPeer(ToggleSplitButton)

Initializes a new instance of the ToggleSplitButtonAutomationPeer class.

Properties
ExpandCollapseState
ExpandCollapseState
ExpandCollapseState

Gets the state, expanded or collapsed, of the control.

ToggleState
ToggleState
ToggleState

Gets the toggle state of the control.

Methods
Collapse()
Collapse()
Collapse()

Hides the control's drop down menu.


Expand()
Expand()
Expand()

Displays the control's drop down menu.

Toggle()
Toggle()
Toggle()

Cycles through the toggle states of a control.


ToggleSplitButtonAutomationPeer.Collapse ToggleSplit
ButtonAutomationPeer.Collapse ToggleSplitButton
AutomationPeer.Collapse
I n this Article
Edit
Hides the control's drop down menu.
public : void Collapse()
void Collapse() const;
public void Collapse()
ToggleSplitButtonAutomationPeer.Expand ToggleSplit
ButtonAutomationPeer.Expand ToggleSplitButton
AutomationPeer.Expand
I n this Article
Edit
Displays the control's drop down menu.
public : void Expand()
void Expand() const;
public void Expand()
ToggleSplitButtonAutomationPeer.ExpandCollapseState
ToggleSplitButtonAutomationPeer.ExpandCollapseState
ToggleSplitButtonAutomationPeer.ExpandCollapseState
I n this Article
Edit
Gets the state, expanded or collapsed, of the control.
public : ExpandCollapseState ExpandCollapseState { get; }
ExpandCollapseState ExpandCollapseState();
public ExpandCollapseState ExpandCollapseState { get; }

Returns
ExpandCollapseState
A value of the enumeration.
ToggleSplitButtonAutomationPeer.Toggle ToggleSplit
ButtonAutomationPeer.Toggle ToggleSplitButton
AutomationPeer.Toggle
I n this Article
Edit
Cycles through the toggle states of a control.
public : void Toggle()
void Toggle() const;
public void Toggle()
ToggleSplitButtonAutomationPeer ToggleSplitButton
AutomationPeer ToggleSplitButtonAutomationPeer
I n this Article
Edit
Initializes a new instance of the ToggleSplitButtonAutomationPeer class.
public : ToggleSplitButtonAutomationPeer(ToggleSplitButton owner)
ToggleSplitButtonAutomationPeer(ToggleSplitButton owner) const;
public ToggleSplitButtonAutomationPeer(ToggleSplitButton owner)

Parameters
owner ToggleSplitButton
The ToggleSplitButton control instance to create the peer for.
ToggleSplitButtonAutomationPeer.ToggleState Toggle
SplitButtonAutomationPeer.ToggleState ToggleSplit
ButtonAutomationPeer.ToggleState
I n this Article
Edit
Gets the toggle state of the control.
public : ToggleState ToggleState { get; }
ToggleState ToggleState();
public ToggleState ToggleState { get; }

Returns
ToggleState
A value of the enumeration.
ToggleSplitButtonIsCheckedChangedEventArgs Toggle
SplitButtonIsCheckedChangedEventArgs ToggleSplit
ButtonIsCheckedChangedEventArgs Class
Provides event data for the ToggleSplitButton.IsCheckedChanged event.

D eclaration
public : sealed class ToggleSplitButtonIsCheckedChangedEventArgs :
IToggleSplitButtonIsCheckedChangedEventArgs
struct winrt::Windows::UI::Xaml::Controls::ToggleSplitButtonIsCheckedChangedEventArgs :
IToggleSplitButtonIsCheckedChangedEventArgs
public sealed class ToggleSplitButtonIsCheckedChangedEventArgs :
IToggleSplitButtonIsCheckedChangedEventArgs

I nheritance H ierarchy
None
ToggleSwitch ToggleSwitch ToggleSwitch Class
Represents a switch that can be toggled between two states.

D eclaration
public : sealed class ToggleSwitch : Control, IToggleSwitch, IToggleSwitchOverrides
struct winrt::Windows::UI::Xaml::Controls::ToggleSwitch : Control, IToggleSwitch,
IToggleSwitchOverrides
public sealed class ToggleSwitch : Control, IToggleSwitch, IToggleSwitchOverrides

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
 Tip

For more info, design guidance, and code examples, see Toggle switches.
ToggleSwitch is a control that can be toggled between 2 states.

Use a ToggleSwitch control to let the user switch an option between on and off states. Use the IsOn property to
determine the state of the switch. Handle the Toggled event to respond to changes in the state.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the ToggleSwitch control.

R ES O U R CE K EY D ES CR IPTIO N

ToggleSwitchContainerBackground Background color of entire control bounds at rest


ToggleSwitchContainerBackgroundPointerOver Background color on hover

ToggleSwitchContainerBackgroundPressed Background color when pressed

ToggleSwitchContainerBackgroundDisabled Background color when disabled

ToggleSwitchContentForeground Label text color at rest

ToggleSwitchContentForegroundDisabled Label text color when disabled

ToggleSwitchHeaderForeground Header text color at rest

ToggleSwitchHeaderForegroundDisabled Header text color when disabled

ToggleSwitchFillOff Background color of switch control part in "Off" state

ToggleSwitchFillOffPointerOver Background olor of switch control part in "Off" state on hover

ToggleSwitchFillOffPressed Background color of switch control part in "Off" state when


pressed

ToggleSwitchFillOffDisabled Background color of switch control part in "Off" state when


disabled

ToggleSwitchFillOn Background color of switch control part in "On" state

ToggleSwitchFillOnPointerOver Background color of switch control part in "On" state on hover

ToggleSwitchFillOnPressed Background color of switch control part in "On" state when


pressed

ToggleSwitchFillOnDisabled Background color of switch control part in "On" state when


disabled

ToggleSwitchStrokeOff Border color of switch control part in "Off" state

ToggleSwitchStrokeOffPointerOver Border color of switch control part in "Off" state on hover

ToggleSwitchStrokeOffPressed Border color of switch control part in "Off" state when pressed

ToggleSwitchStrokeOffDisabled Border color of switch control part in "Off" state when disabled

ToggleSwitchStrokeOn Border color of switch control part in "On" state

ToggleSwitchStrokeOnPointerOver Border color of switch control part in "On" state on hover

ToggleSwitchStrokeOnPressed Border color of switch control part in "On" state when pressed

ToggleSwitchStrokeOnDisabled Border color of switch control part in "On" state when disabled

ToggleSwitchKnobFillOff Color of switch control's knob in "Off" state

ToggleSwitchKnobFillOffPointerOver Color of switch control's knob in "Off" state on hover


ToggleSwitchKnobFillOffPressed Color of switch control's knob in "Off" state when pressed

ToggleSwitchKnobFillOffDisabled Color of switch control's knob in "Off" state when disabled

ToggleSwitchKnobFillOn Color of switch control's knob in "On" state

ToggleSwitchKnobFillOnPointerOver Color of switch control's knob in "On" state on hover

ToggleSwitchKnobFillOnPressed Color of switch control's knob in "On" state when pressed

ToggleSwitchKnobFillOnDisabled Color of switch control's knob in "On" state when disabled

Constructors
ToggleSwitch()
ToggleSwitch()
ToggleSwitch()

Initializes a new instance of the ToggleSwitch class.

Properties
Header
Header
Header

Gets or sets the header content.

HeaderProperty
HeaderProperty
HeaderProperty

Identifies the Header dependency property.

HeaderTemplate
HeaderTemplate
HeaderTemplate

Gets or sets the DataTemplate used to display the control's header.

HeaderTemplateProperty
HeaderTemplateProperty
HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

IsOn
IsOn
IsOn

Gets or sets a value that declares whether the state of the ToggleSwitch is "On".

IsOnProperty
IsOnProperty
IsOnProperty

Identifies the IsOn dependency property.

OffContent
OffContent
OffContent

Provides the object content that should be displayed using the OffContentTemplate when this ToggleSwitch has
state of "Off".

OffContentProperty
OffContentProperty
OffContentProperty

Identifies the OffContent dependency property.

OffContentTemplate
OffContentTemplate
OffContentTemplate

Gets or sets the DataTemplate used to display the control's content while in "Off" state.

OffContentTemplateProperty
OffContentTemplateProperty
OffContentTemplateProperty

Identifies the OffContentTemplate dependency property.

OnContent
OnContent
OnContent

Provides the object content that should be displayed using the OnContentTemplate when this ToggleSwitch has
state of "On".

OnContentProperty
OnContentProperty
OnContentProperty

Identifies the OnContent dependency property.

OnContentTemplate
OnContentTemplate
OnContentTemplate

Gets or sets the DataTemplate used to display the control's content while in "On" state.

OnContentTemplateProperty
OnContentTemplateProperty
OnContentTemplateProperty

Identifies the OnContentTemplate dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ToggleSwitch control.

Methods
OnHeaderChanged(Object, Object)
OnHeaderChanged(Object, Object)
OnHeaderChanged(Object, Object)

Invoked when the content for Header changes.

OnOffContentChanged(Object, Object)
OnOffContentChanged(Object, Object)
OnOffContentChanged(Object, Object)

Invoked when the content for OffContent changes.

OnOnContentChanged(Object, Object)
OnOnContentChanged(Object, Object)
OnOnContentChanged(Object, Object)

Invoked when the content for OnContent changes.

OnToggled()
OnToggled()
OnToggled()
Invoked before the Toggled event is raised.

Events
Toggled
Toggled
Toggled

Occurs when "On"/"Off" state changes for this ToggleSwitch.

See Also
ToggleSwitch.Header ToggleSwitch.Header ToggleSwitch.
Header
I n this Article
Edit
Gets or sets the header content.
public : Platform::Object Header { get; set; }
winrt::Windows::Foundation::IInspectable Header();

void Header(winrt::Windows::Foundation::IInspectable header);


public object Header { get; set; }

<ToggleSwitch Header="textContent" />

Returns
object
The header content for the ToggleSwitch.
ToggleSwitch.HeaderProperty ToggleSwitch.Header
Property ToggleSwitch.HeaderProperty
I n this Article
Edit
Identifies the Header dependency property.
public : static DependencyProperty HeaderProperty { get; }
static DependencyProperty HeaderProperty();
public static DependencyProperty HeaderProperty { get; }

Returns
DependencyProperty
The identifier for the Header dependency property.
ToggleSwitch.HeaderTemplate ToggleSwitch.Header
Template ToggleSwitch.HeaderTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the control's header.
public : DataTemplate HeaderTemplate { get; set; }
DataTemplate HeaderTemplate();

void HeaderTemplate(DataTemplate headertemplate);


public DataTemplate HeaderTemplate { get; set; }

<ToggleSwitch>
<ToggleSwitch.HeaderTemplate>
singleDataTemplate
</ToggleSwitch.HeaderTemplate>
</ToggleSwitch>

Returns
DataTemplate
The DataTemplate used to display the control's header.
ToggleSwitch.HeaderTemplateProperty ToggleSwitch.
HeaderTemplateProperty ToggleSwitch.HeaderTemplate
Property
I n this Article
Edit
Identifies the HeaderTemplate dependency property.
public : static DependencyProperty HeaderTemplateProperty { get; }
static DependencyProperty HeaderTemplateProperty();
public static DependencyProperty HeaderTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the HeaderTemplate dependency property.
ToggleSwitch.IsOn ToggleSwitch.IsOn ToggleSwitch.IsOn
I n this Article
Edit
Gets or sets a value that declares whether the state of the ToggleSwitch is "On".

public : Platform::Boolean IsOn { get; set; }


bool IsOn();

void IsOn(bool ison);


public bool IsOn { get; set; }

<ToggleSwitch IsOn="bool" />

Returns
bool
true if the state is "On"; false if the state is "Off".

Remarks
"On" state uses the template from OnContentTemplate. "Off" state uses the template from OffContentTemplate.
ToggleSwitch.IsOnProperty ToggleSwitch.IsOnProperty
ToggleSwitch.IsOnProperty
I n this Article
Edit
Identifies the IsOn dependency property.
public : static DependencyProperty IsOnProperty { get; }
static DependencyProperty IsOnProperty();
public static DependencyProperty IsOnProperty { get; }

Returns
DependencyProperty
The identifier for the IsOn dependency property.
ToggleSwitch.OffContent ToggleSwitch.OffContent
ToggleSwitch.OffContent
I n this Article
Edit
Provides the object content that should be displayed using the OffContentTemplate when this ToggleSwitch has state
of "Off".
public : Platform::Object OffContent { get; set; }
winrt::Windows::Foundation::IInspectable OffContent();

void OffContent(winrt::Windows::Foundation::IInspectable offcontent);


public object OffContent { get; set; }

<ToggleSwitch OffContent="stringContent"/>

Returns
object
The object content. In some cases this is a string, in other cases it is a single element that provides a root for further
composition content. Probably the most common "set" usage is to place a binding here.
ToggleSwitch.OffContentProperty ToggleSwitch.Off
ContentProperty ToggleSwitch.OffContentProperty
I n this Article
Edit
Identifies the OffContent dependency property.
public : static DependencyProperty OffContentProperty { get; }
static DependencyProperty OffContentProperty();
public static DependencyProperty OffContentProperty { get; }

Returns
DependencyProperty
The identifier for the OffContent dependency property.
ToggleSwitch.OffContentTemplate ToggleSwitch.Off
ContentTemplate ToggleSwitch.OffContentTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the control's content while in "Off" state.
public : DataTemplate OffContentTemplate { get; set; }
DataTemplate OffContentTemplate();

void OffContentTemplate(DataTemplate offcontenttemplate);


public DataTemplate OffContentTemplate { get; set; }

<ToggleSwitch>
<ToggleSwitch.OffContentTemplate>
singleDataTemplate
</ToggleSwitch.OffContentTemplate>
</ToggleSwitch>

Returns
DataTemplate
The DataTemplate that displays the control's content while in "Off" state.
ToggleSwitch.OffContentTemplateProperty ToggleSwitch.
OffContentTemplateProperty ToggleSwitch.OffContent
TemplateProperty
I n this Article
Edit
Identifies the OffContentTemplate dependency property.
public : static DependencyProperty OffContentTemplateProperty { get; }
static DependencyProperty OffContentTemplateProperty();
public static DependencyProperty OffContentTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the OffContentTemplate dependency property.
ToggleSwitch.OnContent ToggleSwitch.OnContent
ToggleSwitch.OnContent
I n this Article
Edit
Provides the object content that should be displayed using the OnContentTemplate when this ToggleSwitch has state
of "On".
public : Platform::Object OnContent { get; set; }
winrt::Windows::Foundation::IInspectable OnContent();

void OnContent(winrt::Windows::Foundation::IInspectable oncontent);


public object OnContent { get; set; }

<ToggleSwitch OnContent="stringContent"/>

Returns
object
The object content. In some cases this is a string, in other cases it is a single element that provides a root for further
composition content. Probably the most common "set" usage is to place a binding here.
ToggleSwitch.OnContentProperty ToggleSwitch.On
ContentProperty ToggleSwitch.OnContentProperty
I n this Article
Edit
Identifies the OnContent dependency property.
public : static DependencyProperty OnContentProperty { get; }
static DependencyProperty OnContentProperty();
public static DependencyProperty OnContentProperty { get; }

Returns
DependencyProperty
The identifier for the OnContent dependency property.
ToggleSwitch.OnContentTemplate ToggleSwitch.On
ContentTemplate ToggleSwitch.OnContentTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display the control's content while in "On" state.
public : DataTemplate OnContentTemplate { get; set; }
DataTemplate OnContentTemplate();

void OnContentTemplate(DataTemplate oncontenttemplate);


public DataTemplate OnContentTemplate { get; set; }

<ToggleSwitch>
<ToggleSwitch.OnContentTemplate>
singleDataTemplate
</ToggleSwitch.OnContentTemplate>
</ToggleSwitch>

Returns
DataTemplate
The DataTemplate that displays the control's content while in "On" state.
ToggleSwitch.OnContentTemplateProperty ToggleSwitch.
OnContentTemplateProperty ToggleSwitch.OnContent
TemplateProperty
I n this Article
Edit
Identifies the OnContentTemplate dependency property.
public : static DependencyProperty OnContentTemplateProperty { get; }
static DependencyProperty OnContentTemplateProperty();
public static DependencyProperty OnContentTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the OnContentTemplate dependency property.
ToggleSwitch.OnHeaderChanged ToggleSwitch.On
HeaderChanged ToggleSwitch.OnHeaderChanged
I n this Article
Edit
Invoked when the content for Header changes.
protected : virtual void OnHeaderChanged(Platform::Object oldContent, Platform::Object newContent)
virtual void OnHeaderChanged(winrt::Windows::Foundation::IInspectable oldContent,
winrt::Windows::Foundation::IInspectable newContent) const;
protected virtual void OnHeaderChanged(Object oldContent, Object newContent)

Parameters
oldContent Object
The string or object content of the old content.
newContent Object
The string or object content of the new content.

Remarks
Override this method in order to add steps to behavior of a custom derived class, or to change the oldContent or
newContent values before passing them on to base.
ToggleSwitch.OnOffContentChanged ToggleSwitch.On
OffContentChanged ToggleSwitch.OnOffContent
Changed
I n this Article
Edit
Invoked when the content for OffContent changes.
protected : virtual void OnOffContentChanged(Platform::Object oldContent, Platform::Object
newContent)
virtual void OnOffContentChanged(winrt::Windows::Foundation::IInspectable oldContent,
winrt::Windows::Foundation::IInspectable newContent) const;
protected virtual void OnOffContentChanged(Object oldContent, Object newContent)

Parameters
oldContent Object
The string or object content of the old content.
newContent Object
The string or object content of the new content that is about to display.

Remarks
Override this method in order to add steps to behavior of a custom derived class, or to change the oldContent or
newContent values before passing them on to base.
ToggleSwitch.OnOnContentChanged ToggleSwitch.OnOn
ContentChanged ToggleSwitch.OnOnContentChanged
I n this Article
Edit
Invoked when the content for OnContent changes.
protected : virtual void OnOnContentChanged(Platform::Object oldContent, Platform::Object
newContent)
virtual void OnOnContentChanged(winrt::Windows::Foundation::IInspectable oldContent,
winrt::Windows::Foundation::IInspectable newContent) const;
protected virtual void OnOnContentChanged(Object oldContent, Object newContent)

Parameters
oldContent Object
The string or object content of the old content.
newContent Object
The string or object content of the new content that is about to display.

Remarks
Override this method in order to add steps to behavior of a custom derived class, or to change the oldContent or
newContent values before passing them on to base.
ToggleSwitch.OnToggled ToggleSwitch.OnToggled Toggle
Switch.OnToggled
I n this Article
Edit
Invoked before the Toggled event is raised.
protected : virtual void OnToggled()
virtual void OnToggled() const;
protected virtual void OnToggled()

Remarks
Override this method to provide a class-based behavior that should be invoked each time that the Toggled event is
raised. The event data does not contain the state information, but you can determine the state from IsOn, which
represents the new value.
ToggleSwitch.TemplateSettings ToggleSwitch.Template
Settings ToggleSwitch.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ToggleSwitch control.
public : ToggleSwitchTemplateSettings TemplateSettings { get; }
ToggleSwitchTemplateSettings TemplateSettings();
public ToggleSwitchTemplateSettings TemplateSettings { get; }

Returns
ToggleSwitchTemplateSettings
An object that provides calculated values for templates.
ToggleSwitch.Toggled ToggleSwitch.Toggled Toggle
Switch.Toggled
I n this Article
Edit
Occurs when "On"/"Off" state changes for this ToggleSwitch.
public : event RoutedEventHandler Toggled
// Register
event_token Toggled(RoutedEventHandler const& handler) const;

// Revoke with event_token


void Toggled(event_token const& cookie) const;

// Revoke with event_revoker


Toggled_revoker Toggled(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler Toggled

<ToggleSwitch Toggled="eventhandler"/>
ToggleSwitch ToggleSwitch ToggleSwitch
I n this Article
Edit
Initializes a new instance of the ToggleSwitch class.

public : ToggleSwitch()
ToggleSwitch() const;
public ToggleSwitch()
ToolTip ToolTip ToolTip Class
Represents a control that creates a pop-up window that displays information for an element in the UI.

D eclaration
public : class ToolTip : ContentControl, IToolTip, IToolTip2
struct winrt::Windows::UI::Xaml::Controls::ToolTip : ContentControl, IToolTip, IToolTip2
public class ToolTip : ContentControl, IToolTip, IToolTip2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl

Remarks
A ToolTip is a short description that is linked to another control or object. ToolTip s help users understand unfamiliar
objects that aren't described directly in the UI. They display automatically when the user presses and holds or hovers
the mouse pointer over a control. The ToolTip disappears after a short time, or when the user moves the pointer.
Here's a ToolTip for a Button.

For design guidelines, see Guidelines for tooltips.


Usage
A ToolTip must be assigned to another UI element that is its owner. The ToolTipService class provides static methods to
display a ToolTip.
In XAML, use the ToolTipService.Tooltip attached property to assign the ToolTip to an owner.
<Button Content="Submit" ToolTipService.ToolTip="Click to submit"/>

In code, use the ToolTipService.SetToolTip method to assign the ToolTip to an owner.


<Button x:Name="submitButton" Content="Submit"/>

ToolTip toolTip = new ToolTip();


toolTip.Content = "Click to submit";
ToolTipService.SetToolTip(submitButton, toolTip);

You can use any object as the Content of a ToolTip. Here's an example of using an Image in a ToolTip.
<TextBlock Text="store logo">
<ToolTipService.ToolTip>
<Image Source="Assets/StoreLogo.png"/>
</ToolTipService.ToolTip>
</TextBlock>

P lacement
By default, a ToolTip is displayed centered above the pointer. The placement is not constrained by the app window, so
the ToolTip might be displayed partially or completely outside of the app window bounds.
If a ToolTip obscures the content it is referring to, you can adjust it's placement. Use the Placement property or
ToolTipService.Placement attached property to place the ToolTip above, below, left, or right of the pointer. You can set
the VerticalOffset and HorizontalOffset properties to change the distance between the pointer and the ToolTip.
Control style and template
You can modify the default Style and ControlTemplate to give the control a unique appearance. For information about
modifying a control's style and template, see Styling controls. The default style, template, and resources that define the
look of the control are included in the generic.xaml file. For design purposes, generic.xaml is available in the (Program
Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP&lt;SDK version>\Generic folder from a
Windows Software Development Kit (SDK) installation. Styles and resources from different versions of the SDK might
have different values.
Starting in Windows 10, version 1607 (Windows Software Development Kit (SDK) version 10.0.14393.0), generic.xaml
includes resources that you can use to modify the colors of a control in different visual states without modifying the
control template. In apps that target this software development kit (SDK) or later, modifying these resources is
preferred to setting properties such as Background and Foreground. For more info, see the Light-weight styling
section of the Styling controls article.
This table shows the resources used by the ToolTip control.

R ES O U R CE K EY D ES CR IPTIO N

ToolTipForeground Text color in tool tip

ToolTipBackground Background color

ToolTipBorderBrush Border color

Notes for previous versions


Windows 8.x ToolTip is intended only for use in Windows. The ToolTip type is available in Windows Phone
projects for compatibility with universal project templates, but the ToolTip is not shown in the Windows Phone UI.

ToolTip is displayed only within the bounds of the app window. It's placement might be adjusted to stay within those
bounds.

Constructors
ToolTip()
ToolTip()
ToolTip()

Initializes a new instance of the ToolTip class.


Properties
HorizontalOffset
HorizontalOffset
HorizontalOffset

Gets or sets the horizontal distance between the target origin and the pop-up alignment point.

HorizontalOffsetProperty
HorizontalOffsetProperty
HorizontalOffsetProperty

Identifies the HorizontalOffset dependency property.

IsOpen
IsOpen
IsOpen

Gets or sets a value that indicates whether the ToolTip is visible.

IsOpenProperty
IsOpenProperty
IsOpenProperty

Identifies the IsOpen dependency property.

Placement
Placement
Placement

Gets or sets how a ToolTip is positioned in relation to the placement target element.

PlacementProperty
PlacementProperty
PlacementProperty

Identifies the Placement dependency property.

PlacementRect
PlacementRect
PlacementRect

Gets or sets the rectangular area that the tooltip should be positioned in relation to when opened by the
ToolTipService. If space allows, the open tooltip will not occlude the area defined by its PlacementRect.

PlacementRectProperty
PlacementRectProperty
PlacementRectProperty

Identifies the PlacementRect dependency property.

PlacementTarget
PlacementTarget
PlacementTarget

Gets or sets the visual element or control that the tool tip should be positioned in relation to when opened by the
ToolTipService.

PlacementTargetProperty
PlacementTargetProperty
PlacementTargetProperty

Identifies the PlacementTarget dependency property.

TemplateSettings
TemplateSettings
TemplateSettings

Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ToolTip.

VerticalOffset
VerticalOffset
VerticalOffset

Gets or sets the vertical distance between the target origin and the pop-up alignment point.

VerticalOffsetProperty
VerticalOffsetProperty
VerticalOffsetProperty

Identifies the VerticalOffset dependency property.

Events
Closed
Closed
Closed

Occurs when a ToolTip is closed and is no longer visible.

Opened
Opened
Opened

Occurs when a ToolTip becomes visible.

See Also
ContentControl
ContentControl
ContentControl
ContentControl
ToolTip.Closed ToolTip.Closed ToolTip.Closed
I n this Article
Edit
Occurs when a ToolTip is closed and is no longer visible.

public : event RoutedEventHandler Closed


// Register
event_token Closed(RoutedEventHandler const& handler) const;

// Revoke with event_token


void Closed(event_token const& cookie) const;

// Revoke with event_revoker


Closed_revoker Closed(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler Closed

<ToolTip Closed="eventhandler"/>
ToolTip.HorizontalOffset ToolTip.HorizontalOffset Tool
Tip.HorizontalOffset
I n this Article
Edit
Gets or sets the horizontal distance between the target origin and the pop-up alignment point.
public : double HorizontalOffset { get; set; }
double HorizontalOffset();

void HorizontalOffset(double horizontaloffset);


public double HorizontalOffset { get; set; }

<ToolTip HorizontalOffset="double"/>

Returns
double
The horizontal distance between the target origin and the pop-up alignment point. The default is 0.
ToolTip.HorizontalOffsetProperty ToolTip.Horizontal
OffsetProperty ToolTip.HorizontalOffsetProperty
I n this Article
Edit
Identifies the HorizontalOffset dependency property.
public : static DependencyProperty HorizontalOffsetProperty { get; }
static DependencyProperty HorizontalOffsetProperty();
public static DependencyProperty HorizontalOffsetProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalOffset dependency property.
ToolTip.IsOpen ToolTip.IsOpen ToolTip.IsOpen
I n this Article
Edit
Gets or sets a value that indicates whether the ToolTip is visible.

public : Platform::Boolean IsOpen { get; set; }


bool IsOpen();

void IsOpen(bool isopen);


public bool IsOpen { get; set; }

Returns
bool
true if the ToolTip is visible; otherwise, false. The default is false.

Remarks
This property is not typically set in XAML.
A ToolTip must be assigned to another UI element that is its owner. In XAML, use the ToolTipService.Tooltip attached
property to assign the ToolTip to an owner. In code, use the ToolTipService.SetToolTip method to assign the ToolTip to
an owner. If you set the IsOpen property to true in your app code before the ToolTip is assigned to an owner, an
exception is thrown.
See ToolTipService.Tooltip
Also
ToolTip.IsOpenProperty ToolTip.IsOpenProperty ToolTip.
IsOpenProperty
I n this Article
Edit
Identifies the IsOpen dependency property.
public : static DependencyProperty IsOpenProperty { get; }
static DependencyProperty IsOpenProperty();
public static DependencyProperty IsOpenProperty { get; }

Returns
DependencyProperty
The identifier for the IsOpen dependency property.
ToolTip.Opened ToolTip.Opened ToolTip.Opened
I n this Article
Edit
Occurs when a ToolTip becomes visible.

public : event RoutedEventHandler Opened


// Register
event_token Opened(RoutedEventHandler const& handler) const;

// Revoke with event_token


void Opened(event_token const& cookie) const;

// Revoke with event_revoker


Opened_revoker Opened(auto_revoke_t, RoutedEventHandler const& handler) const;
public event RoutedEventHandler Opened

<ToolTip Opened="eventhandler"/>
ToolTip.Placement ToolTip.Placement ToolTip.Placement
I n this Article
Edit
Gets or sets how a ToolTip is positioned in relation to the placement target element.

public : PlacementMode Placement { get; set; }


PlacementMode Placement();

void Placement(PlacementMode placement);


public PlacementMode Placement { get; set; }

<ToolTip Placement="placementModeMemberName"/>

Returns
PlacementMode
One of the PlacementMode values.

Examples
The following code example demonstrates the placement modes for a ToolTip.
<StackPanel Margin="120" >
<TextBlock Text="ToolTip Control"/>
<TextBlock Text="Hover over an item to see its ToolTip: " Margin="0,10"/>
<ListBox Width="100" HorizontalAlignment="Left">
<ListBoxItem Content="Left"
ToolTipService.ToolTip="ToolTip to the left."
ToolTipService.Placement="Left" />
<ListBoxItem Content="Right"
ToolTipService.ToolTip="ToolTip to the right."
ToolTipService.Placement="Right" />
<ListBoxItem Content="Top"
ToolTipService.ToolTip="ToolTip at the top."
ToolTipService.Placement="Top" />
<ListBoxItem Content="Bottom"
ToolTipService.ToolTip="ToolTip at the bottom."
ToolTipService.Placement="Bottom"/>
<ListBoxItem Content="Mouse"
ToolTipService.ToolTip="ToolTip based on the cursor position."
ToolTipService.Placement="Mouse"/>
</ListBox>
</StackPanel>

Remarks
If there is no explicit PlacementTarget, the placement target for a ToolTip is the element that specifies the ToolTip as the
value for its TooltipService.ToolTip attached property value, and any Placement value applies to that target.
Placement and PlacementTarget are usually left as the defaults. The scenario for specifying either or both of these
properties is if you are trying to avoid a case where the tooltip obscures the content it is referring to while the tooltip is
displayed.
See PlacementMode
Also
ToolTip.PlacementProperty ToolTip.PlacementProperty
ToolTip.PlacementProperty
I n this Article
Edit
Identifies the Placement dependency property.
public : static DependencyProperty PlacementProperty { get; }
static DependencyProperty PlacementProperty();
public static DependencyProperty PlacementProperty { get; }

Returns
DependencyProperty
The identifier for the Placement dependency property.
ToolTip.PlacementRect ToolTip.PlacementRect ToolTip.
PlacementRect
I n this Article
Edit
Gets or sets the rectangular area that the tooltip should be positioned in relation to when opened by the
ToolTipService. If space allows, the open tooltip will not occlude the area defined by its PlacementRect.
public : IReference<Rect> PlacementRect { get; set; }
IReference<Rect> PlacementRect();

void PlacementRect(IReference<Rect> placementrect);


public Nullable<Rect> PlacementRect { get; set; }

Returns
Nullable<Rect>
The rectangular area that the tooltip is positioned in relation to when opened by the ToolTipService. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)

Remarks
PlacementRect anchors the tooltip's position and also serves as an area that the opened tooltip will not occlude,
provided there's sufficient space to draw tooltip outside this area. You can specify the origin of the rectangle relative to
the tooltip's owner, and the height and width of the exclusion area. The Placement property will define if tooltip should
draw above, below, left, or right of the PlacementRect.
ToolTip.PlacementRectProperty ToolTip.PlacementRect
Property ToolTip.PlacementRectProperty
I n this Article
Edit
Identifies the PlacementRect dependency property.
public : static DependencyProperty PlacementRectProperty { get; }
static DependencyProperty PlacementRectProperty();
public static DependencyProperty PlacementRectProperty { get; }

Returns
DependencyProperty
The identifier for the PlacementRect dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


ToolTip.PlacementTarget ToolTip.PlacementTarget Tool
Tip.PlacementTarget
I n this Article
Edit
Gets or sets the visual element or control that the tool tip should be positioned in relation to when opened by the
ToolTipService.
public : UIElement PlacementTarget { get; set; }
UIElement PlacementTarget();

void PlacementTarget(UIElement placementtarget);


public UIElement PlacementTarget { get; set; }

<ToolTip PlacementTarget="{Binding ElementName=placementTargetName}"/>

Returns
UIElement
The visual element or control that the tool tip is positioned in relation to when opened by the ToolTipService. The
default is null.

Remarks
If there is no explicit PlacementTarget, the placement target for a ToolTip is the element that specifies the ToolTip as the
value for its TooltipService.ToolTip attached property value, and any Placement value applies to that target. The
placement target determination is based on visual tree composition, and whether to display a tooltip at all is parallel to
the target's hit test characteristics. A Control instance where IsEnabled is false will not display a ToolTip.
Placement and PlacementTarget are usually left as the defaults. The scenario for specifying either or both of these
properties is if you are trying to avoid a case where the tooltip obscures the content it is referring to while the tooltip is
displayed.
See PlacementMode
Also
ToolTip.PlacementTargetProperty ToolTip.Placement
TargetProperty ToolTip.PlacementTargetProperty
I n this Article
Edit
Identifies the PlacementTarget dependency property.
public : static DependencyProperty PlacementTargetProperty { get; }
static DependencyProperty PlacementTargetProperty();
public static DependencyProperty PlacementTargetProperty { get; }

Returns
DependencyProperty
The identifier for the PlacementTarget dependency property.
ToolTip.TemplateSettings ToolTip.TemplateSettings Tool
Tip.TemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as TemplateBinding sources when defining
templates for a ToolTip.
public : ToolTipTemplateSettings TemplateSettings { get; }
ToolTipTemplateSettings TemplateSettings();
public ToolTipTemplateSettings TemplateSettings { get; }

Returns
ToolTipTemplateSettings
An object that provides calculated values for templates.
ToolTip ToolTip ToolTip
I n this Article
Edit
Initializes a new instance of the ToolTip class.

public : ToolTip()
ToolTip() const;
public ToolTip()
ToolTip.VerticalOffset ToolTip.VerticalOffset ToolTip.
VerticalOffset
I n this Article
Edit
Gets or sets the vertical distance between the target origin and the pop-up alignment point.
public : double VerticalOffset { get; set; }
double VerticalOffset();

void VerticalOffset(double verticaloffset);


public double VerticalOffset { get; set; }

<ToolTip VerticalOffset="double"/>

Returns
double
The vertical distance between the target origin and the pop-up alignment point. The default is 0.
ToolTip.VerticalOffsetProperty ToolTip.VerticalOffset
Property ToolTip.VerticalOffsetProperty
I n this Article
Edit
Identifies the VerticalOffset dependency property.
public : static DependencyProperty VerticalOffsetProperty { get; }
static DependencyProperty VerticalOffsetProperty();
public static DependencyProperty VerticalOffsetProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalOffset dependency property.
ToolTipService ToolTipService ToolTipService Class
Represents a service that provides static methods to display a ToolTip.

D eclaration
public : sealed class ToolTipService : IToolTipService
struct winrt::Windows::UI::Xaml::Controls::ToolTipService : IToolTipService
public sealed class ToolTipService : IToolTipService

I nheritance H ierarchy
None

Remarks
ToolTipService X A ML attached properties
ToolTipService is the host service class for several Extensible Application Markup Language (XAML ) attached
properties. The purpose of these attached properties is to enable target elements to qualify how they should be
positioned relative to placement target elements.
ToolTipService provides the following attached properties for Extensible Application Markup Language (XAML ) usage:
ToolTipService.Placement
ToolTipService.PlacementTarget
ToolTipService.Tooltip
In order to support Extensible Application Markup Language (XAML ) processor access to the attached properties, and
also to expose equivalent get and set operations to code, each Extensible Application Markup Language (XAML )
attached property has a pair of Get and Set accessor methods. For example, the GetPlacement and SetPlacement
methods support and provide the equivalent code-only support for ToolTipService.Placement. Alternatively, you can
use the dependency property system to get or set the value of the attached property. Call GetValue or SetValue,
passing the arguments of the dependency property identifier to set, and a reference to the target object on which to get
or set the value.
A ToolTip must be assigned to another UI element that is its owner. In Extensible Application Markup Language
(XAML ), use the ToolTipService.Tooltip attached property to assign the ToolTip to an owner. In code, use the
ToolTipService.SetToolTip method to assign the ToolTip to an owner.
P lacement
By default, a ToolTip is displayed centered above the pointer. The placement is not constrained by the app window, so
the ToolTip might be displayed partially or completely outside of the app window bounds.
If a ToolTip obscures the content it is referring to, you can adjust it's placement. Use the ToolTipService.Placement
attached property to place the ToolTip above, below, left, or right of the pointer.
Notes for previous versions
Windows 8.x ToolTip is intended only for use in Windows. The ToolTip type is available in Windows Phone
projects for compatibility with universal project templates, but the ToolTip is not shown in the Windows Phone UI.

ToolTip is displayed only within the bounds of the app window. It's placement might be adjusted to stay within those
bounds.
Properties
PlacementProperty
PlacementProperty
PlacementProperty

Identifies the ToolTipService.Placement XAML attached property.

PlacementTargetProperty
PlacementTargetProperty
PlacementTargetProperty

Identifies the ToolTipService.PlacementTarget XAML attached property.

ToolTipProperty
ToolTipProperty
ToolTipProperty

Identifies the ToolTipService.ToolTip XAML attached property.

Methods
GetPlacement(DependencyObject)
GetPlacement(DependencyObject)
GetPlacement(DependencyObject)

Gets the ToolTipService.Placement XAML attached property value for the specified target element.

GetPlacementTarget(DependencyObject)
GetPlacementTarget(DependencyObject)
GetPlacementTarget(DependencyObject)

Gets the ToolTipService.PlacementTarget XAML attached property value for the specified target element.

GetToolTip(DependencyObject)
GetToolTip(DependencyObject)
GetToolTip(DependencyObject)

Gets the value of the ToolTipService.ToolTip XAML attached property for an object.

SetPlacement(DependencyObject, PlacementMode)
SetPlacement(DependencyObject, PlacementMode)
SetPlacement(DependencyObject, PlacementMode)

Sets the ToolTipService.Placement XAML attached property value for the specified target element.
SetPlacementTarget(DependencyObject, UIElement)
SetPlacementTarget(DependencyObject, UIElement)
SetPlacementTarget(DependencyObject, UIElement)

Sets the ToolTipService.PlacementTarget XAML attached property value for the specified target element.

SetToolTip(DependencyObject, Object)
SetToolTip(DependencyObject, Object)
SetToolTip(DependencyObject, Object)

Sets the value of the ToolTipService.ToolTip XAML attached property.

See Also
ToolTipService.GetPlacement ToolTipService.Get
Placement ToolTipService.GetPlacement
I n this Article
Edit
Gets the ToolTipService.Placement XAML attached property value for the specified target element.
public : static PlacementMode GetPlacement(DependencyObject element)
static PlacementMode GetPlacement(DependencyObject element) const;
public static PlacementMode GetPlacement(DependencyObject element)

Parameters
element DependencyObject
The target element for the attached property value.
Returns
PlacementMode
The relative position of the specified tooltip.
ToolTipService.GetPlacementTarget ToolTipService.Get
PlacementTarget ToolTipService.GetPlacementTarget
I n this Article
Edit
Gets the ToolTipService.PlacementTarget XAML attached property value for the specified target element.
public : static UIElement GetPlacementTarget(DependencyObject element)
static UIElement GetPlacementTarget(DependencyObject element) const;
public static UIElement GetPlacementTarget(DependencyObject element)

Parameters
element DependencyObject
The target element for the attached property value.
Returns
UIElement
The visual element that the tooltip is positioned relative to.
ToolTipService.GetToolTip ToolTipService.GetToolTip Tool
TipService.GetToolTip
I n this Article
Edit
Gets the value of the ToolTipService.ToolTip XAML attached property for an object.
public : static Platform::Object GetToolTip(DependencyObject element)
static winrt::Windows::Foundation::IInspectable GetToolTip(DependencyObject element) const;
public static object GetToolTip(DependencyObject element)

Parameters
element DependencyObject
The object from which the property value is read.
Returns
object
The object's tooltip content.
ToolTipService.PlacementProperty ToolTipService.
PlacementProperty ToolTipService.PlacementProperty
I n this Article
Edit
Identifies the ToolTipService.Placement XAML attached property.
public : static DependencyProperty PlacementProperty { get; }
static DependencyProperty PlacementProperty();
public static DependencyProperty PlacementProperty { get; }

Returns
DependencyProperty
The identifier for the ToolTipService.Placement XAML attached property.
ToolTipService.PlacementTargetProperty ToolTipService.
PlacementTargetProperty ToolTipService.Placement
TargetProperty
I n this Article
Edit
Identifies the ToolTipService.PlacementTarget XAML attached property.
public : static DependencyProperty PlacementTargetProperty { get; }
static DependencyProperty PlacementTargetProperty();
public static DependencyProperty PlacementTargetProperty { get; }

Returns
DependencyProperty
The identifier for the ToolTipService.PlacementTarget XAML attached property.
ToolTipService.SetPlacement ToolTipService.Set
Placement ToolTipService.SetPlacement
I n this Article
Edit
Sets the ToolTipService.Placement XAML attached property value for the specified target element.
public : static void SetPlacement(DependencyObject element, PlacementMode value)
static void SetPlacement(DependencyObject element, PlacementMode value) const;
public static void SetPlacement(DependencyObject element, PlacementMode value)

Parameters
element DependencyObject
The target element for the attached property value.
value PlacementMode
One of the PlacementMode values, which specifies where the tooltip should appear relative to the control that is the
placement target.

Remarks
This method supports the ToolTipService.Placement attached property usage for Extensible Application Markup
Language (XAML ). The target element is not necessarily a ToolTip, it might be an element that owns an inferred tooltip
through usage of ToolTipService APIs. Also, the target element is not necessarily the final placement target, because
that can be reset by setting the ToolTipService.PlacementTarget attached property.
ToolTipService.SetPlacementTarget ToolTipService.Set
PlacementTarget ToolTipService.SetPlacementTarget
I n this Article
Edit
Sets the ToolTipService.PlacementTarget XAML attached property value for the specified target element.
public : static void SetPlacementTarget(DependencyObject element, UIElement value)
static void SetPlacementTarget(DependencyObject element, UIElement value) const;
public static void SetPlacementTarget(DependencyObject element, UIElement value)

Parameters
element DependencyObject
The target element for the attached property value.
value UIElement
The visual element that should be the placement target for the tooltip.

Remarks
This method supports the ToolTipService.PlacementTarget attached property usage for Extensible Application Markup
Language (XAML ). The value for element is not necessarily a ToolTip, it might be an element that owns an inferred
tooltip through usage of ToolTipService APIs. You can use the ToolTipService.PlacementTarget attached property to set
the placement target to be different than the element that owns the ToolTip for purposes of UI behavior and built-in
PointerEntered / PointerExited handling. This enables controls to act like a unit for tooltip display, so that the tooltip
from one control does not obscure an important part of a related control when it displays.
ToolTipService.SetToolTip ToolTipService.SetToolTip Tool
TipService.SetToolTip
I n this Article
Edit
Sets the value of the ToolTipService.ToolTip XAML attached property.
public : static void SetToolTip(DependencyObject element, Platform::Object value)
static void SetToolTip(DependencyObject element, winrt::Windows::Foundation::IInspectable value)
const;
public static void SetToolTip(DependencyObject element, Object value)

Parameters
element DependencyObject
The object to set tooltip content on.
value Object
The value to set for tooltip content.

Remarks
A ToolTip must be assigned to another UI element that is its owner. In Extensible Application Markup Language
(XAML ), use the ToolTipService.Tooltip attached property to assign the ToolTip to an owner. In code, use the
ToolTipService.SetToolTip method to assign the ToolTip to an owner.
See ToolTipService.ToolTip or ToolTip to learn more about the object content or text that is appropriate to use as tooltip
content.
ToolTipService.ToolTipProperty ToolTipService.ToolTip
Property ToolTipService.ToolTipProperty
I n this Article
Edit
Identifies the ToolTipService.ToolTip XAML attached property.
public : static DependencyProperty ToolTipProperty { get; }
static DependencyProperty ToolTipProperty();
public static DependencyProperty ToolTipProperty { get; }

Returns
DependencyProperty
The identifier for the ToolTipService.ToolTip XAML attached property.
TreeView TreeView TreeView Class
Represents a hierarchical list with expanding and collapsing nodes that contain nested items.

D eclaration
public : class TreeView : Control, ITreeView, ITreeView2
struct winrt::Windows::UI::Xaml::Controls::TreeView : Control, ITreeView, ITreeView2
public class TreeView : Control, ITreeView, ITreeView2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Constructors
TreeView()
TreeView()
TreeView()

Initializes a new instance of the TreeView control.

Properties
CanDragItems
CanDragItems
CanDragItems

Gets or sets a value that indicates whether items in the view can be dragged as data payload.

CanDragItemsProperty
CanDragItemsProperty
CanDragItemsProperty

Identifies the CanDragItems dependency property.

CanReorderItems
CanReorderItems
CanReorderItems

Gets or sets a value that indicates whether items in the view can be reordered through user interaction.

CanReorderItemsProperty
CanReorderItemsProperty
CanReorderItemsProperty
Identifies the CanReorderItems dependency property.

ItemContainerStyle
ItemContainerStyle
ItemContainerStyle

Gets or sets the style that is used when rendering the item containers.

ItemContainerStyleProperty
ItemContainerStyleProperty
ItemContainerStyleProperty

Identifies the ItemContainerStyle dependency property.

ItemContainerStyleSelector
ItemContainerStyleSelector
ItemContainerStyleSelector

Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector returns different Style values to
use for the item container based on characteristics of the object being displayed.

ItemContainerStyleSelectorProperty
ItemContainerStyleSelectorProperty
ItemContainerStyleSelectorProperty

Identifies the ItemContainerStyleSelector dependency property.

ItemContainerTransitions
ItemContainerTransitions
ItemContainerTransitions

Gets or sets the collection of Transition style elements that apply to the item containers of a TreeView.

ItemContainerTransitionsProperty
ItemContainerTransitionsProperty
ItemContainerTransitionsProperty

Identifies the ItemContainerTransitions dependency property.

ItemsSource
ItemsSource
ItemsSource

Gets or sets an object source used to generate the content of the TreeView.
ItemsSourceProperty
ItemsSourceProperty
ItemsSourceProperty

Identifies the ItemsSource dependency property.

ItemTemplate
ItemTemplate
ItemTemplate

Gets or sets the DataTemplate used to display each item.

ItemTemplateProperty
ItemTemplateProperty
ItemTemplateProperty

Identifies the ItemTemplate dependency property.

ItemTemplateSelector
ItemTemplateSelector
ItemTemplateSelector

Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector referenced by
this property returns a template to apply to items.

ItemTemplateSelectorProperty
ItemTemplateSelectorProperty
ItemTemplateSelectorProperty

Identifies the ItemTemplateSelector dependency property.

RootNodes
RootNodes
RootNodes

Gets or sets the collection of root nodes of the tree.

SelectedNodes
SelectedNodes
SelectedNodes

Gets or sets the collection of nodes that are selected in the tree.

SelectionMode
SelectionMode
SelectionMode

Gets or sets the selection behavior for a TreeView instance.

SelectionModeProperty
SelectionModeProperty
SelectionModeProperty

Identifies the SelectionMode dependency property.

Methods
Collapse(TreeViewNode)
Collapse(TreeViewNode)
Collapse(TreeViewNode)

Collapses the specified node in the tree.

ContainerFromItem(Object)
ContainerFromItem(Object)
ContainerFromItem(Object)

Returns the container corresponding to the specified item.

ContainerFromNode(TreeViewNode)
ContainerFromNode(TreeViewNode)
ContainerFromNode(TreeViewNode)

Returns the container corresponding to the specified node.

Expand(TreeViewNode)
Expand(TreeViewNode)
Expand(TreeViewNode)

Expands the specified node in the tree.

ItemFromContainer(DependencyObject)
ItemFromContainer(DependencyObject)
ItemFromContainer(DependencyObject)

Returns the item that corresponds to the specified, generated container.

NodeFromContainer(DependencyObject)
NodeFromContainer(DependencyObject)
NodeFromContainer(DependencyObject)
Returns the TreeViewNode corresponding to the specified container.

SelectAll()
SelectAll()
SelectAll()

Selects all nodes in the tree.

Events
Collapsed
Collapsed
Collapsed

Occurs when a node in the tree is collapsed.

DragItemsCompleted
DragItemsCompleted
DragItemsCompleted

Occurs when a drag operation that involves one of the items in the view is ended.

DragItemsStarting
DragItemsStarting
DragItemsStarting

Occurs when a drag operation that involves one of the items in the view is initiated.

Expanding
Expanding
Expanding

Occurs when a node in the tree starts to expand.

ItemInvoked
ItemInvoked
ItemInvoked

Occurs when an item in the tree is invoked.


TreeView.CanDragItems TreeView.CanDragItems Tree
View.CanDragItems
I n this Article
Edit
Gets or sets a value that indicates whether items in the view can be dragged as data payload.
public : Platform::Boolean CanDragItems { get; set; }
bool CanDragItems();

void CanDragItems(bool candragitems);


public bool CanDragItems { get; set; }

<TreeView CanDragItems="bool"/>

Returns
bool
true if items in the view can be dragged as data payload; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.CanDragItemsProperty TreeView.CanDragItems
Property TreeView.CanDragItemsProperty
I n this Article
Edit
Identifies the CanDragItems dependency property.
public : static DependencyProperty CanDragItemsProperty { get; }
static DependencyProperty CanDragItemsProperty();
public static DependencyProperty CanDragItemsProperty { get; }

Returns
DependencyProperty
The identifier for the CanDragItems dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.CanReorderItems TreeView.CanReorderItems
TreeView.CanReorderItems
I n this Article
Edit
Gets or sets a value that indicates whether items in the view can be reordered through user interaction.
public : Platform::Boolean CanReorderItems { get; set; }
bool CanReorderItems();

void CanReorderItems(bool canreorderitems);


public bool CanReorderItems { get; set; }

<TreeView CanReorderItems="bool"/>

Returns
bool
true if items in the view can be reordered through user interaction; otherwise, false. The default is false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.CanReorderItemsProperty TreeView.CanReorder
ItemsProperty TreeView.CanReorderItemsProperty
I n this Article
Edit
Identifies the CanReorderItems dependency property.
public : static DependencyProperty CanReorderItemsProperty { get; }
static DependencyProperty CanReorderItemsProperty();
public static DependencyProperty CanReorderItemsProperty { get; }

Returns
DependencyProperty
The identifier for the CanReorderItems dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.Collapse TreeView.Collapse TreeView.Collapse
I n this Article
Edit
Collapses the specified node in the tree.

public : void Collapse(TreeViewNode value)


void Collapse(TreeViewNode value) const;
public void Collapse(TreeViewNode value)

Parameters
value TreeViewNode
The tree node to collapse.
TreeView.Collapsed TreeView.Collapsed TreeView.
Collapsed
I n this Article
Edit
Occurs when a node in the tree is collapsed.
public : event TypedEventHandler<TreeView, TreeViewCollapsedEventArgs> Collapsed
// Register
event_token Collapsed(TypedEventHandler<TreeView, TreeViewCollapsedEventArgs> const& handler) const;

// Revoke with event_token


void Collapsed(event_token const& cookie) const;

// Revoke with event_revoker


Collapsed_revoker Collapsed(auto_revoke_t, TypedEventHandler<TreeView, TreeViewCollapsedEventArgs>
const& handler) const;
public event TypedEventHandler<TreeView, TreeViewCollapsedEventArgs> Collapsed
TreeView.ContainerFromItem TreeView.ContainerFrom
Item TreeView.ContainerFromItem
I n this Article
Edit
Returns the container corresponding to the specified item.
public : DependencyObject ContainerFromItem(Platform::Object item)
DependencyObject ContainerFromItem(winrt::Windows::Foundation::IInspectable item) const;
public DependencyObject ContainerFromItem(Object item)

Parameters
item Object
The item to retrieve the container for.
Returns
DependencyObject
A container that corresponds to the specified item, if the item has a container and exists in the collection; otherwise,
null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ContainerFromNode TreeView.ContainerFrom
Node TreeView.ContainerFromNode
I n this Article
Edit
Returns the container corresponding to the specified node.
public : DependencyObject ContainerFromNode(TreeViewNode node)
DependencyObject ContainerFromNode(TreeViewNode node) const;
public DependencyObject ContainerFromNode(TreeViewNode node)

Parameters
node TreeViewNode
The node to retrieve the container for.
Returns
DependencyObject
A container that corresponds to the specified node, if the node has a container and exists in the collection; otherwise,
null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.DragItemsCompleted TreeView.DragItems
Completed TreeView.DragItemsCompleted
I n this Article
Edit
Occurs when a drag operation that involves one of the items in the view is ended.
public : event TypedEventHandler<TreeView, TreeViewDragItemsCompletedEventArgs> DragItemsCompleted
// Register
event_token DragItemsCompleted(TypedEventHandler<TreeView, TreeViewDragItemsCompletedEventArgs>
const& handler) const;

// Revoke with event_token


void DragItemsCompleted(event_token const& cookie) const;

// Revoke with event_revoker


DragItemsCompleted_revoker DragItemsCompleted(auto_revoke_t, TypedEventHandler<TreeView,
TreeViewDragItemsCompletedEventArgs> const& handler) const;
public event TypedEventHandler<TreeView, TreeViewDragItemsCompletedEventArgs> DragItemsCompleted

<TreeView DragItemsCompleted="eventhandler"/>

Remarks
To receive this event, set the CanDragItems property to true.
TreeView.DragItemsStarting TreeView.DragItemsStarting
TreeView.DragItemsStarting
I n this Article
Edit
Occurs when a drag operation that involves one of the items in the view is initiated.
public : event TypedEventHandler<TreeView, TreeViewDragItemsStartingEventArgs> DragItemsStarting
// Register
event_token DragItemsStarting(TypedEventHandler<TreeView, TreeViewDragItemsStartingEventArgs> const&
handler) const;

// Revoke with event_token


void DragItemsStarting(event_token const& cookie) const;

// Revoke with event_revoker


DragItemsStarting_revoker DragItemsStarting(auto_revoke_t, TypedEventHandler<TreeView,
TreeViewDragItemsStartingEventArgs> const& handler) const;
public event TypedEventHandler<TreeView, TreeViewDragItemsStartingEventArgs> DragItemsStarting

<TreeView DragItemsStarting="eventhandler"/>

Remarks
To receive this event, set the CanDragItems property to true.
This event occurs when you start a drag-and-drop operation, including when you perform a reorder operation by drag-
and-drop. When you perform custom actions as a result of a drag-and-drop operation, you typically listen to this event
and provide more data using the TreeViewDragItemsStartingEventArgs.Data property.
You can inspect the items being dragged by checking the TreeViewDragItemsStartingEventArgs.Items property.
You can cancel the drag operation by setting the TreeViewDragItemsStartingEventArgs.Cancel property to true.
TreeView.Expand TreeView.Expand TreeView.Expand
I n this Article
Edit
Expands the specified node in the tree.

public : void Expand(TreeViewNode value)


void Expand(TreeViewNode value) const;
public void Expand(TreeViewNode value)

Parameters
value TreeViewNode
The tree node to expand.
TreeView.Expanding TreeView.Expanding TreeView.
Expanding
I n this Article
Edit
Occurs when a node in the tree starts to expand.
public : event TypedEventHandler<TreeView, TreeViewExpandingEventArgs> Expanding
// Register
event_token Expanding(TypedEventHandler<TreeView, TreeViewExpandingEventArgs> const& handler) const;

// Revoke with event_token


void Expanding(event_token const& cookie) const;

// Revoke with event_revoker


Expanding_revoker Expanding(auto_revoke_t, TypedEventHandler<TreeView, TreeViewExpandingEventArgs>
const& handler) const;
public event TypedEventHandler<TreeView, TreeViewExpandingEventArgs> Expanding
TreeView.ItemContainerStyle TreeView.ItemContainer
Style TreeView.ItemContainerStyle
I n this Article
Edit
Gets or sets the style that is used when rendering the item containers.
public : Style ItemContainerStyle { get; set; }
Style ItemContainerStyle();

void ItemContainerStyle(Style itemcontainerstyle);


public Style ItemContainerStyle { get; set; }

<TreeView>
<TreeView.ItemContainerStyle>
inlineStyle
</TreeView.ItemContainerStyle>
</TreeView>

Returns
Style
The style applied to the item containers. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemContainerStyleProperty TreeView.Item
ContainerStyleProperty TreeView.ItemContainerStyle
Property
I n this Article
Edit
Identifies the ItemContainerStyle dependency property.
public : static DependencyProperty ItemContainerStyleProperty { get; }
static DependencyProperty ItemContainerStyleProperty();
public static DependencyProperty ItemContainerStyleProperty { get; }

Returns
DependencyProperty
The identifier for the ItemContainerStyle dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemContainerStyleSelector TreeView.Item
ContainerStyleSelector TreeView.ItemContainerStyle
Selector
I n this Article
Edit
Gets or sets a reference to a custom StyleSelector logic class. The StyleSelector returns different Style values to use for
the item container based on characteristics of the object being displayed.
public : StyleSelector ItemContainerStyleSelector { get; set; }
StyleSelector ItemContainerStyleSelector();

void ItemContainerStyleSelector(StyleSelector itemcontainerstyleselector);


public StyleSelector ItemContainerStyleSelector { get; set; }

<TreeView ItemContainerStyleSelector="styleSelectorReference" />

Returns
StyleSelector
A custom StyleSelector logic class.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemContainerStyleSelectorProperty TreeView.
ItemContainerStyleSelectorProperty TreeView.Item
ContainerStyleSelectorProperty
I n this Article
Edit
Identifies the ItemContainerStyleSelector dependency property.
public : static DependencyProperty ItemContainerStyleSelectorProperty { get; }
static DependencyProperty ItemContainerStyleSelectorProperty();
public static DependencyProperty ItemContainerStyleSelectorProperty { get; }

Returns
DependencyProperty
The identifier for the ItemContainerStyleSelector dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemContainerTransitions TreeView.Item
ContainerTransitions TreeView.ItemContainerTransitions
I n this Article
Edit
Gets or sets the collection of Transition style elements that apply to the item containers of a TreeView.
public : TransitionCollection ItemContainerTransitions { get; set; }
TransitionCollection ItemContainerTransitions();

void ItemContainerTransitions(TransitionCollection itemcontainertransitions);


public TransitionCollection ItemContainerTransitions { get; set; }

<TreeView>
<TreeView.ItemContainerTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</TreeView.ItemContainerTransitions>
</TreeView>

Returns
TransitionCollection
The collection of Transition style elements that apply to the item containers of an ItemsControl.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemContainerTransitionsProperty TreeView.Item
ContainerTransitionsProperty TreeView.ItemContainer
TransitionsProperty
I n this Article
Edit
Identifies the ItemContainerTransitions dependency property.
public : static DependencyProperty ItemContainerTransitionsProperty { get; }
static DependencyProperty ItemContainerTransitionsProperty();
public static DependencyProperty ItemContainerTransitionsProperty { get; }

Returns
DependencyProperty
The identifier for the ItemContainerTransitions dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemFromContainer TreeView.ItemFrom
Container TreeView.ItemFromContainer
I n this Article
Edit
Returns the item that corresponds to the specified, generated container.
public : Platform::Object ItemFromContainer(DependencyObject container)
winrt::Windows::Foundation::IInspectable ItemFromContainer(DependencyObject container) const;
public object ItemFromContainer(DependencyObject container)

Parameters
container DependencyObject
The DependencyObject that corresponds to the item to be returned.
Returns
object
The contained item, or the container if it does not contain an item.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemInvoked TreeView.ItemInvoked TreeView.
ItemInvoked
I n this Article
Edit
Occurs when an item in the tree is invoked.
public : event TypedEventHandler<TreeView, TreeViewItemInvokedEventArgs> ItemInvoked
// Register
event_token ItemInvoked(TypedEventHandler<TreeView, TreeViewItemInvokedEventArgs> const& handler)
const;

// Revoke with event_token


void ItemInvoked(event_token const& cookie) const;

// Revoke with event_revoker


ItemInvoked_revoker ItemInvoked(auto_revoke_t, TypedEventHandler<TreeView,
TreeViewItemInvokedEventArgs> const& handler) const;
public event TypedEventHandler<TreeView, TreeViewItemInvokedEventArgs> ItemInvoked
TreeView.ItemsSource TreeView.ItemsSource TreeView.
ItemsSource
I n this Article
Edit
Gets or sets an object source used to generate the content of the TreeView.
public : Platform::Object ItemsSource { get; set; }
winrt::Windows::Foundation::IInspectable ItemsSource();

void ItemsSource(winrt::Windows::Foundation::IInspectable itemssource);


public object ItemsSource { get; set; }

<TreeView ItemsSource="bindingDeclaration"/>
-or-
<TreeView ItemsSource="resourceReferenceToSource"/>

Returns
object
The object that is used to generate the content of the TreeView. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemsSourceProperty TreeView.ItemsSource
Property TreeView.ItemsSourceProperty
I n this Article
Edit
Identifies the ItemsSource dependency property.
public : static DependencyProperty ItemsSourceProperty { get; }
static DependencyProperty ItemsSourceProperty();
public static DependencyProperty ItemsSourceProperty { get; }

Returns
DependencyProperty
The identifier for the ItemsSource dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemTemplate TreeView.ItemTemplate TreeView.
ItemTemplate
I n this Article
Edit
Gets or sets the DataTemplate used to display each item.
public : DataTemplate ItemTemplate { get; set; }
DataTemplate ItemTemplate();

void ItemTemplate(DataTemplate itemtemplate);


public DataTemplate ItemTemplate { get; set; }

<TreeView>
<TreeView.ItemTemplate>
singleDataTemplate
</TreeView.ItemTemplate>
</TreeView>

Returns
DataTemplate
The template that specifies the visualization of the data objects. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemTemplateProperty TreeView.ItemTemplate
Property TreeView.ItemTemplateProperty
I n this Article
Edit
Identifies the ItemTemplate dependency property.
public : static DependencyProperty ItemTemplateProperty { get; }
static DependencyProperty ItemTemplateProperty();
public static DependencyProperty ItemTemplateProperty { get; }

Returns
DependencyProperty
The identifier for the ItemTemplate dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemTemplateSelector TreeView.ItemTemplate
Selector TreeView.ItemTemplateSelector
I n this Article
Edit
Gets or sets a reference to a custom DataTemplateSelector logic class. The DataTemplateSelector referenced by this
property returns a template to apply to items.
public : DataTemplateSelector ItemTemplateSelector { get; set; }
DataTemplateSelector ItemTemplateSelector();

void ItemTemplateSelector(DataTemplateSelector itemtemplateselector);


public DataTemplateSelector ItemTemplateSelector { get; set; }

<TreeView ItemTemplateSelector="dataTemplateSelectorReference" />

Returns
DataTemplateSelector
A reference to a custom DataTemplateSelector logic class.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.ItemTemplateSelectorProperty TreeView.Item
TemplateSelectorProperty TreeView.ItemTemplate
SelectorProperty
I n this Article
Edit
Identifies the ItemTemplateSelector dependency property.
public : static DependencyProperty ItemTemplateSelectorProperty { get; }
static DependencyProperty ItemTemplateSelectorProperty();
public static DependencyProperty ItemTemplateSelectorProperty { get; }

Returns
DependencyProperty
The identifier for the ItemTemplateSelector dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.NodeFromContainer TreeView.NodeFrom
Container TreeView.NodeFromContainer
I n this Article
Edit
Returns the TreeViewNode corresponding to the specified container.
public : TreeViewNode NodeFromContainer(DependencyObject container)
TreeViewNode NodeFromContainer(DependencyObject container) const;
public TreeViewNode NodeFromContainer(DependencyObject container)

Parameters
container DependencyObject
The container to retrieve the TreeViewNode for.
Returns
TreeViewNode
The node that corresponds to the specified container.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeView.RootNodes TreeView.RootNodes TreeView.Root
Nodes
I n this Article
Edit
Gets or sets the collection of root nodes of the tree.
public : IVector<TreeViewNode> RootNodes { get; }
IVector<TreeViewNode> RootNodes();
public IList<TreeViewNode> RootNodes { get; }

Returns
IList<TreeViewNode>
The collection of root nodes of the tree.
TreeView.SelectAll TreeView.SelectAll TreeView.SelectAll
I n this Article
Edit
Selects all nodes in the tree.

public : void SelectAll()


void SelectAll() const;
public void SelectAll()
TreeView.SelectedNodes TreeView.SelectedNodes Tree
View.SelectedNodes
I n this Article
Edit
Gets or sets the collection of nodes that are selected in the tree.
public : IVector<TreeViewNode> SelectedNodes { get; }
IVector<TreeViewNode> SelectedNodes();
public IList<TreeViewNode> SelectedNodes { get; }

Returns
IList<TreeViewNode>
The collection of nodes that are selected in the tree. The default is an empty collection.
TreeView.SelectionMode TreeView.SelectionMode Tree
View.SelectionMode
I n this Article
Edit
Gets or sets the selection behavior for a TreeView instance.
public : TreeViewSelectionMode SelectionMode { get; set; }
TreeViewSelectionMode SelectionMode();

void SelectionMode(TreeViewSelectionMode selectionmode);


public TreeViewSelectionMode SelectionMode { get; set; }

Returns
TreeViewSelectionMode
An enumeration value that specifies the selection behavior for a TreeView. The default is Single selection.
TreeView.SelectionModeProperty TreeView.Selection
ModeProperty TreeView.SelectionModeProperty
I n this Article
Edit
Identifies the SelectionMode dependency property.
public : static DependencyProperty SelectionModeProperty { get; }
static DependencyProperty SelectionModeProperty();
public static DependencyProperty SelectionModeProperty { get; }

Returns
DependencyProperty
The identifier for the SelectionMode dependency property.
TreeView TreeView TreeView
I n this Article
Edit
Initializes a new instance of the TreeView control.

public : TreeView()
TreeView() const;
public TreeView()
TreeViewCollapsedEventArgs TreeViewCollapsedEvent
Args TreeViewCollapsedEventArgs Class
Provides event data for the TreeView.Collapsed event.

D eclaration
public : sealed class TreeViewCollapsedEventArgs : ITreeViewCollapsedEventArgs,
ITreeViewCollapsedEventArgs2
struct winrt::Windows::UI::Xaml::Controls::TreeViewCollapsedEventArgs :
ITreeViewCollapsedEventArgs, ITreeViewCollapsedEventArgs2
public sealed class TreeViewCollapsedEventArgs : ITreeViewCollapsedEventArgs,
ITreeViewCollapsedEventArgs2

I nheritance H ierarchy
None

Properties
Item
Item
Item

Gets the TreeView item that is collapsed.

Node
Node
Node

Gets the TreeView node that is collapsed.


TreeViewCollapsedEventArgs.Item TreeViewCollapsed
EventArgs.Item TreeViewCollapsedEventArgs.Item
I n this Article
Edit
Gets the TreeView item that is collapsed.
public : Platform::Object Item { get; }
winrt::Windows::Foundation::IInspectable Item();
public object Item { get; }

Returns
object
The TreeView item that is collapsed.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeViewCollapsedEventArgs.Node TreeViewCollapsed
EventArgs.Node TreeViewCollapsedEventArgs.Node
I n this Article
Edit
Gets the TreeView node that is collapsed.
public : TreeViewNode Node { get; }
TreeViewNode Node();
public TreeViewNode Node { get; }

Returns
TreeViewNode
The TreeView node that is collapsed.
TreeViewDragItemsCompletedEventArgs TreeViewDrag
ItemsCompletedEventArgs TreeViewDragItems
CompletedEventArgs Class
Provides event data for the TreeView.DragItemsCompleted event.

D eclaration
public : sealed class TreeViewDragItemsCompletedEventArgs : ITreeViewDragItemsCompletedEventArgs
struct winrt::Windows::UI::Xaml::Controls::TreeViewDragItemsCompletedEventArgs :
ITreeViewDragItemsCompletedEventArgs
public sealed class TreeViewDragItemsCompletedEventArgs : ITreeViewDragItemsCompletedEventArgs

I nheritance H ierarchy
None

Properties
DropResult
DropResult
DropResult

Gets a value that indicates what operation was performed on the dragged data, and whether it was successful.

Items
Items
Items

Gets the loosely typed collection of objects that are selected for the item drag action.
TreeViewDragItemsCompletedEventArgs.DropResult Tree
ViewDragItemsCompletedEventArgs.DropResult Tree
ViewDragItemsCompletedEventArgs.DropResult
I n this Article
Edit
Gets a value that indicates what operation was performed on the dragged data, and whether it was successful.
public : DataPackageOperation DropResult { get; }
DataPackageOperation DropResult();
public DataPackageOperation DropResult { get; }

Returns
DataPackageOperation
A value of the enumeration that indicates what operation was performed on the dragged data.
TreeViewDragItemsCompletedEventArgs.Items TreeView
DragItemsCompletedEventArgs.Items TreeViewDrag
ItemsCompletedEventArgs.Items
I n this Article
Edit
Gets the loosely typed collection of objects that are selected for the item drag action.
public : IVectorView<Platform::Object> Items { get; }
IVectorView<winrt::Windows::Foundation::IInspectable> Items();
public IReadOnlyList<object> Items { get; }

Returns
IReadOnlyList<object>
A loosely typed collection of objects.
TreeViewDragItemsStartingEventArgs TreeViewDragItems
StartingEventArgs TreeViewDragItemsStartingEventArgs
Class
Provides event data for the TreeView.DragItemsStarting event.

D eclaration
public : sealed class TreeViewDragItemsStartingEventArgs : ITreeViewDragItemsStartingEventArgs
struct winrt::Windows::UI::Xaml::Controls::TreeViewDragItemsStartingEventArgs :
ITreeViewDragItemsStartingEventArgs
public sealed class TreeViewDragItemsStartingEventArgs : ITreeViewDragItemsStartingEventArgs

I nheritance H ierarchy
None

Properties
Cancel
Cancel
Cancel

Gets or sets a value that indicates whether the item drag action should be canceled.

Data
Data
Data

Gets the data payload associated with an items drag action.

Items
Items
Items

Gets the loosely typed collection of objects that are selected for the item drag action.
TreeViewDragItemsStartingEventArgs.Cancel TreeView
DragItemsStartingEventArgs.Cancel TreeViewDragItems
StartingEventArgs.Cancel
I n this Article
Edit
Gets or sets a value that indicates whether the item drag action should be canceled.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
true to cancel the item drag action; otherwise, false.

Remarks
Set this property to true in a handler in order to cancel an items drag action.
TreeViewDragItemsStartingEventArgs.Data TreeViewDrag
ItemsStartingEventArgs.Data TreeViewDragItemsStarting
EventArgs.Data
I n this Article
Edit
Gets the data payload associated with an items drag action.
public : DataPackage Data { get; }
DataPackage Data();
public DataPackage Data { get; }

Returns
DataPackage
The data payload.

Remarks
By default the data is empty. When you perform custom actions as the result of a drag-and-drop operation, you
typically provide custom data that can later be inspected and used to perform the custom action.
TreeViewDragItemsStartingEventArgs.Items TreeView
DragItemsStartingEventArgs.Items TreeViewDragItems
StartingEventArgs.Items
I n this Article
Edit
Gets the loosely typed collection of objects that are selected for the item drag action.
public : IVector<Platform::Object> Items { get; }
IVector<winrt::Windows::Foundation::IInspectable> Items();
public IList<object> Items { get; }

Returns
IList<object>
A loosely typed collection of objects.
TreeViewExpandingEventArgs TreeViewExpandingEvent
Args TreeViewExpandingEventArgs Class
Provides event data for the TreeView.Expanding event.

D eclaration
public : sealed class TreeViewExpandingEventArgs : ITreeViewExpandingEventArgs,
ITreeViewExpandingEventArgs2
struct winrt::Windows::UI::Xaml::Controls::TreeViewExpandingEventArgs :
ITreeViewExpandingEventArgs, ITreeViewExpandingEventArgs2
public sealed class TreeViewExpandingEventArgs : ITreeViewExpandingEventArgs,
ITreeViewExpandingEventArgs2

I nheritance H ierarchy
None

Properties
Item
Item
Item

Gets the data item for the tree view node that is expanding.

Node
Node
Node

Gets the tree view node that is expanding.


TreeViewExpandingEventArgs.Item TreeViewExpanding
EventArgs.Item TreeViewExpandingEventArgs.Item
I n this Article
Edit
Gets the data item for the tree view node that is expanding.
public : Platform::Object Item { get; }
winrt::Windows::Foundation::IInspectable Item();
public object Item { get; }

Returns
object
The data item for the tree view node that is expanding.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeViewExpandingEventArgs.Node TreeViewExpanding
EventArgs.Node TreeViewExpandingEventArgs.Node
I n this Article
Edit
Gets the tree view node that is expanding.
public : TreeViewNode Node { get; }
TreeViewNode Node();
public TreeViewNode Node { get; }

Returns
TreeViewNode
The tree view node that is expanding.
TreeViewItem TreeViewItem TreeViewItem Class
Represents the container for an item in a TreeView control.

D eclaration
public : class TreeViewItem : ListViewItem, ITreeViewItem, ITreeViewItem2
struct winrt::Windows::UI::Xaml::Controls::TreeViewItem : ListViewItem, ITreeViewItem,
ITreeViewItem2
public class TreeViewItem : ListViewItem, ITreeViewItem, ITreeViewItem2

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
SelectorItem
ListViewItem

Constructors
TreeViewItem()
TreeViewItem()
TreeViewItem()

Initializes a new instance of the TreeViewItem control.

Properties
CollapsedGlyph
CollapsedGlyph
CollapsedGlyph

Gets or sets the glyph to show for a collapsed tree node.

CollapsedGlyphProperty
CollapsedGlyphProperty
CollapsedGlyphProperty

Identifies the CollapsedGlyph dependency property.

ExpandedGlyph
ExpandedGlyph
ExpandedGlyph

Gets or sets the glyph to show for an expanded tree node.


ExpandedGlyphProperty
ExpandedGlyphProperty
ExpandedGlyphProperty

Identifies the ExpandedGlyph dependency property.

GlyphBrush
GlyphBrush
GlyphBrush

Gets or sets the Brush used to paint node glyphs on a TreeView.

GlyphBrushProperty
GlyphBrushProperty
GlyphBrushProperty

Identifies the GlyphBrush dependency property.

GlyphOpacity
GlyphOpacity
GlyphOpacity

Gets or sets the opacity of node glyphs on a TreeView.

GlyphOpacityProperty
GlyphOpacityProperty
GlyphOpacityProperty

Identifies the GlyphOpacity dependency property.

GlyphSize
GlyphSize
GlyphSize

Gets or sets the size of node glyphs on a TreeView.

GlyphSizeProperty
GlyphSizeProperty
GlyphSizeProperty

Identifies the GlyphSize dependency property.

HasUnrealizedChildren
HasUnrealizedChildren
HasUnrealizedChildren
Gets or sets a value that indicates whether the current item has child items that haven't been shown.

HasUnrealizedChildrenProperty
HasUnrealizedChildrenProperty
HasUnrealizedChildrenProperty

Identifies the HasUnrealizedChildren dependency property.

IsExpanded
IsExpanded
IsExpanded

Gets or sets a value that indicates whether a tree node is expanded.

IsExpandedProperty
IsExpandedProperty
IsExpandedProperty

Identifies the IsExpanded dependency property.

ItemsSource
ItemsSource
ItemsSource

Gets or sets an object source used to generate the content of the TreeView.

ItemsSourceProperty
ItemsSourceProperty
ItemsSourceProperty

Identifies the ItemsSource dependency property.

TreeViewItemTemplateSettings
TreeViewItemTemplateSettings
TreeViewItemTemplateSettings

Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension
sources when defining templates for a TreeViewItem control.

TreeViewItemTemplateSettingsProperty
TreeViewItemTemplateSettingsProperty
TreeViewItemTemplateSettingsProperty

Identifies the TreeViewItemTemplateSettings dependency property.


TreeViewItem.CollapsedGlyph TreeViewItem.Collapsed
Glyph TreeViewItem.CollapsedGlyph
I n this Article
Edit
Gets or sets the glyph to show for a collapsed tree node.
public : Platform::String CollapsedGlyph { get; set; }
winrt::hstring CollapsedGlyph();

void CollapsedGlyph(winrt::hstring collapsedglyph);


public string CollapsedGlyph { get; set; }

Returns
string
The glyph to show for a collapsed tree node.
TreeViewItem.CollapsedGlyphProperty TreeViewItem.
CollapsedGlyphProperty TreeViewItem.CollapsedGlyph
Property
I n this Article
Edit
Identifies the CollapsedGlyph dependency property.
public : static DependencyProperty CollapsedGlyphProperty { get; }
static DependencyProperty CollapsedGlyphProperty();
public static DependencyProperty CollapsedGlyphProperty { get; }

Returns
DependencyProperty
The identifier for the CollapsedGlyph dependency property.
TreeViewItem.ExpandedGlyph TreeViewItem.Expanded
Glyph TreeViewItem.ExpandedGlyph
I n this Article
Edit
Gets or sets the glyph to show for an expanded tree node.
public : Platform::String ExpandedGlyph { get; set; }
winrt::hstring ExpandedGlyph();

void ExpandedGlyph(winrt::hstring expandedglyph);


public string ExpandedGlyph { get; set; }

Returns
string
The glyph to show for an expanded tree node.
TreeViewItem.ExpandedGlyphProperty TreeViewItem.
ExpandedGlyphProperty TreeViewItem.ExpandedGlyph
Property
I n this Article
Edit
Identifies the ExpandedGlyph dependency property.
public : static DependencyProperty ExpandedGlyphProperty { get; }
static DependencyProperty ExpandedGlyphProperty();
public static DependencyProperty ExpandedGlyphProperty { get; }

Returns
DependencyProperty
The identifier for the ExpandedGlyph dependency property.
TreeViewItem.GlyphBrush TreeViewItem.GlyphBrush Tree
ViewItem.GlyphBrush
I n this Article
Edit
Gets or sets the Brush used to paint node glyphs on a TreeView.
public : Brush GlyphBrush { get; set; }
Brush GlyphBrush();

void GlyphBrush(Brush glyphbrush);


public Brush GlyphBrush { get; set; }

Returns
Brush
The Brush used to paint node glyphs on a TreeView.
TreeViewItem.GlyphBrushProperty TreeViewItem.Glyph
BrushProperty TreeViewItem.GlyphBrushProperty
I n this Article
Edit
Identifies the GlyphBrush dependency property.
public : static DependencyProperty GlyphBrushProperty { get; }
static DependencyProperty GlyphBrushProperty();
public static DependencyProperty GlyphBrushProperty { get; }

Returns
DependencyProperty
The identifier for the GlyphBrush dependency property.
TreeViewItem.GlyphOpacity TreeViewItem.GlyphOpacity
TreeViewItem.GlyphOpacity
I n this Article
Edit
Gets or sets the opacity of node glyphs on a TreeView.
public : double GlyphOpacity { get; set; }
double GlyphOpacity();

void GlyphOpacity(double glyphopacity);


public double GlyphOpacity { get; set; }

Returns
double
The opacity of node glyphs on a TreeView.
TreeViewItem.GlyphOpacityProperty TreeViewItem.Glyph
OpacityProperty TreeViewItem.GlyphOpacityProperty
I n this Article
Edit
Identifies the GlyphOpacity dependency property.
public : static DependencyProperty GlyphOpacityProperty { get; }
static DependencyProperty GlyphOpacityProperty();
public static DependencyProperty GlyphOpacityProperty { get; }

Returns
DependencyProperty
The identifier for the GlyphOpacity dependency property.
TreeViewItem.GlyphSize TreeViewItem.GlyphSize Tree
ViewItem.GlyphSize
I n this Article
Edit
Gets or sets the size of node glyphs on a TreeView.
public : double GlyphSize { get; set; }
double GlyphSize();

void GlyphSize(double glyphsize);


public double GlyphSize { get; set; }

Returns
double
The opacity of size glyphs on a TreeView.
TreeViewItem.GlyphSizeProperty TreeViewItem.GlyphSize
Property TreeViewItem.GlyphSizeProperty
I n this Article
Edit
Identifies the GlyphSize dependency property.
public : static DependencyProperty GlyphSizeProperty { get; }
static DependencyProperty GlyphSizeProperty();
public static DependencyProperty GlyphSizeProperty { get; }

Returns
DependencyProperty
The identifier for the GlyphSize dependency property.
TreeViewItem.HasUnrealizedChildren TreeViewItem.Has
UnrealizedChildren TreeViewItem.HasUnrealizedChildren
I n this Article
Edit
Gets or sets a value that indicates whether the current item has child items that haven't been shown.
public : Platform::Boolean HasUnrealizedChildren { get; set; }
bool HasUnrealizedChildren();

void HasUnrealizedChildren(bool hasunrealizedchildren);


public bool HasUnrealizedChildren { get; set; }

Returns
bool
true of the current item has child items that haven't been shown; otherwise, false.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeViewItem.HasUnrealizedChildrenProperty TreeView
Item.HasUnrealizedChildrenProperty TreeViewItem.Has
UnrealizedChildrenProperty
I n this Article
Edit
Identifies the HasUnrealizedChildren dependency property.
public : static DependencyProperty HasUnrealizedChildrenProperty { get; }
static DependencyProperty HasUnrealizedChildrenProperty();
public static DependencyProperty HasUnrealizedChildrenProperty { get; }

Returns
DependencyProperty
The identifier for the HasUnrealizedChildren dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeViewItem.IsExpanded TreeViewItem.IsExpanded Tree
ViewItem.IsExpanded
I n this Article
Edit
Gets or sets a value that indicates whether a tree node is expanded.
public : Platform::Boolean IsExpanded { get; set; }
bool IsExpanded();

void IsExpanded(bool isexpanded);


public bool IsExpanded { get; set; }

Returns
bool
true if the tree node is expanded; otherwise, false.
TreeViewItem.IsExpandedProperty TreeViewItem.Is
ExpandedProperty TreeViewItem.IsExpandedProperty
I n this Article
Edit
Identifies the IsExpanded dependency property.
public : static DependencyProperty IsExpandedProperty { get; }
static DependencyProperty IsExpandedProperty();
public static DependencyProperty IsExpandedProperty { get; }

Returns
DependencyProperty
The identifier for the IsExpanded dependency property.
TreeViewItem.ItemsSource TreeViewItem.ItemsSource
TreeViewItem.ItemsSource
I n this Article
Edit
Gets or sets an object source used to generate the content of the TreeView.
public : Platform::Object ItemsSource { get; set; }
winrt::Windows::Foundation::IInspectable ItemsSource();

void ItemsSource(winrt::Windows::Foundation::IInspectable itemssource);


public object ItemsSource { get; set; }

<TreeViewItem ItemsSource="bindingDeclaration"/>
-or-
<TreeViewItem ItemsSource="resourceReferenceToSource"/>

Returns
object
The object that is used to generate the content of the TreeViewItem. The default is null.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeViewItem.ItemsSourceProperty TreeViewItem.Items
SourceProperty TreeViewItem.ItemsSourceProperty
I n this Article
Edit
Identifies the ItemsSource dependency property.
public : static DependencyProperty ItemsSourceProperty { get; }
static DependencyProperty ItemsSourceProperty();
public static DependencyProperty ItemsSourceProperty { get; }

Returns
DependencyProperty
The identifier for the ItemsSource dependency property.
Additional features and requirements
Device family Windows 10, version 1809 (introduced v10.0.17763.0)

API contract Windows.Foundation.UniversalApiContract (introduced v7)


TreeViewItem TreeViewItem TreeViewItem
I n this Article
Edit
Initializes a new instance of the TreeViewItem control.

public : TreeViewItem()
TreeViewItem() const;
public TreeViewItem()
TreeViewItem.TreeViewItemTemplateSettings TreeView
Item.TreeViewItemTemplateSettings TreeViewItem.Tree
ViewItemTemplateSettings
I n this Article
Edit
Gets an object that provides calculated values that can be referenced as {TemplateBinding} markup extension sources
when defining templates for a TreeViewItem control.
public : TreeViewItemTemplateSettings TreeViewItemTemplateSettings { get; }
TreeViewItemTemplateSettings TreeViewItemTemplateSettings();
public TreeViewItemTemplateSettings TreeViewItemTemplateSettings { get; }

Returns
TreeViewItemTemplateSettings
An object that provides calculated values for templates.
TreeViewItem.TreeViewItemTemplateSettingsProperty
TreeViewItem.TreeViewItemTemplateSettingsProperty
TreeViewItem.TreeViewItemTemplateSettingsProperty
I n this Article
Edit
Identifies the TreeViewItemTemplateSettings dependency property.
public : static DependencyProperty TreeViewItemTemplateSettingsProperty { get; }
static DependencyProperty TreeViewItemTemplateSettingsProperty();
public static DependencyProperty TreeViewItemTemplateSettingsProperty { get; }

Returns
DependencyProperty
The identifier for the TreeViewItemTemplateSettings dependency property.
TreeViewItemInvokedEventArgs TreeViewItemInvoked
EventArgs TreeViewItemInvokedEventArgs Class
Provides event data for the TreeView.ItemInvoked event.

D eclaration
public : sealed class TreeViewItemInvokedEventArgs : ITreeViewItemInvokedEventArgs
struct winrt::Windows::UI::Xaml::Controls::TreeViewItemInvokedEventArgs :
ITreeViewItemInvokedEventArgs
public sealed class TreeViewItemInvokedEventArgs : ITreeViewItemInvokedEventArgs

I nheritance H ierarchy
None

Properties
Handled
Handled
Handled

Gets or sets a value that marks the routed event as handled. A true value for prevents most handlers along the
event route from handling the same event again.

InvokedItem
InvokedItem
InvokedItem

Gets the TreeView item that is invoked.


TreeViewItemInvokedEventArgs.Handled TreeViewItem
InvokedEventArgs.Handled TreeViewItemInvokedEvent
Args.Handled
I n this Article
Edit
Gets or sets a value that marks the routed event as handled. A true value for prevents most handlers along the event
route from handling the same event again.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
true to mark the routed event handled. false to leave the routed event unhandled, which permits the event to
potentially route further and be acted on by other handlers. The default is false.
TreeViewItemInvokedEventArgs.InvokedItem TreeView
ItemInvokedEventArgs.InvokedItem TreeViewItemInvoked
EventArgs.InvokedItem
I n this Article
Edit
Gets the TreeView item that is invoked.
public : Platform::Object InvokedItem { get; }
winrt::Windows::Foundation::IInspectable InvokedItem();
public object InvokedItem { get; }

Returns
object
The TreeView item that is invoked.
TreeViewItemTemplateSettings TreeViewItemTemplate
Settings TreeViewItemTemplateSettings Class
Provides calculated values that can be referenced as TemplatedParent sources when defining templates for a
TreeViewItem control. Not intended for general use.

D eclaration
public : class TreeViewItemTemplateSettings : DependencyObject, ITreeViewItemTemplateSettings
struct winrt::Windows::UI::Xaml::Controls::TreeViewItemTemplateSettings : DependencyObject,
ITreeViewItemTemplateSettings
public class TreeViewItemTemplateSettings : DependencyObject, ITreeViewItemTemplateSettings

I nheritance H ierarchy
DependencyObject

Constructors
TreeViewItemTemplateSettings()
TreeViewItemTemplateSettings()
TreeViewItemTemplateSettings()

Initializes a new instance of the TreeViewItemTemplateSettings class.

Properties
CollapsedGlyphVisibility
CollapsedGlyphVisibility
CollapsedGlyphVisibility

Gets the visibilty of a collapsed glyph.

CollapsedGlyphVisibilityProperty
CollapsedGlyphVisibilityProperty
CollapsedGlyphVisibilityProperty

Identifies the CollapsedGlyphVisibility dependency property.

DragItemsCount
DragItemsCount
DragItemsCount

Gets the number of items being dragged.

DragItemsCountProperty
DragItemsCountProperty
DragItemsCountProperty
Identifies the DragItemsCount dependency property.

ExpandedGlyphVisibility
ExpandedGlyphVisibility
ExpandedGlyphVisibility

Gets the visibilty of an expanded glyph.

ExpandedGlyphVisibilityProperty
ExpandedGlyphVisibilityProperty
ExpandedGlyphVisibilityProperty

Identifies the ExpandedGlyphVisibility dependency property.

Indentation
Indentation
Indentation

Gets the amount that the item is indented.

IndentationProperty
IndentationProperty
IndentationProperty

Identifies the Indentation dependency property.


TreeViewItemTemplateSettings.CollapsedGlyphVisibility
TreeViewItemTemplateSettings.CollapsedGlyphVisibility
TreeViewItemTemplateSettings.CollapsedGlyphVisibility
I n this Article
Edit
Gets the visibilty of a collapsed glyph.
public : Visibility CollapsedGlyphVisibility { get; }
Visibility CollapsedGlyphVisibility();
public Visibility CollapsedGlyphVisibility { get; }

Returns
Visibility
The visibilty of a collapsed glyph.
TreeViewItemTemplateSettings.CollapsedGlyphVisibility
Property TreeViewItemTemplateSettings.CollapsedGlyph
VisibilityProperty TreeViewItemTemplateSettings.
CollapsedGlyphVisibilityProperty
I n this Article
Edit
Identifies the CollapsedGlyphVisibility dependency property.
public : static DependencyProperty CollapsedGlyphVisibilityProperty { get; }
static DependencyProperty CollapsedGlyphVisibilityProperty();
public static DependencyProperty CollapsedGlyphVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the CollapsedGlyphVisibility dependency property.
TreeViewItemTemplateSettings.DragItemsCount TreeView
ItemTemplateSettings.DragItemsCount TreeViewItem
TemplateSettings.DragItemsCount
I n this Article
Edit
Gets the number of items being dragged.
public : int DragItemsCount { get; }
int32_t DragItemsCount();
public int DragItemsCount { get; }

Returns
int
The number of items being dragged.
TreeViewItemTemplateSettings.DragItemsCountProperty
TreeViewItemTemplateSettings.DragItemsCountProperty
TreeViewItemTemplateSettings.DragItemsCountProperty
I n this Article
Edit
Identifies the DragItemsCount dependency property.
public : static DependencyProperty DragItemsCountProperty { get; }
static DependencyProperty DragItemsCountProperty();
public static DependencyProperty DragItemsCountProperty { get; }

Returns
DependencyProperty
The identifier for the DragItemsCount dependency property.
TreeViewItemTemplateSettings.ExpandedGlyphVisibility
TreeViewItemTemplateSettings.ExpandedGlyphVisibility
TreeViewItemTemplateSettings.ExpandedGlyphVisibility
I n this Article
Edit
Gets the visibilty of an expanded glyph.
public : Visibility ExpandedGlyphVisibility { get; }
Visibility ExpandedGlyphVisibility();
public Visibility ExpandedGlyphVisibility { get; }

Returns
Visibility
The visibilty of an expanded glyph.
TreeViewItemTemplateSettings.ExpandedGlyphVisibility
Property TreeViewItemTemplateSettings.ExpandedGlyph
VisibilityProperty TreeViewItemTemplateSettings.
ExpandedGlyphVisibilityProperty
I n this Article
Edit
Identifies the ExpandedGlyphVisibility dependency property.
public : static DependencyProperty ExpandedGlyphVisibilityProperty { get; }
static DependencyProperty ExpandedGlyphVisibilityProperty();
public static DependencyProperty ExpandedGlyphVisibilityProperty { get; }

Returns
DependencyProperty
The identifier for the ExpandedGlyphVisibility dependency property.
TreeViewItemTemplateSettings.Indentation TreeViewItem
TemplateSettings.Indentation TreeViewItemTemplate
Settings.Indentation
I n this Article
Edit
Gets the amount that the item is indented.
public : Thickness Indentation { get; }
Thickness Indentation();
public Thickness Indentation { get; }

Returns
Thickness
The amount that the item is indented.
TreeViewItemTemplateSettings.IndentationProperty Tree
ViewItemTemplateSettings.IndentationProperty TreeView
ItemTemplateSettings.IndentationProperty
I n this Article
Edit
Identifies the Indentation dependency property.
public : static DependencyProperty IndentationProperty { get; }
static DependencyProperty IndentationProperty();
public static DependencyProperty IndentationProperty { get; }

Returns
DependencyProperty
The identifier for the Indentation dependency property.
TreeViewItemTemplateSettings TreeViewItemTemplate
Settings TreeViewItemTemplateSettings
I n this Article
Edit
Initializes a new instance of the TreeViewItemTemplateSettings class.
public : TreeViewItemTemplateSettings()
TreeViewItemTemplateSettings() const;
public TreeViewItemTemplateSettings()
TreeViewList TreeViewList TreeViewList Class
Represents a flattened list of tree view items so that operations such as keyboard navigation and drag-and-drop can be
inherited from ListView.

D eclaration
public : class TreeViewList : ListView, ITreeViewList
struct winrt::Windows::UI::Xaml::Controls::TreeViewList : ListView, ITreeViewList
public class TreeViewList : ListView, ITreeViewList

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control
ItemsControl
Selector
ListViewBase
ListView

Constructors
TreeViewList()
TreeViewList()
TreeViewList()

Initializes a new instance of the TreeViewList control.


TreeViewList TreeViewList TreeViewList
I n this Article
Edit
Initializes a new instance of the TreeViewList control.

public : TreeViewList()
TreeViewList() const;
public TreeViewList()
TreeViewNode TreeViewNode TreeViewNode Class
Represents a node in a TreeView control.

D eclaration
public : class TreeViewNode : DependencyObject, ITreeViewNode
struct winrt::Windows::UI::Xaml::Controls::TreeViewNode : DependencyObject, ITreeViewNode
public class TreeViewNode : DependencyObject, ITreeViewNode

I nheritance H ierarchy
DependencyObject

Constructors
TreeViewNode()
TreeViewNode()
TreeViewNode()

Initializes a new instance of the TreeViewNode class.

Properties
Children
Children
Children

Gets the collection of nodes that are children of the current node.

Content
Content
Content

Gets or sets the data content for the current node.

ContentProperty
ContentProperty
ContentProperty

Identifies the Content dependency property.

Depth
Depth
Depth

Gets a value that indicates how far the current node is from the root node of the tree.
DepthProperty
DepthProperty
DepthProperty

Identifies the Depth dependency property.

HasChildren
HasChildren
HasChildren

Gets a value that indicates whether the current node has child items.

HasChildrenProperty
HasChildrenProperty
HasChildrenProperty

Identifies the HasChildren dependency property.

HasUnrealizedChildren
HasUnrealizedChildren
HasUnrealizedChildren

Gets or sets a value that indicates whether the current node has child items that haven't been shown.

IsExpanded
IsExpanded
IsExpanded

Gets or sets a value that indicates whether the cuurent tree view node is expanded.

IsExpandedProperty
IsExpandedProperty
IsExpandedProperty

Identifies the IsExpanded dependency property.

Parent
Parent
Parent

Gets or sets the node that is the parent of the current node.
TreeViewNode.Children TreeViewNode.Children TreeView
Node.Children
I n this Article
Edit
Gets the collection of nodes that are children of the current node.
public : IVector<TreeViewNode> Children { get; }
IVector<TreeViewNode> Children();
public IList<TreeViewNode> Children { get; }

Returns
IList<TreeViewNode>
The collection of nodes that are children of the current node. The default is an empty collection.
TreeViewNode.Content TreeViewNode.Content TreeView
Node.Content
I n this Article
Edit
Gets or sets the data content for the current node.
public : Platform::Object Content { get; set; }
winrt::Windows::Foundation::IInspectable Content();

void Content(winrt::Windows::Foundation::IInspectable content);


public object Content { get; set; }

Returns
object
The data content for the current node.
TreeViewNode.ContentProperty TreeViewNode.Content
Property TreeViewNode.ContentProperty
I n this Article
Edit
Identifies the Content dependency property.
public : static DependencyProperty ContentProperty { get; }
static DependencyProperty ContentProperty();
public static DependencyProperty ContentProperty { get; }

Returns
DependencyProperty
The identifier for the Content dependency property.
TreeViewNode.Depth TreeViewNode.Depth TreeView
Node.Depth
I n this Article
Edit
Gets a value that indicates how far the current node is from the root node of the tree.
public : int Depth { get; }
int32_t Depth();
public int Depth { get; }

Returns
int
The depth of the current node from the root node of the tree.
TreeViewNode.DepthProperty TreeViewNode.Depth
Property TreeViewNode.DepthProperty
I n this Article
Edit
Identifies the Depth dependency property.
public : static DependencyProperty DepthProperty { get; }
static DependencyProperty DepthProperty();
public static DependencyProperty DepthProperty { get; }

Returns
DependencyProperty
The identifier for the Depth dependency property.
TreeViewNode.HasChildren TreeViewNode.HasChildren
TreeViewNode.HasChildren
I n this Article
Edit
Gets a value that indicates whether the current node has child items.
public : Platform::Boolean HasChildren { get; }
bool HasChildren();
public bool HasChildren { get; }

Returns
bool
true if the current node has child items; otherwise, false.
TreeViewNode.HasChildrenProperty TreeViewNode.Has
ChildrenProperty TreeViewNode.HasChildrenProperty
I n this Article
Edit
Identifies the HasChildren dependency property.
public : static DependencyProperty HasChildrenProperty { get; }
static DependencyProperty HasChildrenProperty();
public static DependencyProperty HasChildrenProperty { get; }

Returns
DependencyProperty
The identifier for the HasChildren dependency property.
TreeViewNode.HasUnrealizedChildren TreeViewNode.
HasUnrealizedChildren TreeViewNode.HasUnrealized
Children
I n this Article
Edit
Gets or sets a value that indicates whether the current node has child items that haven't been shown.
public : Platform::Boolean HasUnrealizedChildren { get; set; }
bool HasUnrealizedChildren();

void HasUnrealizedChildren(bool hasunrealizedchildren);


public bool HasUnrealizedChildren { get; set; }

Returns
bool
true of the current node has child items that haven't been shown; otherwise, false.
TreeViewNode.IsExpanded TreeViewNode.IsExpanded
TreeViewNode.IsExpanded
I n this Article
Edit
Gets or sets a value that indicates whether the cuurent tree view node is expanded.
public : Platform::Boolean IsExpanded { get; set; }
bool IsExpanded();

void IsExpanded(bool isexpanded);


public bool IsExpanded { get; set; }

Returns
bool
true if the node is expanded; otherwise, false.
TreeViewNode.IsExpandedProperty TreeViewNode.Is
ExpandedProperty TreeViewNode.IsExpandedProperty
I n this Article
Edit
Identifies the IsExpanded dependency property.
public : static DependencyProperty IsExpandedProperty { get; }
static DependencyProperty IsExpandedProperty();
public static DependencyProperty IsExpandedProperty { get; }

Returns
DependencyProperty
The identifier for the IsExpanded dependency property.
TreeViewNode.Parent TreeViewNode.Parent TreeView
Node.Parent
I n this Article
Edit
Gets or sets the node that is the parent of the current node.
public : TreeViewNode Parent { get; }
TreeViewNode Parent();
public TreeViewNode Parent { get; }

Returns
TreeViewNode TreeViewNode TreeViewNode
The node that is the parent of the current node.
TreeViewNode TreeViewNode TreeViewNode
I n this Article
Edit
Initializes a new instance of the TreeViewNode class.

public : TreeViewNode()
TreeViewNode() const;
public TreeViewNode()
TreeViewSelectionMode TreeViewSelectionMode Tree
ViewSelectionMode Enum
Defines constants that specify the selection behavior for a TreeView instance.

D eclaration
public : enum class TreeViewSelectionMode
enum class winrt::Windows::UI::Xaml::Controls::TreeViewSelectionMode : int32_t
public enum TreeViewSelectionMode

I nheritance H ierarchy
None

Fields
Multiple Multiple Multiple The user can select multiple items.

None None None A user can't select items.

Single Single Single A user can select a single item.


UIElementCollection UIElementCollection UIElement
Collection Class
Represents an ordered collection of UIElement objects.

D eclaration
public : sealed class UIElementCollection : IIterable<UIElement>, IVector<UIElement>,
IUIElementCollection
struct winrt::Windows::UI::Xaml::Controls::UIElementCollection : IIterable<UIElement>,
IVector<UIElement>, IUIElementCollection
public sealed class UIElementCollection : IEnumerable<UIElement>, IList<UIElement>,
IUIElementCollection

I nheritance H ierarchy
None

Remarks
A UIElementCollection is the type of object that you get from the Children property of a Panel. For example, if you get
a value from Grid.Children, that value is a UIElementCollection instance. All the properties that use a
UIElementCollection in the Windows Runtime API are read-only properties, where the property is initialized with zero
items when an object is first instantiated. But you can then add, remove or query items in the collection at run time,
using the UIElementCollection properties and methods.
The type of the items in the UIElementCollection is constrained as UIElement. But UIElement is a base element class in
Windows Runtime using XAML, so there are hundreds of element types that can be treated as a UIElement and can
thus be one of the items in a UIElementCollection.
Enumerating the collection in C# or Microsoft V isual B asic
A UIElementCollection is enumerable, so you can use language-specific syntax such as foreach in C# to enumerate the
items in the UIElementCollection. The compiler does the type-casting for you and you won't need to cast to
IEnumerable<UIElement> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator,
cast to IEnumerable with a UIElement constraint.

Properties
Item[Int32]
Item[Int32]
Item[Int32]

Gets or sets the element at the specified index.

Size
Size
Size

Gets the size (count) of the collection.


Methods
Append(UIElement)
Append(UIElement)
Append(UIElement)

Adds a new item to the collection.

Clear()
Clear()
Clear()

Removes all items from the collection.

First()
First()
First()

Returns the iterator object that can iterate over the items in the UIElementCollection.

GetAt(UInt32)
GetAt(UInt32)
GetAt(UInt32)

Returns the item located at the specified index.

GetEnumerator()
GetEnumerator()
GetEnumerator()

Returns an enumerator that iterates through the collection.

GetMany(UInt32, UIElement[])
GetMany(UInt32, UIElement[])
GetMany(UInt32, UIElement[])

Retrieves multiple elements in a single pass through the iterator.

GetView()
GetView()
GetView()

Gets an immutable view into the collection.

IndexOf(T)
IndexOf(T)
IndexOf(T)

Determines the index of a specific item in the System.Collections.Generic.IList`1.

IndexOf(UIElement, UInt32)
IndexOf(UIElement, UInt32)
IndexOf(UIElement, UInt32)

Retrieves the index of the specified item.

Insert(Int32, T)
Insert(Int32, T)
Insert(Int32, T)

Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

InsertAt(UInt32, UIElement)
InsertAt(UInt32, UIElement)
InsertAt(UInt32, UIElement)

Inserts the specified item at the specified index.

Move(UInt32, UInt32)
Move(UInt32, UInt32)
Move(UInt32, UInt32)

Moves the item at the specified index to a new location in the collection.

RemoveAt(Int32)
RemoveAt(Int32)
RemoveAt(Int32)

Removes the System.Collections.Generic.IList`1 item at the specified index.

RemoveAt(UInt32)
RemoveAt(UInt32)
RemoveAt(UInt32)

Removes the item at the specified index.

RemoveAtEnd()
RemoveAtEnd()
RemoveAtEnd()

Removes the last item in the collection.


ReplaceAll(UIElement[])
ReplaceAll(UIElement[])
ReplaceAll(UIElement[])

Initially clears the collection, then inserts the provided array as new items.

SetAt(UInt32, UIElement)
SetAt(UInt32, UIElement)
SetAt(UInt32, UIElement)

Sets the value at the specified index to the UIElement value specified.

See Also
UIElement
UIElementCollection.Append UIElementCollection.
Append UIElementCollection.Append
I n this Article
Edit
Adds a new item to the collection.
public : void Append(UIElement value)
void Append(UIElement value) const;
// This member is not implemented in C#

Parameters
value UIElement
The new item to add.

Remarks
Append adds the item to the end of the collection. If you want to insert an item into the beginning or middle of a
collection, use InsertAt.
If you are programming using C# or Microsoft Visual Basic, see Add.
UIElementCollection.Clear UIElementCollection.Clear U
IElementCollection.Clear
I n this Article
Edit
Removes all items from the collection.
public : void Clear()
void Clear() const;
// This member is not implemented in C#

Remarks
The Clear method can be used when programming in C#, Microsoft Visual Basic or Visual C++ component extensions
(C++/CX). The method signature is the same in each of these languages, and the behavior is the same.
UIElementCollection.First UIElementCollection.First U
IElementCollection.First
I n this Article
Edit
Returns the iterator object that can iterate over the items in the UIElementCollection.
public : IIterator<UIElement> First()
IIterator<UIElement> First() const;
// This member is not implemented in C#

Returns
IIterator<UIElement>
The iterator object. The iterator's current position is at the 0-index position, or at the collection end if the collection is
empty.

Remarks
A convenient way to hold the iterator returned by First is to assign the return value to a variable that is declared with
the auto type deduction keyword. Then use IIterator API as part of a while loop. For example:
auto iterator1{ uieCollection.First() };
while (iterator1.HasCurrent())
{
Windows::UI::Xaml::UIElement currentItem{ iterator1.Current() };
// Your logic here that does something with currentItem.
iterator1.MoveNext();
}
UIElementCollection.GetAt UIElementCollection.GetAt U
IElementCollection.GetAt
I n this Article
Edit
Returns the item located at the specified index.
public : UIElement GetAt(unsigned int index)
UIElement GetAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The integer index for the value to retrieve.
Returns
UIElement
The UIElement value at the specified index.

Remarks
If you are programming using C# or Microsoft Visual Basic, see Item (indexer).
IEnumerable<T>.GetEnumerator IEnumerable<T>.Get
Enumerator
I n this Article
Edit
Returns an enumerator that iterates through the collection.
// This member is not implemented in C++/CX
IEnumerator<T> GetEnumerator()

Returns
An enumerator that can be used to iterate through the collection.
UIElementCollection.GetMany UIElementCollection.Get
Many UIElementCollection.GetMany
I n this Article
Edit
Retrieves multiple elements in a single pass through the iterator.
public : unsigned int GetMany(unsigned int startIndex, UIElement[] items)
uint32_t GetMany(uint32_t startIndex, UIElement[] items) const;
// This member is not implemented in C#

Parameters
startIndex UInt32
The index from which to start retrieval.
items UIElement[]
Provides the destination for the result. Size the initial array size as a "capacity" in order to specify how many results
should be retrieved.
Returns
uint
The number of items retrieved.

Remarks
If you are programming using C# or Microsoft Visual Basic, see CopyTo.
UIElementCollection.GetView UIElementCollection.Get
View UIElementCollection.GetView
I n this Article
Edit
Gets an immutable view into the collection.
public : IVectorView<UIElement> GetView()
IVectorView<UIElement> GetView() const;
// This member is not implemented in C#

Returns
IReadOnlyList<UIElement>
An object representing the immutable collection view. This object implements IVectorView; with a UIElement
constraint.

Remarks
If you are programming using C# or Microsoft Visual Basic, see CopyTo.
See UIElement
Also
UIElementCollection.IndexOf UIElementCollection.Index
Of UIElementCollection.IndexOf
I n this Article

Overloads
IndexOf(T) IndexOf(T)
Determines the index of a specific item in the
System.Collections.Generic.IList`1.

IndexOf(UIElement, UInt32) IndexOf(UIElement, UInt32) Index


Of(UIElement, UInt32) Retrieves the index of the specified item.

IndexOf(T) IndexOf(T)
Edit
Determines the index of a specific item in the System.Collections.Generic.IList`1.
// This member is not implemented in C++/CX
int IndexOf(T item)

Parameters
item TTT
The object to locate in the System.Collections.Generic.IList`1.
Returns
The index of item if found in the list; otherwise, -1.

IndexOf(UIElement, UInt32) IndexOf(UIElement, UInt32)


IndexOf(UIElement, UInt32)
Edit
Retrieves the index of the specified item.
public : Platform::Boolean IndexOf(UIElement value, unsigned int index)
bool IndexOf(UIElement value, uint32_t const& index) const;
// This member is not implemented in C#

Parameters
value UIElement
The value to find in the collection.
index UInt32
The index of the item to find, if found.
Returns
bool
true if an item with the specified value was found; otherwise, false.
Remarks
If you are programming using C# or Microsoft Visual Basic, see IndexOf.
See UIElement
Also
IList<T>.Insert IList<T>.Insert
I n this Article
Edit
Inserts an item to the System.Collections.Generic.IList`1 at the specified index.

// This member is not implemented in C++/CX


void Insert(int index, T item)

Parameters
index
The zero-based index at which item should be inserted.
item TT
The object to insert into the System.Collections.Generic.IList`1.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.
UIElementCollection.InsertAt UIElementCollection.Insert
At UIElementCollection.InsertAt
I n this Article
Edit
Inserts the specified item at the specified index.
public : void InsertAt(unsigned int index, UIElement value)
void InsertAt(uint32_t index, UIElement value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value UIElement
The value to set.

Remarks
InsertAt expands the collection and moves all subsequent index items by one. In contrast, SetAt replaces the item at the
index, and the collection count remains the same.
If you are programming using C# or Microsoft Visual Basic, see Insert.
IList<T>.Item IList<T>.Item
I n this Article
Edit
Gets or sets the element at the specified index.

// This member is not implemented in C++/CX


T this[int index] { get; set; }

Parameters
index
The zero-based index of the element to get or set.
Returns
TT
The element at the specified index.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The property is set and the System.Collections.Generic.IList`1 is read-only.
UIElementCollection.Move UIElementCollection.Move U
IElementCollection.Move
I n this Article
Edit
Moves the item at the specified index to a new location in the collection.
public : void Move(unsigned int oldIndex, unsigned int newIndex)
void Move(uint32_t oldIndex, uint32_t newIndex) const;
public void Move(UInt32 oldIndex, UInt32 newIndex)

Parameters
oldIndex UInt32
The zero-based index specifying the location of the item to be moved.
newIndex UInt32
The zero-based index specifying the new location of the item.

Remarks
Calling this method offers advantages over removing an item and adding it to a new location. Specifically, not as much
tree rebuilding is required internally, and panels or controls that use UIElementCollection for items can be more
responsive.
An example of a scenario where using Move may be useful is if you have a collection view or a specialized panel that
supports a user experience where items wrap around. In this case you might want to move an item from the start of
the collection to the end or vice versa, without forcing the entire visual tree under the panel or view to be rebuilt.
UIElementCollection.RemoveAt UIElementCollection.
RemoveAt UIElementCollection.RemoveAt
I n this Article

Overloads
RemoveAt(Int32) RemoveAt(Int32)
Removes the System.Collections.Generic.IList`1 item at the
specified index.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Removes the item at the specified index.

RemoveAt(Int32) RemoveAt(Int32)
Edit
Removes the System.Collections.Generic.IList`1 item at the specified index.
// This member is not implemented in C++/CX
void RemoveAt(int index)

Parameters
index
The zero-based index of the item to remove.
Exceptions
index is not a valid index in the System.Collections.Generic.IList`1.
The System.Collections.Generic.IList`1 is read-only.

RemoveAt(UInt32) RemoveAt(UInt32) RemoveAt(UInt32)


Edit
Removes the item at the specified index.
public : void RemoveAt(unsigned int index)
void RemoveAt(uint32_t index) const;
// This member is not implemented in C#

Parameters
index UInt32
The index position of the item to remove.
Remarks
If successful, calling this method reduces the collection size by one. Items with index values greater than the called
index have their index values reduced by one.
If you are programming using C# or Microsoft Visual Basic, see RemoveAt. The behavior of each language's
RemoveAt is basically the same.
UIElementCollection.RemoveAtEnd UIElementCollection.
RemoveAtEnd UIElementCollection.RemoveAtEnd
I n this Article
Edit
Removes the last item in the collection.
public : void RemoveAtEnd()
void RemoveAtEnd() const;
// This member is not implemented in C#

Remarks
If successful, calling this method reduces the collection size by one.
If you are programming using C# or Microsoft Visual Basic, see RemoveAt (pass an index value of Count minus one).
UIElementCollection.ReplaceAll UIElementCollection.
ReplaceAll UIElementCollection.ReplaceAll
I n this Article
Edit
Initially clears the collection, then inserts the provided array as new items.
public : void ReplaceAll(UIElement[] items)
void ReplaceAll(UIElement[] items) const;
// This member is not implemented in C#

Parameters
items UIElement[]
The new collection items.

Remarks
For implementations that track a "changed" event, the initial reset fires an event, but the items added do not fire
discrete per-item events.
If you are programming using C# or Microsoft Visual Basic, there is no single-call equivalent to
@Windows.UI.Xaml.Controls.UIElementCollection.ReplaceAll(Windows.UI.Xaml.UIElement[])?text=ReplaceAll. Use
Clear and then successive calls to Add.
See System.Collections.Generic.ICollection<T>.Clear()
Also
UIElementCollection.SetAt UIElementCollection.SetAt U
IElementCollection.SetAt
I n this Article
Edit
Sets the value at the specified index to the UIElement value specified.
public : void SetAt(unsigned int index, UIElement value)
void SetAt(uint32_t index, UIElement value) const;
// This member is not implemented in C#

Parameters
index UInt32
The index at which to set the value.
value UIElement
The value to set.

Remarks
If you are programming using C# or Microsoft Visual Basic, see Item (indexer).
UIElementCollection.Size UIElementCollection.Size U
IElementCollection.Size
I n this Article
Edit
Gets the size (count) of the collection.
public : unsigned int Size { get; }
uint32_t Size();
// This member is not implemented in C#

Returns
uint
The count of items in the collection.

Remarks
The Size value returns the true number of items. API that use the index, such as GetAt, use a zero-based index, so you
would subtract one from Size in order to specify that you want the last item in the collection.
If you are programming using C# or Microsoft Visual Basic, see Count.
UserControl UserControl UserControl Class
Provides the base class for defining a new control that encapsulates related existing controls and provides its own logic.

D eclaration
public : class UserControl : Control, IUserControl
struct winrt::Windows::UI::Xaml::Controls::UserControl : Control, IUserControl
public class UserControl : Control, IUserControl

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Control

Remarks
Note that UserControl does not manifest the value of its property in its control template. Instead, set the Background
of the root element inside the UserControl. For more info, see Remarks in Control.Background.

Constructors
UserControl()
UserControl()
UserControl()

Initializes a new instance of the UserControl class.

Properties
Content
Content
Content

Gets or sets the content that is contained within a user control.

ContentProperty
ContentProperty
ContentProperty

Identifies the Content dependency property.


UserControl.Content UserControl.Content UserControl.
Content
I n this Article
Edit
Gets or sets the content that is contained within a user control.
public : UIElement Content { get; set; }
UIElement Content();

void Content(UIElement content);


public UIElement Content { get; set; }

<UserControl ...>
singleContentElement
</UserControl>
-or-
<UserControl .../>

Returns
UIElement
The content of the user control.
UserControl.ContentProperty UserControl.Content
Property UserControl.ContentProperty
I n this Article
Edit
Identifies the Content dependency property.
public : static DependencyProperty ContentProperty { get; }
static DependencyProperty ContentProperty();
public static DependencyProperty ContentProperty { get; }

Returns
DependencyProperty
The identifier for the Content dependency property.
UserControl UserControl UserControl
I n this Article
Edit
Initializes a new instance of the UserControl class.

public : UserControl()
UserControl() const;
public UserControl()
VariableSizedWrapGrid VariableSizedWrapGrid Variable
SizedWrapGrid Class
Provides a grid-style layout panel where each tile/cell can be variable size based on content.

D eclaration
public : sealed class VariableSizedWrapGrid : Panel, IVariableSizedWrapGrid
struct winrt::Windows::UI::Xaml::Controls::VariableSizedWrapGrid : Panel, IVariableSizedWrapGrid
public sealed class VariableSizedWrapGrid : Panel, IVariableSizedWrapGrid

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel

Remarks
 Tip

For more info, design guidance, and code examples, see Layout panels.
VariableSizedWrapGrid is layout panel that supports arranging child elements in rows and columns. Each child
element can span multiple rows and columns.

In a VariableSizedWrapGrid, elements are arranged in rows or columns that automatically wrap to a new row or
column when the MaximumRowsOrColumns value is reached. The Orientation property specifies whether the grid
adds its items in rows or columns before wrapping.
When the value is Vertical, the grid adds items in columns from top to bottom, then wraps from left to right, like this:

Item 1 Item 4 Item 7

Item 2 Item 5 Item 8

Item 3 Item 6 Item 9

When the value is Horizontal, the grid adds items in rows from left to right, then wraps from top to bottom, like this:

Item 1 Item 2 Item 3


Item 4 Item 5 Item 6

Item 7 Item 8 Item 9

You can make items different sizes in the grid by making them span multiple rows and columns using the
VariableSizedWrapGrid.RowSpan and VariableSizedWrapGrid.ColumnSpan attached properties.
VariableSizedWrapG rid X A ML attached properties
VariableSizedWrapGrid is the host service class for several XAML attached properties. The purpose of these attached
properties is to enable child elements to specify how they should be positioned within the VariableSizedWrapGrid.
VariableSizedWrapGrid provides the following attached properties for XAML usage:
VariableSizedWrapGrid.ColumnSpan
VariableSizedWrapGrid.RowSpan
You can set either or both of these attached properties on any child elements in the VariableSizedWrapGrid in order to
have particular child elements use a spanning logic for layout. This is useful if an element has a notably larger size than
other elements. For example, if one child element has a desired size that is about twice as large in both dimensions, and
you don't want this large element to produce a lot of white space in the nearby cells of peer elements, then you might
use markup like this:
<VariableSizedWrapGrid>
<Image Name="MyBigImage"
VariableSizedWrapGrid.ColumnSpan="2"
VariableSizedWrapGrid.RowSpan="2"
...
/>
...
</VariableSizedWrapGrid>

In order to support XAML processor access to the attached properties, and also to expose equivalent get and set
operations to code, each XAML attached property has a pair of Get and Set accessor methods. For example, the
GetRowSpan and SetRowSpan methods support and provide the equivalent code-only support for
VariableSizedWrapGrid.RowSpan . Alternatively, you can use the dependency property system to get or set the value
of the attached property. Call GetValue or SetValue, passing the arguments of the dependency property identifier to
set, and a reference to the target object on which to get or set the value.
Note

VariableSizedWrapGrid is not supported for use as the ItemsPanel of a ListView control. You can use it as the
ItemsPanel in a GridView or ItemsControl, but the content of a VariableSizedWrapGrid is not virtualized. This can
reduce performance when you work with large data sets. For more info about virtualization, see Optimize ListView and
GridView.

Constructors
VariableSizedWrapGrid()
VariableSizedWrapGrid()
VariableSizedWrapGrid()

Initializes a new instance of the VariableSizedWrapGrid class.

Properties
ColumnSpanProperty
ColumnSpanProperty
ColumnSpanProperty

Identifies the VariableSizedWrapGrid.ColumnSpan XAML attached property.

HorizontalChildrenAlignment
HorizontalChildrenAlignment
HorizontalChildrenAlignment

Gets or sets the alignment rules by which child elements are arranged for the horizontal dimension.

HorizontalChildrenAlignmentProperty
HorizontalChildrenAlignmentProperty
HorizontalChildrenAlignmentProperty

Identifies the HorizontalChildrenAlignment dependency property.

ItemHeight
ItemHeight
ItemHeight

Gets or sets the height of the layout area for each item that is contained in a VariableSizedWrapGrid.

ItemHeightProperty
ItemHeightProperty
ItemHeightProperty

Identifies the ItemHeight dependency property.

ItemWidth
ItemWidth
ItemWidth

Gets or sets the width of the layout area for each item that is contained in a VariableSizedWrapGrid.

ItemWidthProperty
ItemWidthProperty
ItemWidthProperty

Identifies the ItemWidth dependency property.

MaximumRowsOrColumns
MaximumRowsOrColumns
MaximumRowsOrColumns
Gets or sets a value that influences the wrap point, also accounting for Orientation.

MaximumRowsOrColumnsProperty
MaximumRowsOrColumnsProperty
MaximumRowsOrColumnsProperty

Identifies the MaximumRowsOrColumns dependency property.

Orientation
Orientation
Orientation

Gets or sets the direction in which child elements are arranged.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the Orientation dependency property.

RowSpanProperty
RowSpanProperty
RowSpanProperty

Identifies the VariableSizedWrapGrid.RowSpan XAML attached property.

VerticalChildrenAlignment
VerticalChildrenAlignment
VerticalChildrenAlignment

Gets or sets the alignment rules by which child elements are arranged for the vertical dimension.

VerticalChildrenAlignmentProperty
VerticalChildrenAlignmentProperty
VerticalChildrenAlignmentProperty

Identifies the VerticalChildrenAlignment dependency property.

Methods
GetColumnSpan(UIElement)
GetColumnSpan(UIElement)
GetColumnSpan(UIElement)

Gets the value of the VariableSizedWrapGrid.ColumnSpan XAML attached property from a target element.
GetRowSpan(UIElement)
GetRowSpan(UIElement)
GetRowSpan(UIElement)

Gets the value of the VariableSizedWrapGrid.RowSpan XAML attached property from a target element.

SetColumnSpan(UIElement, Int32)
SetColumnSpan(UIElement, Int32)
SetColumnSpan(UIElement, Int32)

Sets the value of the VariableSizedWrapGrid.ColumnSpan XAML attached property on a target element.

SetRowSpan(UIElement, Int32)
SetRowSpan(UIElement, Int32)
SetRowSpan(UIElement, Int32)

Sets the value of the VariableSizedWrapGrid.RowSpan XAML attached property on a target element.

See Also
Panel
Panel
Panel
Panel
Panel
Panel
VariableSizedWrapGrid.ColumnSpanProperty Variable
SizedWrapGrid.ColumnSpanProperty VariableSizedWrap
Grid.ColumnSpanProperty
I n this Article
Edit
Identifies the VariableSizedWrapGrid.ColumnSpan XAML attached property.
public : static DependencyProperty ColumnSpanProperty { get; }
static DependencyProperty ColumnSpanProperty();
public static DependencyProperty ColumnSpanProperty { get; }

Returns
DependencyProperty
The identifier for the VariableSizedWrapGrid.ColumnSpan XAML attached property.
VariableSizedWrapGrid.GetColumnSpan VariableSized
WrapGrid.GetColumnSpan VariableSizedWrapGrid.Get
ColumnSpan
I n this Article
Edit
Gets the value of the VariableSizedWrapGrid.ColumnSpan XAML attached property from a target element.
public : static int GetColumnSpan(UIElement element)
static int32_t GetColumnSpan(UIElement element) const;
public static int GetColumnSpan(UIElement element)

Parameters
element UIElement
The target element.
Returns
int
The obtained value.

Remarks
For more info, see the VariableSizedWrapGrid.ColumnSpan attached property.
See VariableSizedWrapGrid.ColumnSpan
Also
VariableSizedWrapGrid.GetRowSpan VariableSizedWrap
Grid.GetRowSpan VariableSizedWrapGrid.GetRowSpan
I n this Article
Edit
Gets the value of the VariableSizedWrapGrid.RowSpan XAML attached property from a target element.
public : static int GetRowSpan(UIElement element)
static int32_t GetRowSpan(UIElement element) const;
public static int GetRowSpan(UIElement element)

Parameters
element UIElement
The target element.
Returns
int
The obtained value.

Remarks
For more info, see the VariableSizedWrapGrid.RowSpan attached property.
See VariableSizedWrapGrid.RowSpan
Also
VariableSizedWrapGrid.HorizontalChildrenAlignment
VariableSizedWrapGrid.HorizontalChildrenAlignment
VariableSizedWrapGrid.HorizontalChildrenAlignment
I n this Article
Edit
Gets or sets the alignment rules by which child elements are arranged for the horizontal dimension.
public : HorizontalAlignment HorizontalChildrenAlignment { get; set; }
HorizontalAlignment HorizontalChildrenAlignment();

void HorizontalChildrenAlignment(HorizontalAlignment horizontalchildrenalignment);


public HorizontalAlignment HorizontalChildrenAlignment { get; set; }

<VariableSizedWrapGrid HorizontalChildrenAlignment="horizontalAlignmentMemberName" />

Returns
HorizontalAlignment
A value of the enumeration. The default is Left.
VariableSizedWrapGrid.HorizontalChildrenAlignment
Property VariableSizedWrapGrid.HorizontalChildren
AlignmentProperty VariableSizedWrapGrid.Horizontal
ChildrenAlignmentProperty
I n this Article
Edit
Identifies the HorizontalChildrenAlignment dependency property.
public : static DependencyProperty HorizontalChildrenAlignmentProperty { get; }
static DependencyProperty HorizontalChildrenAlignmentProperty();
public static DependencyProperty HorizontalChildrenAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalChildrenAlignment dependency property.
VariableSizedWrapGrid.ItemHeight VariableSizedWrap
Grid.ItemHeight VariableSizedWrapGrid.ItemHeight
I n this Article
Edit
Gets or sets the height of the layout area for each item that is contained in a VariableSizedWrapGrid.
public : double ItemHeight { get; set; }
double ItemHeight();

void ItemHeight(double itemheight);


public double ItemHeight { get; set; }

<VariableSizedWrapGrid ItemHeight="double" />


-or-
<VariableSizedWrapGrid ItemHeight="Auto" />

Returns
double
The height of the layout area for each item that is contained in a VariableSizedWrapGrid. The default is Double.NaN,
which results in the "Auto" layout behavior.

Remarks
"Auto" layout and D ouble.NaN
The default value of ItemHeight and ItemWidth is not 0, it is Double.NaN. ItemHeight and ItemWidth support the
ability to be an unset "Auto" value. Because ItemHeight and ItemWidth are Double values, Double.NaN is used as a
special value to represent this "Auto" behavior. The layout system interprets the "Auto" value to generally mean that
the object should be sized to the available size in layout, instead of to a specific pixel value. If you want the "Auto"
behavior for an object when it is used in layout, leave ItemHeight and ItemWidth unset at their Double.NaN default
value. If you have previously set values and want to reenable the "Auto" behavior with run-time code, set to
Double.NaN. In XAML such as templates, you can set attribute values using the string "Auto".
Note

Visual C++ component extensions (C++/CX) doesn't have a constant for NaN, it uses a value, which appears as "-
1.#IND" followed by zeros.
VariableSizedWrapGrid.ItemHeightProperty Variable
SizedWrapGrid.ItemHeightProperty VariableSizedWrap
Grid.ItemHeightProperty
I n this Article
Edit
Identifies the ItemHeight dependency property.
public : static DependencyProperty ItemHeightProperty { get; }
static DependencyProperty ItemHeightProperty();
public static DependencyProperty ItemHeightProperty { get; }

Returns
DependencyProperty
The identifier for the ItemHeight dependency property.
VariableSizedWrapGrid.ItemWidth VariableSizedWrap
Grid.ItemWidth VariableSizedWrapGrid.ItemWidth
I n this Article
Edit
Gets or sets the width of the layout area for each item that is contained in a VariableSizedWrapGrid.
public : double ItemWidth { get; set; }
double ItemWidth();

void ItemWidth(double itemwidth);


public double ItemWidth { get; set; }

<VariableSizedWrapGrid ItemWidth="double" />


-or-
<VariableSizedWrapGrid ItemWidth="Auto" />

Returns
double
The width of the layout area for each item that is contained in a VariableSizedWrapGrid. The default is Double.NaN,
which results in the "Auto" layout behavior.

Remarks
"Auto" layout and D ouble.NaN
The default value of ItemHeight and ItemWidth is not 0, it is Double.NaN. ItemHeight and ItemWidth support the
ability to be an unset "Auto" value. Because ItemHeight and ItemWidth are Double values, Double.NaN is used as a
special value to represent this "Auto" behavior. The layout system interprets the "Auto" value to generally mean that
the object should be sized to the available size in layout, instead of to a specific pixel value. If you want the "Auto"
behavior for an object when it is used in layout, leave ItemHeight and ItemWidth unset at their Double.NaN default
value. If you have previously set values and want to reenable the "Auto" behavior with run-time code, set to
Double.NaN. In XAML such as templates, you can set attribute values using the string "Auto".
Note

Visual C++ component extensions (C++/CX) doesn't have a constant for NaN, it uses a value, which appears as "-
1.#IND" followed by zeros.
VariableSizedWrapGrid.ItemWidthProperty VariableSized
WrapGrid.ItemWidthProperty VariableSizedWrapGrid.
ItemWidthProperty
I n this Article
Edit
Identifies the ItemWidth dependency property.
public : static DependencyProperty ItemWidthProperty { get; }
static DependencyProperty ItemWidthProperty();
public static DependencyProperty ItemWidthProperty { get; }

Returns
DependencyProperty
The identifier for the ItemWidth dependency property.
VariableSizedWrapGrid.MaximumRowsOrColumns
VariableSizedWrapGrid.MaximumRowsOrColumns
VariableSizedWrapGrid.MaximumRowsOrColumns
I n this Article
Edit
Gets or sets a value that influences the wrap point, also accounting for Orientation.
public : int MaximumRowsOrColumns { get; set; }
int32_t MaximumRowsOrColumns();

void MaximumRowsOrColumns(int32_t maximumrowsorcolumns);


public int MaximumRowsOrColumns { get; set; }

<VariableSizedWrapGrid MaximumRowsOrColumns="int" />

Returns
int
The maximum rows or columns that this VariableSizedWrapGrid should present before it introduces wrapping to the
layout. The default is -1, which is a special value that indicates no maximum.
VariableSizedWrapGrid.MaximumRowsOrColumns
Property VariableSizedWrapGrid.MaximumRowsOr
ColumnsProperty VariableSizedWrapGrid.MaximumRows
OrColumnsProperty
I n this Article
Edit
Identifies the MaximumRowsOrColumns dependency property.
public : static DependencyProperty MaximumRowsOrColumnsProperty { get; }
static DependencyProperty MaximumRowsOrColumnsProperty();
public static DependencyProperty MaximumRowsOrColumnsProperty { get; }

Returns
DependencyProperty
The identifier for the MaximumRowsOrColumns dependency property.
VariableSizedWrapGrid.Orientation VariableSizedWrap
Grid.Orientation VariableSizedWrapGrid.Orientation
I n this Article
Edit
Gets or sets the direction in which child elements are arranged.
public : Orientation Orientation { get; set; }
Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

<VariableSizedWrapGrid Orientation="orientationMemberName" />

Returns
Orientation
A value of the enumeration. The default is Vertical.

Remarks
The Orientation property specifies whether the grid adds its items in rows or columns before wrapping.
When the value is Vertical, the grid adds items in columns from top to bottom, then wraps from left to right, like this:

Item 1 Item 4 Item 7

Item 2 Item 5 Item 8

Item 3 Item 6 Item 9

When the value is Horizontal, the grid adds items in rows from left to right, then wraps from top to bottom, like this:

Item 1 Item 2 Item 3

Item 4 Item 5 Item 6

Item 7 Item 8 Item 9


VariableSizedWrapGrid.OrientationProperty Variable
SizedWrapGrid.OrientationProperty VariableSizedWrap
Grid.OrientationProperty
I n this Article
Edit
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
VariableSizedWrapGrid.RowSpanProperty VariableSized
WrapGrid.RowSpanProperty VariableSizedWrapGrid.Row
SpanProperty
I n this Article
Edit
Identifies the VariableSizedWrapGrid.RowSpan XAML attached property.
public : static DependencyProperty RowSpanProperty { get; }
static DependencyProperty RowSpanProperty();
public static DependencyProperty RowSpanProperty { get; }

Returns
DependencyProperty
The identifier for the VariableSizedWrapGrid.RowSpan XAML attached property.
VariableSizedWrapGrid.SetColumnSpan VariableSized
WrapGrid.SetColumnSpan VariableSizedWrapGrid.Set
ColumnSpan
I n this Article
Edit
Sets the value of the VariableSizedWrapGrid.ColumnSpan XAML attached property on a target element.
public : static void SetColumnSpan(UIElement element, int value)
static void SetColumnSpan(UIElement element, int32_t value) const;
public static void SetColumnSpan(UIElement element, Int32 value)

Parameters
element UIElement
The target element.
value Int32
The value to set.

Remarks
For more info, see the VariableSizedWrapGrid.ColumnSpan attached property.
See VariableSizedWrapGrid.ColumnSpan
Also
VariableSizedWrapGrid.SetRowSpan VariableSizedWrap
Grid.SetRowSpan VariableSizedWrapGrid.SetRowSpan
I n this Article
Edit
Sets the value of the VariableSizedWrapGrid.RowSpan XAML attached property on a target element.
public : static void SetRowSpan(UIElement element, int value)
static void SetRowSpan(UIElement element, int32_t value) const;
public static void SetRowSpan(UIElement element, Int32 value)

Parameters
element UIElement
The target element.
value Int32
The value to set.

Remarks
For more info, see the VariableSizedWrapGrid.RowSpan attached property.
See VariableSizedWrapGrid.RowSpan
Also
VariableSizedWrapGrid VariableSizedWrapGrid Variable
SizedWrapGrid
I n this Article
Edit
Initializes a new instance of the VariableSizedWrapGrid class.
public : VariableSizedWrapGrid()
VariableSizedWrapGrid() const;
public VariableSizedWrapGrid()
VariableSizedWrapGrid.VerticalChildrenAlignment
VariableSizedWrapGrid.VerticalChildrenAlignment
VariableSizedWrapGrid.VerticalChildrenAlignment
I n this Article
Edit
Gets or sets the alignment rules by which child elements are arranged for the vertical dimension.
public : VerticalAlignment VerticalChildrenAlignment { get; set; }
VerticalAlignment VerticalChildrenAlignment();

void VerticalChildrenAlignment(VerticalAlignment verticalchildrenalignment);


public VerticalAlignment VerticalChildrenAlignment { get; set; }

<VariableSizedWrapGrid VerticalChildrenAlignment="verticalAlignmentMemberName" />

Returns
VerticalAlignment
A value of the enumeration. The default is Top.
VariableSizedWrapGrid.VerticalChildrenAlignment
Property VariableSizedWrapGrid.VerticalChildren
AlignmentProperty VariableSizedWrapGrid.Vertical
ChildrenAlignmentProperty
I n this Article
Edit
Identifies the VerticalChildrenAlignment dependency property.
public : static DependencyProperty VerticalChildrenAlignmentProperty { get; }
static DependencyProperty VerticalChildrenAlignmentProperty();
public static DependencyProperty VerticalChildrenAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalChildrenAlignment dependency property.
Viewbox Viewbox Viewbox Class
Defines a content decorator that can stretch and scale a single child to fill the available space.

D eclaration
public : sealed class Viewbox : FrameworkElement, IViewbox
struct winrt::Windows::UI::Xaml::Controls::Viewbox : FrameworkElement, IViewbox
public sealed class Viewbox : FrameworkElement, IViewbox

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
Viewbox is a container control that scales its content to a specified size.

Constructors
Viewbox()
Viewbox()
Viewbox()

Initializes a new instance of the Viewbox class.

Properties
Child
Child
Child

Gets or sets the single child element of a Viewbox element.

Stretch
Stretch
Stretch

Gets or sets the Stretch mode, which determines how content fits into the available space.

StretchDirection
StretchDirection
StretchDirection

Gets or sets the StretchDirection, which determines how scaling is applied to the contents of a Viewbox.

StretchDirectionProperty
StretchDirectionProperty
StretchDirectionProperty

Identifies the StretchDirection dependency property.

StretchProperty
StretchProperty
StretchProperty

Identifies the Stretch dependency property.

See Also
FrameworkElement
Viewbox.Child Viewbox.Child Viewbox.Child
I n this Article
Edit
Gets or sets the single child element of a Viewbox element.

public : UIElement Child { get; set; }


UIElement Child();

void Child(UIElement child);


public UIElement Child { get; set; }

<ViewBox ...>
child
</ViewBox>

Returns
UIElement
The single child element of a Viewbox element.
Viewbox.Stretch Viewbox.Stretch Viewbox.Stretch
I n this Article
Edit
Gets or sets the Stretch mode, which determines how content fits into the available space.

public : Stretch Stretch { get; set; }


Stretch Stretch();

void Stretch(Stretch stretch);


public Stretch Stretch { get; set; }

<ViewBox Stretch="stretchMemberName"/>

Returns
Stretch
A Stretch mode, which determines how content fits in the available space. The default is Uniform.
Viewbox.StretchDirection Viewbox.StretchDirection
Viewbox.StretchDirection
I n this Article
Edit
Gets or sets the StretchDirection, which determines how scaling is applied to the contents of a Viewbox.
public : StretchDirection StretchDirection { get; set; }
StretchDirection StretchDirection();

void StretchDirection(StretchDirection stretchdirection);


public StretchDirection StretchDirection { get; set; }

<ViewBox StretchDirection="stretchDirectionMemberName" />

Returns
StretchDirection
A StretchDirection, which determines how scaling is applied to the contents of a Viewbox. The default is Both.
Viewbox.StretchDirectionProperty Viewbox.Stretch
DirectionProperty Viewbox.StretchDirectionProperty
I n this Article
Edit
Identifies the StretchDirection dependency property.
public : static DependencyProperty StretchDirectionProperty { get; }
static DependencyProperty StretchDirectionProperty();
public static DependencyProperty StretchDirectionProperty { get; }

Returns
DependencyProperty
The identifier for the StretchDirection dependency property.
Viewbox.StretchProperty Viewbox.StretchProperty
Viewbox.StretchProperty
I n this Article
Edit
Identifies the Stretch dependency property.
public : static DependencyProperty StretchProperty { get; }
static DependencyProperty StretchProperty();
public static DependencyProperty StretchProperty { get; }

Returns
DependencyProperty
The identifier for the Stretch dependency property.
Viewbox Viewbox Viewbox
I n this Article
Edit
Initializes a new instance of the Viewbox class.

public : Viewbox()
Viewbox() const;
public Viewbox()
VirtualizationMode VirtualizationMode Virtualization
Mode Enum
Defines constants that specify how VirtualizingStackPanel manages item containers for its child items.

D eclaration
public : enum class VirtualizationMode
enum class winrt::Windows::UI::Xaml::Controls::VirtualizationMode : int32_t
public enum VirtualizationMode

I nheritance H ierarchy
None

Fields
Recycling Recycling Recycling Reuse the item containers.

Standard Standard Standard Create and discard the item containers.


VirtualizingPanel VirtualizingPanel VirtualizingPanel
Class
Provides a framework for Panel elements that virtualize their visual children.

D eclaration
public : class VirtualizingPanel : Panel, IVirtualizingPanel, IVirtualizingPanelOverrides,
IVirtualizingPanelProtected
struct winrt::Windows::UI::Xaml::Controls::VirtualizingPanel : Panel, IVirtualizingPanel,
IVirtualizingPanelOverrides, IVirtualizingPanelProtected
public class VirtualizingPanel : Panel, IVirtualizingPanel, IVirtualizingPanelOverrides,
IVirtualizingPanelProtected

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel

Remarks
VirtualizingPanel is not typically used as an object element in XAML. You typically use derived classes such as
VirtualizingStackPanel.
V irtualizingPanel derived classes
VirtualizingPanel is the parent class for OrientedVirtualizingPanel.

Properties
ItemContainerGenerator
ItemContainerGenerator
ItemContainerGenerator

Gets a value that identifies the ItemContainerGenerator for this VirtualizingPanel.

Methods
AddInternalChild(UIElement)
AddInternalChild(UIElement)
AddInternalChild(UIElement)

Adds the specified UIElement to the Children collection of a VirtualizingPanel element.

BringIndexIntoView(Int32)
BringIndexIntoView(Int32)
BringIndexIntoView(Int32)

Generates the item at the specified index location and makes it visible.
InsertInternalChild(Int32, UIElement)
InsertInternalChild(Int32, UIElement)
InsertInternalChild(Int32, UIElement)

Adds the specified UIElement to the collection of a VirtualizingPanel element at the specified index position.

OnClearChildren()
OnClearChildren()
OnClearChildren()

Called when the collection of child elements is cleared by the base Panel class.

OnItemsChanged(Object, ItemsChangedEventArgs)
OnItemsChanged(Object, ItemsChangedEventArgs)
OnItemsChanged(Object, ItemsChangedEventArgs)

Called when the Items collection that is associated with the ItemsControl for this Panel changes.

RemoveInternalChildRange(Int32, Int32)
RemoveInternalChildRange(Int32, Int32)
RemoveInternalChildRange(Int32, Int32)

Removes child elements from the Children collection.

See Also
Panel
VirtualizingPanel.AddInternalChild VirtualizingPanel.Add
InternalChild VirtualizingPanel.AddInternalChild
I n this Article
Edit
Adds the specified UIElement to the Children collection of a VirtualizingPanel element.
protected : void AddInternalChild(UIElement child)
void AddInternalChild(UIElement child) const;
protected void AddInternalChild(UIElement child)

Parameters
child UIElement
The UIElement child to add to the collection.
VirtualizingPanel.BringIndexIntoView VirtualizingPanel.
BringIndexIntoView VirtualizingPanel.BringIndexIntoView
I n this Article
Edit
Generates the item at the specified index location and makes it visible.
protected : virtual void BringIndexIntoView(int index)
virtual void BringIndexIntoView(int32_t index) const;
protected virtual void BringIndexIntoView(Int32 index)

Parameters
index Int32
The index position of the item that is generated and made visible.
VirtualizingPanel.InsertInternalChild VirtualizingPanel.
InsertInternalChild VirtualizingPanel.InsertInternalChild
I n this Article
Edit
Adds the specified UIElement to the collection of a VirtualizingPanel element at the specified index position.
protected : void InsertInternalChild(int index, UIElement child)
void InsertInternalChild(int32_t index, UIElement child) const;
protected void InsertInternalChild(Int32 index, UIElement child)

Parameters
index Int32
The index position within the collection at which the child element is inserted.
child UIElement
The UIElement child to add to the collection.
VirtualizingPanel.ItemContainerGenerator Virtualizing
Panel.ItemContainerGenerator VirtualizingPanel.Item
ContainerGenerator
I n this Article
Edit
Gets a value that identifies the ItemContainerGenerator for this VirtualizingPanel.
public : ItemContainerGenerator ItemContainerGenerator { get; }
ItemContainerGenerator ItemContainerGenerator();
public ItemContainerGenerator ItemContainerGenerator { get; }

Returns
ItemContainerGenerator
The ItemContainerGenerator for this VirtualizingPanel.
VirtualizingPanel.OnClearChildren VirtualizingPanel.On
ClearChildren VirtualizingPanel.OnClearChildren
I n this Article
Edit
Called when the collection of child elements is cleared by the base Panel class.
protected : virtual void OnClearChildren()
virtual void OnClearChildren() const;
protected virtual void OnClearChildren()
VirtualizingPanel.OnItemsChanged VirtualizingPanel.On
ItemsChanged VirtualizingPanel.OnItemsChanged
I n this Article
Edit
Called when the Items collection that is associated with the ItemsControl for this Panel changes.
protected : virtual void OnItemsChanged(Platform::Object sender, ItemsChangedEventArgs args)
virtual void OnItemsChanged(winrt::Windows::Foundation::IInspectable sender, ItemsChangedEventArgs
args) const;
protected virtual void OnItemsChanged(Object sender, ItemsChangedEventArgs args)

Parameters
sender Object
The Object that raised the event.
args ItemsChangedEventArgs
Provides data for the ItemsChanged event.
VirtualizingPanel.RemoveInternalChildRange Virtualizing
Panel.RemoveInternalChildRange VirtualizingPanel.
RemoveInternalChildRange
I n this Article
Edit
Removes child elements from the Children collection.
protected : void RemoveInternalChildRange(int index, int range)
void RemoveInternalChildRange(int32_t index, int32_t range) const;
protected void RemoveInternalChildRange(Int32 index, Int32 range)

Parameters
index Int32
The beginning index position within the collection at which the first child element is removed.
range Int32
The total number of child elements to remove from the collection.
VirtualizingStackPanel VirtualizingStackPanel Virtualizing
StackPanel Class
Arranges and virtualizes content on a single line that is oriented either horizontally or vertically. Can only be used to
display items in an ItemsControl.

D eclaration
public : sealed class VirtualizingStackPanel : OrientedVirtualizingPanel,
IVirtualizingStackPanel, IVirtualizingStackPanelOverrides
struct winrt::Windows::UI::Xaml::Controls::VirtualizingStackPanel : OrientedVirtualizingPanel,
IVirtualizingStackPanel, IVirtualizingStackPanelOverrides
public sealed class VirtualizingStackPanel : OrientedVirtualizingPanel, IVirtualizingStackPanel,
IVirtualizingStackPanelOverrides

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel
VirtualizingPanel
OrientedVirtualizingPanel

Remarks
VirtualizingStackPanel can only be used to display items in an ItemsControl. A primary scenario for
VirtualizingStackPanel is that it provides the items panel template behavior for FlipView and ListBox in default
templates.
Note

Starting in Windows 8.1, ItemsStackPanel is used as the default ItemsPanel for ListView. If you modify the ItemsPanel,
we recommend you use ItemsStackPanel or ItemsWrapGrid instead of VirtualizingStackPanel or WrapGrid.
V irtualizingStackPanel attached properties
VirtualizingStackPanel is the host service class for several attached properties that control or report the virtualization
mode:
VirtualizingStackPanel.VirtualizationMode
VirtualizingStackPanel.IsVirtualizing
VirtualizingStackPanel.VirtualizationMode is an Extensible Application Markup Language (XAML ) attached property,
and child elements set this property in markup to declare how the item should be virtualized when included as a
VirtualizingStackPanel child element.
VirtualizingStackPanel.IsVirtualizing uses the attached property model as a property store, but does not support a
Extensible Application Markup Language (XAML ) usage. Instead, the property serves as a sentinel that any
VirtualizingStackPanel child element can check to determine whether that child is currently being represented as
virtualized. To find out if an item is being virtualized, call GetIsVirtualizing, passing the item as the input parameter.

Constructors
VirtualizingStackPanel()
VirtualizingStackPanel()
VirtualizingStackPanel()

Initializes a new instance of the VirtualizingStackPanel class.

Properties
AreScrollSnapPointsRegular
AreScrollSnapPointsRegular
AreScrollSnapPointsRegular

Gets or sets a value that indicates whether the generated snap points used for panning in the
VirtualizingStackPanel are equidistant from each other.

AreScrollSnapPointsRegularProperty
AreScrollSnapPointsRegularProperty
AreScrollSnapPointsRegularProperty

Identifies the AreScrollSnapPointsRegular dependency property.

IsVirtualizingProperty
IsVirtualizingProperty
IsVirtualizingProperty

Identifies the VirtualizingStackPanel.IsVirtualizing attached property.

Orientation
Orientation
Orientation

Gets or sets a value that describes the horizontal or vertical orientation of stacked content.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the Orientation dependency property.

VirtualizationModeProperty
VirtualizationModeProperty
VirtualizationModeProperty

Identifies the VirtualizingStackPanel.VirtualizationMode XAML attached property.

Methods
GetIsVirtualizing(DependencyObject)
GetIsVirtualizing(DependencyObject)
GetIsVirtualizing(DependencyObject)

Gets a value that determines whether an item is currently being virtualized as part of an items set where the
ItemsPanel is templated with a VirtualizingStackPanel.

GetVirtualizationMode(DependencyObject)
GetVirtualizationMode(DependencyObject)
GetVirtualizationMode(DependencyObject)

Gets the VirtualizingStackPanel.VirtualizationMode XAML attached property value for the specified target
element.

OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs)
OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs)
OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs)

Called when an item that is hosted by the VirtualizingStackPanel is re-virtualized.

SetVirtualizationMode(DependencyObject, VirtualizationMode)
SetVirtualizationMode(DependencyObject, VirtualizationMode)
SetVirtualizationMode(DependencyObject, VirtualizationMode)

Sets the VirtualizingStackPanel.VirtualizationMode XAML attached property on the specified target element.

Events
CleanUpVirtualizedItemEvent
CleanUpVirtualizedItemEvent
CleanUpVirtualizedItemEvent

Occurs when an item that is hosted by the VirtualizingStackPanel is re-virtualized.

See Also
OrientedVirtualizingPanel
OrientedVirtualizingPanel
VirtualizingStackPanel.AreScrollSnapPointsRegular
VirtualizingStackPanel.AreScrollSnapPointsRegular
VirtualizingStackPanel.AreScrollSnapPointsRegular
I n this Article
Edit
Gets or sets a value that indicates whether the generated snap points used for panning in the VirtualizingStackPanel
are equidistant from each other.
public : Platform::Boolean AreScrollSnapPointsRegular { get; set; }
bool AreScrollSnapPointsRegular();

void AreScrollSnapPointsRegular(bool arescrollsnappointsregular);


public bool AreScrollSnapPointsRegular { get; set; }

<VirtualizingStackPanel AreScrollSnapPointsRegular="bool" .../>

Returns
bool
true if the snap points in the VirtualizingStackPanel are equidistant from each other; otherwise, false.
VirtualizingStackPanel.AreScrollSnapPointsRegular
Property VirtualizingStackPanel.AreScrollSnapPoints
RegularProperty VirtualizingStackPanel.AreScrollSnap
PointsRegularProperty
I n this Article
Edit
Identifies the AreScrollSnapPointsRegular dependency property.
public : static DependencyProperty AreScrollSnapPointsRegularProperty { get; }
static DependencyProperty AreScrollSnapPointsRegularProperty();
public static DependencyProperty AreScrollSnapPointsRegularProperty { get; }

Returns
DependencyProperty
The identifier for the AreScrollSnapPointsRegular dependency property.
VirtualizingStackPanel.CleanUpVirtualizedItemEvent
VirtualizingStackPanel.CleanUpVirtualizedItemEvent
VirtualizingStackPanel.CleanUpVirtualizedItemEvent
I n this Article
Edit
Occurs when an item that is hosted by the VirtualizingStackPanel is re-virtualized.
public : event CleanUpVirtualizedItemEventHandler CleanUpVirtualizedItemEvent
// Register
event_token CleanUpVirtualizedItemEvent(CleanUpVirtualizedItemEventHandler const& handler) const;

// Revoke with event_token


void CleanUpVirtualizedItemEvent(event_token const& cookie) const;

// Revoke with event_revoker


CleanUpVirtualizedItemEvent_revoker CleanUpVirtualizedItemEvent(auto_revoke_t,
CleanUpVirtualizedItemEventHandler const& handler) const;
public event CleanUpVirtualizedItemEventHandler CleanUpVirtualizedItemEvent

<VirtualizingStackPanel CleanUpVirtualizedItemEvent="eventhandler" />


VirtualizingStackPanel.GetIsVirtualizing VirtualizingStack
Panel.GetIsVirtualizing VirtualizingStackPanel.GetIs
Virtualizing
I n this Article
Edit
Gets a value that determines whether an item is currently being virtualized as part of an items set where the
ItemsPanel is templated with a VirtualizingStackPanel.
public : static Platform::Boolean GetIsVirtualizing(DependencyObject o)
static bool GetIsVirtualizing(DependencyObject o) const;
public static bool GetIsVirtualizing(DependencyObject o)

Parameters
o DependencyObject
The object item where you want to determine the current virtualization state.
Returns
bool
true if the item specified by o is currently virtualizing its content; otherwise, false.

Remarks
VirtualizingStackPanel.IsVirtualizing uses the attached property model as a property store, but does not support a
XAML usage. Instead, the property serves as a sentinel that any VirtualizingStackPanel child element can check to
determine whether that child is currently being represented as virtualized. To find out if an item is being virtualized, call
GetIsVirtualizing, passing the item as the input parameter.
VirtualizingStackPanel.GetVirtualizationMode
VirtualizingStackPanel.GetVirtualizationMode
VirtualizingStackPanel.GetVirtualizationMode
I n this Article
Edit
Gets the VirtualizingStackPanel.VirtualizationMode XAML attached property value for the specified target element.
public : static VirtualizationMode GetVirtualizationMode(DependencyObject element)
static VirtualizationMode GetVirtualizationMode(DependencyObject element) const;
public static VirtualizationMode GetVirtualizationMode(DependencyObject element)

Parameters
element DependencyObject
The object from which the VirtualizationMode is read.
Returns
VirtualizationMode
One of the enumeration values that specifies whether the object uses container recycling.

Remarks
For more info, see the VirtualizingStackPanel.VirtualizationMode attached property.
See VirtualizingStackPanel.VirtualizationMode
Also
VirtualizingStackPanel.IsVirtualizingProperty Virtualizing
StackPanel.IsVirtualizingProperty VirtualizingStackPanel.
IsVirtualizingProperty
I n this Article
Edit
Identifies the VirtualizingStackPanel.IsVirtualizing attached property.
public : static DependencyProperty IsVirtualizingProperty { get; }
static DependencyProperty IsVirtualizingProperty();
public static DependencyProperty IsVirtualizingProperty { get; }

Returns
DependencyProperty
The identifier for the VirtualizingStackPanel.IsVirtualizing attached property.

Remarks
VirtualizingStackPanel.IsVirtualizing is an atypical attached property because it does not have a Set accessor, and
thus is not really a XAML attached property with a markup usage. Instead, VirtualizingStackPanel.IsVirtualizing
functions as a sentinel whereby child elements can query the VirtualizingStackPanel parent, and determine whether
virtualization is being used. This might be important information for layout logic or further virtualization logic that is
used by the child element itself.
VirtualizingStackPanel.OnCleanUpVirtualizedItem
VirtualizingStackPanel.OnCleanUpVirtualizedItem
VirtualizingStackPanel.OnCleanUpVirtualizedItem
I n this Article
Edit
Called when an item that is hosted by the VirtualizingStackPanel is re-virtualized.
protected : virtual void OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs e)
virtual void OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs e) const;
protected virtual void OnCleanUpVirtualizedItem(CleanUpVirtualizedItemEventArgs e)

Parameters
e CleanUpVirtualizedItemEventArgs
Data about the event.
VirtualizingStackPanel.Orientation VirtualizingStack
Panel.Orientation VirtualizingStackPanel.Orientation
I n this Article
Edit
Gets or sets a value that describes the horizontal or vertical orientation of stacked content.
public : Orientation Orientation { get; set; }
Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

<VirtualizingStackPanel Orientation="Horizontal"/>
- or -
<VirtualizingStackPanel Orientation="Vertical"/>

Returns
Orientation
The Orientation of child content, as a value of the enumeration. The default is Vertical.
VirtualizingStackPanel.OrientationProperty Virtualizing
StackPanel.OrientationProperty VirtualizingStackPanel.
OrientationProperty
I n this Article
Edit
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
VirtualizingStackPanel.SetVirtualizationMode
VirtualizingStackPanel.SetVirtualizationMode
VirtualizingStackPanel.SetVirtualizationMode
I n this Article
Edit
Sets the VirtualizingStackPanel.VirtualizationMode XAML attached property on the specified target element.
public : static void SetVirtualizationMode(DependencyObject element, VirtualizationMode value)
static void SetVirtualizationMode(DependencyObject element, VirtualizationMode value) const;
public static void SetVirtualizationMode(DependencyObject element, VirtualizationMode value)

Parameters
element DependencyObject
The target element.
value VirtualizationMode
One of the enumeration values that specifies whether element uses container recycling.

Remarks
For more info, see the VirtualizingStackPanel.VirtualizationMode attached property.
See VirtualizingStackPanel.VirtualizationMode
Also
VirtualizingStackPanel.VirtualizationModeProperty
VirtualizingStackPanel.VirtualizationModeProperty
VirtualizingStackPanel.VirtualizationModeProperty
I n this Article
Edit
Identifies the VirtualizingStackPanel.VirtualizationMode XAML attached property.
public : static DependencyProperty VirtualizationModeProperty { get; }
static DependencyProperty VirtualizationModeProperty();
public static DependencyProperty VirtualizationModeProperty { get; }

Returns
DependencyProperty
The identifier for the VirtualizingStackPanel.VirtualizationMode XAML attached property.
VirtualizingStackPanel VirtualizingStackPanel Virtualizing
StackPanel
I n this Article
Edit
Initializes a new instance of the VirtualizingStackPanel class.
public : VirtualizingStackPanel()
VirtualizingStackPanel() const;
public VirtualizingStackPanel()
WebView WebView WebView Class
Provides a control that hosts HTML content in an app.

D eclaration
public : sealed class WebView : FrameworkElement, IWebView, IWebView2, IWebView3, IWebView4,
IWebView5, IWebView6, IWebView7
struct winrt::Windows::UI::Xaml::Controls::WebView : FrameworkElement, IWebView, IWebView2,
IWebView3, IWebView4, IWebView5, IWebView6, IWebView7
public sealed class WebView : FrameworkElement, IWebView, IWebView2, IWebView3, IWebView4,
IWebView5, IWebView6, IWebView7

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement

Remarks
Use the WebView control to host web content in your app.
WebView is not a Control subclass and thus does not have a control template. You can set various properties to control
some visual aspects of the WebView. The display area is constrained by the Width and Height properties. To translate,
scale, skew, and rotate a WebView, use the RenderTransform property. To control the opacity of the WebView, set the
Opacity property. To specify a color to use as the web page background when the HTML content does not specify a
color, set the DefaultBackgroundColor property.
You can get the title of the HTML document currently displayed in the WebView by using the DocumentTitle property.
Although WebView is not a Control subclass, it will receive keyboard input focus and participate in the tab sequence. It
provides a Focus method, and GotFocus and LostFocus events, but it has no tab-related properties. Its position in the
tab sequence is the same as its position in the XAML document order. The tab sequence includes all elements in the
WebView content that can receive input focus.
As indicated in the Events table, WebView doesn’t support most of the user input events inherited from UIElement,
such as KeyDown, KeyUp, and PointerPressed. A common workaround is to use InvokeScriptAsync with the JavaScript
eval function to use the HTML event handlers, and to use window.external.notify from the HTML event handler to
notify the application using WebView.ScriptNotify.
In apps compiled for Windows 10, WebView uses the Microsoft Edge rendering engine to display HTML content. In
apps compiled for Windows 8 or Windows 8.1, WebView uses Internet Explorer 11 in document mode. It does not
support any Microsoft ActiveX controls or plugins like Microsoft Silverlight or Portable Document Format (PDF ) files.
Navigating to content
WebView provides several API for basic navigation: GoBack, GoForward, Stop, Refresh, CanGoBack, and
CanGoForward. You can use these to add typical web browsing capabilities to your app.
To set the initial content of the WebView, set the Source property in XAML. The XAML parser automatically converts
the string to a Uri.
<!-- Source file is on the web. -->
<WebView x:Name="webView1" Source="http://www.contoso.com"/>

<!-- Source file is in local storage. -->


<WebView x:Name="webView2" Source="ms-appdata:///local/intro/welcome.html"/>

<!-- Source file is in the app package. -->


<WebView x:Name="webView3" Source="ms-appx-web:///help/about.html"/>

The Source property can be set in code, but rather than doing so, you typically use one of the Navigate methods to
load content in code.
To load web content, use the Navigate method with a Uri that uses the http or https scheme.
webView1.Navigate(new Uri("http://www.contoso.com"));

To navigate to a Uniform Resource Identifier (URI) with a POST request and HTTP headers, use the
NavigateWithHttpRequestMessage method. This method supports only HttpMethod.Post and HttpMethod.Get for the
HttpRequestMessage.Method property value.
To load uncompressed and unencrypted content from your app’s LocalFolder or TemporaryFolder data stores, use the
Navigate method with a Uri that uses the ms-appdata scheme. The WebView support for this scheme requires you to
place your content in a subfolder under the local or temporary folder. This enables navigation to Uniform Resource
Identifier (URI) such as ms-appdata:///local/folder/file.html and ms-appdata:///temp/folder/file.html. (To load
compressed or encrypted files, see NavigateToLocalStreamUri.)
Each of these first-level subfolders is isolated from the content in other first-level subfolders. For example, you can
navigate to ms-appdata:///temp/folder1/file.html, but you can’t have a link in this file to ms-
appdata:///temp/folder2/file.html. However, you can still link to HTML content in the app package using the ms-appx-
web scheme, and to web content using the http and https Uniform Resource Identifier (URI) schemes.
webView1.Navigate(new Uri("ms-appdata:///local/intro/welcome.html"));

To load content from the your app package, use the Navigate method with a Uri that uses the ms-appx-web scheme.
webView1.Navigate(new Uri("ms-appx-web:///help/about.html"));

You can load local content through a custom resolver using the NavigateToLocalStreamUri method. This enables
advanced scenarios such as downloading and caching web-based content for offline use, or extracting content from a
compressed file.
Responding to navigation events
WebView provides several events that you can use to respond to navigation and content loading states. The events
occur in the following order for the root WebView content:
NavigationStarting - Occurs before the WebView navigates to new content. You can cancel navigation in a handler for
this event by setting the WebViewNavigationStartingEventArgs.Cancel property to true.
webView1.NavigationStarting += webView1_NavigationStarting;

private void webView1_NavigationStarting(object sender, WebViewNavigationStartingEventArgs args)


{
// Cancel navigation if URL is not allowed. (Implemetation of IsAllowedUri not shown.)
if (!IsAllowedUri(args.Uri))
args.Cancel = true;
}

ContentLoading - Occurs when the WebView has started loading new content.

webView1.ContentLoading += webView1_ContentLoading;

private void webView1_ContentLoading(WebView sender, WebViewContentLoadingEventArgs args)


{
// Show status.
if (args.Uri != null)
{
statusTextBlock.Text = "Loading content for " + args.Uri.ToString();
}
}

DOMContentLoaded - Occurs when the WebView has finished parsing the current HTML content.
webView1.DOMContentLoaded += webView1_DOMContentLoaded;

private void webView1_DOMContentLoaded(WebView sender, WebViewDOMContentLoadedEventArgs args)


{
// Show status.
if (args.Uri != null)
{
statusTextBlock.Text = "Content for " + args.Uri.ToString() + " has finished loading";
}
}

NavigationCompleted - Occurs when the WebView has finished loading the current content or if navigation has failed.
To determine whether navigation has failed, check the IsSuccess and WebErrorStatus properties of the
WebViewNavigationCompletedEventArgs class.

webView1.NavigationCompleted += webView1_NavigationCompleted;

private void webView1_NavigationCompleted(WebView sender, WebViewNavigationCompletedEventArgs args)


{
if (args.IsSuccess == true)
{
statusTextBlock.Text = "Navigation to " + args.Uri.ToString() + " completed successfully.";
}
else
{
statusTextBlock.Text = "Navigation to: " + args.Uri.ToString() +
" failed with error " + args.WebErrorStatus.ToString();
}
}

Similar events occur in the same order for each iframe in the WebView content:
FrameNavigationStarting - Occurs before a frame in the WebView navigates to new content.
FrameContentLoading - Occurs when a frame in the WebView has started loading new content.
FrameDOMContentLoaded - Occurs when a frame in the WebView has finished parsing its current HTML content.
FrameNavigationCompleted - Occurs when a frame in the WebView has finished loading its content.
Responding to potential problems
You can respond to potential problems with the content such as long running scripts, content that WebView can't load,
and warnings of unsafe content.
Your app might appear unresponsive while scripts are running. The LongRunningScriptDetected event occurs
periodically while the WebView executes JavaScript and provides an opportunity to interrupt the script. To determine
how long the script has been running, check the ExecutionTime property of the
WebViewLongRunningScriptDetectedEventArgs. To halt the script, set the event args StopPageScriptExecution
property to true. The halted script will not execute again unless it is reloaded during a subsequent WebView
navigation.
The WebView control cannot host arbitrary file types. When an attempt is made to load content that the WebView can't
host, the UnviewableContentIdentified event occurs. You can handle this event and notify the user, or use the Launcher
class to redirect the file to an external browser or another app.
Similarly, the UnsupportedUriSchemeIdentified event occurs when a Uniform Resource Identifier (URI) scheme that's
not supported is invoked in the web content, such as fbconnect:// or mailto://. You can handle this event to provide
custom behavior instead of allowing the default system launcher to launch the Uniform Resource Identifier (URI).
The UnsafeContentWarningDisplaying event occurs when the WebView shows a warning page for content that was
reported as unsafe by the SmartScreen Filter. If the user chooses to continue the navigation, subsequent navigation to
the page will not display the warning nor fire the event.
H andling special cases for WebV iew content
You can use the ContainsFullScreenElement property and ContainsFullScreenElementChanged event to detect,
respond to, and enable full-screen experiences in web content, such as full-screen video playback. For example, you
may use the ContainsFullScreenElementChanged event to resize the WebView to occupy the entirety of your app view,
or, as the following example illustrates, put a windowed app in full screen mode when a full screen web experience is
desired.

// Assume webView is defined in XAML


webView.ContainsFullScreenElementChanged += webView_ContainsFullScreenElementChanged;

private void webView_ContainsFullScreenElementChanged(WebView sender, object args)


{
var applicationView = ApplicationView.GetForCurrentView();

if (sender.ContainsFullScreenElement)
{
applicationView.TryEnterFullScreenMode();
}
else if (applicationView.IsFullScreenMode)
{
applicationView.ExitFullScreenMode();
}
}

You can use the NewWindowRequested event to handle cases where hosted web content requests a new window to be
displayed, such as a popup window. You can use another WebView control to display the contents of the requested
window.
Use PermissionRequested event to enable web features that require special capabilities. These currently include
geolocation, IndexedDB storage, and user audio and video (for example, from a microphone or webcam). If your app
accesses user location or user media, you still are required to declare this capability in the app manifest. For example,
an app that uses geolocation needs the following capability declarations at minimum in Package.appxmanifest:

<Capabilities>
<Capability Name="internetClient"/>
<DeviceCapability Name="location"/>
</Capabilities>

In addition to the app handling the PermissionRequested event, the user will have to approve standard system dialogs
for apps requesting location or media capabilities in order for these features to be enabled.
Here is an example of how an app would enable geolocation in a map from Bing:

// Assume webView is defined in XAML


webView.PermissionRequested += webView_PermissionRequested;

private void webView_PermissionRequested(WebView sender, WebViewPermissionRequestedEventArgs args)


{
if (args.PermissionRequest.PermissionType == WebViewPermissionType.Geolocation &&
args.PermissionRequest.Uri.Host == "www.bing.com")
{
args.PermissionRequest.Allow();
}
}

If your app requires user input or other asynchronous operations to respond to a permission request, use the Defer
method of WebViewPermissionRequest to create a WebViewDeferredPermissionRequest that can be acted upon at a
later time. See WebViewPermissionRequest.Defer.
If users must securely log out of a website hosted in WebView, or in other cases when security is important, call the
static method ClearTemporaryWebDataAsync to clear out all locally cached content from a WebView session. This
prevents malicious users from accessing sensitive data.
I nteracting with WebV iew content
You can interact with the content of the WebView by using the InvokeScriptAsync method to invoke or inject script into
the WebView content, and the ScriptNotify event to get information back from the WebView content.
To invoke JavaScript inside the WebView content, use the InvokeScriptAsync method. The invoked script can return
only string values.
For example, if the content of a WebView named webView1 contains a function named setDate that takes 3
parameters, you can invoke it like this.

string[] args = {"January", "1", "2000"};


string returnValue = await webView1.InvokeScriptAsync("setDate", args);

You can use InvokeScriptAsync with the JavaScript eval function to inject content into the web page.
Here, the text of a XAML TextBox ( nameTextBox.Text ) is written to a div in an HTML page hosted in webView1 .
private async void Button_Click(object sender, RoutedEventArgs e)
{
string functionString = String.Format("document.getElementById('nameDiv').innerText = 'Hello,
{0}';", nameTextBox.Text);
await webView1.InvokeScriptAsync("eval", new string[] { functionString });
}

Scripts in the WebView content can use window.external.notify with a string parameter to send information back to
your app. To receive these messages, handle the ScriptNotify event.
To enable an external web page to fire the ScriptNotify event when calling window.external.notify, you must include
the page's Uniform Resource Identifier (URI) in the ApplicationContentUriRules section of the app manifest. (You
can do this in Microsoft Visual Studio on the Content URIs tab of the Package.appxmanifest designer.) The URIs in this
list must use HTTPS, and may contain subdomain wildcards (for example, https://.microsoft.com ) but they cannot
contain domain wildcards (for example, https://.com and https://.). The manifest requirement does not apply to content
that originates from the app package, uses an ms-local-stream:// URI, or is loaded using NavigateToString.
Accessing the Windows Runtime in WebV iew
Starting in Windows 10, you can use the AddWebAllowedObject method to inject an instance of a native class from a
Windows Runtime component into the JavaScript context of the WebView. This allows full access to the native
methods, properties, and events of that object in the JavaScript content of that WebView. The class must be decorated
with the AllowForWeb attribute.
For example, this code injects an instance of MyClass imported from a Windows Runtime component into WebView.

private void webView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)


{
if (args.Uri.Host == "www.contoso.com")
{
webView.AddWebAllowedObject("nativeObject", new MyClass());
}
}

For more info, see WebView.AddWebAllowedObject.


In addition, trusted JavaScript content in WebView can be allowed to directly access Windows RuntimeAPI. This
provides powerful native capabilities for web apps hosted in WebView. To enable this feature, the Uniform Resource
Identifier (URI) for trusted content must be whitelisted in the ApplicationContentUriRules of the app in
Package.appxmanifest, with WindowsRuntimeAccess specifically set to "all".
This example shows a section of the app manifest. Here, a local Uniform Resource Identifier (URI) is given access to the
Windows Runtime.

<Applications>
<Application Id="App"
...

<uap:ApplicationContentUriRules>
<uap:Rule Match="ms-appx-web:///Web/App.html" WindowsRuntimeAccess="all" Type="include"/>
</uap:ApplicationContentUriRules>
</Application>
</Applications>

Options for web content hosting


Starting in Windows 10, you can use the WebView.Settings property (of type WebViewSettings ) to control whether
JavaScript and IndexedDB are enabled. For example, if you use WebView to display strictly static content, you might
want to disable JavaScript for best performance.
Capturing WebV iew content
To enable sharing WebView content with other apps, use the CaptureSelectedContentToDataPackageAsync method,
which returns the selected content as a DataPackage. This method is asynchronous, so you must use a deferral to
prevent your DataRequested event handler from returning before the asynchronous call is complete.
To get a preview image of the WebView 's current content, use the CapturePreviewToStreamAsync method. This
method creates an image of the current content and writes it to the specified stream.
Execution modes
By default, WebView content is hosted on the UI thread on devices in the desktop device family, and off the UI thread
on all other devices. You can use the WebView.DefaultExecutionMode static property to query the default threading
behavior for the current client. If necessary, you can use the WebView (WebViewExecutionMode) constructor to
override this behavior.
The supported WebViewExecutionMode values are:
SameThread - The WebView content is hosted on the UI Thread.
SeparateThread - The WebView content is hosted on a separate thread off the UI thread.
SeparateProcess - (Windows 10, version 1803 or later) The WebView content is hosted on a separate process off the
app process. All of an app's WebView instances share the same separate process, there is not a separate process per
WebView instance.
When running in a separate process, WebView exibits two behavior differences:
The WebView process could terminate. You can be notified of this by listening to the SeparateProcessLost event.
The WebView process could asynchronously reject keyboard focus. In this case, the WebView.Focus method returns
true, and then immediately (but asynchronously), focus moves away from the WebView. (Other ways of moving focus
behave similarly, such as FocusManager.TryMoveFocus.) You can track this more explicitly by using the
FocusManager.TryFocusAsync or FocusManager.TryMoveFocusAsync APIs.
This example demonstrates how to create a WebView control that runs in a separate process from the host app, and
will be re-created if the separate process is lost.
<Grid>
<Border x:Name="WebViewBorder" Loaded="WebViewBorder_Loaded" />
</Grid>
...

public sealed partial class MainPage : Page


{
public MainPage()
{
this.InitializeComponent();

var webView = new WebView(WebViewExecutionMode.SeparateProcess);


WebViewBorder.Child = webView;;

InitializeWebView(webView);
}

void InitializeWebView(WebView webView)


{
webView.Source = this.WebViewSourceUri;

webView.SeparateProcessLost += (sender, e) =>


{
var newWebView = new WebView(WebViewExecutionMode.SeparateProcess);
InitializeWebView(newWebView);
WebViewBorder.Child = newWebView;
};
}
}

Note

There might be performance issues when hosting content on the UI thread on mobile devices, so be sure to test on all
target devices when you change DefaultExecutionMode.
A WebView that hosts content off the UI thread is not compatible with parent controls that require gestures to
propagate up from the WebView control to the parent, such as FlipView, ScrollViewer, and other related controls.
These controls will not be able to receive gestures initiated in the off-thread WebView. In addition, printing off-thread
web content is not directly supported – you should print an element with WebViewBrush fill instead.
Focus behavior for WebView in a separate process

Whether running in the app process or a separate process, you can set focus on a WebView by calling the
WebView.Focus method. This is equivalent to the Control.Focus and Hyperlink.Focus methods (note that WebView
does not derive from Control).
Similarly, several methods on the FocusManager class can affect a WebView (or Control or Hyperlink):
TryMoveFocus, FindNextFocusableElement, FindLastFocusableElement, and GetFocusedElement. For
example, TryMoveFocus moves focus to a WebView, and GetFocusedElement returns a WebView that has focus.
Finally, moving focus to or from a WebView raises focus events, both on the WebView itself and on the element that
loses or receives focus. The events are LosingFocus, LostFocus, GettingFocus, and GotFocus. For example, when
focus moves from a Control to a WebView, the Control will raise LosingFocus and LostFocus events, and the WebView
will raise GettingFocus and GotFocus events.
When a WebView is running in a separate process, the behavior of these APIs changes slightly. Assuming the
WebView is focusable, the WebView.Focus method will return true (success), but focus has not actually moved yet. The
same is true if rather than the WebView.Focus method, FocusManager.TryMoveFocus is called and it identifies a
WebView as the next focusable element.
The differences in behavior are:
FocusManager.GetFocusedElement does not return the WebView unless/until the asynchronous operation completes.
The control that is losing focus will receive its LosingFocus event synchronously; however, it will not receive LostFocus
unless/until the asynchronous operation completes.
Similarly, the GettingFocus event will occur on the WebView synchronously; however, the GotFocus event won’t be
raised unless/until the asynchronous operation completes.
None of this changes if you call FocusManager.TryFocusAsync instead. However, the async method gives you an
opportunity to determine if the focus change succeeded.
Calling FocusManager.TryMoveFocusAsync on an element other than a WebView in a separate process will complete
synchronously.
This example demonstrates how to move focus to the next logical element, but if that fails, restore focus to its initial
location.

async void MoveFocus(WebView webView))


{
FocusMovementResult result;
result = await FocusManager.TryFocusAsync(webView, FocusState.Programmatic);
if (!result.Succeeded)
{
// Reset focus to the starting position
this.Focus(FocusState.Programmatic);
}
}

Use of Alert
If a web page hosted in a WebView uses the JavaScript Alert function, it will not be displayed. This is by design for all
versions of WebView.
You might be able to intercept the information displayed by an Alert and do what you want with it in the host
application. Whether this is possible depends on how the page is written and whether you have control of it. A sample
is available that demonstrates one possible technique to do this. The sample is written for Windows 8.1 and Windows
Phone 8.1, but will also work for apps using the Universal Windows Platform (UWP ). However, this might not work for
every scenario.
How to intercept JavaScript alert in WebView in universal Windows apps sample
Notes for previous versions
Windows 8.1
The following WebView APIs are deprecated in Windows 8.1:
LoadCompleted and NavigationFailed. Use NavigationCompleted instead.
@Windows.UI.Xaml.Controls.WebView.InvokeScript(System.String,System.String[])?text=InvokeScript. Use
InvokeScriptAsync instead.
DataTransferPackage and DataTransferPackageProperty. Use CaptureSelectedContentToDataPackageAsync instead.
AllowedScriptNotifyUris, AnyScriptNotifyUri, and AllowedScriptNotifyUrisProperty. Include the page's URI in the
ApplicationContentUriRules section of the app manifest instead.
On Windows only, you can handle the UnsafeContentWarningDisplaying event. This event occurs when the WebView
shows a warning page for content that was reported as unsafe by the SmartScreen Filter. If the user chooses to
continue the navigation, subsequent navigation to the page will not display the warning nor fire the event. This event is
not implemented for Windows Phone.
When you invoke JavaScript inside the WebView by calling the InvokeScriptAsync method, functions that require a
secondary window, like Alert, are not supported.
Windows P hone 8
WebView on Windows Phone 8.1 is not compatible with parent controls that require gestures to propagate up from
the WebView control to the parent, such as FlipView, ScrollViewer class, and other related controls.
WebView on Windows Phone 8.1 includes the ContainsFullScreenElement property and
ContainsFullScreenElementChanged event. These members are not available on Windows.
The UnsafeContentWarningDisplaying event is not implemented for Windows Phone prior to Windows 10.
Windows 8
These remarks apply only to apps compiled for Windows 8, even when running on Windows 8.1 or later.
In Windows 8,WebView has the characteristic that other UI regions such as controls cannot be rendered on top of the
WebView. This "airspace problem" is because of how window regions are handled internally, particularly how input
events are processed and how the screen draws. If you want to render HTML content and also place other UI elements
on top of that HTML content, you should use WebViewBrush as the render area. The WebView still provides the HTML
source information, and you reference that WebView through the SourceName property. WebViewBrush does not
have this overlay limitation.
If you want to display an interactive WebView that only occasionally has overlapping content (such as a drop-down list
or app bar), you can temporarily hide the WebView control when necessary, replacing it with an element using a
WebViewBrush fill. Then, when the overlapping content is no longer present, you can display the original WebView
again.
Note

The "airspace problem" has been fixed starting with Windows 8.1 and does not apply for apps targeting Windows 8.1
or Windows 10.
WebView always uses Internet Explorer 10 in document mode.

Constructors
WebView()
WebView()
WebView()

Initializes a new instance of the WebView class.

WebView(WebViewExecutionMode)
WebView(WebViewExecutionMode)
WebView(WebViewExecutionMode)

Initializes a new instance of the WebView class with the specified execution mode.

Properties
AllowedScriptNotifyUris
AllowedScriptNotifyUris
AllowedScriptNotifyUris
Note

AllowedScriptNotifyUris is not supported in apps compiled for Windows 8.1. Instead, update the
ApplicationContentUriRules section of the app manifest. For more info, see the Remarks section.
Gets or sets a safe list of URIs that are permitted to fire ScriptNotify events to this WebView.
AllowedScriptNotifyUrisProperty
AllowedScriptNotifyUrisProperty
AllowedScriptNotifyUrisProperty
Note

AllowedScriptNotifyUrisProperty is not supported in apps compiled for Windows 8.1. Instead, update the
ApplicationContentUriRules section of the app manifest. For more info, see the Remarks section.
Identifies the AllowedScriptNotifyUris dependency property.

AnyScriptNotifyUri
AnyScriptNotifyUri
AnyScriptNotifyUri
Note

AnyScriptNotifyUri is not supported in apps compiled for Windows 8.1. Instead, update the
ApplicationContentUriRules section of the app manifest. For more info, see the Remarks section.
Gets a value that you can use to set the AllowedScriptNotifyUris property to indicate that any page can fire
ScriptNotify events to this WebView.

CanGoBack
CanGoBack
CanGoBack

Gets a value that indicates whether there is at least one page in the backward navigation history.

CanGoBackProperty
CanGoBackProperty
CanGoBackProperty

Identifies the CanGoBack dependency property.

CanGoForward
CanGoForward
CanGoForward

Gets a value that indicates whether there is at least one page in the forward navigation history.

CanGoForwardProperty
CanGoForwardProperty
CanGoForwardProperty

Identifies the CanGoForward dependency property.

ContainsFullScreenElement
ContainsFullScreenElement
ContainsFullScreenElement
Gets a value that indicates whether the WebView contains an element that supports full screen.

ContainsFullScreenElementProperty
ContainsFullScreenElementProperty
ContainsFullScreenElementProperty

Identifies the ContainsFullScreenElement dependency property.

DataTransferPackage
DataTransferPackage
DataTransferPackage
Note

DataTransferPackage may be altered or unavailable for releases after Windows 8.1. Instead, use
CaptureSelectedContentToDataPackageAsync.
Gets a clipboard DataPackage as passed to the WebView.

DataTransferPackageProperty
DataTransferPackageProperty
DataTransferPackageProperty
Note

DataTransferPackageProperty may be altered or unavailable for releases after Windows 8.1. Instead, use
CaptureSelectedContentToDataPackageAsync.
Identifies the DataTransferPackage dependency property.

DefaultBackgroundColor
DefaultBackgroundColor
DefaultBackgroundColor

Gets or sets the color to use as the WebView background when the HTML content does not specify a color.

DefaultBackgroundColorProperty
DefaultBackgroundColorProperty
DefaultBackgroundColorProperty

Identifies the DefaultBackgroundColor dependency property.

DefaultExecutionMode
DefaultExecutionMode
DefaultExecutionMode

Gets the default threading behavior of WebView instances in the current app.

DeferredPermissionRequests
DeferredPermissionRequests
DeferredPermissionRequests

Gets a collection of permission requests that are waiting to be granted or denied.

DocumentTitle
DocumentTitle
DocumentTitle

Gets the title of the page currently displayed in the WebView.

DocumentTitleProperty
DocumentTitleProperty
DocumentTitleProperty

Identifies the DocumentTitle dependency property.

ExecutionMode
ExecutionMode
ExecutionMode

Gets a value that indicates whether the WebView hosts content on the UI thread or a non-UI thread.

Settings
Settings
Settings

Gets a WebViewSettings object that contains properties to enable or disable WebView features.

Source
Source
Source

Gets or sets the Uniform Resource Identifier (URI) source of the HTML content to display in the WebView control.

SourceProperty
SourceProperty
SourceProperty

Identifies the Source dependency property.

XYFocusDown
XYFocusDown
XYFocusDown

Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) down.
XYFocusDownProperty
XYFocusDownProperty
XYFocusDownProperty

Identifies the XYFocusDown dependency property.

XYFocusLeft
XYFocusLeft
XYFocusLeft

Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) left.

XYFocusLeftProperty
XYFocusLeftProperty
XYFocusLeftProperty

Identifies the XYFocusLeft dependency property.

XYFocusRight
XYFocusRight
XYFocusRight

Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) right.

XYFocusRightProperty
XYFocusRightProperty
XYFocusRightProperty

Identifies the XYFocusRight dependency property.

XYFocusUp
XYFocusUp
XYFocusUp

Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) up.

XYFocusUpProperty
XYFocusUpProperty
XYFocusUpProperty

Identifies the XYFocusUp dependency property.

Methods
AddWebAllowedObject(String, Object)
AddWebAllowedObject(String, Object)
AddWebAllowedObject(String, Object)

Adds a native Windows Runtime object as a global parameter to the top level document inside of a WebView.

BuildLocalStreamUri(String, String)
BuildLocalStreamUri(String, String)
BuildLocalStreamUri(String, String)

Creates a URI that you can pass to NavigateToLocalStreamUri.

CapturePreviewToStreamAsync(IRandomAccessStream)
CapturePreviewToStreamAsync(IRandomAccessStream)
CapturePreviewToStreamAsync(IRandomAccessStream)

Creates an image of the current WebView contents and writes it to the specified stream.

CaptureSelectedContentToDataPackageAsync()
CaptureSelectedContentToDataPackageAsync()
CaptureSelectedContentToDataPackageAsync()

Asynchronously gets a DataPackage that contains the selected content within the WebView.

ClearTemporaryWebDataAsync()
ClearTemporaryWebDataAsync()
ClearTemporaryWebDataAsync()

Clears the WebView 's cache and IndexedDB data.

DeferredPermissionRequestById(UInt32)
DeferredPermissionRequestById(UInt32)
DeferredPermissionRequestById(UInt32)

Returns the deferred permission request with the specified Id.

Focus(FocusState)
Focus(FocusState)
Focus(FocusState)

Sets the input focus to the WebView.

GoBack()
GoBack()
GoBack()

Navigates the WebView to the previous page in the navigation history.


GoForward()
GoForward()
GoForward()

Navigates the WebView to the next page in the navigation history.

InvokeScript(String, String[])
InvokeScript(String, String[])
InvokeScript(String, String[])
Note

@Windows.UI.Xaml.Controls.WebView.InvokeScript(System.String,System.String[])?text=InvokeScript may be
altered or unavailable for releases after Windows 8.1. Instead, use InvokeScriptAsync.
Executes the specified script function from the currently loaded HTML, with specific arguments.

InvokeScriptAsync(String, IIterable<String>)
InvokeScriptAsync(String, IIterable<String>)
InvokeScriptAsync(String, IIterable<String>)

Executes the specified script function from the currently loaded HTML, with specific arguments, as an
asynchronous action.

Navigate(Uri)
Navigate(Uri)
Navigate(Uri)

Loads the HTML content at the specified Uniform Resource Identifier (URI).

NavigateToLocalStreamUri(Uri, IUriToStreamResolver)
NavigateToLocalStreamUri(Uri, IUriToStreamResolver)
NavigateToLocalStreamUri(Uri, IUriToStreamResolver)

Loads local web content at the specified URI using an IUriToStreamResolver.

NavigateToString(String)
NavigateToString(String)
NavigateToString(String)

Loads the specified HTML content as a new document.

NavigateWithHttpRequestMessage(HttpRequestMessage)
NavigateWithHttpRequestMessage(HttpRequestMessage)
NavigateWithHttpRequestMessage(HttpRequestMessage)

Navigates the WebView to a URI with a POST request and HTTP headers.
Refresh()
Refresh()
Refresh()

Reloads the current content in the WebView.

Stop()
Stop()
Stop()

Halts the current WebView navigation or download.

Events
ContainsFullScreenElementChanged
ContainsFullScreenElementChanged
ContainsFullScreenElementChanged

Occurs when the status of whether the WebView currently contains a full screen element or not changes.

ContentLoading
ContentLoading
ContentLoading

Occurs when the WebView has started loading new content.

DOMContentLoaded
DOMContentLoaded
DOMContentLoaded

Occurs when the WebView has finished parsing the current HTML content.

FrameContentLoading
FrameContentLoading
FrameContentLoading

Occurs when a frame in the WebView has started loading new content.

FrameDOMContentLoaded
FrameDOMContentLoaded
FrameDOMContentLoaded

Occurs when a frame in the WebView has finished parsing its current HTML content.

FrameNavigationCompleted
FrameNavigationCompleted
FrameNavigationCompleted

Occurs when a frame in the WebView has finished loading its content.

FrameNavigationStarting
FrameNavigationStarting
FrameNavigationStarting

Occurs before a frame in the WebView navigates to new content.

LoadCompleted
LoadCompleted
LoadCompleted
Note

LoadCompleted may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.
Occurs when top-level navigation completes and the content loads into the WebView control or when an error
occurs during loading.

LongRunningScriptDetected
LongRunningScriptDetected
LongRunningScriptDetected

Occurs periodically while the WebView executes JavaScript, letting you halt the script.

NavigationCompleted
NavigationCompleted
NavigationCompleted

Occurs when the WebView has finished loading the current content or if navigation has failed.

NavigationFailed
NavigationFailed
NavigationFailed
Note

NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.
Occurs when the WebView cannot complete the navigation attempt.

NavigationStarting
NavigationStarting
NavigationStarting

Occurs before the WebView navigates to new content.

NewWindowRequested
NewWindowRequested
NewWindowRequested

Occurs when a user performs an action in a WebView that causes content to be opened in a new window.

PermissionRequested
PermissionRequested
PermissionRequested

Occurs when an action in a WebView requires that permission be granted.

ScriptNotify
ScriptNotify
ScriptNotify

Occurs when the content contained in the WebView control passes a string to the application by using JavaScript.

SeparateProcessLost
SeparateProcessLost
SeparateProcessLost

Occurs when a WebView runs with an ExecutionMode of SeparateProcess, and the separate process is lost.

UnsafeContentWarningDisplaying
UnsafeContentWarningDisplaying
UnsafeContentWarningDisplaying

Occurs when the WebView shows a warning page for content that was reported as unsafe by SmartScreen Filter.

UnsupportedUriSchemeIdentified
UnsupportedUriSchemeIdentified
UnsupportedUriSchemeIdentified

Occurs when an attempt is made to navigate to a Uniform Resource Identifier (URI) using a scheme that WebView
doesn't support.

UnviewableContentIdentified
UnviewableContentIdentified
UnviewableContentIdentified

Occurs when the WebView attempts to download an unsupported file.

WebResourceRequested
WebResourceRequested
WebResourceRequested
Occurs when an HTTP request has been made.

See Also
FrameworkElement
FrameworkElement
FrameworkElement
FrameworkElement
FrameworkElement
WebView.AddWebAllowedObject WebView.AddWeb
AllowedObject WebView.AddWebAllowedObject
I n this Article
Edit
Adds a native Windows Runtime object as a global parameter to the top level document inside of a WebView.
public : void AddWebAllowedObject(Platform::String name, Platform::Object pObject)
void AddWebAllowedObject(winrt::hstring name, winrt::Windows::Foundation::IInspectable pObject)
const;
public void AddWebAllowedObject(String name, Object pObject)

Parameters
name String
The name of the object to expose to the document in the WebView.
pObject Object
The object to expose to the document in the WebView.

Examples
This example shows how to decorate a class with the AllowForWeb attribute.
using Windows.Foundation.Metadata;

namespace MyRuntimeComponent
{
[AllowForWeb]
public sealed class MyNativeClass
{
public void NativeMethod()
{
...
}

...
}
}

This example demonstrates using the NavigationStarting event to inject an object when navigation begins.
<WebView x:Name="webView" Source="https://www.contoso.com/index.html"
NavigationStarting="webView_NavigationStarting"/>

private void webView_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)


{
if (args.Uri.Host == "www.contoso.com")
{
webView.AddWebAllowedObject("nativeObject", new MyNativeClass());
}
}
Here's how to access the native object in a script in the web page.

Remarks
Use this method to expose a native Windows Runtime object as a global parameter in the context of the top level
document inside of a WebView. For a Windows Runtime object to be projected, it must agile and be decorated with the
AllowForWeb attribute.
Note

Runtime classes created using Microsoft Visual Basic, C# or Visual C++ component extensions (C++/CX) are agile by
default. For more info, see Threading and Marshaling and Using Windows Runtime objects in a multithreaded
environment.
The object passed into AddWebAllowedObject must be imported from a Windows Runtime component that is
separate from the app assembly. This is necessary for the AllowForWeb attribute to be property identified by the
WebView security subsystem. If you use a class from your app project, AddWebAllowedObject does not work.
You must call AddWebAllowedObject every time WebView is navigated to a new page that accesses the native object.
You can use the WebView.NavigationStarting event to inject the object when navigation begins.
WebView.AllowedScriptNotifyUris WebView.Allowed
ScriptNotifyUris WebView.AllowedScriptNotifyUris
I n this Article
Edit
Note

AllowedScriptNotifyUris is not supported in apps compiled for Windows 8.1. Instead, update the
ApplicationContentUriRules section of the app manifest. For more info, see the Remarks section.
Gets or sets a safe list of URIs that are permitted to fire ScriptNotify events to this WebView.
public : IVector<Uri> AllowedScriptNotifyUris { get; set; }
IVector<Uri> AllowedScriptNotifyUris();

void AllowedScriptNotifyUris(IVector<Uri> allowedscriptnotifyuris);


public IList<Uri> AllowedScriptNotifyUris { get; set; }

Returns
IList<Uri>
The safe list of URIs that are permitted to fire ScriptNotify events.

Remarks
Windows 8.1
AllowedScriptNotifyUris is not supported in apps compiled for Windows 8.1. To enable an external web page to fire
the ScriptNotify event when calling window.external.notify, you must include the page's URI in the
ApplicationContentUriRules section of the app manifest. (You can do this in Visual Studio on the Content URIs tab
of the Package.appxmanifest designer.) The URIs in this list must use HTTPS, and may contain subdomain wildcards
(for example, https://.microsoft.com ) but they cannot contain domain wildcards (for example, https://.com and https://.).
The manifest requirement does not apply to content that originates from the app package, uses an ms-local-stream://
URI, or is loaded using NavigateToString.
Windows 8
These remarks apply only to apps compiled for Windows 8, even when running on Windows 8.1.
To enable an external web page to fire the ScriptNotify event when calling window.external.notify, you must include
the page's URI in the list returned by the AllowedScriptNotifyUris property. Set this property to AnyScriptNotifyUri to
indicate that any page can fire ScriptNotify events for this WebView control. This requirement does not apply to
content loaded using the NavigateToString method.
WebView.AllowedScriptNotifyUrisProperty WebView.
AllowedScriptNotifyUrisProperty WebView.AllowedScript
NotifyUrisProperty
I n this Article
Edit
Note

AllowedScriptNotifyUrisProperty is not supported in apps compiled for Windows 8.1. Instead, update the
ApplicationContentUriRules section of the app manifest. For more info, see the Remarks section.
Identifies the AllowedScriptNotifyUris dependency property.

public : static DependencyProperty AllowedScriptNotifyUrisProperty { get; }


static DependencyProperty AllowedScriptNotifyUrisProperty();
public static DependencyProperty AllowedScriptNotifyUrisProperty { get; }

Returns
DependencyProperty
The identifier for the AllowedScriptNotifyUris dependency property.

Remarks
Windows 8.1
AllowedScriptNotifyUrisProperty is not supported in apps compiled for Windows 8.1. To enable an external web page
to fire the ScriptNotify event when calling window.external.notify, you must include the page's URI in the
ApplicationContentUriRules section of the app manifest. (You can do this in Visual Studio on the Content URIs tab
of the Package.appxmanifest designer.) The URIs in this list must use HTTPS, and may contain subdomain wildcards
(for example, https://.microsoft.com ) but they cannot contain domain wildcards (for example, https://.com and https://.).
The manifest requirement does not apply to content that originates from the app package, uses an ms-local-stream://
URI, or is loaded using NavigateToString.
Windows 8
These remarks apply only to apps compiled for Windows 8, even when running on Windows 8.1.
To enable an external web page to fire the ScriptNotify event when calling window.external.notify, you must include
the page's URI in the list returned by the AllowedScriptNotifyUris property. Set this property to AnyScriptNotifyUri to
indicate that any page can fire ScriptNotify events for this WebView control. This requirement does not apply to
content loaded using the NavigateToString method.
WebView.AnyScriptNotifyUri WebView.AnyScriptNotify
Uri WebView.AnyScriptNotifyUri
I n this Article
Edit
Note

AnyScriptNotifyUri is not supported in apps compiled for Windows 8.1. Instead, update the
ApplicationContentUriRules section of the app manifest. For more info, see the Remarks section.
Gets a value that you can use to set the AllowedScriptNotifyUris property to indicate that any page can fire
ScriptNotify events to this WebView.
public : static IVector<Uri> AnyScriptNotifyUri { get; }
static IVector<Uri> AnyScriptNotifyUri();
public static IList<Uri> AnyScriptNotifyUri { get; }

Returns
IList<Uri>
The safe list of URIs that are permitted to fire ScriptNotify events.

Remarks
Windows 8.1
AnyScriptNotifyUri is not supported in apps compiled for Windows 8.1. To enable an external web page to fire the
ScriptNotify event when calling window.external.notify, you must include the page's URI in the
ApplicationContentUriRules section of the app manifest. (You can do this in Visual Studio on the Content URIs tab
of the Package.appxmanifest designer.) The URIs in this list must use HTTPS, and may contain subdomain wildcards
(for example, https://.microsoft.com ) but they cannot contain domain wildcards (for example, https://.com and https://.).
The manifest requirement does not apply to content that originates from the app package, uses an ms-local-stream://
URI, or is loaded using NavigateToString.
Windows 8
These remarks apply only to apps compiled for Windows 8, even when running on Windows 8.1.
To enable an external web page to fire the ScriptNotify event when calling window.external.notify, you must include
the page's URI in the list returned by the AllowedScriptNotifyUris property. Set this property to AnyScriptNotifyUri to
indicate that any page can fire ScriptNotify events for this WebView control. This requirement does not apply to
content loaded using the NavigateToString method.
WebView.BuildLocalStreamUri WebView.BuildLocal
StreamUri WebView.BuildLocalStreamUri
I n this Article
Edit
Creates a URI that you can pass to NavigateToLocalStreamUri.
public : Uri BuildLocalStreamUri(Platform::String contentIdentifier, Platform::String relativePath)
Uri BuildLocalStreamUri(winrt::hstring contentIdentifier, winrt::hstring relativePath) const;
public Uri BuildLocalStreamUri(String contentIdentifier, String relativePath)

Parameters
contentIdentifier String
A unique identifier for the content the URI is referencing. This defines the root of the URI.
relativePath String
The path to the resource, relative to the root.
Returns
Uri
The URI created by combining and normalizing the contentIdentifier and relativePath.

Examples
The following code example shows how to use this method with a resolver that will serve a file from the app package.
For a complete example, see the XAML WebView control sample.
public sealed partial class TestPage : Page
{
// ... other code ...

protected override void OnNavigatedTo(NavigationEventArgs e)


{
// The 'Host' part of the URI for the ms-local-stream protocol needs to be a combination of
the package name
// and an application-defined key, which identifies the specific resolver, in this case
'MyTag'.

Uri url = webView4.BuildLocalStreamUri("MyTag","/Minesweeper/default.html");


StreamUriWinRTResolver myResolver = new StreamUriWinRTResolver();

// Pass the resolver object to the navigate call.


webView4.NavigateToLocalStreamUri(url, myResolver);
}
}

public sealed class StreamUriWinRTResolver : IUriToStreamResolver


{
public IAsyncOperation<IInputStream> UriToStreamAsync(Uri uri)
{
if (uri == null)
{
throw new Exception();
}
string path = uri.AbsolutePath;

// Because of the signature of the this method, it can't use await, so we


// call into a seperate helper method that can use the C# await pattern.
return GetContent(path).AsAsyncOperation();
}

private async Task<IInputStream> GetContent(string path)


{
// We use a package folder as the source, but the same principle should apply
// when supplying content from other locations
try
{
Uri localUri= new Uri("ms-appx:///html" + path);
StorageFile f = await StorageFile.GetFileFromApplicationUriAsync(localUri);
IRandomAccessStream stream = await f.OpenAsync(FileAccessMode.Read);
return stream.GetInputStreamAt(0);
}
catch (Exception) { throw new Exception("Invalid path"); }
}
}

See XAML WebView control sample


Also
WebView.CanGoBack WebView.CanGoBack WebView.
CanGoBack
I n this Article
Edit
Gets a value that indicates whether there is at least one page in the backward navigation history.
public : Platform::Boolean CanGoBack { get; }
bool CanGoBack();
public bool CanGoBack { get; }

Returns
bool
true if the WebView can navigate backward; otherwise, false.

Remarks
To navigate backward, call the GoBack method.
WebView.CanGoBackProperty WebView.CanGoBack
Property WebView.CanGoBackProperty
I n this Article
Edit
Identifies the CanGoBack dependency property.
public : static DependencyProperty CanGoBackProperty { get; }
static DependencyProperty CanGoBackProperty();
public static DependencyProperty CanGoBackProperty { get; }

Returns
DependencyProperty
The identifier for the CanGoBack dependency property.
WebView.CanGoForward WebView.CanGoForward Web
View.CanGoForward
I n this Article
Edit
Gets a value that indicates whether there is at least one page in the forward navigation history.
public : Platform::Boolean CanGoForward { get; }
bool CanGoForward();
public bool CanGoForward { get; }

Returns
bool
true if the WebView can navigate forward; otherwise, false.

Remarks
To navigate forward, call the GoForward method.
WebView.CanGoForwardProperty WebView.CanGo
ForwardProperty WebView.CanGoForwardProperty
I n this Article
Edit
Identifies the CanGoForward dependency property.
public : static DependencyProperty CanGoForwardProperty { get; }
static DependencyProperty CanGoForwardProperty();
public static DependencyProperty CanGoForwardProperty { get; }

Returns
DependencyProperty
The identifier for the CanGoForward dependency property.
WebView.CapturePreviewToStreamAsync WebView.
CapturePreviewToStreamAsync WebView.CapturePreview
ToStreamAsync
I n this Article
Edit
Creates an image of the current WebView contents and writes it to the specified stream.
public : IAsyncAction CapturePreviewToStreamAsync(IRandomAccessStream stream)
IAsyncAction CapturePreviewToStreamAsync(IRandomAccessStream stream) const;
public IAsyncAction CapturePreviewToStreamAsync(IRandomAccessStream stream)

Parameters
stream IRandomAccessStream
The stream to write the image to.
Returns
IAsyncAction
An asynchronous action to await the capture operation.
Attributes RemoteAsyncAttribute

Examples
This example shows how to use this method to create a thumbnail image of the current content. For the complete
example, see the WebView control sample.
private async void bookmarkBtn_Click(object sender, RoutedEventArgs e)
{
InMemoryRandomAccessStream ms = new InMemoryRandomAccessStream();
await webView8.CapturePreviewToStreamAsync(ms);

// Create a small thumbnail.


int longlength = 180, width = 0, height = 0;
double srcwidth = webView8.ActualWidth, srcheight = webView8.ActualHeight;
double factor = srcwidth / srcheight;
if (factor < 1)
{
height = longlength;
width = (int)(longlength * factor);
}
else
{
width = longlength;
height = (int)(longlength / factor);
}
BitmapSource small = await resize(width, height, ms);

BookmarkItem item = new BookmarkItem();


item.Title = webView8.DocumentTitle;
item.PageUrl = webView8.Source;
item.Preview = small;

bookmarks.Add(item);
}

See XAML WebView control sample


Also WebView control (XAML ) sample (Windows 10)
WebView.CaptureSelectedContentToDataPackageAsync
WebView.CaptureSelectedContentToDataPackageAsync
WebView.CaptureSelectedContentToDataPackageAsync
I n this Article
Edit
Asynchronously gets a DataPackage that contains the selected content within the WebView.
public : IAsyncOperation<DataPackage> CaptureSelectedContentToDataPackageAsync()
IAsyncOperation<DataPackage> CaptureSelectedContentToDataPackageAsync() const;
public IAsyncOperation<DataPackage> CaptureSelectedContentToDataPackageAsync()

Returns
IAsyncOperation<DataPackage>
When this method completes, it returns the selected content as a DataPackage.
Attributes RemoteAsyncAttribute

Remarks
You can use this method during a share operation to send the selected WebView content to a target app. This method
is asynchronous, so you must use a deferral to prevent your DataRequested event handler from returning before the
asynchronous call is complete. Call DataRequestedEventArgs.Request.GetDeferral to create the deferral and
DataRequestDeferral.Complete to end it.
See DataPackage
Also WebView control (XAML ) sample (Windows 10)
WebView.ClearTemporaryWebDataAsync WebView.Clear
TemporaryWebDataAsync WebView.ClearTemporaryWeb
DataAsync
I n this Article
Edit
Clears the WebView 's cache and IndexedDB data.
public : static IAsyncAction ClearTemporaryWebDataAsync()
static IAsyncAction ClearTemporaryWebDataAsync() const;
public static IAsyncAction ClearTemporaryWebDataAsync()

Returns
IAsyncAction
An asynchronous action to await the clear operation.
Attributes RemoteAsyncAttribute
WebView.ContainsFullScreenElement WebView.Contains
FullScreenElement WebView.ContainsFullScreenElement
I n this Article
Edit
Gets a value that indicates whether the WebView contains an element that supports full screen.
public : Platform::Boolean ContainsFullScreenElement { get; }
bool ContainsFullScreenElement();
public bool ContainsFullScreenElement { get; }

Returns
bool
true if the WebView contains an element that supports full screen; otherwise, false.
WebView.ContainsFullScreenElementChanged WebView.
ContainsFullScreenElementChanged WebView.Contains
FullScreenElementChanged
I n this Article
Edit
Occurs when the status of whether the WebView currently contains a full screen element or not changes.
public : event TypedEventHandler<WebView, object> ContainsFullScreenElementChanged
// Register
event_token ContainsFullScreenElementChanged(TypedEventHandler<WebView, object> const& handler)
const;

// Revoke with event_token


void ContainsFullScreenElementChanged(event_token const& cookie) const;

// Revoke with event_revoker


ContainsFullScreenElementChanged_revoker ContainsFullScreenElementChanged(auto_revoke_t,
TypedEventHandler<WebView, object> const& handler) const;
public event TypedEventHandler<WebView, object> ContainsFullScreenElementChanged

<WebView ContainsFullScreenElementChanged="eventhandler"/>
WebView.ContainsFullScreenElementProperty WebView.
ContainsFullScreenElementProperty WebView.Contains
FullScreenElementProperty
I n this Article
Edit
Identifies the ContainsFullScreenElement dependency property.
public : static DependencyProperty ContainsFullScreenElementProperty { get; }
static DependencyProperty ContainsFullScreenElementProperty();
public static DependencyProperty ContainsFullScreenElementProperty { get; }

Returns
DependencyProperty
The identifier for the ContainsFullScreenElement dependency property.
WebView.ContentLoading WebView.ContentLoading
WebView.ContentLoading
I n this Article
Edit
Occurs when the WebView has started loading new content.
public : event TypedEventHandler<WebView, WebViewContentLoadingEventArgs> ContentLoading
// Register
event_token ContentLoading(TypedEventHandler<WebView, WebViewContentLoadingEventArgs> const&
handler) const;

// Revoke with event_token


void ContentLoading(event_token const& cookie) const;

// Revoke with event_revoker


ContentLoading_revoker ContentLoading(auto_revoke_t, TypedEventHandler<WebView,
WebViewContentLoadingEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewContentLoadingEventArgs> ContentLoading

<WebView ContentLoading="eventhandler"/>

Remarks
WebView navigation events occur in the following order:
NavigationStarting
ContentLoading
DOMContentLoaded
NavigationCompleted
Similar events occur in the same order for each iframe in the WebView content:
FrameNavigationStarting
FrameContentLoading
FrameDOMContentLoaded
FrameNavigationCompleted
WebView.DataTransferPackage WebView.DataTransfer
Package WebView.DataTransferPackage
I n this Article
Edit
Note

DataTransferPackage may be altered or unavailable for releases after Windows 8.1. Instead, use
CaptureSelectedContentToDataPackageAsync.
Gets a clipboard DataPackage as passed to the WebView.
public : DataPackage DataTransferPackage { get; }
DataPackage DataTransferPackage();
public DataPackage DataTransferPackage { get; }

Returns
DataPackage
A clipboard data package.

Examples
The following code example demonstrates how to use this property to implement sharing support.
private void Share_Click(object sender, RoutedEventArgs e)
{
dataTransferManager = DataTransferManager.GetForCurrentView();
dataTransferManager.DataRequested += dataTransferManager_DataRequested;
DataTransferManager.ShowShareUI();
}

void dataTransferManager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)


{
DataRequest request = args.Request;
DataPackage p = WebView7.DataTransferPackage;

if (p.GetView().Contains(StandardDataFormats.Text))
{
p.Properties.Title = "WebView Sharing Excerpt";
p.Properties.Description = "This is a snippet from the content hosted in the WebView
control";
request.Data = p;
}
else
{
request.FailWithDisplayText("Nothing to share");
}
dataTransferManager.DataRequested -= dataTransferManager_DataRequested;
}

Remarks
This property is typically used to support sharing. During a share operation, the source app puts the data being shared
in a DataPackage object and sends that object to the target app for processing.
See XAML WebView control sample
Also
WebView.DataTransferPackageProperty WebView.Data
TransferPackageProperty WebView.DataTransferPackage
Property
I n this Article
Edit
Note

DataTransferPackageProperty may be altered or unavailable for releases after Windows 8.1. Instead, use
CaptureSelectedContentToDataPackageAsync.
Identifies the DataTransferPackage dependency property.

public : static DependencyProperty DataTransferPackageProperty { get; }


static DependencyProperty DataTransferPackageProperty();
public static DependencyProperty DataTransferPackageProperty { get; }

Returns
DependencyProperty
The identifier for the DataTransferPackage dependency property.
WebView.DefaultBackgroundColor WebView.Default
BackgroundColor WebView.DefaultBackgroundColor
I n this Article
Edit
Gets or sets the color to use as the WebView background when the HTML content does not specify a color.
public : Color DefaultBackgroundColor { get; set; }
Color DefaultBackgroundColor();

void DefaultBackgroundColor(Color defaultbackgroundcolor);


public Color DefaultBackgroundColor { get; set; }

<WebView DefaultBackgroundColor="predefinedColorName"/>
- or -
<WebView DefaultBackgroundColor="#rgb"/>
- or -
<WebView DefaultBackgroundColor="#argb"/>
- or -
<WebView DefaultBackgroundColor="#rrggbb"/>
- or -
<WebView DefaultBackgroundColor="#aarrggbb"/>
- or -
<WebView DefaultBackgroundColor="sc#scR,scG,scB"/>
- or -
<WebView DefaultBackgroundColor="sc#scA,scR,scG,scB"/>

Returns
Color
The background color.
WebView.DefaultBackgroundColorProperty WebView.
DefaultBackgroundColorProperty WebView.Default
BackgroundColorProperty
I n this Article
Edit
Identifies the DefaultBackgroundColor dependency property.
public : static DependencyProperty DefaultBackgroundColorProperty { get; }
static DependencyProperty DefaultBackgroundColorProperty();
public static DependencyProperty DefaultBackgroundColorProperty { get; }

Returns
DependencyProperty
The identifier for the DefaultBackgroundColor dependency property.
WebView.DefaultExecutionMode WebView.Default
ExecutionMode WebView.DefaultExecutionMode
I n this Article
Edit
Gets the default threading behavior of WebView instances in the current app.
public : static WebViewExecutionMode DefaultExecutionMode { get; }
static WebViewExecutionMode DefaultExecutionMode();
public static WebViewExecutionMode DefaultExecutionMode { get; }

Returns
WebViewExecutionMode
The default threading behavior of WebView instances in the current app.

Remarks
The default value for the desktop device family is SameThread. The default value for all other device families is
SeparateThread.
WebView.DeferredPermissionRequestById WebView.
DeferredPermissionRequestById WebView.Deferred
PermissionRequestById
I n this Article
Edit
Returns the deferred permission request with the specified Id.
public : WebViewDeferredPermissionRequest DeferredPermissionRequestById(unsigned int id)
WebViewDeferredPermissionRequest DeferredPermissionRequestById(uint32_t id) const;
public WebViewDeferredPermissionRequest DeferredPermissionRequestById(UInt32 id)

Parameters
id UInt32
The Id of the deferred permission request.
Returns
WebViewDeferredPermissionRequest
The deferred permission request with the specified Id.

Remarks
When you defer a WebViewPermissionRequest, a new WebViewDeferredPermissionRequest is created with the same
Id and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the
DeferredPermissionRequestById method and pass the Id of the deferred request. After you retrieve the request, you
can call the Allow method to grant the request, or call the Deny method to deny the request.
See PermissionRequestedPermissionRequestedPermissionRequested
Also
WebView.DeferredPermissionRequests WebView.
DeferredPermissionRequests WebView.Deferred
PermissionRequests
I n this Article
Edit
Gets a collection of permission requests that are waiting to be granted or denied.
public : IVector<WebViewDeferredPermissionRequest> DeferredPermissionRequests { get; }
IVector<WebViewDeferredPermissionRequest> DeferredPermissionRequests();
public IList<WebViewDeferredPermissionRequest> DeferredPermissionRequests { get; }

Returns
IList<WebViewDeferredPermissionRequest>
A collection of WebViewDeferredPermissionRequest objects that are waiting to be granted or denied.

Remarks
When you defer a WebViewPermissionRequest, a new WebViewDeferredPermissionRequest is created with the same
Id and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the
DeferredPermissionRequestById method and pass the Id of the deferred request. After you retrieve the request, you
can call the Allow method to grant the request, or call the Deny method to deny the request.
See WebViewDeferredPermissionRequest
Also
WebView.DocumentTitle WebView.DocumentTitle Web
View.DocumentTitle
I n this Article
Edit
Gets the title of the page currently displayed in the WebView.
public : Platform::String DocumentTitle { get; }
winrt::hstring DocumentTitle();
public string DocumentTitle { get; }

Returns
string
The page title.
WebView.DocumentTitleProperty WebView.Document
TitleProperty WebView.DocumentTitleProperty
I n this Article
Edit
Identifies the DocumentTitle dependency property.
public : static DependencyProperty DocumentTitleProperty { get; }
static DependencyProperty DocumentTitleProperty();
public static DependencyProperty DocumentTitleProperty { get; }

Returns
DependencyProperty
The identifier of the DocumentTitle dependency property.
WebView.DOMContentLoaded WebView.DOMContent
Loaded WebView.DOMContentLoaded
I n this Article
Edit
Occurs when the WebView has finished parsing the current HTML content.
public : event TypedEventHandler<WebView, WebViewDOMContentLoadedEventArgs> DOMContentLoaded
// Register
event_token DOMContentLoaded(TypedEventHandler<WebView, WebViewDOMContentLoadedEventArgs> const&
handler) const;

// Revoke with event_token


void DOMContentLoaded(event_token const& cookie) const;

// Revoke with event_revoker


DOMContentLoaded_revoker DOMContentLoaded(auto_revoke_t, TypedEventHandler<WebView,
WebViewDOMContentLoadedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewDOMContentLoadedEventArgs> DOMContentLoaded

<WebView DOMContentLoaded="eventhandler"/>

Remarks
WebView navigation events occur in the following order:
NavigationStarting
ContentLoading
DOMContentLoaded
NavigationCompleted
Similar events occur in the same order for each iframe in the WebView content:
FrameNavigationStarting
FrameContentLoading
FrameDOMContentLoaded
FrameNavigationCompleted
WebView.ExecutionMode WebView.ExecutionMode Web
View.ExecutionMode
I n this Article
Edit
Gets a value that indicates whether the WebView hosts content on the UI thread or a non-UI thread.
public : WebViewExecutionMode ExecutionMode { get; }
WebViewExecutionMode ExecutionMode();
public WebViewExecutionMode ExecutionMode { get; }

Returns
WebViewExecutionMode
A value of the enumeration that specifies whether the WebView hosts content on the UI thread or a non-UI thread.

Remarks
To create a WebView with a specific ExecutionMode, use the WebView (WebViewExecutionMode) constructor.
When the ExecutionMode is SameThread, WebView content is hosted on the UI thread. When the value is
SeparateThread, content is hosted on a background thread.
When the WebView is not on the UI thread, the behaviors listed here are not supported:
Scroll chaining and pointer chaining. (Input events aren't propagated to parent controls that uses DirectManipulation
like ScrollViewer or FlipView.)
Tab navigation to escape focus on WebView.
Printing.
See WebViewExecutionMode
Also
WebView.Focus WebView.Focus WebView.Focus
I n this Article
Edit
Sets the input focus to the WebView.

public : Platform::Boolean Focus(FocusState value)


bool Focus(FocusState value) const;
public bool Focus(FocusState value)

Parameters
value FocusState
A value that indicates how the focus was set.
Returns
bool
true if focus was set; otherwise, false.

Remarks
In apps compiled for Windows 8, the WebView control automatically gets input focus whenever you use script to
programmatically set the focus to some content in the WebView. In apps compiled for Windows 8.1, this does not
occur automatically. Instead, you must call the Focus method to set the focus to the WebView control and also use
script to set the focus to some content in the control.
When you call this method, you will typically pass in a FocusState value of Programmatic. Use the Pointer and
Keyboard values when you call this method in response to direct user input. You cannot use this method to remove
input focus from the control. The Unfocused value will throw an exception.
WebView.FrameContentLoading WebView.FrameContent
Loading WebView.FrameContentLoading
I n this Article
Edit
Occurs when a frame in the WebView has started loading new content.
public : event TypedEventHandler<WebView, WebViewContentLoadingEventArgs> FrameContentLoading
// Register
event_token FrameContentLoading(TypedEventHandler<WebView, WebViewContentLoadingEventArgs> const&
handler) const;

// Revoke with event_token


void FrameContentLoading(event_token const& cookie) const;

// Revoke with event_revoker


FrameContentLoading_revoker FrameContentLoading(auto_revoke_t, TypedEventHandler<WebView,
WebViewContentLoadingEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewContentLoadingEventArgs> FrameContentLoading

<WebView FrameContentLoading="eventhandler"/>

Remarks
WebView navigation events occur in the following order:
NavigationStarting
ContentLoading
DOMContentLoaded
NavigationCompleted
Similar events occur in the same order for each iframe in the WebView content:
FrameNavigationStarting
FrameContentLoading
FrameDOMContentLoaded
FrameNavigationCompleted
WebView.FrameDOMContentLoaded WebView.Frame
DOMContentLoaded WebView.FrameDOMContent
Loaded
I n this Article
Edit
Occurs when a frame in the WebView has finished parsing its current HTML content.
public : event TypedEventHandler<WebView, WebViewDOMContentLoadedEventArgs> FrameDOMContentLoaded
// Register
event_token FrameDOMContentLoaded(TypedEventHandler<WebView, WebViewDOMContentLoadedEventArgs>
const& handler) const;

// Revoke with event_token


void FrameDOMContentLoaded(event_token const& cookie) const;

// Revoke with event_revoker


FrameDOMContentLoaded_revoker FrameDOMContentLoaded(auto_revoke_t, TypedEventHandler<WebView,
WebViewDOMContentLoadedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewDOMContentLoadedEventArgs> FrameDOMContentLoaded

<WebView FrameDOMContentLoaded="eventhandler"/>

Remarks
WebView navigation events occur in the following order:
NavigationStarting
ContentLoading
DOMContentLoaded
NavigationCompleted
Similar events occur in the same order for each iframe in the WebView content:
FrameNavigationStarting
FrameContentLoading
FrameDOMContentLoaded
FrameNavigationCompleted
WebView.FrameNavigationCompleted WebView.Frame
NavigationCompleted WebView.FrameNavigation
Completed
I n this Article
Edit
Occurs when a frame in the WebView has finished loading its content.
public : event TypedEventHandler<WebView, WebViewNavigationCompletedEventArgs>
FrameNavigationCompleted
// Register
event_token FrameNavigationCompleted(TypedEventHandler<WebView, WebViewNavigationCompletedEventArgs>
const& handler) const;

// Revoke with event_token


void FrameNavigationCompleted(event_token const& cookie) const;

// Revoke with event_revoker


FrameNavigationCompleted_revoker FrameNavigationCompleted(auto_revoke_t, TypedEventHandler<WebView,
WebViewNavigationCompletedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewNavigationCompletedEventArgs>
FrameNavigationCompleted

<WebView FrameNavigationCompleted="eventhandler"/>

Remarks
WebView navigation events occur in the following order:
NavigationStarting
ContentLoading
DOMContentLoaded
NavigationCompleted
Similar events occur in the same order for each iframe in the WebView content:
FrameNavigationStarting
FrameContentLoading
FrameDOMContentLoaded
FrameNavigationCompleted
WebView.FrameNavigationStarting WebView.Frame
NavigationStarting WebView.FrameNavigationStarting
I n this Article
Edit
Occurs before a frame in the WebView navigates to new content.
public : event TypedEventHandler<WebView, WebViewNavigationStartingEventArgs>
FrameNavigationStarting
// Register
event_token FrameNavigationStarting(TypedEventHandler<WebView, WebViewNavigationStartingEventArgs>
const& handler) const;

// Revoke with event_token


void FrameNavigationStarting(event_token const& cookie) const;

// Revoke with event_revoker


FrameNavigationStarting_revoker FrameNavigationStarting(auto_revoke_t, TypedEventHandler<WebView,
WebViewNavigationStartingEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewNavigationStartingEventArgs> FrameNavigationStarting

<WebView FrameNavigationStarting="eventhandler"/>

Remarks
You can cancel navigation in a handler for this event by setting the WebViewNavigationStartingEventArgs.Cancel
property to true.
WebView navigation events occur in the following order:
NavigationStarting
ContentLoading
DOMContentLoaded
NavigationCompleted
Similar events occur in the same order for each iframe in the WebView content:
FrameNavigationStarting
FrameContentLoading
FrameDOMContentLoaded
FrameNavigationCompleted
WebView.GoBack WebView.GoBack WebView.GoBack
I n this Article
Edit
Navigates the WebView to the previous page in the navigation history.

public : void GoBack()


void GoBack() const;
public void GoBack()
WebView.GoForward WebView.GoForward WebView.Go
Forward
I n this Article
Edit
Navigates the WebView to the next page in the navigation history.
public : void GoForward()
void GoForward() const;
public void GoForward()
WebView.InvokeScript WebView.InvokeScript WebView.
InvokeScript
I n this Article
Edit
Note

@Windows.UI.Xaml.Controls.WebView.InvokeScript(System.String,System.String[])?text=InvokeScript may be altered


or unavailable for releases after Windows 8.1. Instead, use InvokeScriptAsync.
Executes the specified script function from the currently loaded HTML, with specific arguments.
public : Platform::String InvokeScript(Platform::String scriptName, Platform::String[] arguments)
winrt::hstring InvokeScript(winrt::hstring scriptName, winrt::hstring[] arguments) const;
public string InvokeScript(String scriptName, String[] arguments)

Parameters
scriptName String
The name of the script function to invoke.
arguments String[]
A string array that packages arguments to the script function.
Returns
string
The result of the script invocation.
Attributes DeprecatedAttribute

Remarks
The invoked script can return only string values.
WebView.InvokeScriptAsync WebView.InvokeScriptAsync
WebView.InvokeScriptAsync
I n this Article
Edit
Executes the specified script function from the currently loaded HTML, with specific arguments, as an asynchronous
action.
public : IAsyncOperation<Platform::String> InvokeScriptAsync(Platform::String scriptName,
IIterable<Platform::String> arguments)
IAsyncOperation<winrt::hstring> InvokeScriptAsync(winrt::hstring scriptName,
IIterable<winrt::hstring> arguments) const;
public IAsyncOperation<string> InvokeScriptAsync(String scriptName, IEnumerable<String> arguments)

Parameters
scriptName String
The name of the script function to invoke.
arguments IEnumerable<String>
A string array that packages arguments to the script function.
Returns
IAsyncOperation<string>
When this method returns, the string result of the script invocation.
Attributes RemoteAsyncAttribute

Remarks
To prevent malicious code from exploiting your app, be sure to call this method to invoke only scripts that you trust.
The invoked script can return only string values.
Your app might appear unresponsive while scripts are running. Handle the LongRunningScriptDetected event to
interrupt a long-running script.
WebView.LoadCompleted WebView.LoadCompleted
WebView.LoadCompleted
I n this Article
Edit
Note

LoadCompleted may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.
Occurs when top-level navigation completes and the content loads into the WebView control or when an error occurs
during loading.
public : event LoadCompletedEventHandler LoadCompleted
// Register
event_token LoadCompleted(LoadCompletedEventHandler const& handler) const;

// Revoke with event_token


void LoadCompleted(event_token const& cookie) const;

// Revoke with event_revoker


LoadCompleted_revoker LoadCompleted(auto_revoke_t, LoadCompletedEventHandler const& handler) const;
public event LoadCompletedEventHandler LoadCompleted

<WebView LoadCompleted="eventhandler"/>
WebView.LongRunningScriptDetected WebView.Long
RunningScriptDetected WebView.LongRunningScript
Detected
I n this Article
Edit
Occurs periodically while the WebView executes JavaScript, letting you halt the script.
public : event TypedEventHandler<WebView, WebViewLongRunningScriptDetectedEventArgs>
LongRunningScriptDetected
// Register
event_token LongRunningScriptDetected(TypedEventHandler<WebView,
WebViewLongRunningScriptDetectedEventArgs> const& handler) const;

// Revoke with event_token


void LongRunningScriptDetected(event_token const& cookie) const;

// Revoke with event_revoker


LongRunningScriptDetected_revoker LongRunningScriptDetected(auto_revoke_t,
TypedEventHandler<WebView, WebViewLongRunningScriptDetectedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewLongRunningScriptDetectedEventArgs>
LongRunningScriptDetected

<WebView LongRunningScriptDetected="eventhandler"/>

Remarks
Your app might appear unresponsive while scripts are running. This event provides an opportunity to interrupt a long-
running script. To determine how long the script has been running, check the ExecutionTime property of the
WebViewLongRunningScriptDetectedEventArgs object. To halt the script, set the event args StopPageScriptExecution
property to true. The halted script will not execute again unless it is reloaded during a subsequent WebView
navigation.
Note

In some cases, the WebView cannot detect a long-running script. For example, this event might not occur if the script is
stuck in a loop that doesn’t perform any memory allocations.
WebView.Navigate WebView.Navigate WebView.
Navigate
I n this Article
Edit
Loads the HTML content at the specified Uniform Resource Identifier (URI).
public : void Navigate(Uri source)
void Navigate(Uri source) const;
public void Navigate(Uri source)

Parameters
source Uri
The Uniform Resource Identifier (URI) to load.
Additional features and requirements
Capabilities enterpriseCloudSS

See Uri
Also WebView control (XAML ) sample (Windows 10)
WebView.NavigateToLocalStreamUri WebView.Navigate
ToLocalStreamUri WebView.NavigateToLocalStreamUri
I n this Article
Edit
Loads local web content at the specified URI using an IUriToStreamResolver.
public : void NavigateToLocalStreamUri(Uri source, IUriToStreamResolver streamResolver)
void NavigateToLocalStreamUri(Uri source, IUriToStreamResolver streamResolver) const;
public void NavigateToLocalStreamUri(Uri source, IUriToStreamResolver streamResolver)

Parameters
source Uri
A URI identifying the local HTML content to load.
streamResolver IUriToStreamResolver
A resolver that converts the URI into a stream to load.
Additional features and requirements
Capabilities enterpriseCloudSS

Examples
The following code example shows how to create and use a resolver that will serve a file from the app package. For a
complete example, see the XAML WebView control sample.
public sealed partial class TestPage : Page
{
// ... other code ...

protected override void OnNavigatedTo(NavigationEventArgs e)


{
// The 'Host' part of the URI for the ms-local-stream protocol needs to be a combination of
the package name
// and an application-defined key, which identifies the specific resolver, in this case
'MyTag'.

Uri url = webView4.BuildLocalStreamUri("MyTag","/Minesweeper/default.html");


StreamUriWinRTResolver myResolver = new StreamUriWinRTResolver();

// Pass the resolver object to the navigate call.


webView4.NavigateToLocalStreamUri(url, myResolver);
}
}

public sealed class StreamUriWinRTResolver : IUriToStreamResolver


{
public IAsyncOperation<IInputStream> UriToStreamAsync(Uri uri)
{
if (uri == null)
{
throw new Exception();
}
string path = uri.AbsolutePath;

// Because of the signature of the this method, it can't use await, so we


// call into a seperate helper method that can use the C# await pattern.
return GetContent(path).AsAsyncOperation();
}

private async Task<IInputStream> GetContent(string path)


{
// We use a package folder as the source, but the same principle should apply
// when supplying content from other locations
try
{
Uri localUri= new Uri("ms-appx:///html" + path);
StorageFile f = await StorageFile.GetFileFromApplicationUriAsync(localUri);
IRandomAccessStream stream = await f.OpenAsync(FileAccessMode.Read);
return stream;
}
catch (Exception) { throw new Exception("Invalid path"); }
}
}

Remarks
Use this method to load local content that the NavigateToString method won't handle. NavigateToString provides an
easy way to navigate to static HTML content, including content with references to resources such as CSS, scripts,
images, and fonts. However, NavigateToString does not provide a way to generate these resources programmatically.
To use the NavigateToLocalStreamUri method, you must pass in an IUriToStreamResolver implementation that
translates a URI pattern into a content stream. You can do this to supply the content for all the resources used by a web
page, or series of pages. For example, you can use this method to display content saved on the local file system as
encrypted files or in cab packages. When the content is requested, you can use an IUriToStreamResolver
implementation to decrypt it on the fly.
The IUriToStreamResolver interface has one method, UriToStreamAsync which takes the URI and returns the stream.
The URI is in the form of “ms-local-stream://appname_KEY/folder/file” where KEY identifies the resolver. Use
BuildLocalStreamUri to create a URI in the correct format that references the local content to load.
Note

Your IUriToStreamResolver implementation must be agile to prevent deadlock that can occur when the UI thread waits
for the IUriToStreamResolver to finish its work before continuing. For more info, see Threading and Marshaling
See IUriToStreamResolver
Also XAML WebView control sample
WebView control (XAML ) sample (Windows 10)
WebView.NavigateToString WebView.NavigateToString
WebView.NavigateToString
I n this Article
Edit
Loads the specified HTML content as a new document.
public : void NavigateToString(Platform::String text)
void NavigateToString(winrt::hstring text) const;
public void NavigateToString(String text)

Parameters
text String
The HTML content to display in the WebView control.
Additional features and requirements
Capabilities enterpriseCloudSS

Remarks
NavigateToString is asynchronous. Use the NavigationCompleted event to detect when navigation has completed.
Note

NavigationCompleted replaces LoadCompleted starting with Windows 8.1. In apps compiled for Windows 8, use
LoadCompleted instead.
NavigateToString supports content with references to external files such as CSS, scripts, images, and fonts. However, it
does not provide a way to generate or provide these resources programmatically. Windows 8.1 introduces
NavigateToLocalStreamUri to provide this support.
See LoadCompletedLoadCompletedLoadCompleted
Also NavigationCompletedNavigationCompletedNavigationCompleted
WebView control (XAML ) sample (Windows 10)
WebView.NavigateWithHttpRequestMessage WebView.
NavigateWithHttpRequestMessage WebView.Navigate
WithHttpRequestMessage
I n this Article
Edit
Navigates the WebView to a URI with a POST request and HTTP headers.
public : void NavigateWithHttpRequestMessage(HttpRequestMessage requestMessage)
void NavigateWithHttpRequestMessage(HttpRequestMessage requestMessage) const;
public void NavigateWithHttpRequestMessage(HttpRequestMessage requestMessage)

Parameters
requestMessage HttpRequestMessage
The details of the HTTP request.
Additional features and requirements
Capabilities enterpriseCloudSS

Examples
This example shows how to create an HTTP request and use it with this method.
HttpRequestMessage httpRequestMessage = new HttpRequestMessage(
HttpMethod.Post, new Uri("http://www.contoso.com"));
httpRequestMessage.Content = new HttpStringContent("hello, world");
httpRequestMessage.Headers.Append("X-My-Client","true");

myWebView.NavigateWithHttpRequestMessage(httpRequestMessage);

Remarks
This method supports only HttpMethod.Post and HttpMethod.Get for the HttpRequestMessage.Method property
value.
W arning

If you add additional headers to this request, such as authentication credentials, remember that those headers will also
be included with any subsequent child requests. Use caution to prevent accidental disclosure of confidential or personal
information.
WebView.NavigationCompleted WebView.Navigation
Completed WebView.NavigationCompleted
I n this Article
Edit
Occurs when the WebView has finished loading the current content or if navigation has failed.
public : event TypedEventHandler<WebView, WebViewNavigationCompletedEventArgs> NavigationCompleted
// Register
event_token NavigationCompleted(TypedEventHandler<WebView, WebViewNavigationCompletedEventArgs>
const& handler) const;

// Revoke with event_token


void NavigationCompleted(event_token const& cookie) const;

// Revoke with event_revoker


NavigationCompleted_revoker NavigationCompleted(auto_revoke_t, TypedEventHandler<WebView,
WebViewNavigationCompletedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewNavigationCompletedEventArgs> NavigationCompleted

<WebView NavigationCompleted="eventhandler"/>

Remarks
To determine whether navigation has failed, check the IsSuccess and WebErrorStatus properties of the
WebViewNavigationCompletedEventArgs class.
WebView navigation events occur in the following order:
NavigationStarting
ContentLoading
DOMContentLoaded
NavigationCompleted
Similar events occur in the same order for each iframe in the WebView content:
FrameNavigationStarting
FrameContentLoading
FrameDOMContentLoaded
FrameNavigationCompleted
WebView.NavigationFailed WebView.NavigationFailed
WebView.NavigationFailed
I n this Article
Edit
Note

NavigationFailed may be altered or unavailable for releases after Windows 8.1. Instead, use NavigationCompleted.
Occurs when the WebView cannot complete the navigation attempt.
public : event WebViewNavigationFailedEventHandler NavigationFailed
// Register
event_token NavigationFailed(WebViewNavigationFailedEventHandler const& handler) const;

// Revoke with event_token


void NavigationFailed(event_token const& cookie) const;

// Revoke with event_revoker


NavigationFailed_revoker NavigationFailed(auto_revoke_t, WebViewNavigationFailedEventHandler const&
handler) const;
public event WebViewNavigationFailedEventHandler NavigationFailed

<WebView NavigationFailed="eventhandler" />


WebView.NavigationStarting WebView.Navigation
Starting WebView.NavigationStarting
I n this Article
Edit
Occurs before the WebView navigates to new content.
public : event TypedEventHandler<WebView, WebViewNavigationStartingEventArgs> NavigationStarting
// Register
event_token NavigationStarting(TypedEventHandler<WebView, WebViewNavigationStartingEventArgs> const&
handler) const;

// Revoke with event_token


void NavigationStarting(event_token const& cookie) const;

// Revoke with event_revoker


NavigationStarting_revoker NavigationStarting(auto_revoke_t, TypedEventHandler<WebView,
WebViewNavigationStartingEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewNavigationStartingEventArgs> NavigationStarting

<WebView NavigationStarting="eventhandler" />

Examples
The following code example demonstrates how to handle this event to update a text box used as an address bar. For the
complete example, see the XAML WebView control sample.
void webView1_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args)
{
string url = "";
try { url = args.Uri.ToString(); }
finally
{
address.Text = url;
appendLog(String.Format("Starting navigation to: \"{0}\".\n", url));
pageIsLoading = true;
}
}

Remarks
You can cancel navigation in a handler for this event by setting the WebViewNavigationStartingEventArgs.Cancel
property to true.
WebView navigation events occur in the following order:
NavigationStarting
ContentLoading
DOMContentLoaded
NavigationCompleted
Similar events occur in the same order for each iframe in the WebView content:
FrameNavigationStarting
FrameContentLoading
FrameDOMContentLoaded
FrameNavigationCompleted
See XAML WebView control sample
Also
WebView.NewWindowRequested WebView.NewWindow
Requested WebView.NewWindowRequested
I n this Article
Edit
Occurs when a user performs an action in a WebView that causes content to be opened in a new window.
public : event TypedEventHandler<WebView, WebViewNewWindowRequestedEventArgs> NewWindowRequested
// Register
event_token NewWindowRequested(TypedEventHandler<WebView, WebViewNewWindowRequestedEventArgs> const&
handler) const;

// Revoke with event_token


void NewWindowRequested(event_token const& cookie) const;

// Revoke with event_revoker


NewWindowRequested_revoker NewWindowRequested(auto_revoke_t, TypedEventHandler<WebView,
WebViewNewWindowRequestedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewNewWindowRequestedEventArgs> NewWindowRequested

<WebView NewWindowRequested="eventhandler"/>

Examples
<WebView x:Name="myWebView" NewWindowRequested="OnNewWindowRequested" />

private void OnNewWindowRequested (WebView sender, WebViewNewWindowRequestedEventArgs e)


{
if (e.Referrer.Host == "www.contoso.com")
{
var newWebView = new WebView();
newWebView.Navigate(e.Uri);
myGrid.Children.Add(newWebView);
e.Handled = true;
}
}

Remarks
See WebViewNewWindowRequestedEventArgs.
This event occurs only for user initiated actions. By default, when a user clicks a link in a WebView that requests to
open in a new window, the link launches the default browser. A new window can be caused by the user clicking on an
href, or a button which calls window.open.
Handle this event to provide custom handling of the new window request. You might navigate the WebView to the
desired page, or create a new WebView in your app to display the requested content. If you provide custom handling of
the new window request, set the Handled property to true to prevent the default browser from being launched.
WebView.PermissionRequested WebView.Permission
Requested WebView.PermissionRequested
I n this Article
Edit
Occurs when an action in a WebView requires that permission be granted.
public : event TypedEventHandler<WebView, WebViewPermissionRequestedEventArgs> PermissionRequested
// Register
event_token PermissionRequested(TypedEventHandler<WebView, WebViewPermissionRequestedEventArgs>
const& handler) const;

// Revoke with event_token


void PermissionRequested(event_token const& cookie) const;

// Revoke with event_revoker


PermissionRequested_revoker PermissionRequested(auto_revoke_t, TypedEventHandler<WebView,
WebViewPermissionRequestedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewPermissionRequestedEventArgs> PermissionRequested

Remarks
The types of permission that can be requested are defined in the WebViewPermissionType enumeration.
If you don't handle the PermissionRequested event, the WebView denies permission by default.
When you handle a permission request in a WebView, you get a WebViewPermissionRequest object as the value of the
WebViewPermissionRequestedEventArgs.PermissionRequest property. You can call Allow to grant the request, Deny to
deny the request, or Defer to defer the request until a later time. For example, you might defer the request if you need
to prompt the user for consent.
When you defer a WebViewPermissionRequest, a new WebViewDeferredPermissionRequest is created with the same
Id and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the
DeferredPermissionRequestById method and pass the Id of the deferred request. After you retrieve the request, you
can call the Allow method to grant the request, or call the Deny method to deny the request.
WebView.Refresh WebView.Refresh WebView.Refresh
I n this Article
Edit
Reloads the current content in the WebView.

public : void Refresh()


void Refresh() const;
public void Refresh()

Remarks
If the current content was loaded via an HTTP URI, this method reloads the file without forced cache validation by
sending a "Pragma:no-cache" header to the server.
WebView.ScriptNotify WebView.ScriptNotify WebView.
ScriptNotify
I n this Article
Edit
Occurs when the content contained in the WebView control passes a string to the application by using JavaScript.
public : event NotifyEventHandler ScriptNotify
// Register
event_token ScriptNotify(NotifyEventHandler const& handler) const;

// Revoke with event_token


void ScriptNotify(event_token const& cookie) const;

// Revoke with event_revoker


ScriptNotify_revoker ScriptNotify(auto_revoke_t, NotifyEventHandler const& handler) const;
public event NotifyEventHandler ScriptNotify

<WebView ScriptNotify="eventhandler"/>

Examples
The following code example demonstrates the use of the ScriptNotify event in apps compiled for Windows 8. Starting
with Windows 8.1, omit the lines related to AllowedScriptNotifyUris.
public MyPage()
{
this.InitializeComponent();
MyWebView.ScriptNotify += MyWebView_ScriptNotify;

// Here we have to set the AllowedScriptNotifyUri property because we are


// navigating to some site where we don't own the content and we want to
// allow window.external.notify() to pass data back to the app.
List<Uri> allowedUris = new List<Uri>();
allowedUris.Add(new Uri("http://www.bing.com"));
MyWebView.AllowedScriptNotifyUris = allowedUris;
}

void MyWebView_ScriptNotify(object sender, NotifyEventArgs e)


{
// Respond to the script notification.
}

Remarks
A hosted HTML page can fire the ScriptNotify event in your UWP app when the page calls window.external.notify
and passes a string parameter.
Note

Because this event is initiated by external code, you should be careful about what you put in the event handler. To
prevent malicious scripts from exploiting this event, be sure to enable it only for trusted URIs, as described below.
Windows 8.1
To enable an external web page to fire the ScriptNotify event when calling window.external.notify, you must include
the page's URI in the ApplicationContentUriRules section of the app manifest. (You can do this in Visual Studio on
the Content URIs tab of the Package.appxmanifest designer.) The URIs in this list must use HTTPS and may contain
subdomain wildcards (for example, "https://.microsoft.com"), but they can't contain domain wildcards (for example,
"https://.com" and "https://."). The manifest requirement does not apply to content that originates from the app
package, uses an ms-local-stream:// URI, or is loaded using NavigateToString.
Note

If you have more then one subdomain, you must use one wildcard for each subdomain. For example,
"https://*.microsoft.com" matches with "https://any.microsoft.com" but not with "https://this.any.microsoft.com."
These changes do not affect apps compiled for Windows 8, even when running on Windows 8.1.
AllowedScriptNotifyUris, AnyScriptNotifyUri, and AllowedScriptNotifyUrisProperty are not supported in apps
compiled for Windows 8.1.
Windows 8
These remarks apply only to apps compiled for Windows 8, even when running on Windows 8.1.
If content is loaded into the WebView control using the Navigate method, the app must opt-in to receiving ScriptNotify
events by using the AllowedScriptNotifyUris property, which has the list of URIs that can fire ScriptNotify. If the
content is loaded using NavigateToString, the application will receive ScriptNotify events without the opt-in. Set the
AllowedScriptNotifyUris property to the value returned by the AnyScriptNotifyUri property to indicate that any page
can fire ScriptNotify events to this WebView control.
See WebView control (XAML ) sample (Windows 10)
Also
WebView.SeparateProcessLost WebView.SeparateProcess
Lost WebView.SeparateProcessLost
I n this Article
Edit
Occurs when a WebView runs with an ExecutionMode of SeparateProcess, and the separate process is lost.
public : event TypedEventHandler<WebView, WebViewSeparateProcessLostEventArgs> SeparateProcessLost
// Register
event_token SeparateProcessLost(TypedEventHandler<WebView, WebViewSeparateProcessLostEventArgs>
const& handler) const;

// Revoke with event_token


void SeparateProcessLost(event_token const& cookie) const;

// Revoke with event_revoker


SeparateProcessLost_revoker SeparateProcessLost(auto_revoke_t, TypedEventHandler<WebView,
WebViewSeparateProcessLostEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewSeparateProcessLostEventArgs> SeparateProcessLost

Remarks
For more info, see the Execution mode section of the WebView class Remarks.
WebView.Settings WebView.Settings WebView.Settings
I n this Article
Edit
Gets a WebViewSettings object that contains properties to enable or disable WebView features.

public : WebViewSettings Settings { get; }


WebViewSettings Settings();
public WebViewSettings Settings { get; }

Returns
WebViewSettings
A WebViewSettings object that contains properties to enable or disable WebView features.

Remarks
Use the WebViewSettings object to enable or disable the use of JavaScript and IndexedDB in the WebView. See
WebViewSettings.IsIndexedDBEnabled and WebViewSettings.IsJavaScriptEnabled.
WebView.Source WebView.Source WebView.Source
I n this Article
Edit
Gets or sets the Uniform Resource Identifier (URI) source of the HTML content to display in the WebView control.

public : Uri Source { get; set; }


Uri Source();

void Source(Uri source);


public Uri Source { get; set; }

<WebView Source="uriString"/>

Returns
Uri
The Uniform Resource Identifier (URI) source of the HTML content to display in the WebView control.

Remarks
The Source property retains its old value during navigation until the navigation is complete. During navigation, you can
get the new Uniform Resource Identifier (URI) through the event arguments for the navigation events.
WebView.SourceProperty WebView.SourceProperty Web
View.SourceProperty
I n this Article
Edit
Identifies the Source dependency property.
public : static DependencyProperty SourceProperty { get; }
static DependencyProperty SourceProperty();
public static DependencyProperty SourceProperty { get; }

Returns
DependencyProperty
The identifier for the Source dependency property.
WebView.Stop WebView.Stop WebView.Stop
I n this Article
Edit
Halts the current WebView navigation or download.

public : void Stop()


void Stop() const;
public void Stop()
WebView.UnsafeContentWarningDisplaying WebView.
UnsafeContentWarningDisplaying WebView.Unsafe
ContentWarningDisplaying
I n this Article
Edit
Occurs when the WebView shows a warning page for content that was reported as unsafe by SmartScreen Filter.
public : event TypedEventHandler<WebView, object> UnsafeContentWarningDisplaying
// Register
event_token UnsafeContentWarningDisplaying(TypedEventHandler<WebView, object> const& handler) const;

// Revoke with event_token


void UnsafeContentWarningDisplaying(event_token const& cookie) const;

// Revoke with event_revoker


UnsafeContentWarningDisplaying_revoker UnsafeContentWarningDisplaying(auto_revoke_t,
TypedEventHandler<WebView, object> const& handler) const;
public event TypedEventHandler<WebView, object> UnsafeContentWarningDisplaying

<WebView UnsafeContentWarningDisplaying="eventhandler" />

Remarks
This event is not implemented on Windows Phone 8.1 and will never be raised.

This event occurs when the warning page appears. If the user chooses to continue the navigation, subsequent
navigation to the page will not display the warning nor fire the event.
WebView.UnsupportedUriSchemeIdentified WebView.
UnsupportedUriSchemeIdentified WebView.Unsupported
UriSchemeIdentified
I n this Article
Edit
Occurs when an attempt is made to navigate to a Uniform Resource Identifier (URI) using a scheme that WebView
doesn't support.
public : event TypedEventHandler<WebView, WebViewUnsupportedUriSchemeIdentifiedEventArgs>
UnsupportedUriSchemeIdentified
// Register
event_token UnsupportedUriSchemeIdentified(TypedEventHandler<WebView,
WebViewUnsupportedUriSchemeIdentifiedEventArgs> const& handler) const;

// Revoke with event_token


void UnsupportedUriSchemeIdentified(event_token const& cookie) const;

// Revoke with event_revoker


UnsupportedUriSchemeIdentified_revoker UnsupportedUriSchemeIdentified(auto_revoke_t,
TypedEventHandler<WebView, WebViewUnsupportedUriSchemeIdentifiedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewUnsupportedUriSchemeIdentifiedEventArgs>
UnsupportedUriSchemeIdentified

<WebView UnsupportedUriSchemeIdentified="eventhandler"/>

Examples
<WebView x:Name="myWebView" UnsupportedUriSchemeIdentified="OnUnsupportedUriSchemeIdentified" />

private void OnUnsupportedUriSchemeIdentified (WebView sender,


WebViewUnsupportedUriSchemeIdentifiedEventArgs e)
{
// Block all URIs from invoking other apps except the mailto: protocol.
if (e.Uri.Scheme != "mailto")
{
e.Handled= true;
}
}

Remarks
See WebViewUnsupportedUriSchemeIdentifiedEventArgs.
WebView supports navigation to Uniform Resource Identifier (URI) using these schemes: http, https, ms-appx-web,
ms-appdata and ms-local-stream.
If an attempt is made to navigate to a Uniform Resource Identifier (URI) that the WebView doesn't support, the
navigation is blocked. By default, when an unsupported Uniform Resource Identifier (URI) scheme is encountered, the
launcher is invoked to find the default provider for the Uniform Resource Identifier (URI) scheme. You can handle the
UnsupportedUriSchemeIdentified event to decide how to handle an unsupported Uniform Resource Identifier (URI)
scheme. If you do nothing, the launcher is invoked. If you provide custom handling for the Uniform Resource Identifier
(URI) scheme, set the Handled property to true to prevent the default provider for the Uniform Resource Identifier
(URI) scheme from being invoked.
WebView.UnviewableContentIdentified WebView.
UnviewableContentIdentified WebView.Unviewable
ContentIdentified
I n this Article
Edit
Occurs when the WebView attempts to download an unsupported file.
public : event TypedEventHandler<WebView, WebViewUnviewableContentIdentifiedEventArgs>
UnviewableContentIdentified
// Register
event_token UnviewableContentIdentified(TypedEventHandler<WebView,
WebViewUnviewableContentIdentifiedEventArgs> const& handler) const;

// Revoke with event_token


void UnviewableContentIdentified(event_token const& cookie) const;

// Revoke with event_revoker


UnviewableContentIdentified_revoker UnviewableContentIdentified(auto_revoke_t,
TypedEventHandler<WebView, WebViewUnviewableContentIdentifiedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewUnviewableContentIdentifiedEventArgs>
UnviewableContentIdentified

<WebView UnviewableContentIdentified="eventhandler" />

Examples
The following code example demonstrates how to handle this event to launch an external browser when the WebView
control cannot render the target content. For the complete example, see the XAML WebView control sample.
void webView1_UnviewableContentIdentified(WebView sender,
WebViewUnviewableContentIdentifiedEventArgs args)
{
appendLog(String.Format("Content for \"{0}\" cannot be loaded into webview. " +
"Invoking the default launcher instead.\n", args.Uri.ToString()));

// We turn around and hand the Uri to the


// system launcher to launch the default handler for it.
Windows.Foundation.IAsyncOperation<bool> b =
Windows.System.Launcher.LaunchUriAsync(args.Uri);
pageIsLoading = false;
}

Remarks
The WebView control cannot host arbitrary file types, but you can handle this event and use the Launcher class to
redirect the file to the browser or another app.
See XAML WebView control sample
Also
WebView.WebResourceRequested WebView.Web
ResourceRequested WebView.WebResourceRequested
I n this Article
Edit
Occurs when an HTTP request has been made.
public : event TypedEventHandler<WebView, WebViewWebResourceRequestedEventArgs> WebResourceRequested
// Register
event_token WebResourceRequested(TypedEventHandler<WebView, WebViewWebResourceRequestedEventArgs>
const& handler) const;

// Revoke with event_token


void WebResourceRequested(event_token const& cookie) const;

// Revoke with event_revoker


WebResourceRequested_revoker WebResourceRequested(auto_revoke_t, TypedEventHandler<WebView,
WebViewWebResourceRequestedEventArgs> const& handler) const;
public event TypedEventHandler<WebView, WebViewWebResourceRequestedEventArgs> WebResourceRequested

<WebView WebResourceRequested="eventhandler"/>

Examples
This example demonstrates how to intercept request for a specific domain generate an alternate response.
Uri _myUri = new Uri("http://www.contoso.com");

void InterceptWebRequest(WebView sender, WebResourceRequestedEventArgs args)


{
if (_myUri.IsBaseOf(args.Request.RequestUri))
{
args.Response = GenerateResponse(args.Request);
}
}

HttpResponseMessage GenerateResponse(HttpRequestMessage request)


{
// ...
}

Remarks
This event occurs after the HTTP request has been made. You can use this event to intercept the response before it's
processed by the WebView.
WebView WebView WebView
I n this Article

Overloads
WebView() WebView() WebView()
Initializes a new instance of the WebView class.

WebView(WebViewExecutionMode) WebView(WebView
ExecutionMode) WebView(WebViewExecutionMode) Initializes a new instance of the WebView class with the
specified execution mode.

WebView() WebView() WebView()


Edit
Initializes a new instance of the WebView class.
public : WebView()
WebView() const;
public WebView()

See
Also
WebView (WebViewExecutionMode)WebView (WebViewExecutionMode)WebView (WebViewExecutionMode)

WebView(WebViewExecutionMode)
WebView(WebViewExecutionMode)
WebView(WebViewExecutionMode)
Edit
Initializes a new instance of the WebView class with the specified execution mode.
public : WebView(WebViewExecutionMode executionMode)
WebView(WebViewExecutionMode executionMode) const;
public WebView(WebViewExecutionMode executionMode)

Parameters
executionMode WebViewExecutionMode
A value of the enumeration that indicates whether the WebView hosts content on the UI thread or a non-UI thread.
See WebView ()WebView ()WebView ()
Also
WebView.XYFocusDown WebView.XYFocusDown Web
View.XYFocusDown
I n this Article
Edit
Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) down.
public : DependencyObject XYFocusDown { get; set; }
DependencyObject XYFocusDown();

void XYFocusDown(DependencyObject xyfocusdown);


public DependencyObject XYFocusDown { get; set; }

<WebView XYFocusDown="{x:Bind dependencyObjectValue}"/>

Returns
DependencyObject
The object that gets focus when a user presses the Directional Pad (D -pad).
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
XYFocusDown is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.
For more info about this property, see the XY focus navigation and interaction section of the Designing for Xbox and
TV article.
Version compatibility
The XYFocusDown property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.WebView", "XYFocusDown"))
{
webView1.XYFocusDown = button1;
}
WebView.XYFocusDownProperty WebView.XYFocus
DownProperty WebView.XYFocusDownProperty
I n this Article
Edit
Identifies the XYFocusDown dependency property.
public : static DependencyProperty XYFocusDownProperty { get; }
static DependencyProperty XYFocusDownProperty();
public static DependencyProperty XYFocusDownProperty { get; }

Returns
DependencyProperty
The identifier for the XYFocusDown dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


WebView.XYFocusLeft WebView.XYFocusLeft WebView.
XYFocusLeft
I n this Article
Edit
Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) left.
public : DependencyObject XYFocusLeft { get; set; }
DependencyObject XYFocusLeft();

void XYFocusLeft(DependencyObject xyfocusleft);


public DependencyObject XYFocusLeft { get; set; }

<WebView XYFocusLeft="{x:Bind dependencyObjectValue}"/>

Returns
DependencyObject
The object that gets focus when a user presses the Directional Pad (D -pad).
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
XYFocusLeft is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.
For more info about this property, see the XY focus navigation and interaction section of the Designing for Xbox and
TV article.
Version compatibility
The XYFocusLeft property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.WebView", "XYFocusLeft"))
{
webView1.XYFocusLeft = button1;
}
WebView.XYFocusLeftProperty WebView.XYFocusLeft
Property WebView.XYFocusLeftProperty
I n this Article
Edit
Identifies the XYFocusLeft dependency property.
public : static DependencyProperty XYFocusLeftProperty { get; }
static DependencyProperty XYFocusLeftProperty();
public static DependencyProperty XYFocusLeftProperty { get; }

Returns
DependencyProperty
The identifier for the XYFocusLeft dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


WebView.XYFocusRight WebView.XYFocusRight Web
View.XYFocusRight
I n this Article
Edit
Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) right.
public : DependencyObject XYFocusRight { get; set; }
DependencyObject XYFocusRight();

void XYFocusRight(DependencyObject xyfocusright);


public DependencyObject XYFocusRight { get; set; }

<WebView XYFocusRight="{x:Bind dependencyObjectValue}"/>

Returns
DependencyObject
The object that gets focus when a user presses the Directional Pad (D -pad).
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
XYFocusRight is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.
For more info about this property, see the XY focus navigation and interaction section of the Designing for Xbox and
TV article.
Version compatibility
The XYFocusRight property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform
version' setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in
this page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.WebView", "XYFocusRight"))
{
webView1.XYFocusRight = button1;
}
WebView.XYFocusRightProperty WebView.XYFocusRight
Property WebView.XYFocusRightProperty
I n this Article
Edit
Identifies the XYFocusRight dependency property.
public : static DependencyProperty XYFocusRightProperty { get; }
static DependencyProperty XYFocusRightProperty();
public static DependencyProperty XYFocusRightProperty { get; }

Returns
DependencyProperty
The identifier for the XYFocusRight dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


WebView.XYFocusUp WebView.XYFocusUp WebView.XY
FocusUp
I n this Article
Edit
Gets or sets the object that gets focus when a user presses the Directional Pad (D -pad) up.
public : DependencyObject XYFocusUp { get; set; }
DependencyObject XYFocusUp();

void XYFocusUp(DependencyObject xyfocusup);


public DependencyObject XYFocusUp { get; set; }

<WebView XYFocusUp="{x:Bind dependencyObjectValue}"/>

Returns
DependencyObject
The object that gets focus when a user presses the Directional Pad (D -pad).
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)

Remarks
XYFocusUp is supported only on the Xbox device family, and only when using a game pad or remote control. The
property is ignored otherwise.
For more info about this property, see the XY focus navigation and interaction section of the Designing for Xbox and
TV article.
Version compatibility
The XYFocusUp property is not available prior to Windows 10, version 1607. If your app’s 'minimum platform version'
setting in Microsoft Visual Studio is less than the 'introduced version' shown in the Requirements block later in this
page, you must design and test your app to account for this. For more info, see Version adaptive code.
To avoid exceptions when your app runs on previous versions of Windows 10, do not set this property in XAML or use
it without performing a runtime check. This example shows how to use the ApiInformation class to check for the
presence of this property before you set it.

if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.WebView", "XYFocusUp"))
{
webView1.XYFocusUp = button1;
}
WebView.XYFocusUpProperty WebView.XYFocusUp
Property WebView.XYFocusUpProperty
I n this Article
Edit
Identifies the XYFocusUp dependency property.
public : static DependencyProperty XYFocusUpProperty { get; }
static DependencyProperty XYFocusUpProperty();
public static DependencyProperty XYFocusUpProperty { get; }

Returns
DependencyProperty
The identifier for the XYFocusUp dependency property.
Additional features and requirements
Device family Windows 10 Anniversary Edition (introduced v10.0.14393.0)

API contract Windows.Foundation.UniversalApiContract (introduced v3)


WebViewBrush WebViewBrush WebViewBrush Class
Provides a brush that renders the content that is currently hosted in a WebView control.

D eclaration
public : sealed class WebViewBrush : TileBrush, IWebViewBrush
struct winrt::Windows::UI::Xaml::Controls::WebViewBrush : TileBrush, IWebViewBrush
public sealed class WebViewBrush : TileBrush, IWebViewBrush

I nheritance H ierarchy
DependencyObject
Brush
TileBrush

Remarks
In Windows 8, the WebView control has the characteristic that other UI regions such as controls cannot be rendered on
top of it. This is because of how window regions are handled internally, particularly how input events are processed
and how the screen draws. If you want to render HTML content and also place other UI elements on top of that HTML
content, you should use WebViewBrush as the render area. The WebView still provides the HTML source information,
and you reference that WebView through the SourceName property (or by calling SetSource, the method and
property yield the same results). WebViewBrush does not have this overlay limitation, but it doesn't enable interaction.
Note

The preceding remarks apply only to apps compiled for Windows 8, even when running on Windows 8.1. Windows 8.1
introduces changes to the WebView control that fix the issues described here. For Windows 8.1, it's anticipated that
scenarios where you'll still use a WebViewBrush won't be very common. In most cases you can just use a WebView
control and get the functionality you need.
You can apply a WebViewBrush to any property that takes a Brush. For example, you can set Shape.Fill or
Control.Background with a WebViewBrush.
There are two alternatives for associating a WebViewBrush with a WebView control source:
Reference the source WebView by its identifier name, by setting the SourceName property.
Reference the source WebView by reference, by calling the SetSource method and passing a WebView object.
Im p o rt a nt

It's often necessary to call Redraw for a WebViewBrush that's declared in XAML in the same UI as is the WebView
source. A WebView control has an inherently asynchronous behavior that redraws the control when its content is
completely loaded. But an associated WebViewBrush renders as soon as the XAML is parsed (which might be before
the URI content is loaded by the WebView ). Alternatively, you can wait to call SetSource on the WebViewBrush until
the source content is fully loaded (for example by calling SetSource in the handler for the WebView.LoadCompleted
event.

This class is not supported on Windows Phone 8.x. WebView content will not be captured.

Constructors
WebViewBrush()
WebViewBrush()
WebViewBrush()

Initializes a new instance of the WebViewBrush class.

Properties
SourceName
SourceName
SourceName

Gets or sets the name of the source WebView control that provides the HTML content.

SourceNameProperty
SourceNameProperty
SourceNameProperty

Identifies the SourceName dependency property.

Methods
Redraw()
Redraw()
Redraw()

Causes the WebViewBrush to get updated source pixels from the associated WebView and its current content.
This happens asynchronously.

SetSource(WebView)
SetSource(WebView)
SetSource(WebView)

Sets the source of the content for the WebViewBrush.

See Also
TileBrush
Brush
WebView
TileBrush
TileBrush
WebViewBrush.Redraw WebViewBrush.Redraw WebView
Brush.Redraw
I n this Article
Edit
Causes the WebViewBrush to get updated source pixels from the associated WebView and its current content. This
happens asynchronously.
public : void Redraw()
void Redraw() const;
public void Redraw()

Remarks
A WebViewBrush is basically a snapshot of the content being displayed in a WebView. It won't show animations or any
dynamic changes to the content. Call Redraw if the source WebView has changed its content significantly and you want
to make a new snapshot to display as the WebViewBrush content.
See WebView
Also
WebViewBrush.SetSource WebViewBrush.SetSource Web
ViewBrush.SetSource
I n this Article
Edit
Sets the source of the content for the WebViewBrush.
public : void SetSource(WebView source)
void SetSource(WebView source) const;
public void SetSource(WebView source)

Parameters
source WebView
The WebView hosting the HTML content that is the source for the brush.

Remarks
There are two alternatives for associating a WebViewBrush with a WebView control source:
Reference the source WebView by its identifier name, by setting the SourceName property.
Reference the source WebView by reference, by calling the SetSource method and passing a WebView object.
WebViewBrush.SourceName WebViewBrush.SourceName
WebViewBrush.SourceName
I n this Article
Edit
Gets or sets the name of the source WebView control that provides the HTML content.
public : Platform::String SourceName { get; set; }
winrt::hstring SourceName();

void SourceName(winrt::hstring sourcename);


public string SourceName { get; set; }

<WebViewBrush SourceName="nameOfWebView"/>

Returns
string
The Name or x:Name attribute of the WebView that provides the HTML content.

Remarks
There are two alternatives for associating a WebViewBrush with a WebView control source:
Reference the source WebView by its identifier name, by setting the SourceName property.
Reference the source WebView by reference, by calling the SetSource method and passing a WebView object.
WebViewBrush.SourceNameProperty WebViewBrush.
SourceNameProperty WebViewBrush.SourceName
Property
I n this Article
Edit
Identifies the SourceName dependency property.
public : static DependencyProperty SourceNameProperty { get; }
static DependencyProperty SourceNameProperty();
public static DependencyProperty SourceNameProperty { get; }

Returns
DependencyProperty
The identifier for the SourceName dependency property.
WebViewBrush WebViewBrush WebViewBrush
I n this Article
Edit
Initializes a new instance of the WebViewBrush class.

public : WebViewBrush()
WebViewBrush() const;
public WebViewBrush()
WebViewContentLoadingEventArgs WebViewContent
LoadingEventArgs WebViewContentLoadingEventArgs
Class
Provides data for the WebView.ContentLoading event.

D eclaration
public : sealed class WebViewContentLoadingEventArgs : IWebViewContentLoadingEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewContentLoadingEventArgs :
IWebViewContentLoadingEventArgs
public sealed class WebViewContentLoadingEventArgs : IWebViewContentLoadingEventArgs

I nheritance H ierarchy
None

Properties
Uri
Uri
Uri

Gets the Uniform Resource Identifier (URI) of the content the WebView is loading.
WebViewContentLoadingEventArgs.Uri WebView
ContentLoadingEventArgs.Uri WebViewContentLoading
EventArgs.Uri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the content the WebView is loading.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content.
WebViewDeferredPermissionRequest WebViewDeferred
PermissionRequest WebViewDeferredPermissionRequest
Class
Represents a deferred request for permissions in a WebView.

D eclaration
public : sealed class WebViewDeferredPermissionRequest : IWebViewDeferredPermissionRequest
struct winrt::Windows::UI::Xaml::Controls::WebViewDeferredPermissionRequest :
IWebViewDeferredPermissionRequest
public sealed class WebViewDeferredPermissionRequest : IWebViewDeferredPermissionRequest

I nheritance H ierarchy
None

Remarks
For more info, see the WebView.PermissionRequested event.
When a WebViewPermissionRequest is deferred, a WebViewDeferredPermissionRequest is created with the same Id
and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the
DeferredPermissionRequestById method and pass the Id of the deferred request. After you retrieve the request, you
can call the Allow method to grant the request, or call the Deny method to deny the request.

Properties
Id
Id
Id

Gets the identifier for the permission request.

PermissionType
PermissionType
PermissionType

Gets a value that indicates the type of permission that's requested.

Uri
Uri
Uri

Gets the Uniform Resource Identifier (URI) of the content where the permission request originated.

Methods
Allow()
Allow()
Allow()

Grants the requested permission.

Deny()
Deny()
Deny()

Denies the requested permission.


WebViewDeferredPermissionRequest.Allow WebView
DeferredPermissionRequest.Allow WebViewDeferred
PermissionRequest.Allow
I n this Article
Edit
Grants the requested permission.
public : void Allow()
void Allow() const;
public void Allow()

Remarks
When you allow the requested permission, subsequent calls to Allow or Deny the permission request result in an error.
WebViewDeferredPermissionRequest.Deny WebView
DeferredPermissionRequest.Deny WebViewDeferred
PermissionRequest.Deny
I n this Article
Edit
Denies the requested permission.
public : void Deny()
void Deny() const;
public void Deny()

Remarks
When you deny the requested permission, subsequent calls to Allow or Deny the permission request result in an error.
WebViewDeferredPermissionRequest.Id WebView
DeferredPermissionRequest.Id WebViewDeferred
PermissionRequest.Id
I n this Article
Edit
Gets the identifier for the permission request.
public : unsigned int Id { get; }
uint32_t Id();
public uint Id { get; }

Returns
uint
The identifier for the permission request.

Remarks
When a WebViewPermissionRequest is deferred, a WebViewDeferredPermissionRequest is created with the same Id
and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the
DeferredPermissionRequestById method and pass the Id of the deferred request.
WebViewDeferredPermissionRequest.PermissionType
WebViewDeferredPermissionRequest.PermissionType
WebViewDeferredPermissionRequest.PermissionType
I n this Article
Edit
Gets a value that indicates the type of permission that's requested.
public : WebViewPermissionType PermissionType { get; }
WebViewPermissionType PermissionType();
public WebViewPermissionType PermissionType { get; }

Returns
WebViewPermissionType
An enumeration value that indicates the type of permission requested.
WebViewDeferredPermissionRequest.Uri WebView
DeferredPermissionRequest.Uri WebViewDeferred
PermissionRequest.Uri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the content where the permission request originated.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content where the permission request originated.
WebViewDOMContentLoadedEventArgs WebViewDO
MContentLoadedEventArgs WebViewDOMContent
LoadedEventArgs Class
Provides data for the DOMContentLoaded event.

D eclaration
public : sealed class WebViewDOMContentLoadedEventArgs : IWebViewDOMContentLoadedEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewDOMContentLoadedEventArgs :
IWebViewDOMContentLoadedEventArgs
public sealed class WebViewDOMContentLoadedEventArgs : IWebViewDOMContentLoadedEventArgs

I nheritance H ierarchy
None

Properties
Uri
Uri
Uri

Gets the Uniform Resource Identifier (URI) of the content the WebView is loading.
WebViewDOMContentLoadedEventArgs.Uri WebView
DOMContentLoadedEventArgs.Uri WebViewDO
MContentLoadedEventArgs.Uri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the content the WebView is loading.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content.
WebViewExecutionMode WebViewExecutionMode Web
ViewExecutionMode Enum
Defines constants that specify whether WebView hosts HTML content on the UI thread or on a non-UI thread.

D eclaration
public : enum class WebViewExecutionMode
enum class winrt::Windows::UI::Xaml::Controls::WebViewExecutionMode : int32_t
public enum WebViewExecutionMode

I nheritance H ierarchy
None

Remarks
Version history
V ER S IO N S D K V ER S IO N V ALU E AD D ED

1803 17134 SeparateProcess

Fields
SameThread SameThread Content is hosted on the UI thread.
SameThread

SeparateProcess Content is hosted on a separate process off the app process. All of an app's WebView
SeparateProcess instances share the same separate process, there is not a separate process per WebView
SeparateProcess instance.

SeparateThread Content is hosted on a background thread.


SeparateThread
SeparateThread
WebViewLongRunningScriptDetectedEventArgs Web
ViewLongRunningScriptDetectedEventArgs WebView
LongRunningScriptDetectedEventArgs Class
Provides data for the WebView.LongRunningScriptDetected event.

D eclaration
public : sealed class WebViewLongRunningScriptDetectedEventArgs :
IWebViewLongRunningScriptDetectedEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewLongRunningScriptDetectedEventArgs :
IWebViewLongRunningScriptDetectedEventArgs
public sealed class WebViewLongRunningScriptDetectedEventArgs :
IWebViewLongRunningScriptDetectedEventArgs

I nheritance H ierarchy
None

Properties
ExecutionTime
ExecutionTime
ExecutionTime

Gets the number of milliseconds that the WebView control has been executing a long-running script.

StopPageScriptExecution
StopPageScriptExecution
StopPageScriptExecution

Halts a long-running script executing in a WebView control.


WebViewLongRunningScriptDetectedEventArgs.
ExecutionTime WebViewLongRunningScriptDetected
EventArgs.ExecutionTime WebViewLongRunningScript
DetectedEventArgs.ExecutionTime
I n this Article
Edit
Gets the number of milliseconds that the WebView control has been executing a long-running script.
public : TimeSpan ExecutionTime { get; }
TimeSpan ExecutionTime();
public TimeSpan ExecutionTime { get; }

Returns
TimeSpan
The number of milliseconds the script has been running.

Remarks
If the script is still running after 5 seconds, the app will hang. To halt the script, set the StopPageScriptExecution
property to true. The halted script will not resume for the lifetime of the WebView.
WebViewLongRunningScriptDetectedEventArgs.Stop
PageScriptExecution WebViewLongRunningScript
DetectedEventArgs.StopPageScriptExecution WebView
LongRunningScriptDetectedEventArgs.StopPageScript
Execution
I n this Article
Edit
Halts a long-running script executing in a WebView control.
public : Platform::Boolean StopPageScriptExecution { get; set; }
bool StopPageScriptExecution();

void StopPageScriptExecution(bool stoppagescriptexecution);


public bool StopPageScriptExecution { get; set; }

Returns
bool
true to halt the script; otherwise, false.

Remarks
The halted script will not resume for the lifetime of the WebView. If the script is still running after 5 seconds, the app
will hang. To determine how long the script has been running, check the ExecutionTime property.
WebViewNavigationCompletedEventArgs WebView
NavigationCompletedEventArgs WebViewNavigation
CompletedEventArgs Class
Provides data for the WebView.NavigationCompleted and FrameNavigationCompleted events.

D eclaration
public : sealed class WebViewNavigationCompletedEventArgs : IWebViewNavigationCompletedEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewNavigationCompletedEventArgs :
IWebViewNavigationCompletedEventArgs
public sealed class WebViewNavigationCompletedEventArgs : IWebViewNavigationCompletedEventArgs

I nheritance H ierarchy
None

Properties
IsSuccess
IsSuccess
IsSuccess

Gets a value that indicates whether the navigation completed successfully.

Uri
Uri
Uri

Gets the Uniform Resource Identifier (URI) of the WebView content.

WebErrorStatus
WebErrorStatus
WebErrorStatus

If the navigation was unsuccessful, gets a value that indicates why


WebViewNavigationCompletedEventArgs.IsSuccess Web
ViewNavigationCompletedEventArgs.IsSuccess WebView
NavigationCompletedEventArgs.IsSuccess
I n this Article
Edit
Gets a value that indicates whether the navigation completed successfully.
public : Platform::Boolean IsSuccess { get; }
bool IsSuccess();
public bool IsSuccess { get; }

Returns
bool
true if the navigation completed successfully; otherwise, false.
WebViewNavigationCompletedEventArgs.Uri WebView
NavigationCompletedEventArgs.Uri WebViewNavigation
CompletedEventArgs.Uri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the WebView content.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content.
WebViewNavigationCompletedEventArgs.WebError
Status WebViewNavigationCompletedEventArgs.Web
ErrorStatus WebViewNavigationCompletedEventArgs.
WebErrorStatus
I n this Article
Edit
If the navigation was unsuccessful, gets a value that indicates why
public : WebErrorStatus WebErrorStatus { get; }
WebErrorStatus WebErrorStatus();
public WebErrorStatus WebErrorStatus { get; }

Returns
WebErrorStatus
A value that explains an unsuccessful navigation.
WebViewNavigationFailedEventArgs WebView
NavigationFailedEventArgs WebViewNavigationFailed
EventArgs Class
Provides data for the WebView.NavigationFailed event.

D eclaration
public : sealed class WebViewNavigationFailedEventArgs : IWebViewNavigationFailedEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewNavigationFailedEventArgs :
IWebViewNavigationFailedEventArgs
public sealed class WebViewNavigationFailedEventArgs : IWebViewNavigationFailedEventArgs

I nheritance H ierarchy
None

Properties
Uri
Uri
Uri

Gets the URI that the WebView attempted to navigate to.

WebErrorStatus
WebErrorStatus
WebErrorStatus

Gets the error that occurred when navigation failed.


WebViewNavigationFailedEventArgs.Uri WebView
NavigationFailedEventArgs.Uri WebViewNavigation
FailedEventArgs.Uri
I n this Article
Edit
Gets the URI that the WebView attempted to navigate to.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The attempted navigation target.
WebViewNavigationFailedEventArgs.WebErrorStatus
WebViewNavigationFailedEventArgs.WebErrorStatus
WebViewNavigationFailedEventArgs.WebErrorStatus
I n this Article
Edit
Gets the error that occurred when navigation failed.
public : WebErrorStatus WebErrorStatus { get; }
WebErrorStatus WebErrorStatus();
public WebErrorStatus WebErrorStatus { get; }

Returns
WebErrorStatus
The navigation error.
WebViewNavigationFailedEventHandler WebView
NavigationFailedEventHandler WebViewNavigationFailed
EventHandler Delegate
Represents the method that will handle the WebView.NavigationFailed event.

D eclaration
public : delegate void WebViewNavigationFailedEventHandler(Platform::Object sender,
WebViewNavigationFailedEventArgs e)
struct WebViewNavigationFailedEventHandler : winrt::Windows::Foundation::IUnknown
{
WebViewNavigationFailedEventHandler(std::nullptr_t = nullptr) noexcept;
template <typename L> WebViewNavigationFailedEventHandler(L lambda);
template <typename F> WebViewNavigationFailedEventHandler(F* function);
template <typename O, typename M> WebViewNavigationFailedEventHandler(O* object, M method);
void operator()(winrt::Windows::Foundation::IInspectable const& sender,
winrt::Windows::UI::Xaml::Controls::WebViewNavigationFailedEventArgs const& e) const;
};
public delegate void WebViewNavigationFailedEventHandler(Object sender,
WebViewNavigationFailedEventArgs e)

I nheritance H ierarchy
None
WebViewNavigationStartingEventArgs WebView
NavigationStartingEventArgs WebViewNavigation
StartingEventArgs Class
Provides data for the WebView.NavigationStarting and FrameNavigationStarting events.

D eclaration
public : sealed class WebViewNavigationStartingEventArgs : IWebViewNavigationStartingEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewNavigationStartingEventArgs :
IWebViewNavigationStartingEventArgs
public sealed class WebViewNavigationStartingEventArgs : IWebViewNavigationStartingEventArgs

I nheritance H ierarchy
None

Properties
Cancel
Cancel
Cancel

Gets or sets a value indicating whether to cancel the WebView navigation.

Uri
Uri
Uri

Gets the Uniform Resource Identifier (URI) of the content the WebView is loading.
WebViewNavigationStartingEventArgs.Cancel WebView
NavigationStartingEventArgs.Cancel WebView
NavigationStartingEventArgs.Cancel
I n this Article
Edit
Gets or sets a value indicating whether to cancel the WebView navigation.
public : Platform::Boolean Cancel { get; set; }
bool Cancel();

void Cancel(bool cancel);


public bool Cancel { get; set; }

Returns
bool
true to cancel the navigation; otherwise, false.
See
Also
WebViewNavigationStartingEventArgsWebViewNavigationStartingEventArgsWebViewNavigationStartingEventArgs
WebViewNavigationStartingEventArgs.Uri WebView
NavigationStartingEventArgs.Uri WebViewNavigation
StartingEventArgs.Uri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the content the WebView is loading.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content.
WebViewNewWindowRequestedEventArgs WebViewNew
WindowRequestedEventArgs WebViewNewWindow
RequestedEventArgs Class
Provides data for the WebView.NewWindowRequested event.

D eclaration
public : sealed class WebViewNewWindowRequestedEventArgs : IWebViewNewWindowRequestedEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewNewWindowRequestedEventArgs :
IWebViewNewWindowRequestedEventArgs
public sealed class WebViewNewWindowRequestedEventArgs : IWebViewNewWindowRequestedEventArgs

I nheritance H ierarchy
None

Properties
Handled
Handled
Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents other handlers
along the event route from handling the same event again.

Referrer
Referrer
Referrer

Gets the Uniform Resource Identifier (URI) of the content where the navigation was initiated.

Uri
Uri
Uri

Gets the Uniform Resource Identifier (URI) of the content the WebView is attempting to navigate to.
WebViewNewWindowRequestedEventArgs.Handled Web
ViewNewWindowRequestedEventArgs.Handled WebView
NewWindowRequestedEventArgs.Handled
I n this Article
Edit
Gets or sets a value that marks the routed event as handled. A true value for Handled prevents other handlers along
the event route from handling the same event again.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
true to mark the routed event handled. false to leave the routed event unhandled, which permits the event to
potentially route further and be acted on by other handlers. The default is false.
WebViewNewWindowRequestedEventArgs.Referrer Web
ViewNewWindowRequestedEventArgs.Referrer WebView
NewWindowRequestedEventArgs.Referrer
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the content where the navigation was initiated.
public : Uri Referrer { get; }
Uri Referrer();
public Uri Referrer { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content where the navigation was initiated.
WebViewNewWindowRequestedEventArgs.Uri WebView
NewWindowRequestedEventArgs.Uri WebViewNew
WindowRequestedEventArgs.Uri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the content the WebView is attempting to navigate to.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content the WebView is attempting to navigate to.
WebViewPermissionRequest WebViewPermissionRequest
WebViewPermissionRequest Class
Represents a request for permissions in a WebView.

D eclaration
public : sealed class WebViewPermissionRequest : IWebViewPermissionRequest
struct winrt::Windows::UI::Xaml::Controls::WebViewPermissionRequest : IWebViewPermissionRequest
public sealed class WebViewPermissionRequest : IWebViewPermissionRequest

I nheritance H ierarchy
None

Remarks
For more info, see the WebView.PermissionRequested event.
When you handle a permission request in a WebView, you get a WebViewPermissionRequest object as the value of the
WebViewPermissionRequestedEventArgs.PermissionRequest property. You can call Allow to grant the request, Deny to
deny the request, or Defer to defer the request until a later time. For example, you might defer the request if you need
to prompt the user for consent.

Properties
Id
Id
Id

Gets the identifier for the permission request.

PermissionType
PermissionType
PermissionType

Gets a value that indicates the type of permission that's requested.

State
State
State

Gets the current state of the permission request.

Uri
Uri
Uri

Gets the Uniform Resource Identifier (URI) of the content where the permission request originated.
Methods
Allow()
Allow()
Allow()

Grants the requested permission.

Defer()
Defer()
Defer()

Defers the permission request to be allowed or denied at a later time.

Deny()
Deny()
Deny()

Denies the requested permission.


WebViewPermissionRequest.Allow WebViewPermission
Request.Allow WebViewPermissionRequest.Allow
I n this Article
Edit
Grants the requested permission.
public : void Allow()
void Allow() const;
public void Allow()

Remarks
When you allow the requested permission, subsequent calls to Allow, Deny, or Defer the permission request result in
an error.
WebViewPermissionRequest.Defer WebViewPermission
Request.Defer WebViewPermissionRequest.Defer
I n this Article
Edit
Defers the permission request to be allowed or denied at a later time.
public : void Defer()
void Defer() const;
public void Defer()

Remarks
When you defer a WebViewPermissionRequest, a new WebViewDeferredPermissionRequest is created with the same
Id and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the
DeferredPermissionRequestById method and pass the Id of the deferred request. After you retrieve the request, you
can call the Allow method to grant the request, or call the Deny method to deny the request.
WebViewPermissionRequest.Deny WebViewPermission
Request.Deny WebViewPermissionRequest.Deny
I n this Article
Edit
Denies the requested permission.
public : void Deny()
void Deny() const;
public void Deny()

Remarks
When you deny the requested permission, subsequent calls to Allow, Deny, or Defer the permission request result in
an error.
WebViewPermissionRequest.Id WebViewPermission
Request.Id WebViewPermissionRequest.Id
I n this Article
Edit
Gets the identifier for the permission request.
public : unsigned int Id { get; }
uint32_t Id();
public uint Id { get; }

Returns
uint
The identifier for the permission request.

Remarks
If you defer a permission request, save the Id to use later to retrieve the deferred request.
When a WebViewPermissionRequest is deferred, a WebViewDeferredPermissionRequest is created with the same Id
and added to the DeferredPermissionRequests collection. When you are ready to act on the request, call the
DeferredPermissionRequestById method and pass the Id of the deferred request.
WebViewPermissionRequest.PermissionType WebView
PermissionRequest.PermissionType WebViewPermission
Request.PermissionType
I n this Article
Edit
Gets a value that indicates the type of permission that's requested.
public : WebViewPermissionType PermissionType { get; }
WebViewPermissionType PermissionType();
public WebViewPermissionType PermissionType { get; }

Returns
WebViewPermissionType
An enumeration value that indicates the type of permission requested.
WebViewPermissionRequest.State WebViewPermission
Request.State WebViewPermissionRequest.State
I n this Article
Edit
Gets the current state of the permission request.
public : WebViewPermissionState State { get; }
WebViewPermissionState State();
public WebViewPermissionState State { get; }

Returns
WebViewPermissionState
An enumeration value that indicates the current state of the permission request. The default is Unknown.

Remarks
The default State value is Unknown. Calling the Allow, Deny, or Defer method sets the State property to the
corresponding WebViewPermissionState.
WebViewPermissionRequest.Uri WebViewPermission
Request.Uri WebViewPermissionRequest.Uri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the content where the permission request originated.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content where the permission request originated.
WebViewPermissionRequestedEventArgs WebView
PermissionRequestedEventArgs WebViewPermission
RequestedEventArgs Class
Provides event data for the WebView.PermissionRequested event.

D eclaration
public : sealed class WebViewPermissionRequestedEventArgs : IWebViewPermissionRequestedEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewPermissionRequestedEventArgs :
IWebViewPermissionRequestedEventArgs
public sealed class WebViewPermissionRequestedEventArgs : IWebViewPermissionRequestedEventArgs

I nheritance H ierarchy
None

Properties
PermissionRequest
PermissionRequest
PermissionRequest

Gets the WebViewPermissionRequest object that contains information about the request.
WebViewPermissionRequestedEventArgs.Permission
Request WebViewPermissionRequestedEventArgs.
PermissionRequest WebViewPermissionRequestedEvent
Args.PermissionRequest
I n this Article
Edit
Gets the WebViewPermissionRequest object that contains information about the request.
public : WebViewPermissionRequest PermissionRequest { get; }
WebViewPermissionRequest PermissionRequest();
public WebViewPermissionRequest PermissionRequest { get; }

Returns
WebViewPermissionRequest
The WebViewPermissionRequest object that contains information about the request.
WebViewPermissionState WebViewPermissionState Web
ViewPermissionState Enum
Defines constants that specify the state of a WebView.PermissionRequested event.

D eclaration
public : enum class WebViewPermissionState
enum class winrt::Windows::UI::Xaml::Controls::WebViewPermissionState : int32_t
public enum WebViewPermissionState

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the WebViewPermissionRequest.State property.

Fields
Allow Allow Allow WebViewPermissionRequest.Allow was called. The permission request is allowed.

Defer Defer Defer WebViewPermissionRequest.Defer was called. The permission request is deferred.

Deny Deny Deny WebViewPermissionRequest.Deny was called. The permission request is denied.

Unknown Unknown Unknown The state of the permission request can't be determined.
WebViewPermissionType WebViewPermissionType Web
ViewPermissionType Enum
Defines constants the specify the type of permission requested in a WebView.

D eclaration
public : enum class WebViewPermissionType
enum class winrt::Windows::UI::Xaml::Controls::WebViewPermissionType : int32_t
public enum WebViewPermissionType

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the WebViewPermissionRequest.PermissionType and
WebViewDeferredPermissionRequest.PermissionType properties.
Version history
V ER S IO N S D K V ER S IO N V ALU E AD D ED

1511 10586 PointerLock

1607 14393 WebNotifications

1803 17134 ImmersiveView

1803 17134 Screen

Fields
Geolocation Geolocation Geolocation Permission is for geolocation.

ImmersiveView ImmersiveView ImmersiveView Permission is for immersive view (WebVR).

Media Media Media Permission is for media.

PointerLock PointerLock PointerLock Permission is for pointer lock.

Screen Screen Screen Permission is for screen capture.


UnlimitedIndexedDBQuota UnlimitedIndexedDBQuota Permission is for unlimited IndexedDB data
UnlimitedIndexedDBQuota storage.

WebNotifications WebNotifications WebNotifications Permission is for web notifications.


WebViewSeparateProcessLostEventArgs WebView
SeparateProcessLostEventArgs WebViewSeparateProcess
LostEventArgs Class
Provides event data for the WebView.SeparateProcessLost event.

D eclaration
public : sealed class WebViewSeparateProcessLostEventArgs : IWebViewSeparateProcessLostEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewSeparateProcessLostEventArgs :
IWebViewSeparateProcessLostEventArgs
public sealed class WebViewSeparateProcessLostEventArgs : IWebViewSeparateProcessLostEventArgs

I nheritance H ierarchy
None
WebViewSettings WebViewSettings WebViewSettings
Class
Defines properties that enable or disable WebView features.

D eclaration
public : sealed class WebViewSettings : IWebViewSettings
struct winrt::Windows::UI::Xaml::Controls::WebViewSettings : IWebViewSettings
public sealed class WebViewSettings : IWebViewSettings

I nheritance H ierarchy
None

Remarks
To get an instance of this class, use the WebView.Settings property.

Properties
IsIndexedDBEnabled
IsIndexedDBEnabled
IsIndexedDBEnabled

Gets or sets a value that indicates whether the use of IndexedDB is allowed in the WebView.

IsJavaScriptEnabled
IsJavaScriptEnabled
IsJavaScriptEnabled

Gets or sets a value that indicates whether the use of JavaScript is allowed in the WebView.
WebViewSettings.IsIndexedDBEnabled WebViewSettings.
IsIndexedDBEnabled WebViewSettings.IsIndexedDB
Enabled
I n this Article
Edit
Gets or sets a value that indicates whether the use of IndexedDB is allowed in the WebView.
public : Platform::Boolean IsIndexedDBEnabled { get; set; }
bool IsIndexedDBEnabled();

void IsIndexedDBEnabled(bool isindexeddbenabled);


public bool IsIndexedDBEnabled { get; set; }

Returns
bool
true if IndexedDB is allowed in the WebView; otherwise, false. The default is true.
WebViewSettings.IsJavaScriptEnabled WebViewSettings.
IsJavaScriptEnabled WebViewSettings.IsJavaScript
Enabled
I n this Article
Edit
Gets or sets a value that indicates whether the use of JavaScript is allowed in the WebView.
public : Platform::Boolean IsJavaScriptEnabled { get; set; }
bool IsJavaScriptEnabled();

void IsJavaScriptEnabled(bool isjavascriptenabled);


public bool IsJavaScriptEnabled { get; set; }

Returns
bool
true if JavaScript is allowed in the WebView; otherwise, false. The default is true.
WebViewUnsupportedUriSchemeIdentifiedEventArgs
WebViewUnsupportedUriSchemeIdentifiedEventArgs
WebViewUnsupportedUriSchemeIdentifiedEventArgs
Class
Provides data for the WebView.UnsupportedUriSchemeIdentified event.

D eclaration
public : sealed class WebViewUnsupportedUriSchemeIdentifiedEventArgs :
IWebViewUnsupportedUriSchemeIdentifiedEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewUnsupportedUriSchemeIdentifiedEventArgs :
IWebViewUnsupportedUriSchemeIdentifiedEventArgs
public sealed class WebViewUnsupportedUriSchemeIdentifiedEventArgs :
IWebViewUnsupportedUriSchemeIdentifiedEventArgs

I nheritance H ierarchy
None

Properties
Handled
Handled
Handled

Gets or sets a value that marks the routed event as handled. A true value for Handled prevents other handlers
along the event route from handling the same event again.

Uri
Uri
Uri

Gets the Uniform Resource Identifier (URI) of the content the WebView attempted to navigate to.
WebViewUnsupportedUriSchemeIdentifiedEventArgs.
Handled WebViewUnsupportedUriSchemeIdentified
EventArgs.Handled WebViewUnsupportedUriScheme
IdentifiedEventArgs.Handled
I n this Article
Edit
Gets or sets a value that marks the routed event as handled. A true value for Handled prevents other handlers along
the event route from handling the same event again.
public : Platform::Boolean Handled { get; set; }
bool Handled();

void Handled(bool handled);


public bool Handled { get; set; }

Returns
bool
true to mark the routed event handled. false to leave the routed event unhandled, which permits the event to
potentially route further and be acted on by other handlers. The default is false.
WebViewUnsupportedUriSchemeIdentifiedEventArgs.Uri
WebViewUnsupportedUriSchemeIdentifiedEventArgs.Uri
WebViewUnsupportedUriSchemeIdentifiedEventArgs.Uri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the content the WebView attempted to navigate to.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content.
WebViewUnviewableContentIdentifiedEventArgs Web
ViewUnviewableContentIdentifiedEventArgs WebView
UnviewableContentIdentifiedEventArgs Class
Provides data for the WebView.UnviewableContentIdentified event.

D eclaration
public : sealed class WebViewUnviewableContentIdentifiedEventArgs :
IWebViewUnviewableContentIdentifiedEventArgs, IWebViewUnviewableContentIdentifiedEventArgs2
struct winrt::Windows::UI::Xaml::Controls::WebViewUnviewableContentIdentifiedEventArgs :
IWebViewUnviewableContentIdentifiedEventArgs, IWebViewUnviewableContentIdentifiedEventArgs2
public sealed class WebViewUnviewableContentIdentifiedEventArgs :
IWebViewUnviewableContentIdentifiedEventArgs, IWebViewUnviewableContentIdentifiedEventArgs2

I nheritance H ierarchy
None

Properties
MediaType
MediaType
MediaType

Gets the media type of content that can't be viewed.

Referrer
Referrer
Referrer

Gets the Uniform Resource Identifier (URI) of the page that contains the link to the unviewable content.

Uri
Uri
Uri

Gets the Uniform Resource Identifier (URI) of the content the WebView attempted to load.
WebViewUnviewableContentIdentifiedEventArgs.Media
Type WebViewUnviewableContentIdentifiedEventArgs.
MediaType WebViewUnviewableContentIdentifiedEvent
Args.MediaType
I n this Article
Edit
Gets the media type of content that can't be viewed.
public : Platform::String MediaType { get; }
winrt::hstring MediaType();
public string MediaType { get; }

Returns
string
The media type of content that can't be viewed.
WebViewUnviewableContentIdentifiedEventArgs.Referrer
WebViewUnviewableContentIdentifiedEventArgs.Referrer
WebViewUnviewableContentIdentifiedEventArgs.Referrer
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the page that contains the link to the unviewable content.
public : Uri Referrer { get; }
Uri Referrer();
public Uri Referrer { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the referring page.
WebViewUnviewableContentIdentifiedEventArgs.Uri
WebViewUnviewableContentIdentifiedEventArgs.Uri
WebViewUnviewableContentIdentifiedEventArgs.Uri
I n this Article
Edit
Gets the Uniform Resource Identifier (URI) of the content the WebView attempted to load.
public : Uri Uri { get; }
Uri Uri();
public Uri Uri { get; }

Returns
Uri
The Uniform Resource Identifier (URI) of the content.
WebViewWebResourceRequestedEventArgs WebView
WebResourceRequestedEventArgs WebViewWeb
ResourceRequestedEventArgs Class
Provides event data for the WebView.WebResourceRequested event.

D eclaration
public : sealed class WebViewWebResourceRequestedEventArgs :
IWebViewWebResourceRequestedEventArgs
struct winrt::Windows::UI::Xaml::Controls::WebViewWebResourceRequestedEventArgs :
IWebViewWebResourceRequestedEventArgs
public sealed class WebViewWebResourceRequestedEventArgs : IWebViewWebResourceRequestedEventArgs

I nheritance H ierarchy
None

Properties
Request
Request
Request

Gets the web resource request.

Response
Response
Response

Gets or sets the response to the web resource request.

Methods
GetDeferral()
GetDeferral()
GetDeferral()

Gets a deferral object for managing the work done in the WebResourceRequested event handler.
WebViewWebResourceRequestedEventArgs.GetDeferral
WebViewWebResourceRequestedEventArgs.GetDeferral
WebViewWebResourceRequestedEventArgs.GetDeferral
I n this Article
Edit
Gets a deferral object for managing the work done in the WebResourceRequested event handler.
public : Deferral GetDeferral()
Deferral GetDeferral() const;
public Deferral GetDeferral()

Returns
Deferral
A deferral object.
WebViewWebResourceRequestedEventArgs.Request
WebViewWebResourceRequestedEventArgs.Request
WebViewWebResourceRequestedEventArgs.Request
I n this Article
Edit
Gets the web resource request.
public : HttpRequestMessage Request { get; }
HttpRequestMessage Request();
public HttpRequestMessage Request { get; }

Returns
HttpRequestMessage
The web resource request.
WebViewWebResourceRequestedEventArgs.Response
WebViewWebResourceRequestedEventArgs.Response
WebViewWebResourceRequestedEventArgs.Response
I n this Article
Edit
Gets or sets the response to the web resource request.
public : HttpResponseMessage Response { get; set; }
HttpResponseMessage Response();

void Response(HttpResponseMessage response);


public HttpResponseMessage Response { get; set; }

Returns
HttpResponseMessage
The response to the web resource request.
WrapGrid WrapGrid WrapGrid Class
Positions child elements sequentially from left to right or top to bottom. When elements extend beyond the container
edge, elements are positioned in the next row or column. Can only be used to display items in an ItemsControl. See
Remarks.

D eclaration
public : sealed class WrapGrid : OrientedVirtualizingPanel, IWrapGrid
struct winrt::Windows::UI::Xaml::Controls::WrapGrid : OrientedVirtualizingPanel, IWrapGrid
public sealed class WrapGrid : OrientedVirtualizingPanel, IWrapGrid

I nheritance H ierarchy
DependencyObject
UIElement
FrameworkElement
Panel
VirtualizingPanel
OrientedVirtualizingPanel

Remarks
Im p o rt a nt

Starting in Windows 8.1, ItemsWrapGrid is used as the default ItemsPanel for GridView. If you modify the ItemsPanel,
we recommend you use ItemsStackPanel or ItemsWrapGrid instead of VirtualizingStackPanel or WrapGrid.
WrapGrid can only be used to display items in an ItemsControl.
The content of a WrapGrid is virtualized. This can improve performance when you work with large data sets. For more
info, see Optimize ListView and GridView.
In a WrapGrid, elements are arranged in rows or columns that automatically wrap to a new row or column when the
MaximumRowsOrColumns value is reached. The Orientation property specifies whether the grid adds its items in rows
or columns before wrapping.
When the value is Vertical, the grid adds items in columns from top to bottom, then wraps from left to right, like this:

Item 1 Item 4 Item 7

Item 2 Item 5 Item 8

Item 3 Item 6 Item 9

When the value is Horizontal, the grid adds items in rows from left to right, then wraps from top to bottom, like this:

Item 1 Item 2 Item 3

Item 4 Item 5 Item 6

Item 7 Item 8 Item 9

Windows 8 behavior
For Windows 8, items added to the items lists programmatically at run-time sometimes would start a new row in the
internal grid representation, even if the item could have been added to an existing row based on the
MaximumRowsOrColumns setting.
Starting with Windows 8.1, items added to items lists programmatically at run-time will fill rows in expected ways,
starting a new row only when row -column limits are exceeded.
This behavior difference usually has no effect on the layout the user sees, because the items control that contains the
WrapGrid is ultimately controlling the layout. But the difference can be detected if you are using coordinate-relative
techniques to check the layout within the WrapGrid. For instance, you might see coordinate differences if you are
calling TransformToVisual or VisualTreeHelper API, with the WrapGrid as the "relative-to" element.
If you migrate your app code from Windows 8 to Windows 8.1, and you're doing advanced layout verification with
TransformToVisual or VisualTreeHelper within a WrapGrid you may want to account for this behavior change.
Apps that were compiled for Windows 8 but running on Windows 8.1 continue to use the Windows 8 behavior.

Constructors
WrapGrid()
WrapGrid()
WrapGrid()

Initializes a new instance of the WrapGrid class.

Properties
HorizontalChildrenAlignment
HorizontalChildrenAlignment
HorizontalChildrenAlignment

Gets or sets the alignment rules by which child elements are arranged for the horizontal dimension.

HorizontalChildrenAlignmentProperty
HorizontalChildrenAlignmentProperty
HorizontalChildrenAlignmentProperty

Identifies the HorizontalChildrenAlignment dependency property.

ItemHeight
ItemHeight
ItemHeight

Gets or sets the height of the layout area for each item that is contained in a WrapGrid.

ItemHeightProperty
ItemHeightProperty
ItemHeightProperty

Identifies the ItemHeight dependency property.


ItemWidth
ItemWidth
ItemWidth

Gets or sets the width of the layout area for each item that is contained in a WrapGrid.

ItemWidthProperty
ItemWidthProperty
ItemWidthProperty

Identifies the ItemWidth dependency property.

MaximumRowsOrColumns
MaximumRowsOrColumns
MaximumRowsOrColumns

Gets or sets a value that influences the wrap point, also accounting for Orientation.

MaximumRowsOrColumnsProperty
MaximumRowsOrColumnsProperty
MaximumRowsOrColumnsProperty

Identifies the MaximumRowsOrColumns dependency property.

Orientation
Orientation
Orientation

Gets or sets the direction in which child elements are arranged.

OrientationProperty
OrientationProperty
OrientationProperty

Identifies the Orientation dependency property.

VerticalChildrenAlignment
VerticalChildrenAlignment
VerticalChildrenAlignment

Gets or sets the alignment rules by which child elements are arranged for the vertical dimension.

VerticalChildrenAlignmentProperty
VerticalChildrenAlignmentProperty
VerticalChildrenAlignmentProperty
Identifies the VerticalChildrenAlignment dependency property.

See Also
OrientedVirtualizingPanel
OrientedVirtualizingPanel
WrapGrid.HorizontalChildrenAlignment WrapGrid.
HorizontalChildrenAlignment WrapGrid.Horizontal
ChildrenAlignment
I n this Article
Edit
Gets or sets the alignment rules by which child elements are arranged for the horizontal dimension.
public : HorizontalAlignment HorizontalChildrenAlignment { get; set; }
HorizontalAlignment HorizontalChildrenAlignment();

void HorizontalChildrenAlignment(HorizontalAlignment horizontalchildrenalignment);


public HorizontalAlignment HorizontalChildrenAlignment { get; set; }

<WrapGrid HorizontalChildrenAlignment="horizontalAlignmentMemberName" />

Returns
HorizontalAlignment
A value of the enumeration. The default is Left.
WrapGrid.HorizontalChildrenAlignmentProperty Wrap
Grid.HorizontalChildrenAlignmentProperty WrapGrid.
HorizontalChildrenAlignmentProperty
I n this Article
Edit
Identifies the HorizontalChildrenAlignment dependency property.
public : static DependencyProperty HorizontalChildrenAlignmentProperty { get; }
static DependencyProperty HorizontalChildrenAlignmentProperty();
public static DependencyProperty HorizontalChildrenAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the HorizontalChildrenAlignment dependency property.
WrapGrid.ItemHeight WrapGrid.ItemHeight WrapGrid.
ItemHeight
I n this Article
Edit
Gets or sets the height of the layout area for each item that is contained in a WrapGrid.
public : double ItemHeight { get; set; }
double ItemHeight();

void ItemHeight(double itemheight);


public double ItemHeight { get; set; }

<WrapGrid ItemHeight="double" />

Returns
double
The height of the layout area for each item that is contained in a WrapGrid. The default is Double.NaN, which results in
the "Auto" layout behavior.

Remarks
"Auto" layout and D ouble.NaN
The default value of ItemHeight and ItemWidth is not 0, it is Double.NaN. ItemHeight and ItemWidth support the
ability to be an unset "Auto" value. Because ItemHeight and ItemWidth are Double values, Double.NaN is used as a
special value to represent this "Auto" behavior. The layout system interprets the "Auto" value to generally mean that
the object should be sized to the available size in layout, instead of to a specific pixel value. If you want the "Auto"
behavior for an object when it is used in layout, leave ItemHeight and ItemWidth unset at their Double.NaN default
value. If you have previously set values and want to reenable the "Auto" behavior with run-time code, set to
Double.NaN. In XAML such as templates, you can set attribute values using the string "Auto".
Note

Visual C++ component extensions (C++/CX) doesn't have a constant for NaN, it uses a value, which appears as "-
1.#IND" followed by zeros.
WrapGrid.ItemHeightProperty WrapGrid.ItemHeight
Property WrapGrid.ItemHeightProperty
I n this Article
Edit
Identifies the ItemHeight dependency property.
public : static DependencyProperty ItemHeightProperty { get; }
static DependencyProperty ItemHeightProperty();
public static DependencyProperty ItemHeightProperty { get; }

Returns
DependencyProperty
The identifier for the ItemHeight dependency property.
WrapGrid.ItemWidth WrapGrid.ItemWidth WrapGrid.
ItemWidth
I n this Article
Edit
Gets or sets the width of the layout area for each item that is contained in a WrapGrid.
public : double ItemWidth { get; set; }
double ItemWidth();

void ItemWidth(double itemwidth);


public double ItemWidth { get; set; }

<WrapGrid ItemWidth="double" />

Returns
double
The width of the layout area for each item that is contained in a WrapGrid. The default is Double.NaN, which results in
the "Auto" layout behavior.

Remarks
"Auto" layout and D ouble.NaN
The default value of ItemHeight and ItemWidth is not 0, it is Double.NaN. ItemHeight and ItemWidth support the
ability to be an unset "Auto" value. Because ItemHeight and ItemWidth are Double values, Double.NaN is used as a
special value to represent this "Auto" behavior. The layout system interprets the "Auto" value to generally mean that
the object should be sized to the available size in layout, instead of to a specific pixel value. If you want the "Auto"
behavior for an object when it is used in layout, leave ItemHeight and ItemWidth unset at their Double.NaN default
value. If you have previously set values and want to reenable the "Auto" behavior with run-time code, set to
Double.NaN. In XAML such as templates, you can set attribute values using the string "Auto".
Note

Visual C++ component extensions (C++/CX) doesn't have a constant for NaN, it uses a value, which appears as "-
1.#IND" followed by zeros.
WrapGrid.ItemWidthProperty WrapGrid.ItemWidth
Property WrapGrid.ItemWidthProperty
I n this Article
Edit
Identifies the ItemWidth dependency property.
public : static DependencyProperty ItemWidthProperty { get; }
static DependencyProperty ItemWidthProperty();
public static DependencyProperty ItemWidthProperty { get; }

Returns
DependencyProperty
The identifier for the ItemWidth dependency property.
WrapGrid.MaximumRowsOrColumns WrapGrid.
MaximumRowsOrColumns WrapGrid.MaximumRowsOr
Columns
I n this Article
Edit
Gets or sets a value that influences the wrap point, also accounting for Orientation.
public : int MaximumRowsOrColumns { get; set; }
int32_t MaximumRowsOrColumns();

void MaximumRowsOrColumns(int32_t maximumrowsorcolumns);


public int MaximumRowsOrColumns { get; set; }

<WrapGrid MaximumRowsOrColumns="int" />

Returns
int
The maximum rows or columns that this WrapGrid should present before it introduces wrapping to the layout. The
default is -1, which is a special value that indicates no maximum.
WrapGrid.MaximumRowsOrColumnsProperty WrapGrid.
MaximumRowsOrColumnsProperty WrapGrid.Maximum
RowsOrColumnsProperty
I n this Article
Edit
Identifies the MaximumRowsOrColumns dependency property.
public : static DependencyProperty MaximumRowsOrColumnsProperty { get; }
static DependencyProperty MaximumRowsOrColumnsProperty();
public static DependencyProperty MaximumRowsOrColumnsProperty { get; }

Returns
DependencyProperty
The identifier for the MaximumRowsOrColumns dependency property.
WrapGrid.Orientation WrapGrid.Orientation WrapGrid.
Orientation
I n this Article
Edit
Gets or sets the direction in which child elements are arranged.
public : Orientation Orientation { get; set; }
Orientation Orientation();

void Orientation(Orientation orientation);


public Orientation Orientation { get; set; }

WrapGrid Orientation="orientationMemberName" />

Returns
Orientation
A value of the enumeration. The default is Vertical.

Remarks
The Orientation property specifies whether the grid adds its items in rows or columns before wrapping.
When the value is Vertical, the grid adds items in columns from top to bottom, then wraps from left to right, like this:

Item 1 Item 4 Item 7

Item 2 Item 5 Item 8

Item 3 Item 6 Item 9

When the value is Horizontal, the grid adds items in rows from left to right, then wraps from top to bottom, like this:

Item 1 Item 2 Item 3

Item 4 Item 5 Item 6

Item 7 Item 8 Item 9


WrapGrid.OrientationProperty WrapGrid.Orientation
Property WrapGrid.OrientationProperty
I n this Article
Edit
Identifies the Orientation dependency property.
public : static DependencyProperty OrientationProperty { get; }
static DependencyProperty OrientationProperty();
public static DependencyProperty OrientationProperty { get; }

Returns
DependencyProperty
The identifier for the Orientation dependency property.
WrapGrid.VerticalChildrenAlignment WrapGrid.Vertical
ChildrenAlignment WrapGrid.VerticalChildrenAlignment
I n this Article
Edit
Gets or sets the alignment rules by which child elements are arranged for the vertical dimension.
public : VerticalAlignment VerticalChildrenAlignment { get; set; }
VerticalAlignment VerticalChildrenAlignment();

void VerticalChildrenAlignment(VerticalAlignment verticalchildrenalignment);


public VerticalAlignment VerticalChildrenAlignment { get; set; }

<WrapGrid VerticalChildrenAlignment="verticalAlignmentMemberName" />

Returns
VerticalAlignment
A value of the enumeration. The default is Top.
WrapGrid.VerticalChildrenAlignmentProperty WrapGrid.
VerticalChildrenAlignmentProperty WrapGrid.Vertical
ChildrenAlignmentProperty
I n this Article
Edit
Identifies the VerticalChildrenAlignment dependency property.
public : static DependencyProperty VerticalChildrenAlignmentProperty { get; }
static DependencyProperty VerticalChildrenAlignmentProperty();
public static DependencyProperty VerticalChildrenAlignmentProperty { get; }

Returns
DependencyProperty
The identifier for the VerticalChildrenAlignment dependency property.
WrapGrid WrapGrid WrapGrid
I n this Article
Edit
Initializes a new instance of the WrapGrid class.

public : WrapGrid()
WrapGrid() const;
public WrapGrid()
ZoomMode ZoomMode ZoomMode Enum
Defines constants that specify the current mode for zoom behavior in the ScrollViewer content.

D eclaration
public : enum class ZoomMode
enum class winrt::Windows::UI::Xaml::Controls::ZoomMode : int32_t
public enum ZoomMode

I nheritance H ierarchy
None

Remarks
This enumeration provides values for the ScrollViewer.ZoomMode property. See ScrollViewer.ZoomMode for more
info.

Fields
Disabled Disabled Disabled Zoom of content is disabled.

Enabled Enabled Enabled Zoom of content is enabled.

You might also like