|
|
|
@ -29,26 +29,16 @@ namespace Avalonia.Benchmarks.Themes |
|
|
|
} |
|
|
|
|
|
|
|
[Benchmark] |
|
|
|
[Arguments(FluentThemeMode.Dark)] |
|
|
|
[Arguments(FluentThemeMode.Light)] |
|
|
|
public bool InitFluentTheme(FluentThemeMode mode) |
|
|
|
public bool InitFluentTheme() |
|
|
|
{ |
|
|
|
UnitTestApplication.Current.Styles[0] = new FluentTheme() |
|
|
|
{ |
|
|
|
Mode = mode |
|
|
|
}; |
|
|
|
UnitTestApplication.Current.Styles[0] = new FluentTheme(); |
|
|
|
return ((IResourceHost)UnitTestApplication.Current).TryGetResource("SystemAccentColor", out _); |
|
|
|
} |
|
|
|
|
|
|
|
[Benchmark] |
|
|
|
[Arguments(SimpleThemeMode.Dark)] |
|
|
|
[Arguments(SimpleThemeMode.Light)] |
|
|
|
public bool InitSimpleTheme(SimpleThemeMode mode) |
|
|
|
public bool InitSimpleTheme() |
|
|
|
{ |
|
|
|
UnitTestApplication.Current.Styles[0] = new SimpleTheme() |
|
|
|
{ |
|
|
|
Mode = mode |
|
|
|
}; |
|
|
|
UnitTestApplication.Current.Styles[0] = new SimpleTheme(); |
|
|
|
return ((IResourceHost)UnitTestApplication.Current).TryGetResource("ThemeAccentColor", out _); |
|
|
|
} |
|
|
|
|
|
|
|
@ -58,7 +48,7 @@ namespace Avalonia.Benchmarks.Themes |
|
|
|
[Arguments(typeof(DatePicker))] |
|
|
|
public object FindFluentControlTheme(Type type) |
|
|
|
{ |
|
|
|
_reusableFluentTheme.TryGetResource(type, out var theme); |
|
|
|
_reusableFluentTheme.TryGetResource(type, ThemeVariant.Default, out var theme); |
|
|
|
return theme; |
|
|
|
} |
|
|
|
|
|
|
|
@ -68,7 +58,7 @@ namespace Avalonia.Benchmarks.Themes |
|
|
|
[Arguments(typeof(DatePicker))] |
|
|
|
public object FindSimpleControlTheme(Type type) |
|
|
|
{ |
|
|
|
_reusableSimpleTheme.TryGetResource(type, out var theme); |
|
|
|
_reusableSimpleTheme.TryGetResource(type, ThemeVariant.Default, out var theme); |
|
|
|
return theme; |
|
|
|
} |
|
|
|
|
|
|
|
|