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..eb8ecc3af0 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;
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.cs b/samples/ControlCatalog/MainView.xaml.cs
index 47d11738bc..d8d58edaf6 100644
--- a/samples/ControlCatalog/MainView.xaml.cs
+++ b/samples/ControlCatalog/MainView.xaml.cs
@@ -60,14 +60,14 @@ namespace ControlCatalog
}
else if (theme == CatalogTheme.DefaultLight)
{
- App.Default.Mode = Avalonia.Themes.Default.SimpleThemeMode.Light;
+ App.Default.Mode = Avalonia.Themes.Simple.SimpleThemeMode.Light;
Application.Current.Styles[0] = App.DefaultLight;
Application.Current.Styles[1] = App.ColorPickerDefault;
Application.Current.Styles[2] = App.DataGridDefault;
}
else if (theme == CatalogTheme.DefaultDark)
{
- App.Default.Mode = Avalonia.Themes.Default.SimpleThemeMode.Dark;
+ App.Default.Mode = Avalonia.Themes.Simple.SimpleThemeMode.Dark;
Application.Current.Styles[0] = App.DefaultDark;
Application.Current.Styles[1] = App.ColorPickerDefault;
Application.Current.Styles[2] = App.DataGridDefault;
diff --git a/samples/PlatformSanityChecks/App.xaml b/samples/PlatformSanityChecks/App.xaml
index 25bab6ae35..1b9d64fca6 100644
--- a/samples/PlatformSanityChecks/App.xaml
+++ b/samples/PlatformSanityChecks/App.xaml
@@ -1,6 +1,5 @@
-
-
+
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..0b64d0c09b 100644
--- a/samples/VirtualizationDemo/App.xaml
+++ b/samples/VirtualizationDemo/App.xaml
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="VirtualizationDemo.App">
-
-
+
+
\ 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/ProgressBar.cs b/src/Avalonia.Controls/ProgressBar.cs
index 56b9caf085..91114628ee 100644
--- a/src/Avalonia.Controls/ProgressBar.cs
+++ b/src/Avalonia.Controls/ProgressBar.cs
@@ -119,14 +119,12 @@ namespace Avalonia.Controls
nameof(Percentage),
o => 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..63073952ac 100644
--- a/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml
+++ b/src/Avalonia.Diagnostics/Diagnostics/Views/MainWindow.xaml
@@ -2,7 +2,7 @@
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"
+ xmlns:default="using:Avalonia.Themes.Simple"
Title="Avalonia DevTools"
x:Class="Avalonia.Diagnostics.Views.MainWindow"
Theme="{StaticResource {x:Type Window}}">
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..c64931a6ef 100644
--- a/tests/Avalonia.Benchmarks/Themes/ThemeBenchmark.cs
+++ b/tests/Avalonia.Benchmarks/Themes/ThemeBenchmark.cs
@@ -37,8 +37,8 @@ namespace Avalonia.Benchmarks.Themes
}
[Benchmark]
- [Arguments("avares://Avalonia.Themes.Default/Accents/BaseLight.xaml")]
- [Arguments("avares://Avalonia.Themes.Default/Accents/BaseDark.xaml")]
+ [Arguments("avares://Avalonia.Themes.Simple/Accents/BaseLight.xaml")]
+ [Arguments("avares://Avalonia.Themes.Simple/Accents/BaseDark.xaml")]
public bool InitDefaultTheme(string themeUri)
{
UnitTestApplication.Current.Styles[0] = new Styles
@@ -49,7 +49,7 @@ namespace Avalonia.Benchmarks.Themes
},
new StyleInclude(new Uri("resm:Styles?assembly=Avalonia.Benchmarks"))
{
- Source = new Uri("avares://Avalonia.Themes.Default/DefaultTheme.xaml")
+ Source = new Uri("avares://Avalonia.Themes.Simple/DefaultTheme.xaml")
}
};
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..803cae09c8 100644
--- a/tests/Avalonia.DesignerSupport.TestApp/App.xaml
+++ b/tests/Avalonia.DesignerSupport.TestApp/App.xaml
@@ -3,8 +3,8 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
-
-
-
+
+
+
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);
+ }
}
}
}