Skip to content

Commit

Permalink
Merge pull request #4485 from batzen/develop
Browse files Browse the repository at this point in the history
Adding BackDrop
  • Loading branch information
punker76 authored Oct 14, 2024
2 parents f7ba305 + 02479e0 commit 3eb667c
Show file tree
Hide file tree
Showing 79 changed files with 2,170 additions and 2,464 deletions.
6 changes: 4 additions & 2 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 @@ -30,15 +32,15 @@ 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: ./dotnet-install.ps1 -Version 8.0.403 -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
5 changes: 2 additions & 3 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
#tool dotnet:?package=NuGetKeyVaultSignTool&version=3.2.3
#tool dotnet:?package=AzureSignTool&version=4.0.1
#tool dotnet:?package=GitReleaseManager.Tool&version=0.15.0
#tool dotnet:?package=XamlStyler.Console&version=3.2206.4

#tool dotnet:?package=XamlStyler.Console&version=3.2404.2
#tool nuget:?package=GitVersion.CommandLine&version=5.12.0
#tool nuget:?package=xunit.runner.console&version=2.5.2
#tool nuget:?package=NUnit.ConsoleRunner&version=3.18.3

#addin nuget:?package=Cake.Figlet&version=2.0.1

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
31 changes: 16 additions & 15 deletions src/Directory.packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@
<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="NUnit" Version="4.2.2" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.3.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: 3 additions & 2 deletions src/MahApps.Metro.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28711.60
# Visual Studio Version 17
VisualStudioVersion = 17.11.35312.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MahApps.Metro", "MahApps.Metro\MahApps.Metro.csproj", "{F6432F90-04C2-42B9-992B-CD828729976B}"
EndProject
Expand All @@ -14,6 +14,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EC5373FC-2098-4D7B-8990-B15E9C631AE8}"
ProjectSection(SolutionItems) = preProject
..\.editorconfig = ..\.editorconfig
..\build.cake = ..\build.cake
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
Directory.packages.props = Directory.packages.props
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
2 changes: 2 additions & 0 deletions src/MahApps.Metro/Controls/Icons/PathIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.ComponentModel;
using System.Windows;
using System.Windows.Media;
using System.Windows.Shapes;
Expand All @@ -23,6 +24,7 @@ public static readonly DependencyProperty DataProperty
/// <summary>
/// Gets or sets a Geometry that specifies the shape to be drawn. In XAML this can also be set using the Path Markup Syntax.
/// </summary>
[TypeConverter(typeof(GeometryConverter))]
public Geometry? Data
{
get => (Geometry?)this.GetValue(DataProperty);
Expand Down
Loading

0 comments on commit 3eb667c

Please sign in to comment.