如何解决WINUI3 - 自定义标题栏
只需要对 .setTitleBar() 用法进行快速说明。
MainWindow.xaml
<Window
x:Class="Wrath.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Wrath"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid>
<!-- ... -->
<TextBlock x:Name="CustomTitleBar">Custom title text</TextBlock>
<!-- ... -->
</Grid>
</Window>
MainWindow.xaml.cpp
MainWindow::ExtendsContentIntoTitleBar(true);
MainWindow::SetTitleBar(?);
如何在 SetTitleBar 函数中引用 xaml 元素作为参数?
这是基于以下提供的示例(仅适用于 .cs):
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。