diff --git a/Avalonia.sln b/Avalonia.sln
index 4999719676..35b6b2108a 100644
--- a/Avalonia.sln
+++ b/Avalonia.sln
@@ -13,7 +13,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Direct2D1", "src\W
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Controls", "src\Avalonia.Controls\Avalonia.Controls.csproj", "{D2221C82-4A25-4583-9B43-D791E3F6820C}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Themes.Default", "src\Avalonia.Themes.Default\Avalonia.Themes.Default.csproj", "{3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Themes.Simple", "src\Avalonia.Themes.Simple\Avalonia.Themes.Simple.csproj", "{3E10A5FA-E8DA-48B1-AD44-6A5B6CB7750F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Diagnostics", "src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj", "{7062AE20-5DCC-4442-9645-8195BDECE63E}"
EndProject
diff --git a/samples/BindingDemo/App.xaml b/samples/BindingDemo/App.xaml
index 3e312c8685..175e838616 100644
--- a/samples/BindingDemo/App.xaml
+++ b/samples/BindingDemo/App.xaml
@@ -4,6 +4,6 @@
x:Class="BindingDemo.App">
-
+
diff --git a/samples/ControlCatalog/App.xaml.cs b/samples/ControlCatalog/App.xaml.cs
index 7ebb87094a..750c1082a6 100644
--- a/samples/ControlCatalog/App.xaml.cs
+++ b/samples/ControlCatalog/App.xaml.cs
@@ -5,7 +5,7 @@ using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Styling;
-using Avalonia.Themes.Default;
+using Avalonia.Themes.Simple;
using Avalonia.Themes.Fluent;
using ControlCatalog.ViewModels;
@@ -23,9 +23,9 @@ namespace ControlCatalog
Source = new Uri("avares://Avalonia.Controls.ColorPicker/Themes/Fluent/Fluent.xaml")
};
- public static readonly StyleInclude ColorPickerDefault = new StyleInclude(new Uri("avares://ControlCatalog/Styles"))
+ public static readonly StyleInclude ColorPickerSimple = new StyleInclude(new Uri("avares://ControlCatalog/Styles"))
{
- Source = new Uri("avares://Avalonia.Controls.ColorPicker/Themes/Default/Default.xaml")
+ Source = new Uri("avares://Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml")
};
public static readonly StyleInclude DataGridFluent = new StyleInclude(new Uri("avares://ControlCatalog/Styles"))
@@ -33,16 +33,16 @@ namespace ControlCatalog
Source = new Uri("avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml")
};
- public static readonly StyleInclude DataGridDefault = new StyleInclude(new Uri("avares://ControlCatalog/Styles"))
+ public static readonly StyleInclude DataGridSimple = new StyleInclude(new Uri("avares://ControlCatalog/Styles"))
{
- Source = new Uri("avares://Avalonia.Controls.DataGrid/Themes/Default.xaml")
+ Source = new Uri("avares://Avalonia.Controls.DataGrid/Themes/Simple.xaml")
};
public static FluentTheme Fluent = new FluentTheme(new Uri("avares://ControlCatalog/Styles"));
- public static SimpleTheme Default = new SimpleTheme(new Uri("avares://ControlCatalog/Styles"));
+ public static SimpleTheme Simple = new SimpleTheme(new Uri("avares://ControlCatalog/Styles"));
- public static Styles DefaultLight = new Styles
+ public static Styles SimpleLight = new Styles
{
new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
{
@@ -56,10 +56,10 @@ namespace ControlCatalog
{
Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/BaseLight.xaml")
},
- Default
+ Simple
};
- public static Styles DefaultDark = new Styles
+ public static Styles SimpleDark = new Styles
{
new StyleInclude(new Uri("resm:Styles?assembly=ControlCatalog"))
{
@@ -73,7 +73,7 @@ namespace ControlCatalog
{
Source = new Uri("avares://Avalonia.Themes.Fluent/Accents/BaseDark.xaml")
},
- Default
+ Simple
};
public override void Initialize()
diff --git a/samples/ControlCatalog/ControlCatalog.csproj b/samples/ControlCatalog/ControlCatalog.csproj
index 8358fb3cd4..2654574a3e 100644
--- a/samples/ControlCatalog/ControlCatalog.csproj
+++ b/samples/ControlCatalog/ControlCatalog.csproj
@@ -29,7 +29,7 @@
-
+
diff --git a/samples/ControlCatalog/MainView.xaml b/samples/ControlCatalog/MainView.xaml
index 7461e78c33..7f5a191519 100644
--- a/samples/ControlCatalog/MainView.xaml
+++ b/samples/ControlCatalog/MainView.xaml
@@ -187,8 +187,8 @@
FluentLight
FluentDark
- DefaultLight
- DefaultDark
+ SimpleLight
+ SimpleDark
-
-
+
diff --git a/samples/PlatformSanityChecks/PlatformSanityChecks.csproj b/samples/PlatformSanityChecks/PlatformSanityChecks.csproj
index 4f7f06b529..5c743aabdb 100644
--- a/samples/PlatformSanityChecks/PlatformSanityChecks.csproj
+++ b/samples/PlatformSanityChecks/PlatformSanityChecks.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/samples/Previewer/App.xaml b/samples/Previewer/App.xaml
index 6bae1955af..1b9d64fca6 100644
--- a/samples/Previewer/App.xaml
+++ b/samples/Previewer/App.xaml
@@ -1,6 +1,5 @@
-
-
+
-
\ No newline at end of file
+
diff --git a/samples/Previewer/Previewer.csproj b/samples/Previewer/Previewer.csproj
index 98560e9ab0..2cc84168dc 100644
--- a/samples/Previewer/Previewer.csproj
+++ b/samples/Previewer/Previewer.csproj
@@ -10,7 +10,7 @@
-
+
diff --git a/samples/VirtualizationDemo/App.xaml b/samples/VirtualizationDemo/App.xaml
index 3ad1dce794..eb5f0e4dca 100644
--- a/samples/VirtualizationDemo/App.xaml
+++ b/samples/VirtualizationDemo/App.xaml
@@ -1,9 +1,7 @@
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
diff --git a/samples/VirtualizationDemo/VirtualizationDemo.csproj b/samples/VirtualizationDemo/VirtualizationDemo.csproj
index bd6054327f..b27cfe77e8 100644
--- a/samples/VirtualizationDemo/VirtualizationDemo.csproj
+++ b/samples/VirtualizationDemo/VirtualizationDemo.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/samples/interop/Direct3DInteropSample/App.paml b/samples/interop/Direct3DInteropSample/App.paml
index d9630eef58..e6d77dfaf4 100644
--- a/samples/interop/Direct3DInteropSample/App.paml
+++ b/samples/interop/Direct3DInteropSample/App.paml
@@ -1,6 +1,5 @@
-
-
+
-
\ No newline at end of file
+
diff --git a/samples/interop/Direct3DInteropSample/Direct3DInteropSample.csproj b/samples/interop/Direct3DInteropSample/Direct3DInteropSample.csproj
index 81b94b4d09..f9ef4693d5 100644
--- a/samples/interop/Direct3DInteropSample/Direct3DInteropSample.csproj
+++ b/samples/interop/Direct3DInteropSample/Direct3DInteropSample.csproj
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorPreviewer.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorPreviewer.xaml
similarity index 100%
rename from src/Avalonia.Controls.ColorPicker/Themes/Default/ColorPreviewer.xaml
rename to src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorPreviewer.xaml
diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorSlider.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorSlider.xaml
similarity index 100%
rename from src/Avalonia.Controls.ColorPicker/Themes/Default/ColorSlider.xaml
rename to src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorSlider.xaml
diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Default/ColorSpectrum.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorSpectrum.xaml
similarity index 100%
rename from src/Avalonia.Controls.ColorPicker/Themes/Default/ColorSpectrum.xaml
rename to src/Avalonia.Controls.ColorPicker/Themes/Simple/ColorSpectrum.xaml
diff --git a/src/Avalonia.Controls.ColorPicker/Themes/Default/Default.xaml b/src/Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml
similarity index 94%
rename from src/Avalonia.Controls.ColorPicker/Themes/Default/Default.xaml
rename to src/Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml
index b452e34394..697a94421d 100644
--- a/src/Avalonia.Controls.ColorPicker/Themes/Default/Default.xaml
+++ b/src/Avalonia.Controls.ColorPicker/Themes/Simple/Simple.xaml
@@ -36,9 +36,9 @@
-
-
-
+
+
+
diff --git a/src/Avalonia.Controls.DataGrid/Themes/Default.xaml b/src/Avalonia.Controls.DataGrid/Themes/Simple.xaml
similarity index 99%
rename from src/Avalonia.Controls.DataGrid/Themes/Default.xaml
rename to src/Avalonia.Controls.DataGrid/Themes/Simple.xaml
index 83d9332613..6a748f399e 100644
--- a/src/Avalonia.Controls.DataGrid/Themes/Default.xaml
+++ b/src/Avalonia.Controls.DataGrid/Themes/Simple.xaml
@@ -223,7 +223,7 @@
-
@@ -270,7 +270,7 @@
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"
Foreground="{TemplateBinding Foreground}"
- Theme="{StaticResource DefaultDataGridRowGroupExpanderButtonTheme}" />
+ Theme="{StaticResource SimpleDataGridRowGroupExpanderButtonTheme}" />
o.Percentage);
- [Obsolete("To be removed when Avalonia.Themes.Default is discontinued.")]
public static readonly DirectProperty IndeterminateStartingOffsetProperty =
AvaloniaProperty.RegisterDirect(
nameof(IndeterminateStartingOffset),
p => p.IndeterminateStartingOffset,
(p, o) => p.IndeterminateStartingOffset = o);
- [Obsolete("To be removed when Avalonia.Themes.Default is discontinued.")]
public static readonly DirectProperty IndeterminateEndingOffsetProperty =
AvaloniaProperty.RegisterDirect(
nameof(IndeterminateEndingOffset),
@@ -139,14 +137,12 @@ namespace Avalonia.Controls
private set { SetAndRaise(PercentageProperty, ref _percentage, value); }
}
- [Obsolete("To be removed when Avalonia.Themes.Default is discontinued.")]
public double IndeterminateStartingOffset
{
get => _indeterminateStartingOffset;
set => SetAndRaise(IndeterminateStartingOffsetProperty, ref _indeterminateStartingOffset, value);
}
- [Obsolete("To be removed when Avalonia.Themes.Default is discontinued.")]
public double IndeterminateEndingOffset
{
get => _indeterminateEndingOffset;
diff --git a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj
index adddf3f57b..d719135a7f 100644
--- a/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj
+++ b/src/Avalonia.Diagnostics/Avalonia.Diagnostics.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml b/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml
index 004518598c..1270dbaa62 100644
--- a/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml
+++ b/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml
@@ -2,7 +2,6 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:views="clr-namespace:Avalonia.Diagnostics.Views"
xmlns:diag="clr-namespace:Avalonia.Diagnostics"
- xmlns:default="using:Avalonia.Themes.Default"
Title="Avalonia DevTools"
x:Class="Avalonia.Diagnostics.Views.MainWindow"
Theme="{StaticResource {x:Type Window}}">
@@ -11,8 +10,8 @@
-
-
+
+
diff --git a/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs b/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs
index 96dc929434..c81997f2cb 100644
--- a/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs
+++ b/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml.cs
@@ -11,7 +11,7 @@ using Avalonia.Input;
using Avalonia.Input.Raw;
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
-using Avalonia.Themes.Default;
+using Avalonia.Themes.Simple;
using Avalonia.VisualTree;
namespace Avalonia.Diagnostics.Views
diff --git a/src/Avalonia.Themes.Default/DefaultTheme.xaml b/src/Avalonia.Themes.Default/DefaultTheme.xaml
deleted file mode 100644
index 8f5bea557c..0000000000
--- a/src/Avalonia.Themes.Default/DefaultTheme.xaml
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/Avalonia.Themes.Default/DefaultTheme.xaml.cs b/src/Avalonia.Themes.Default/DefaultTheme.xaml.cs
deleted file mode 100644
index 598b418977..0000000000
--- a/src/Avalonia.Themes.Default/DefaultTheme.xaml.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using Avalonia.Styling;
-
-namespace Avalonia.Themes.Default
-{
- ///
- /// The default Avalonia theme.
- ///
- public class DefaultTheme : Styles
- {
- }
-}
diff --git a/src/Avalonia.Themes.Default/Accents/Base.xaml b/src/Avalonia.Themes.Simple/Accents/Base.xaml
similarity index 100%
rename from src/Avalonia.Themes.Default/Accents/Base.xaml
rename to src/Avalonia.Themes.Simple/Accents/Base.xaml
diff --git a/src/Avalonia.Themes.Default/Accents/BaseDark.xaml b/src/Avalonia.Themes.Simple/Accents/BaseDark.xaml
similarity index 100%
rename from src/Avalonia.Themes.Default/Accents/BaseDark.xaml
rename to src/Avalonia.Themes.Simple/Accents/BaseDark.xaml
diff --git a/src/Avalonia.Themes.Default/Accents/BaseLight.xaml b/src/Avalonia.Themes.Simple/Accents/BaseLight.xaml
similarity index 100%
rename from src/Avalonia.Themes.Default/Accents/BaseLight.xaml
rename to src/Avalonia.Themes.Simple/Accents/BaseLight.xaml
diff --git a/src/Avalonia.Themes.Default/ApiCompatBaseline.txt b/src/Avalonia.Themes.Simple/ApiCompatBaseline.txt
similarity index 100%
rename from src/Avalonia.Themes.Default/ApiCompatBaseline.txt
rename to src/Avalonia.Themes.Simple/ApiCompatBaseline.txt
diff --git a/src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj b/src/Avalonia.Themes.Simple/Avalonia.Themes.Simple.csproj
similarity index 100%
rename from src/Avalonia.Themes.Default/Avalonia.Themes.Default.csproj
rename to src/Avalonia.Themes.Simple/Avalonia.Themes.Simple.csproj
diff --git a/src/Avalonia.Themes.Default/Controls/AutoCompleteBox.xaml b/src/Avalonia.Themes.Simple/Controls/AutoCompleteBox.xaml
similarity index 100%
rename from src/Avalonia.Themes.Default/Controls/AutoCompleteBox.xaml
rename to src/Avalonia.Themes.Simple/Controls/AutoCompleteBox.xaml
diff --git a/src/Avalonia.Themes.Default/Controls/Button.xaml b/src/Avalonia.Themes.Simple/Controls/Button.xaml
similarity index 100%
rename from src/Avalonia.Themes.Default/Controls/Button.xaml
rename to src/Avalonia.Themes.Simple/Controls/Button.xaml
diff --git a/src/Avalonia.Themes.Default/Controls/ButtonSpinner.xaml b/src/Avalonia.Themes.Simple/Controls/ButtonSpinner.xaml
similarity index 94%
rename from src/Avalonia.Themes.Default/Controls/ButtonSpinner.xaml
rename to src/Avalonia.Themes.Simple/Controls/ButtonSpinner.xaml
index 4585fc8e56..9798e5290b 100644
--- a/src/Avalonia.Themes.Default/Controls/ButtonSpinner.xaml
+++ b/src/Avalonia.Themes.Simple/Controls/ButtonSpinner.xaml
@@ -2,7 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:CompileBindings="True">
-
@@ -38,7 +38,7 @@
IsVisible="{TemplateBinding ShowButtonSpinner}"
Rows="2">
+ Theme="{StaticResource SimpleButtonSpinnerRepeatButton}">
+ Theme="{StaticResource SimpleButtonSpinnerRepeatButton}">
-
@@ -44,7 +44,7 @@
TextElement.FontSize="10">
diff --git a/tests/Avalonia.Base.UnitTests/Utilities/UriExtensionsTests.cs b/tests/Avalonia.Base.UnitTests/Utilities/UriExtensionsTests.cs
index 5c3ac6adeb..4a879c8ced 100644
--- a/tests/Avalonia.Base.UnitTests/Utilities/UriExtensionsTests.cs
+++ b/tests/Avalonia.Base.UnitTests/Utilities/UriExtensionsTests.cs
@@ -10,9 +10,9 @@ public class UriExtensionsTests
public void Assembly_Name_From_Query_Parsed()
{
const string key = "assembly";
- const string value = "Avalonia.Themes.Default";
+ const string value = "Avalonia.Themes.Simple";
- var uri = new Uri($"resm:Avalonia.Themes.Default.Accents.BaseLight.xaml?{key}={value}");
+ var uri = new Uri($"resm:Avalonia.Themes.Simple.Accents.BaseLight.xaml?{key}={value}");
var name = uri.GetAssemblyNameFromQuery();
Assert.Equal(value, name);
@@ -21,7 +21,7 @@ public class UriExtensionsTests
[Fact]
public void Assembly_Name_From_Empty_Query_Not_Parsed()
{
- var uri = new Uri("resm:Avalonia.Themes.Default.Accents.BaseLight.xaml");
+ var uri = new Uri("resm:Avalonia.Themes.Simple.Accents.BaseLight.xaml");
var name = uri.GetAssemblyNameFromQuery();
Assert.Equal(string.Empty, name);
diff --git a/tests/Avalonia.Benchmarks/Avalonia.Benchmarks.csproj b/tests/Avalonia.Benchmarks/Avalonia.Benchmarks.csproj
index 5d17808e0c..3f4978f544 100644
--- a/tests/Avalonia.Benchmarks/Avalonia.Benchmarks.csproj
+++ b/tests/Avalonia.Benchmarks/Avalonia.Benchmarks.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/tests/Avalonia.Benchmarks/Themes/ThemeBenchmark.cs b/tests/Avalonia.Benchmarks/Themes/ThemeBenchmark.cs
index 9a5b49790d..aed8a38d08 100644
--- a/tests/Avalonia.Benchmarks/Themes/ThemeBenchmark.cs
+++ b/tests/Avalonia.Benchmarks/Themes/ThemeBenchmark.cs
@@ -4,6 +4,8 @@ using Avalonia.Controls;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Platform;
using Avalonia.Styling;
+using Avalonia.Themes.Fluent;
+using Avalonia.Themes.Simple;
using Avalonia.UnitTests;
using BenchmarkDotNet.Attributes;
@@ -25,32 +27,25 @@ namespace Avalonia.Benchmarks.Themes
}
[Benchmark]
- [Arguments("avares://Avalonia.Themes.Fluent/FluentDark.xaml")]
- [Arguments("avares://Avalonia.Themes.Fluent/FluentLight.xaml")]
- public bool InitFluentTheme(string themeUri)
+ [Arguments(FluentThemeMode.Dark)]
+ [Arguments(FluentThemeMode.Light)]
+ public bool InitFluentTheme(FluentThemeMode mode)
{
- UnitTestApplication.Current.Styles[0] = new StyleInclude(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
+ UnitTestApplication.Current.Styles[0] = new FluentTheme(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
{
- Source = new Uri(themeUri)
+ Mode = mode
};
return ((IResourceHost)UnitTestApplication.Current).TryGetResource("SystemAccentColor", out _);
}
[Benchmark]
- [Arguments("avares://Avalonia.Themes.Default/Accents/BaseLight.xaml")]
- [Arguments("avares://Avalonia.Themes.Default/Accents/BaseDark.xaml")]
- public bool InitDefaultTheme(string themeUri)
+ [Arguments(SimpleThemeMode.Dark)]
+ [Arguments(SimpleThemeMode.Light)]
+ public bool InitDefaultTheme(SimpleThemeMode mode)
{
- UnitTestApplication.Current.Styles[0] = new Styles
+ UnitTestApplication.Current.Styles[0] = new SimpleTheme(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
{
- new StyleInclude(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
- {
- Source = new Uri(themeUri)
- },
- new StyleInclude(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
- {
- Source = new Uri("avares://Avalonia.Themes.Default/DefaultTheme.xaml")
- }
+ Mode = mode
};
return ((IResourceHost)UnitTestApplication.Current).TryGetResource("ThemeAccentColor", out _);
}
diff --git a/tests/Avalonia.DesignerSupport.TestApp/App.xaml b/tests/Avalonia.DesignerSupport.TestApp/App.xaml
index 5a33ffff80..ad32431b37 100644
--- a/tests/Avalonia.DesignerSupport.TestApp/App.xaml
+++ b/tests/Avalonia.DesignerSupport.TestApp/App.xaml
@@ -1,10 +1,7 @@
-
-
-
-
-
-
+
+
+
+
diff --git a/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj b/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj
index f66b2b0457..278b0e087e 100644
--- a/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj
+++ b/tests/Avalonia.DesignerSupport.TestApp/Avalonia.DesignerSupport.TestApp.csproj
@@ -21,7 +21,7 @@
-
+
diff --git a/tests/Avalonia.Direct2D1.RenderTests/Avalonia.Direct2D1.RenderTests.csproj b/tests/Avalonia.Direct2D1.RenderTests/Avalonia.Direct2D1.RenderTests.csproj
index 52acc78db1..4a90da77e7 100644
--- a/tests/Avalonia.Direct2D1.RenderTests/Avalonia.Direct2D1.RenderTests.csproj
+++ b/tests/Avalonia.Direct2D1.RenderTests/Avalonia.Direct2D1.RenderTests.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/tests/Avalonia.LeakTests/Avalonia.LeakTests.csproj b/tests/Avalonia.LeakTests/Avalonia.LeakTests.csproj
index a00b24bdd7..4572f7ae7c 100644
--- a/tests/Avalonia.LeakTests/Avalonia.LeakTests.csproj
+++ b/tests/Avalonia.LeakTests/Avalonia.LeakTests.csproj
@@ -15,7 +15,7 @@
-
+
diff --git a/tests/Avalonia.Markup.Xaml.UnitTests/Avalonia.Markup.Xaml.UnitTests.csproj b/tests/Avalonia.Markup.Xaml.UnitTests/Avalonia.Markup.Xaml.UnitTests.csproj
index a0efa7bdeb..f562529cb8 100644
--- a/tests/Avalonia.Markup.Xaml.UnitTests/Avalonia.Markup.Xaml.UnitTests.csproj
+++ b/tests/Avalonia.Markup.Xaml.UnitTests/Avalonia.Markup.Xaml.UnitTests.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs b/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
index 29148e6f2e..af2435a52f 100644
--- a/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
+++ b/tests/Avalonia.Markup.Xaml.UnitTests/Xaml/BasicTests.cs
@@ -466,7 +466,7 @@ namespace Avalonia.Markup.Xaml.UnitTests.Xaml
var xaml = @"
-
+
";
var styles = AvaloniaRuntimeXamlLoader.Parse(xaml);
diff --git a/tests/Avalonia.Skia.RenderTests/Avalonia.Skia.RenderTests.csproj b/tests/Avalonia.Skia.RenderTests/Avalonia.Skia.RenderTests.csproj
index d3f2b44968..5e481f21c1 100644
--- a/tests/Avalonia.Skia.RenderTests/Avalonia.Skia.RenderTests.csproj
+++ b/tests/Avalonia.Skia.RenderTests/Avalonia.Skia.RenderTests.csproj
@@ -14,7 +14,7 @@
-
+
diff --git a/tests/Avalonia.UnitTests/Avalonia.UnitTests.csproj b/tests/Avalonia.UnitTests/Avalonia.UnitTests.csproj
index 52ef23c966..cb6884cad8 100644
--- a/tests/Avalonia.UnitTests/Avalonia.UnitTests.csproj
+++ b/tests/Avalonia.UnitTests/Avalonia.UnitTests.csproj
@@ -18,7 +18,7 @@
-
+
diff --git a/tests/Avalonia.UnitTests/TestServices.cs b/tests/Avalonia.UnitTests/TestServices.cs
index c1be745aca..6a211d238e 100644
--- a/tests/Avalonia.UnitTests/TestServices.cs
+++ b/tests/Avalonia.UnitTests/TestServices.cs
@@ -6,7 +6,7 @@ using Avalonia.Markup.Xaml;
using Avalonia.Media;
using Avalonia.Platform;
using Avalonia.Styling;
-using Avalonia.Themes.Default;
+using Avalonia.Themes.Simple;
using Avalonia.Rendering;
using System.Reactive.Concurrency;
using System.Collections.Generic;
@@ -81,7 +81,7 @@ namespace Avalonia.UnitTests
IScheduler scheduler = null,
ICursorFactory standardCursorFactory = null,
IStyler styler = null,
- Func theme = null,
+ Func theme = null,
IPlatformThreadingInterface threadingInterface = null,
IFontManagerImpl fontManagerImpl = null,
ITextShaperImpl textShaperImpl = null,
@@ -122,7 +122,7 @@ namespace Avalonia.UnitTests
public IScheduler Scheduler { get; }
public ICursorFactory StandardCursorFactory { get; }
public IStyler Styler { get; }
- public Func Theme { get; }
+ public Func Theme { get; }
public IPlatformThreadingInterface ThreadingInterface { get; }
public IWindowImpl WindowImpl { get; }
public IWindowingPlatform WindowingPlatform { get; }
@@ -169,18 +169,9 @@ namespace Avalonia.UnitTests
windowImpl: windowImpl ?? WindowImpl);
}
- private static Styles CreateDefaultTheme()
+ private static IStyle CreateDefaultTheme()
{
- var result = new Styles
- {
- new DefaultTheme(),
- };
-
- var baseLight = (IStyle)AvaloniaXamlLoader.Load(
- new Uri("avares://Avalonia.Themes.Default/Accents/BaseLight.xaml"));
- result.Add(baseLight);
-
- return result;
+ return new SimpleTheme { Mode = SimpleThemeMode.Light };
}
private static IPlatformRenderInterface CreateRenderInterfaceMock()
diff --git a/tests/Avalonia.UnitTests/UnitTestApplication.cs b/tests/Avalonia.UnitTests/UnitTestApplication.cs
index 63c2832b92..260771c9ab 100644
--- a/tests/Avalonia.UnitTests/UnitTestApplication.cs
+++ b/tests/Avalonia.UnitTests/UnitTestApplication.cs
@@ -71,12 +71,16 @@ namespace Avalonia.UnitTests
.Bind().ToConstant(Services.Styler)
.Bind().ToConstant(Services.WindowingPlatform)
.Bind().ToSingleton();
- var styles = Services.Theme?.Invoke();
+ var theme = Services.Theme?.Invoke();
- if (styles != null)
+ if (theme is Styles styles)
{
Styles.AddRange(styles);
}
+ else if (theme is not null)
+ {
+ Styles.Add(theme);
+ }
}
}
}