Themes
The Themes setting includes settings to customize elements of the Windows visual style, including the window glass color, desktop background, and brand icon.
To customize the Windows default theme, you must include the settings: DesktopBackground and ThemeName. You may also optionally include the settings: BrandIcon, UWPAppsUseLightTheme, and WindowColor.
In addition to customizing the Windows default theme, you can also create additional custom themes using .theme files. See instructions in the MSDN topic: Creating and Installing Theme Files. Theme files can’t be used as the Windows default, however, users can choose to apply one of your custom themes from their Personalization settings if desired.
Child Elements
Setting | Description |
---|---|
BrandIcon | Specifies the path to a graphic file that is incorporated in the theme preview in the user’s Personalization settings. |
CustomDefaultThemeFile | This setting is deprecated. To customize the Windows default theme, simply define the DesktopBackground and ThemeName settings. You may also optionally include the settings: BrandIcon, ScreenSaver, UWPAppsUseLightTheme, and WindowColor. Note: While you can add additional custom themes to a Windows installation using a .theme file, .theme files can no longer be used as the default theme. Only the elements listed here can be customized in the Windows default theme. |
DesktopBackground | Specifies the path to a graphic file that is used for the desktop background. |
ScreenSaver | Specifies the path to a screen-saver file. Note: This setting is now removed. Lockscreen features and policies are preferred over using ScreenSaver. We recommend using automatic power plans to dim the screen. This can help reduce system power consumption. |
ThemeName | Specifies the name of the customized Windows default theme. |
UWPAppsUseLightTheme | Specifies whether dark mode is applied to UWP apps. By default, the classic Windows color mode (light theme) is used. |
WindowColor | Specifies the color of the window borders and the color of various other elements in the system, most notably colors in the Start menu, common controls, active-underline for open apps in the taskbar, and Quick Action tiles in the notification area. |
Valid Configuration Passes
Parent Hierarchy
Applies To
For a list of the supported Windows editions and architectures that this component supports, see Microsoft-Windows-Shell-Setup.
XML Example
The following XML output shows how to set a customized theme.
Где мой Microsoft.Windows.Themes assembly?
Я написал пользовательский элемент управления в XAML, и после того, как он будет скомпилирован в C#, результирующий C# имеет эту строку:
Который теперь выдает ошибку:
Тип или имя пространства имен ‘Themes’ не существует в этом пространстве имен «Microsoft.Windows» (вы пропустили ссылку assembly?)
Я решил, что, поскольку я не могу повлиять на вывод скомпилированного C# (из XAML нечего удалять), я просто добавлю его в качестве ссылки.
Однако диалоговое окно добавить ссылку не содержит Microsoft.Windows.Themes . Разве это не часть .NET?
Вот пример пользовательского элемента управления XAML, который вызывает эту проблему:
Вот пример скомпилированного C#:
1 ответ
Есть ли в любом случае указать assembly вместе с пространством имен в C#? Например, если вы ссылаетесь как на PresentationFramework.Aero , так и на PresentationFramework.Luna в проекте, вы можете заметить, что оба они используют одни и те же элементы управления в одном пространстве имен, но с.
я создал простое приложение и прочитал в книге , что C# или любая программа .net преобразуется в файл assembly, содержащий код assembly, но я хотел бы знать, где найти этот файл assembly .
Microsoft.Windows.Themes находится в тематических сборках PresentationFramework. Вы захотите добавить ссылку на один из следующих вариантов в зависимости от того, на какой из них ссылается ваш XAML:
- PresentationFramework.Aero.dll
- PresentationFramework.AeroLite.dll
- PresentationFramework.Classic.dll
- PresentationFramework.Luna.dll
- PresentationFramework.Royale.dll
Похожие вопросы:
в файле AssemblyInfo.cs у меня есть следующий подраздел: #if DEBUG [assembly: AssemblyConfiguration(Debug)] #else [assembly: AssemblyConfiguration(Release)] #endif Где эту информацию можно увидеть.
Хорошо, я создал .net assembly, и он отлично работает с моего сайта asp.net. Теперь я хочу разместить его как COM, чтобы я мог использовать его на старом устаревшем веб-сайте asp. Это вроде как.
Я работаю над своим первым ‘real’ F# assembly и пытаюсь сделать все правильно. Мне тоже удалось заставить работать xUnit, но в настоящее время мой тестовый модуль находится внутри того же самого.
Есть ли в любом случае указать assembly вместе с пространством имен в C#? Например, если вы ссылаетесь как на PresentationFramework.Aero , так и на PresentationFramework.Luna в проекте, вы можете.
я создал простое приложение и прочитал в книге , что C# или любая программа .net преобразуется в файл assembly, содержащий код assembly, но я хотел бы знать, где найти этот файл assembly .
My assembly (.net exe) обычно начинается с Assembly.Load(pathname). Внутри загруженного assembly я хотел бы получить доступ к assembly, который запустил мой assembly. Есть ли шанс?
Учитывая, что C# assembly может быть легко реверс-инжиниринг с использованием рефлектора, где я должен хранить свои конфиденциальные данные при компиляции assembly в C#? У меня есть X509Certificate.
Итак, я знаю C++, C#, Java и некоторые другие языки, и я решил выучить assembly следующим, но я чувствую, что с самого начала наткнулся на твердую кирпичную стену. Мне просто нужно, чтобы кто-то.
Когда я создаю консольное приложение, которое печатает Hello World, оно сохраняется в Visual Studio/Projects/ Name of solution . Но где EXACTLY — это assembly / сборки (есть ли их больше одного?).