mirror of
https://github.com/microsoft/terminal.git
synced 2025-12-11 04:38:24 -06:00
We originally needed this library (or a separate DLL in our own project) to handle hooking up the XAML resource loader to the providers that our application needed. It was introduced in its nascent form in 2019, in a PR titled "Make XAML files work." It appears we no longer need it, and the provider hookup is being handled by our `AppT2` base class override. I've tested this in Windows 10 Vb running unpackaged, and it seems to work totally fine. Crazy. Removing this dependency saves us a couple hundred kilobytes on disk and removes one consumer of the App CRT from our package.
71 lines
3.2 KiB
XML
71 lines
3.2 KiB
XML
<!--
|
|
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under
|
|
the MIT License. See LICENSE in the project root for license information.
|
|
-->
|
|
<Application x:Class="SampleApp.App"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:TA="using:SampleApp"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="using:SampleApp"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d">
|
|
<!--
|
|
If you want to prove this works, then add `RequestedTheme="Light"` to
|
|
the properties on the XamlApplication
|
|
-->
|
|
<Application.Resources>
|
|
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<!-- Include the MUX Controls resources -->
|
|
<XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
|
|
<ResourceDictionary>
|
|
|
|
<!--
|
|
We're going to apply this style to the root Grid acting
|
|
as the tab row, because we need to be able to set its
|
|
`Background` property to "{ThemeResource
|
|
ApplicationPageBackgroundThemeBrush}" so it will be colored
|
|
appropriately for the theme, regardless of what we set the
|
|
RequestedTheme to
|
|
-->
|
|
<Style x:Name="BackgroundGridThemeStyle"
|
|
TargetType="Grid">
|
|
<Setter Property="Background" Value="{ThemeResource ApplicationPageBackgroundThemeBrush}" />
|
|
</Style>
|
|
|
|
<!--
|
|
We need to manually create the error text brush as a
|
|
theme-dependent brush. SystemControlErrorTextForegroundBrush
|
|
is unfortunately static.
|
|
-->
|
|
<SolidColorBrush x:Name="ErrorTextBrush"
|
|
Color="{ThemeResource SystemErrorTextColor}" />
|
|
|
|
<!-- Suppress top padding -->
|
|
<Thickness x:Key="TabViewHeaderPadding">8,0,8,0</Thickness>
|
|
|
|
<ResourceDictionary.ThemeDictionaries>
|
|
<ResourceDictionary x:Key="Dark">
|
|
<!-- Define resources for Dark mode here -->
|
|
<SolidColorBrush x:Key="TabViewBackground"
|
|
Color="#FF333333" />
|
|
</ResourceDictionary>
|
|
|
|
<ResourceDictionary x:Key="Light">
|
|
<!-- Define resources for Light mode here -->
|
|
<SolidColorBrush x:Key="TabViewBackground"
|
|
Color="#FFCCCCCC" />
|
|
</ResourceDictionary>
|
|
|
|
</ResourceDictionary.ThemeDictionaries>
|
|
|
|
</ResourceDictionary>
|
|
</ResourceDictionary.MergedDictionaries>
|
|
</ResourceDictionary>
|
|
|
|
|
|
</Application.Resources>
|
|
</Application>
|