View extensions
The ApplicationViewExtensions
and TitleBarExtensions
provide a declarative way of setting ApplicationView
, CoreApplicationView
and ApplicationViewTitleBar
properties from XAML.
Platform APIs:
ApplicationViewExtensions
,TitleBarExtensions
Example
These attached properties all target a Page
element, so they can be used directly from XAML when declaring a control of this type in an application:
<Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.ViewExtensionsPage"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="https://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
xmlns:mc="https://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
ui:ApplicationViewExtensions.Title="View Extensions"
ui:ApplicationViewExtensions.ExtendViewIntoTitleBar="True"
ui:TitleBarExtensions.BackgroundColor="Gray"
ui:TitleBarExtensions.ButtonBackgroundColor="Orange"
ui:TitleBarExtensions.ButtonForegroundColor="Black"
ui:TitleBarExtensions.ButtonHoverBackgroundColor="DarkOrange"
ui:TitleBarExtensions.ButtonHoverForegroundColor="Gray"
ui:TitleBarExtensions.ButtonPressedForegroundColor="DarkGray"
mc:Ignorable="d">
<!-- Page content here -->
</Page>
Examples
You can find more examples in the unit tests.
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기