fix LiveCharts Theme

This commit is contained in:
RMBGAME
2022-07-23 18:45:46 +08:00
parent 860f0e90df
commit 9cbacedf34
2 changed files with 22 additions and 22 deletions
@@ -144,6 +144,26 @@ namespace System.Application.UI
// //};
// Resources.MergedDictionaries[0] = (ResourceDictionary)AvaloniaXamlLoader.Load(uri_1);
//}
LiveCharts.Configure(config =>
{
config
// registers SkiaSharp as the library backend
// REQUIRED unless you build your own
.AddSkiaSharp();
// adds the default supported types
// OPTIONAL but highly recommend
//.AddDefaultMappers()
// select a theme, default is Light
// OPTIONAL
//.AddDarkTheme()
if (value == AppTheme.Light)
config.AddLightTheme();
else
config.AddDarkTheme();
});
}
public static void SetThemeAccent(string? colorHex)
@@ -231,26 +251,6 @@ namespace System.Application.UI
}
MainWindow.DataContext = vmService.MainWindow;
}, isTrace: isTrace);
LiveCharts.Configure(config =>
{
config
// registers SkiaSharp as the library backend
// REQUIRED unless you build your own
.AddSkiaSharp();
// adds the default supported types
// OPTIONAL but highly recommend
//.AddDefaultMappers()
// select a theme, default is Light
// OPTIONAL
//.AddDarkTheme()
if (Theme == AppTheme.Light)
config.AddLightTheme();
else
config.AddDarkTheme();
});
#if WINDOWS
InitWebView2();
#endif
@@ -33,11 +33,11 @@
</controls:CarouselBanner.ItemTemplate>
</controls:CarouselBanner>
<TextBlock Text="{ReflectionBinding Path=Res.Advertisement,Mode=OneWay,Source={x:Static resx:R.Current}}"
Foreground="{DynamicResource HighlightForegroundBrushKey}"
Foreground="White"
Margin="10 5"/>
<Button Name="CloseAdBtn"
Background="Transparent"
Foreground="{DynamicResource HighlightForegroundBrushKey}"
Foreground="White"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Cursor="Hand"