Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent

# TUnit0031: Async void methods and lambdas are not allowed
dotnet_diagnostic.TUnit0031.severity = suggestion

[*.{cs,vb}]
#### Naming styles ####

Expand Down Expand Up @@ -188,3 +191,4 @@ dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion

36 changes: 18 additions & 18 deletions Directory.packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BluwolfIcons" Version="1.0.1" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.4.2" />
<PackageVersion Include="Dragablz" Version="0.0.3.234" />
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.1" />
<PackageVersion Include="Humanizer" Version="2.14.1" />
<PackageVersion Include="Humanizer" Version="3.0.10" />
<PackageVersion Include="MahApps.Metro" Version="2.4.11" />
<PackageVersion Include="Microsoft.Bcl.HashCode" Version="6.0.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.8.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.8.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0" PrivateAssets="all" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.3.0" />
<PackageVersion Include="Microsoft.Composition" Version="1.0.31" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.NETCore.Platforms" Version="7.0.4" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.6.0" />
<PackageVersion Include="Microsoft.Toolkit.MVVM" Version="7.1.2" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.77" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.142" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
<PackageVersion Include="Polyfill" Version="8.8.1" />
<PackageVersion Include="Shouldly" Version="4.3.0" />
<PackageVersion Include="ShowMeTheXAML" Version="2.0.0" />
<PackageVersion Include="ShowMeTheXAML.AvalonEdit" Version="2.0.0" />
<PackageVersion Include="ShowMeTheXAML.MSBuild" Version="2.0.0" />
<PackageVersion Include="System.CommandLine" Version="2.0.2" />
<PackageVersion Include="ShowMeTheXAML" Version="2.1.1" />
<PackageVersion Include="ShowMeTheXAML.AvalonEdit" Version="2.1.1" />
<PackageVersion Include="ShowMeTheXAML.MSBuild" Version="2.1.1" />
<PackageVersion Include="System.CommandLine" Version="2.0.9" />
<PackageVersion Include="System.Memory" Version="4.6.3" />
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
<PackageVersion Include="System.Private.Uri" Version="4.3.2" />
<PackageVersion Include="System.ValueTuple" Version="4.6.1" />
<PackageVersion Include="System.ValueTuple" Version="4.6.2" />
<PackageVersion Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageVersion Include="TUnit" Version="1.9.45" />
<PackageVersion Include="VirtualizingWrapPanel" Version="1.5.8" />
<PackageVersion Include="XAMLTest" Version="1.3.1-ci662" />
<PackageVersion Include="TUnit" Version="1.53.0" />
<PackageVersion Include="VirtualizingWrapPanel" Version="2.5.1" />
<PackageVersion Include="XAMLTest" Version="1.3.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "10.0.102",
"version": "10.0.301",
"rollForward": "latestMinor"
},
"test": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ private static partial void LoadThemeColors(ResourceDictionary resourceDictionar
theme.ComboBoxes.HoverBorder = GetColor(resourceDictionary, "MaterialDesign.Brush.ComboBox.HoverBorder", "MaterialDesignBody");
theme.ComboBoxes.Border = GetColor(resourceDictionary, "MaterialDesign.Brush.ComboBox.Border", "MaterialDesignBodyLight", "MaterialDesignCheckBoxOff", "MaterialDesignTextBoxBorder");
theme.ComboBoxes.OutlineBorder = GetColor(resourceDictionary, "MaterialDesign.Brush.ComboBox.OutlineBorder", "MaterialDesignColumnHeader", "MaterialDesignTextAreaBorder");
theme.ComboBoxes.DropDowns.Background = GetColor(resourceDictionary, "MaterialDesign.Brush.ComboBox.DropDown.Background");
theme.ComboBoxes.Popups.DarkBackground = GetColor(resourceDictionary, "MaterialDesign.Brush.ComboBox.Popup.DarkBackground");
theme.ComboBoxes.Popups.DarkForeground = GetColor(resourceDictionary, "MaterialDesign.Brush.ComboBox.Popup.DarkForeground");
theme.ComboBoxes.Popups.LightBackground = GetColor(resourceDictionary, "MaterialDesign.Brush.ComboBox.Popup.LightBackground");
Expand Down Expand Up @@ -164,6 +165,7 @@ private static partial void ApplyThemeColors(ResourceDictionary resourceDictiona
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.ComboBox.OutlineBorder", theme.ComboBoxes.OutlineBorder);
SetSolidColorBrush(resourceDictionary, "MaterialDesignColumnHeader", theme.ComboBoxes.OutlineBorder);
SetSolidColorBrush(resourceDictionary, "MaterialDesignTextAreaBorder", theme.ComboBoxes.OutlineBorder);
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.ComboBox.DropDown.Background", theme.ComboBoxes.DropDowns.Background);
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.ComboBox.Popup.DarkBackground", theme.ComboBoxes.Popups.DarkBackground);
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.ComboBox.Popup.DarkForeground", theme.ComboBoxes.Popups.DarkForeground);
SetSolidColorBrush(resourceDictionary, "MaterialDesign.Brush.ComboBox.Popup.LightBackground", theme.ComboBoxes.Popups.LightBackground);
Expand Down
20 changes: 20 additions & 0 deletions src/MaterialDesignThemes.Wpf/Theme.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ public class ComboBox
public ComboBox(Theme theme)
{
_theme = theme ?? throw new ArgumentNullException(nameof(theme));
DropDowns = new(theme);
Popups = new(theme);
}

Expand Down Expand Up @@ -405,8 +406,27 @@ public ColorReference OutlineBorder
set => _outlineBorder = value;
}

public DropDown DropDowns { get; set; }

public Popup Popups { get; set; }

public class DropDown
{
private readonly Theme _theme;
public DropDown(Theme theme)
{
_theme = theme ?? throw new ArgumentNullException(nameof(theme));
}

private ColorReference _background;
public ColorReference Background
{
get => _theme.Resolve(_background);
set => _background = value;
}

}

public class Popup
{
private readonly Theme _theme;
Expand Down
2 changes: 2 additions & 0 deletions src/MaterialDesignThemes.Wpf/ThemeExtensions.g.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static partial void SetLightTheme(this Theme theme)
theme.ComboBoxes.HoverBorder = BaseThemeColors.Black900;
theme.ComboBoxes.Border = BaseThemeColors.Black500;
theme.ComboBoxes.OutlineBorder = BaseThemeColors.Black700;
theme.ComboBoxes.DropDowns.Background = BaseThemeColors.Neutral900;
theme.ComboBoxes.Popups.DarkBackground = BaseThemeColors.Neutral100;
theme.ComboBoxes.Popups.DarkForeground = BaseThemeColors.Neutral900;
theme.ComboBoxes.Popups.LightBackground = BaseThemeColors.Neutral900;
Expand Down Expand Up @@ -140,6 +141,7 @@ public static partial void SetDarkTheme(this Theme theme)
theme.ComboBoxes.HoverBorder = BaseThemeColors.White900;
theme.ComboBoxes.Border = BaseThemeColors.White500;
theme.ComboBoxes.OutlineBorder = BaseThemeColors.White700;
theme.ComboBoxes.DropDowns.Background = BaseThemeColors.Neutral100;
theme.ComboBoxes.Popups.DarkBackground = BaseThemeColors.Neutral100;
theme.ComboBoxes.Popups.DarkForeground = BaseThemeColors.Neutral900;
theme.ComboBoxes.Popups.LightBackground = BaseThemeColors.Neutral900;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@
PopupAnimation="Fade"
RelativeHorizontalOffset="-6"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Tag="{DynamicResource MaterialDesign.Brush.Background}"
Tag="{DynamicResource MaterialDesign.Brush.ComboBox.DropDown.Background}"
UpVerticalOffset="15"
UseLayoutRounding="{TemplateBinding UseLayoutRounding}"
VerticalOffset="0">
Expand All @@ -557,7 +557,7 @@
<ContentControl>
<ScrollViewer MinHeight="1"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
Background="{Binding Background, ElementName=PART_Popup}">
Background="Transparent">
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</ContentControl>
Expand Down Expand Up @@ -796,8 +796,8 @@
<Condition SourceName="PART_Popup" Property="wpf:ColorZoneAssist.Mode" Value="Standard" />
</MultiTrigger.Conditions>
<Setter Property="TextElement.Foreground" Value="{DynamicResource MaterialDesign.Brush.Foreground}" />
<Setter TargetName="PART_Popup" Property="Background" Value="{Binding Tag, RelativeSource={RelativeSource Self}, Converter={x:Static converters:RemoveAlphaBrushConverter.Instance}}" />
<Setter TargetName="PART_Popup" Property="Tag" Value="{DynamicResource MaterialDesign.Brush.Background}" />
<Setter TargetName="PART_Popup" Property="Background" Value="{Binding Tag, RelativeSource={RelativeSource Self}}" />
<Setter TargetName="PART_Popup" Property="Tag" Value="{DynamicResource MaterialDesign.Brush.ComboBox.DropDown.Background}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<colors:StaticResource x:Key="MaterialDesign.Brush.ColorZone.LightBackground" ResourceKey="Neutral900" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ColorZone.LightForeground" ResourceKey="Black900" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.Disabled" ResourceKey="Neutral300" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.DropDown.Background" ResourceKey="Neutral100" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.FilledBackground" ResourceKey="White100" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.HoverBackground" ResourceKey="White100" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.OutlineInactiveBorder" ResourceKey="White200" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,15 @@
<Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" UseLayoutRounding="True">
<AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}">
<Border x:Name="shadow"
Background="{DynamicResource MaterialDesign.Brush.Background}"
Background="{DynamicResource MaterialDesign.Brush.ComboBox.DropDown.Background}"
BorderThickness="1"
CornerRadius="2"
Effect="{DynamicResource MaterialDesignShadowDepth2}" />
</AdornerDecorator>
<Border x:Name="dropDownBorder"
MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=DataGridCell}}"
Margin="{Binding ElementName=shadow, Path=Margin, Mode=OneWay}"
Background="Transparent"
Background="{DynamicResource MaterialDesign.Brush.ComboBox.DropDown.Background}"
BorderBrush="{DynamicResource MaterialDesign.Brush.DataGrid.ComboBoxHover}"
BorderThickness="1"
CornerRadius="2">
Expand Down Expand Up @@ -285,15 +285,15 @@
<Grid MaxHeight="{TemplateBinding MaxDropDownHeight}" UseLayoutRounding="True">
<AdornerDecorator CacheMode="{Binding RelativeSource={RelativeSource Self}, Path=(wpf:ShadowAssist.CacheMode)}">
<Border x:Name="shadow"
Background="{DynamicResource MaterialDesign.Brush.Background}"
Background="{DynamicResource MaterialDesign.Brush.ComboBox.DropDown.Background}"
BorderThickness="1"
CornerRadius="2"
Effect="{DynamicResource MaterialDesignShadowDepth2}" />
</AdornerDecorator>
<Border x:Name="dropDownBorder"
MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource AncestorType=DataGridCell}}"
Margin="{Binding ElementName=shadow, Path=Margin, Mode=OneWay}"
Background="Transparent"
Background="{DynamicResource MaterialDesign.Brush.ComboBox.DropDown.Background}"
BorderBrush="{DynamicResource MaterialDesign.Brush.DataGrid.ComboBoxHover}"
BorderThickness="1"
CornerRadius="2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<colors:StaticResource x:Key="MaterialDesign.Brush.ColorZone.LightBackground" ResourceKey="Neutral900" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ColorZone.LightForeground" ResourceKey="Black900" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.Disabled" ResourceKey="Neutral700" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.DropDown.Background" ResourceKey="Neutral900" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.FilledBackground" ResourceKey="Black50" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.HoverBackground" ResourceKey="Black100" />
<colors:StaticResource x:Key="MaterialDesign.Brush.ComboBox.OutlineInactiveBorder" ResourceKey="Black200" />
Expand Down
9 changes: 9 additions & 0 deletions src/MaterialDesignToolkit.ResourceGeneration/ThemeColors.json
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@
},
"alternateKeys": []
},
{
"name": "MaterialDesign.Brush.ComboBox.DropDown.Background",
"themeValues": {
"light": "Neutral900",
"dark": "Neutral100"
},
"alternateKeys": [],
"obsoleteKeys": []
},
{
"name": "MaterialDesign.Brush.ComboBox.Popup.DarkBackground",
"themeValues": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

<ItemGroup>
<Using Include="MaterialDesignThemes.Wpf" />
<Using Include="MaterialDesignThemes.Tests.TUnit"/>
<Using Include="XamlTest" />
</ItemGroup>

Expand Down
72 changes: 0 additions & 72 deletions tests/MaterialDesignThemes.UITests/TUnit/IsCloseToExtensions.cs

This file was deleted.

1 change: 1 addition & 0 deletions tests/MaterialDesignThemes.UITests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
[assembly: GenerateHelpers(typeof(DrawerHost))]
[assembly: GenerateHelpers(typeof(NumericUpDown))]
[assembly: GenerateHelpers(typeof(PopupBox))]
[assembly: GenerateHelpers(typeof(ComboBoxPopup))]
[assembly: GenerateHelpers(typeof(SmartHint))]
[assembly: GenerateHelpers(typeof(TimePicker))]
[assembly: GenerateHelpers(typeof(TreeListView))]
Expand Down
Loading
Loading