【问题标题】:Where can I find the default template for the Expander control?在哪里可以找到 Expander 控件的默认模板?
【发布时间】:2022-07-19 22:22:58
【问题描述】:

我需要修改 Expander 控件的模板(将 V 形图标移到左侧),但找不到。

https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.expander?view=winui-3.0#control-style-and-template

定义控件外观的默认样式、模板和资源包含在 generic.xaml 文件中。出于设计目的,generic.xaml 位于 Windows 软件开发工具包 (SDK) 安装的 (Program Files)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\ \Generic 文件夹中。来自不同版本 SDK 的样式和资源可能具有不同的值。

该位置的 generic.xaml 没有 Expander 控件的默认模板。

我还查看了来自%Users%\myuser\.nuget\packages\microsoft.windowsappsdk\1.0.0\lib\net5.0-windows10.0.18362.0\Microsoft.WinUI\Themes\generic.xaml的generic.xaml

太混乱了。回到旧的 WPF\UWP 时代,我可以在 Visual Studio 中进行编辑模板,但使用 WinUI,这是不可用的......

【问题讨论】:

    标签: winui-3


    【解决方案1】:

    这是您正在寻找的资源吗? https://github.com/microsoft/microsoft-ui-xaml/tree/main/dev/Expander

    这是来自 Matteo Pagini 和 Marc Plogas (Link to publisher) 所著的“使用 Windows App SDK 和 WinUI 实现 Windows 应用程序现代化”一书:

    如果您想自定义最新的模板之一 自 WinUI 2.x 以来添加的控件,您将找到模板 在项目的 GitHub 存储库中 https://github.com/microsoft/microsoft-ui-xaml/

    【讨论】:

      猜你喜欢
      • 2011-04-02
      • 1970-01-01
      • 1970-01-01
      • 2014-08-08
      • 2011-11-06
      • 2017-07-21
      • 1970-01-01
      • 1970-01-01
      • 2010-09-12
      相关资源
      最近更新 更多