Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding BackDrop #4485

Merged
merged 10 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ branches:
- main

environment:
# bad, but without this, gitversion doesn't work anymore
IGNORE_NORMALISATION_GIT_HEAD_MOVE: 1
azure-key-vault-url:
secure: 1mKS/HfCVq+iYNRVSrrN8NEowOkKt3knrpMzw+SOy3g=
azure-key-vault-client-id:
Expand All @@ -29,16 +31,16 @@ install:
{
git checkout -qf $($env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT)
}
- ps: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
- ps: ./dotnet-install.ps1 -Version 8.0.100 -InstallDir "C:\Program Files\dotnet"
# - ps: Invoke-WebRequest 'https://dot.net/v1/dotnet-install.ps1' -OutFile 'dotnet-install.ps1'
# - ps: ./dotnet-install.ps1 -Version 8.0.100 -InstallDir "C:\Program Files\dotnet"

pull_requests:
do_not_increment_build_number: false

build_script:
- ps: dotnet --info
- ps: gitversion /version
- ps: .\build.ps1 --target=ci #--verbosity=diagnostic
- ps: .\build.ps1 --target=ci --verbosity=diagnostic

after_build:
- ps: gci -Filter *.trx -Path .\TestResults\ | % { (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $_.FullName)) }
Expand Down
10 changes: 8 additions & 2 deletions src/Directory.Build.Props
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,14 @@

<!-- Add the references for all projects and targets -->
<ItemGroup>
<PackageReference Include="JetBrains.Annotations" PrivateAssets="All" IncludeAssets="build;compile" />
<PackageReference Include="WpfAnalyzers" PrivateAssets="all" IncludeAssets="build;analyzers" />
<PackageReference Include="JetBrains.Annotations">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>compile; build</IncludeAssets>
</PackageReference>
<PackageReference Include="WpfAnalyzers">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>build;analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
Expand Down
32 changes: 17 additions & 15 deletions src/Directory.packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,34 @@
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup Label="Build">
<PackageVersion Include="ControlzEx" Version="7.0.0-alpha0021" />
<PackageVersion Include="ControlzEx" version="7.0.0-rc0118" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageVersion Include="XAMLTools.MSBuild" Version="1.0.0-alpha0167" />
<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0" />
<PackageVersion Include="JetBrains.Annotations" Version="2024.2.0" />
<PackageVersion Include="Caliburn.Micro" Version="4.0.212" />
<PackageVersion Include="MahApps.Metro.IconPacks.Entypo" Version="4.11.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.FontAwesome" Version="4.11.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.Material" Version="4.11.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.Modern" Version="4.11.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.Octicons" Version="4.11.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.Entypo" Version="5.0.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.FontAwesome" Version="5.0.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.Material" Version="5.0.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.Modern" Version="5.0.0" />
<PackageVersion Include="MahApps.Metro.IconPacks.Octicons" Version="5.0.0" />
<PackageVersion Include="MaterialDesignThemes" Version="3.0.1" Condition=" $(DefineConstants.Contains(NETCOREAPP)) == false " />
<PackageVersion Include="MaterialDesignColors" Version="1.2.7" Condition=" $(DefineConstants.Contains(NETCOREAPP)) == false " />
<PackageVersion Include="MaterialDesignThemes" Version="4.9.0" Condition=" $(DefineConstants.Contains(NETCOREAPP)) == true " />
<PackageVersion Include="MaterialDesignColors" Version="2.1.4" Condition=" $(DefineConstants.Contains(NETCOREAPP)) == true " />
<PackageVersion Include="NHotkey.Wpf" Version="3.0.0" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2277.86" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta" />
<PackageVersion Include="Microsoft.Web.WebView2" Version="1.0.2792.45" />
<PackageVersion Include="Microsoft.Windows.CsWin32" Version="0.3.106" />
<PackageVersion Include="System.ComponentModel.Composition" Version="8.0.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
<PackageVersion Include="System.Memory" Version="4.5.5" />
<PackageVersion Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" Condition="'$(TargetFramework)' != 'net8.0-windows'" />
<PackageVersion Include="WpfAnalyzers" Version="4.1.1" />
</ItemGroup>
<ItemGroup Label="Test">
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="xunit.runner.console" Version="2.7.0" />
<PackageVersion Include="xunit.analyzers" Version="1.11.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit.runner.console" Version="2.9.2" />
<PackageVersion Include="xunit.analyzers" Version="1.16.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions src/MahApps.Metro.Samples/MahApps.Metro.Demo/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// See the LICENSE file in the project root for more information.

using System.Windows;
using ControlzEx.Theming;

namespace MetroDemo
{
Expand All @@ -11,5 +12,25 @@ namespace MetroDemo
/// </summary>
public partial class App : Application
{
/// <inheritdoc />
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);

ThemeManager.Current.ThemeSyncMode = ThemeSyncMode.SyncAll;

ThemeManager.Current.SyncTheme();

ThemeManager.Current.ThemeChanged += CurrentOnThemeChanged;

#pragma warning disable CS0618 // Type or member is obsolete
AppModeHelper.SyncAppMode();

void CurrentOnThemeChanged(object? sender, ThemeChangedEventArgs themeChangedEventArgs)
{
AppModeHelper.SyncAppMode();
}
#pragma warning restore CS0618 // Type or member is obsolete
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@

<mah:ToggleSwitch Margin="{StaticResource ControlMargin}"
Header="Header"
Toggled="ToggleSwitch_OnToggled"
IsOn="{Binding CanUseToggleSwitch, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
IsOn="{Binding CanUseToggleSwitch, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
Toggled="ToggleSwitch_OnToggled" />
<mah:ToggleSwitch Margin="{StaticResource ControlMargin}"
CommandParameter="{Binding}"
OffCommand="{Binding ToggleSwitchOffCommand}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:local="clr-namespace:MetroDemo"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:markup="clr-namespace:MetroDemo.Markup"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:markup="clr-namespace:MetroDemo.Markup"
d:DataContext="{d:DesignInstance local:MainWindowViewModel}"
d:DesignHeight="600"
d:DesignWidth="800"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,11 @@
FontSize="20"
Foreground="Black"
Text="{Binding ElementName=sliderTest, Path=Value, Mode=OneWay, FallbackValue=0}" />
<Slider x:Name="sliderTest" Margin="10" Minimum="0" Maximum="100" Value="42" />
<Slider x:Name="sliderTest"
Margin="10"
Maximum="100"
Minimum="0"
Value="42" />
</StackPanel>
</Grid>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,9 +376,9 @@
</mah:MetroHeader>

<mah:MetroHeader Header="Min">
<mah:NumericUpDown AutomationProperties.AutomationId="AutomationIdTested"
Margin="{StaticResource ControlMargin}"
<mah:NumericUpDown Margin="{StaticResource ControlMargin}"
mah:TextBoxHelper.ClearTextButton="True"
AutomationProperties.AutomationId="AutomationIdTested"
Maximum="{Binding ElementName=NUD, Path=Maximum, Mode=OneWay}"
Value="{Binding ElementName=NUD, Path=Minimum, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</mah:MetroHeader>
Expand Down
20 changes: 20 additions & 0 deletions src/MahApps.Metro.Samples/MahApps.Metro.Demo/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@
<x:Type TypeName="controlzEx:WindowCornerPreference" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>

<ObjectDataProvider x:Key="WindowBackdropTypeEnumValues"
MethodName="GetValues"
ObjectType="{x:Type controlzEx:WindowBackdropType}">
<ObjectDataProvider.MethodParameters>
<x:Type TypeName="controlzEx:WindowBackdropType" />
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</ResourceDictionary>
</Window.Resources>

Expand Down Expand Up @@ -238,6 +246,18 @@
</ControlTemplate>
</MenuItem.Template>
</MenuItem>
<MenuItem>
<MenuItem.Template>
<ControlTemplate>
<StackPanel Orientation="Horizontal">
<Label Content="Backdrop" />
<ComboBox VerticalAlignment="Center"
ItemsSource="{Binding Source={StaticResource WindowBackdropTypeEnumValues}}"
SelectedItem="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type mah:MetroWindow}}, Path=(controlzEx:WindowBackdropManager.BackdropType), Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</ControlTemplate>
</MenuItem.Template>
</MenuItem>
</MenuItem>
<MenuItem Header="Glow">
<MenuItem Header="PreferDWMBorderColor"
Expand Down
5 changes: 5 additions & 0 deletions src/MahApps.Metro.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,10 @@ See the LICENSE file in the project root for more information.&#xD;
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateConstants/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="PART_" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=236f7aa5_002D7b06_002D43ca_002Dbf2a_002D9b31bfcff09a/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Any" AccessRightKinds="Private" Description="Constant fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="CONSTANT_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="PART_" Suffix="" Style="AaBb"&gt;&lt;ExtraRule Prefix="" Suffix="" Style="AaBb" /&gt;&lt;/Policy&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=4a98fdf6_002D7d98_002D4f5a_002Dafeb_002Dea44ad98c70c/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Private" Description="Instance fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;Kind Name="READONLY_FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=d042ea60_002Decd9_002D4779_002Db28d_002De9203ebec0ba/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Instance" AccessRightKinds="Public" Description="Test methods"&gt;&lt;ElementKinds&gt;&lt;Kind Name="TEST_TYPE" /&gt;&lt;Kind Name="TEST_MEMBER" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="AaBb_AaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/UserRules/=f9fce829_002De6f4_002D4cb2_002D80f1_002D5497c44f51df/@EntryIndexedValue">&lt;Policy&gt;&lt;Descriptor Staticness="Static" AccessRightKinds="Private" Description="Static fields (private)"&gt;&lt;ElementKinds&gt;&lt;Kind Name="FIELD" /&gt;&lt;/ElementKinds&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;&lt;/Policy&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FCONSTANT/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FFUNCTION/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/JavaScriptNaming/UserRules/=JS_005FBLOCK_005FSCOPE_005FVARIABLE/@EntryIndexedValue">&lt;Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /&gt;</s:String>
Expand Down Expand Up @@ -796,11 +799,13 @@ See the LICENSE file in the project root for more information.&#xD;
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpRenamePlacementToArrangementMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002EMemberReordering_002EMigrations_002ECSharpFileLayoutPatternRemoveIsAttributeUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAddAccessorOwnerDeclarationBracesMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EAlwaysTreatStructAsNotReorderableMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002ECSharpPlaceAttributeOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateThisQualifierSettings/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EPredefinedNamingRulesToUserRulesUpgrade/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsCodeFormatterSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsParsFormattingSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsWrapperSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
Expand Down
8 changes: 7 additions & 1 deletion src/MahApps.Metro/MahApps.Metro.csproj
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 Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<!-- Project properties -->
<PropertyGroup>
Expand Down Expand Up @@ -33,6 +33,12 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Condition="'$(TargetFramework)' != 'net8.0-windows'" />
</ItemGroup>

<ItemGroup Condition="$(DefineConstants.Contains(NETCOREAPP)) == true">
<PackageReference Include="System.Memory" />
</ItemGroup>

<ItemGroup Condition="$(DefineConstants.Contains(NETCOREAPP)) == false">
Expand Down
8 changes: 6 additions & 2 deletions src/MahApps.Metro/Styles/Themes/GeneratorParameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
"MahApps.Brushes.SystemControlHighlightListAccentHigh.Opacity": "0.9",
"MahApps.Brushes.SystemControlHighlightListAccentLow.Opacity": "0.6",
"MahApps.Brushes.SystemControlHighlightListAccentMedium.Opacity": "0.8",
"MahApps.Brushes.SystemControlTransientBorder.Opacity": "0.36"
"MahApps.Brushes.SystemControlTransientBorder.Opacity": "0.36",
"MahApps.Brushes.Window.Background.Backdrop.Acrylic": "#60000000",
"MahApps.Brushes.Window.Background.Backdrop.Auto": "#BB000000"
}
},
{
Expand Down Expand Up @@ -153,7 +155,9 @@
"MahApps.Brushes.SystemControlHighlightListAccentHigh.Opacity": "0.7",
"MahApps.Brushes.SystemControlHighlightListAccentLow.Opacity": "0.4",
"MahApps.Brushes.SystemControlHighlightListAccentMedium.Opacity": "0.6",
"MahApps.Brushes.SystemControlTransientBorder.Opacity": "0.14"
"MahApps.Brushes.SystemControlTransientBorder.Opacity": "0.14",
"MahApps.Brushes.Window.Background.Backdrop.Acrylic": "#60FFFFFF",
"MahApps.Brushes.Window.Background.Backdrop.Auto": "#BBFFFFFF"
}
}
],
Expand Down
Loading
Loading