fix: fix palette trimming issue.

This commit is contained in:
rabbitism 2024-07-18 16:58:05 +08:00
parent 724a528b16
commit 9259f06f57
No known key found for this signature in database
5 changed files with 22 additions and 4 deletions

View File

@ -47,8 +47,8 @@ public class PaletteDemoViewModel: ObservableObject
public PaletteDemoViewModel()
{
_lightResourceDictionary = AvaloniaXamlLoader.Load(new Uri("avares://Semi.Avalonia/Themes/Light/Palette.axaml")) as ResourceDictionary;
_darkResourceDictionary = AvaloniaXamlLoader.Load(new Uri("avares://Semi.Avalonia/Themes/Dark/Palette.axaml")) as ResourceDictionary;
_lightResourceDictionary = new Light.Palette();
_darkResourceDictionary = new Dark.Palette();
WeakReferenceMessenger.Default.Register<PaletteDemoViewModel, ColorItemViewModel>(this, OnClickColorItem);
}

View File

@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary x:Class="Semi.Avalonia.Dark.Palette" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Color Resources -->
<Color x:Key="SemiRed0Color">#6C090B</Color>
<Color x:Key="SemiRed1Color">#901110</Color>

View File

@ -0,0 +1,9 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Dark;
public class Palette: ResourceDictionary
{
}

View File

@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary x:Class="Semi.Avalonia.Light.Palette" xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Color Resources -->
<Color x:Key="SemiRed0Color">#FEF2ED</Color>
<Color x:Key="SemiRed1Color">#FEDDD2</Color>

View File

@ -0,0 +1,9 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Semi.Avalonia.Light;
public class Palette: ResourceDictionary
{
}