Skip to content

Commit

Permalink
Allow microsoft-ui-xaml to support multiple sets of styles (#3690)
Browse files Browse the repository at this point in the history
* update customtask

* update project to use the customtool and support UseVisualStyle

* support new flag in api

* missing one file change for custombuild task

* update to new api and address some comments

* fix the ->

* script to move master xaml to v2.5 and add them to proj

* manually correct the missing items

* vcxproj back to UTF8

* standard the name and replace previous with 2dot5

* batch remove last line for project

* remove pips and address commentss

* trim last line

* remove newline at the end of file

* fix ##[error]dev\dll\XamlControlsResources.cpp(249,0): Error C26449: gsl::span or std::string_view created from a temporary will be invalid when the temporary is invalidated (gsl.view).

* remove return type in lambda

* remove Expander_v2.5.xaml, move merge.bat to tools and fix the test failure

* fix test
  • Loading branch information
licanhua authored Dec 4, 2020
1 parent a749eaa commit eb36cf2
Show file tree
Hide file tree
Showing 157 changed files with 28,555 additions and 48 deletions.
2 changes: 1 addition & 1 deletion build/Helix/PrepareHelixPayload.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Copy-Item "$nugetPackagesDir\taef.redist.wlk.10.31.180822002\build\Binaries\$Pla
New-Item -ItemType Directory -Force -Path "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$nugetPackagesDir\runtime.win-$Platform.microsoft.netcore.app.2.1.0\runtimes\win-$Platform\lib\netcoreapp2.1\*" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$nugetPackagesDir\runtime.win-$Platform.microsoft.netcore.app.2.1.0\runtimes\win-$Platform\native\*" "$payloadDir\.NETCoreApp2.1\"
Copy-Item "$nugetPackagesDir\MUXCustomBuildTasks.1.0.48\tools\$platform\WttLog.dll" $payloadDir
Copy-Item "$nugetPackagesDir\MUXCustomBuildTasks.1.0.70\tools\$platform\WttLog.dll" $payloadDir

function Copy-If-Exists
{
Expand Down
2 changes: 1 addition & 1 deletion build/Helix/packages.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MUXCustomBuildTasks" version="1.0.48" targetFramework="native" />
<package id="MUXCustomBuildTasks" version="1.0.70" targetFramework="native" />
<package id="TAEF.Redist.Wlk" version="10.31.180822002" targetFramework="native" />
<package id="microsoft.windows.apps.test" version="1.0.181203002" targetFramework="native" />
<package id="runtime.win-x86.microsoft.netcore.app" version="2.1.0" targetFramework="native" />
Expand Down
9 changes: 8 additions & 1 deletion dev/AutoSuggestBox/AutoSuggestBox.vcxitems
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
Expand All @@ -15,6 +15,13 @@
</ItemGroup>
<ItemGroup>
<Page Include="$(MSBuildThisFileDirectory)AutoSuggestBox_themeresources.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
</Page>
<Page Include="$(MSBuildThisFileDirectory)AutoSuggestBox_themeresources_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
Expand Down
462 changes: 462 additions & 0 deletions dev/AutoSuggestBox/AutoSuggestBox_themeresources_v2.5.xaml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dev/CalendarDatePicker/CalendarDatePicker.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
</ItemGroup>
<ItemGroup>
<Page Include="$(MSBuildThisFileDirectory)CalendarDatePicker_themeresources.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
</Page>
<Page Include="$(MSBuildThisFileDirectory)CalendarDatePicker_themeresources_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
Expand Down
295 changes: 295 additions & 0 deletions dev/CalendarDatePicker/CalendarDatePicker_themeresources_v2.5.xaml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dev/CalendarView/CalendarView.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@
</ItemGroup>
<ItemGroup>
<Page Include="$(MSBuildThisFileDirectory)CalendarView_themeresources.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
</Page>
<Page Include="$(MSBuildThisFileDirectory)CalendarView_themeresources_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
Expand Down
521 changes: 521 additions & 0 deletions dev/CalendarView/CalendarView_themeresources_v2.5.xaml

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions dev/CheckBox/CheckBox.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
</ItemGroup>
<ItemGroup>
<Page Include="$(MSBuildThisFileDirectory)CheckBox_themeresources.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
</Page>
<Page Include="$(MSBuildThisFileDirectory)CheckBox_themeresources_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
Expand Down
684 changes: 684 additions & 0 deletions dev/CheckBox/CheckBox_themeresources_v2.5.xaml

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions dev/ColorPicker/ColorPicker.vcxitems
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,35 @@
</ItemGroup>
<ItemGroup>
<Page Include="$(MSBuildThisFileDirectory)ColorPicker.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>RS1</Version>
<Type>DefaultStyle</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
</Page>
<Page Include="$(MSBuildThisFileDirectory)ColorPicker_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
<Type>DefaultStyle</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
</Page>
<Page Include="$(MSBuildThisFileDirectory)ColorPicker_themeresources.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
</Page>
<Page Include="$(MSBuildThisFileDirectory)ColorPicker_themeresources_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
<Type>ThemeResources</Type>
</Page>
<Page Include="$(MSBuildThisFileDirectory)ColorSpectrum.xaml">
<UseVisualStyle>Latest</UseVisualStyle>
<Version>RS1</Version>
<Type>DefaultStyle</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
</Page>
<Page Include="$(MSBuildThisFileDirectory)ColorSpectrum_v2.5.xaml">
<UseVisualStyle>V2dot5</UseVisualStyle>
<Version>RS1</Version>
<Type>DefaultStyle</Type>
<UseNonstandardCondtionalXAML>true</UseNonstandardCondtionalXAML>
Expand Down
33 changes: 33 additions & 0 deletions dev/ColorPicker/ColorPicker_themeresources_v2.5.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<!-- Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See LICENSE in the project root for license information. -->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Microsoft.UI.Xaml.Controls">
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<StaticResource x:Key="ColorPickerSliderThumbBackground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ColorPickerSliderThumbBackgroundPointerOver" ResourceKey="SystemControlHighlightChromeAltLowBrush" />
<StaticResource x:Key="ColorPickerSliderThumbBackgroundPressed" ResourceKey="SystemControlForegroundChromeHighBrush" />
<StaticResource x:Key="ColorPickerSliderThumbBackgroundDisabled" ResourceKey="SystemControlDisabledChromeDisabledHighBrush" />
<StaticResource x:Key="ColorPickerSliderTrackFillDisabled" ResourceKey="SystemControlDisabledBaseLowBrush" />
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<StaticResource x:Key="ColorPickerSliderThumbBackground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ColorPickerSliderThumbBackgroundPointerOver" ResourceKey="SystemControlHighlightChromeAltLowBrush" />
<StaticResource x:Key="ColorPickerSliderThumbBackgroundPressed" ResourceKey="SystemControlForegroundChromeHighBrush" />
<StaticResource x:Key="ColorPickerSliderThumbBackgroundDisabled" ResourceKey="SystemControlDisabledChromeDisabledHighBrush" />
<StaticResource x:Key="ColorPickerSliderTrackFillDisabled" ResourceKey="SystemControlDisabledBaseLowBrush" />
</ResourceDictionary>
<ResourceDictionary x:Key="HighContrast">
<StaticResource x:Key="ColorPickerSliderThumbBackground" ResourceKey="SystemControlForegroundBaseHighBrush" />
<StaticResource x:Key="ColorPickerSliderThumbBackgroundPointerOver" ResourceKey="SystemControlHighlightChromeAltLowBrush" />
<StaticResource x:Key="ColorPickerSliderThumbBackgroundPressed" ResourceKey="SystemControlForegroundChromeHighBrush" />
<StaticResource x:Key="ColorPickerSliderThumbBackgroundDisabled" ResourceKey="SystemControlDisabledChromeDisabledHighBrush" />
<StaticResource x:Key="ColorPickerSliderTrackFillDisabled" ResourceKey="SystemControlDisabledBaseLowBrush" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<Style x:Key="ColorPickerBorderStyle" TargetType="Shape">
<Setter Property="Stroke" Value="{ThemeResource SystemControlForegroundListLowBrush}" />
<Setter Property="StrokeThickness" Value="2" />
</Style>
</ResourceDictionary>
Loading

0 comments on commit eb36cf2

Please sign in to comment.