feat: try to fix trimming issue.
This commit is contained in:
@@ -6,12 +6,16 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<AvaloniaUseCompiledBindingsByDefault>false</AvaloniaUseCompiledBindingsByDefault>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<TrimmerRootAssembly Include="Ursa.Demo" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<linker>
|
||||
<!-- Can be removed if CompiledBinding and no reflection are used -->
|
||||
<assembly fullname="Ursa.Demo" preserve="All" />
|
||||
<assembly fullname="Avalonia.Themes.Fluent" preserve="All" />
|
||||
</linker>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
<TrimmerRootAssembly Include="Ursa.Thems.Semi" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -19,7 +20,7 @@
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.0" />
|
||||
<PackageReference Include="Semi.Avalonia" Version="11.1.0-rc2" />
|
||||
<PackageReference Include="Semi.Avalonia" Version="11.1.0-rc2.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)"/>
|
||||
<PackageReference Include="Prism.DryIoc.Avalonia" Version="8.1.97.11072" />
|
||||
<PackageReference Include="Semi.Avalonia" Version="11.1.0-rc2" />
|
||||
<PackageReference Include="Semi.Avalonia" Version="11.1.0-rc2.1" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Version>0.3.0-beta20240226</Version>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Authors>IRIHI Technology Co., Ltd.</Authors>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
Name="ClearButton"
|
||||
Grid.Column="3"
|
||||
Padding="8,0"
|
||||
Command="{Binding $parent[contracts:IClearControl].Clear}"
|
||||
Command="{Binding $parent[u:DateRangePicker].Clear}"
|
||||
Content="{DynamicResource IconButtonClearData}"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
</ControlTheme>
|
||||
|
||||
<ControlTheme x:Key="{x:Type u:NumericUpDown}" TargetType="{x:Type u:NumericUpDown}">
|
||||
<Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
|
||||
<Setter Property="CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownDefaultHeight}"></Setter>
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="u:NumericUpDown">
|
||||
<DataValidationErrors>
|
||||
@@ -44,7 +44,7 @@
|
||||
<TextBox
|
||||
Name="PART_TextBox"
|
||||
Height="{TemplateBinding Height}"
|
||||
MinHeight="{DynamicResource NumericUpDownWrapperDefaultHeight}"
|
||||
MinHeight="{TemplateBinding MinHeight}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
AcceptsReturn="False"
|
||||
CornerRadius="{TemplateBinding CornerRadius}"
|
||||
|
||||
@@ -140,7 +140,7 @@
|
||||
Name="ClearButton"
|
||||
Grid.Column="1"
|
||||
Padding="0,0,8,0"
|
||||
Command="{Binding $parent[iri:IClearControl].Clear}"
|
||||
Command="{Binding $parent[u:TimePicker].Clear}"
|
||||
Content="{DynamicResource IconButtonClearData}"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
|
||||
@@ -59,7 +59,8 @@
|
||||
Name="ClearButton"
|
||||
Grid.Column="3"
|
||||
Padding="8,0"
|
||||
Command="{Binding $parent[iri:IClearControl].Clear}"
|
||||
Command="{Binding $parent[u:TimeRangePicker
|
||||
].Clear}"
|
||||
Content="{DynamicResource IconButtonClearData}"
|
||||
Focusable="False"
|
||||
IsVisible="False"
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
<Button
|
||||
Name="PART_ClearButton"
|
||||
Grid.Column="2"
|
||||
Command="{Binding $parent[iri:IClearControl].Clear}"
|
||||
Command="{Binding $parent[u:TreeComboBox].Clear}"
|
||||
IsVisible="False"
|
||||
Theme="{DynamicResource InnerIconButton}"
|
||||
Content="{DynamicResource IconButtonClearData}" />
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<Styles.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<MergeResourceInclude x:Key="Dark" Source="./Themes/Dark/_index.axaml" />
|
||||
<MergeResourceInclude x:Key="Light" Source="./Themes/Light/_index.axaml" />
|
||||
<ResourceInclude x:Key="Dark" Source="./Themes/Dark/_index.axaml" />
|
||||
<ResourceInclude x:Key="Light" Source="./Themes/Light/_index.axaml" />
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="../Controls/_index.axaml" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Styling;
|
||||
using Ursa.Themes.Semi.Locale;
|
||||
|
||||
namespace Ursa.Themes.Semi;
|
||||
|
||||
@@ -10,14 +11,14 @@ namespace Ursa.Themes.Semi;
|
||||
/// </summary>
|
||||
public class SemiTheme: Styles
|
||||
{
|
||||
private static readonly Lazy<Dictionary<CultureInfo, string>> _localeToResource = new Lazy<Dictionary<CultureInfo, string>>(
|
||||
() => new Dictionary<CultureInfo, string>
|
||||
private static readonly Lazy<Dictionary<CultureInfo, ResourceDictionary>> _localeToResource = new Lazy<Dictionary<CultureInfo, ResourceDictionary>>(
|
||||
() => new Dictionary<CultureInfo, ResourceDictionary>
|
||||
{
|
||||
{ new CultureInfo("zh-CN"), "avares://Ursa.Themes.Semi/Locale/zh-CN.axaml" },
|
||||
{ new CultureInfo("en-US"), "avares://Ursa.Themes.Semi/Locale/en-US.axaml" },
|
||||
{ new CultureInfo("zh-CN"), new zh_cn() },
|
||||
{ new CultureInfo("en-US"), new en_us() },
|
||||
});
|
||||
|
||||
private static readonly string _defaultResource = "avares://Ursa.Themes.Semi/Locale/zh-CN.axaml";
|
||||
private static readonly ResourceDictionary _defaultResource = new zh_cn();
|
||||
|
||||
private readonly IServiceProvider? sp;
|
||||
public SemiTheme(IServiceProvider? provider = null)
|
||||
@@ -36,9 +37,8 @@ public class SemiTheme: Styles
|
||||
{
|
||||
_locale = value;
|
||||
var resource = TryGetLocaleResource(value);
|
||||
var d = AvaloniaXamlLoader.Load(sp, new Uri(resource)) as ResourceDictionary;
|
||||
if (d is null) return;
|
||||
foreach (var kv in d)
|
||||
if (resource is null) return;
|
||||
foreach (var kv in resource)
|
||||
{
|
||||
this.Resources.Add(kv);
|
||||
}
|
||||
@@ -51,7 +51,7 @@ public class SemiTheme: Styles
|
||||
}
|
||||
}
|
||||
|
||||
private static string TryGetLocaleResource(CultureInfo? locale)
|
||||
private static ResourceDictionary? TryGetLocaleResource(CultureInfo? locale)
|
||||
{
|
||||
if (Equals(locale, CultureInfo.InvariantCulture))
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
x:Class="Ursa.Themes.Semi.Locale.en_us"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<x:String x:Key="STRING_MENU_BRING_TO_FRONT">Bring to Front</x:String>
|
||||
|
||||
8
src/Ursa.Themes.Semi/Locale/en-us.axaml.cs
Normal file
8
src/Ursa.Themes.Semi/Locale/en-us.axaml.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Ursa.Themes.Semi.Locale;
|
||||
|
||||
public class en_us: ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui"
|
||||
x:Class="Ursa.Themes.Semi.Locale.zh_cn"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<x:String x:Key="STRING_MENU_BRING_TO_FRONT">置于顶层</x:String>
|
||||
|
||||
8
src/Ursa.Themes.Semi/Locale/zh-cn.axaml.cs
Normal file
8
src/Ursa.Themes.Semi/Locale/zh-cn.axaml.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Ursa.Themes.Semi.Locale;
|
||||
|
||||
public class zh_cn: ResourceDictionary
|
||||
{
|
||||
|
||||
}
|
||||
@@ -64,7 +64,7 @@ public class EnumSelector: TemplatedControl
|
||||
nameof(Values), o => o.Values);
|
||||
|
||||
private IList<EnumItemTuple>? _values;
|
||||
internal IList<EnumItemTuple>? Values
|
||||
public IList<EnumItemTuple>? Values
|
||||
{
|
||||
get => _values;
|
||||
private set => SetAndRaise(ValuesProperty, ref _values, value);
|
||||
|
||||
@@ -12,7 +12,7 @@ public abstract class NumberDisplayerBase : TemplatedControl
|
||||
nameof(InternalText), o => o.InternalText, (o, v) => o.InternalText = v);
|
||||
private string _internalText;
|
||||
|
||||
internal string InternalText
|
||||
public string InternalText
|
||||
{
|
||||
get => _internalText;
|
||||
set => SetAndRaise(InternalTextProperty, ref _internalText, value);
|
||||
|
||||
@@ -59,13 +59,13 @@ public class VerificationCode: TemplatedControl
|
||||
}
|
||||
|
||||
public static readonly DirectProperty<VerificationCode, IList<string>> DigitsProperty = AvaloniaProperty.RegisterDirect<VerificationCode, IList<string>>(
|
||||
nameof(Digits), o => o.Digits, (o, v) => o.Digits = v);
|
||||
nameof(Digits), o => o.Digits);
|
||||
|
||||
private IList<string> _digits = [];
|
||||
internal IList<string> Digits
|
||||
public IList<string> Digits
|
||||
{
|
||||
get => _digits;
|
||||
set => SetAndRaise(DigitsProperty, ref _digits, value);
|
||||
private set => SetAndRaise(DigitsProperty, ref _digits, value);
|
||||
}
|
||||
|
||||
public static readonly RoutedEvent<VerificationCodeCompleteEventArgs> CompleteEvent =
|
||||
|
||||
Reference in New Issue
Block a user