@@ -5,7 +5,9 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!--
|
||||
<TrimmerRootDescriptor Include="Roots.xml"/>
|
||||
-->
|
||||
<AvaloniaResource Include="Assets\**"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -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)"/>
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="vm:AvatarDemoViewModel"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
x:Class="Ursa.Demo.Pages.AvatarDemo">
|
||||
<Design.DataContext>
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pages="clr-namespace:Ursa.Demo.Pages"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
x:DataType="pages:BannerDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<pages:BannerDemoViewModel />
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:vm="using:Ursa.Demo.ViewModels"
|
||||
x:DataType="vm:IntroductionDemoViewModel"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="1600"
|
||||
mc:Ignorable="d">
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
xmlns:viewModels="clr-namespace:Ursa.Demo.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:DataType="viewModels:PaginationDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<viewModels:PaginationDemoViewModel />
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
xmlns:viewModels="clr-namespace:Ursa.Demo.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
x:CompileBindings="False"
|
||||
x:DataType="viewModels:TimelineDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
@@ -27,33 +27,33 @@
|
||||
<u:Timeline
|
||||
Mode="Alternate"
|
||||
HorizontalAlignment="Left"
|
||||
ContentMemberBinding="{ReflectionBinding Description}"
|
||||
HeaderMemberBinding="{ReflectionBinding Header}"
|
||||
IconMemberBinding="{ReflectionBinding ItemType}"
|
||||
ContentMemberBinding="{Binding Description}"
|
||||
HeaderMemberBinding="{Binding Header}"
|
||||
IconMemberBinding="{Binding ItemType}"
|
||||
IconTemplate="{StaticResource IconSelector}"
|
||||
ItemsSource="{Binding Items}"
|
||||
TimeMemberBinding="{ReflectionBinding Time}" >
|
||||
TimeMemberBinding="{Binding Time}" >
|
||||
|
||||
</u:Timeline>
|
||||
<u:Timeline
|
||||
Mode="Left"
|
||||
HorizontalAlignment="Left"
|
||||
ContentMemberBinding="{ReflectionBinding Description}"
|
||||
HeaderMemberBinding="{ReflectionBinding Header}"
|
||||
IconMemberBinding="{ReflectionBinding ItemType}"
|
||||
ContentMemberBinding="{Binding Description}"
|
||||
HeaderMemberBinding="{Binding Header}"
|
||||
IconMemberBinding="{Binding ItemType}"
|
||||
IconTemplate="{StaticResource IconSelector}"
|
||||
ItemsSource="{Binding Items}"
|
||||
TimeMemberBinding="{ReflectionBinding Time}" >
|
||||
TimeMemberBinding="{Binding Time}" >
|
||||
</u:Timeline>
|
||||
<u:Timeline
|
||||
Mode="Right"
|
||||
HorizontalAlignment="Left"
|
||||
ContentMemberBinding="{ReflectionBinding Description}"
|
||||
HeaderMemberBinding="{ReflectionBinding Header}"
|
||||
IconMemberBinding="{ReflectionBinding ItemType}"
|
||||
ContentMemberBinding="{Binding Description}"
|
||||
HeaderMemberBinding="{Binding Header}"
|
||||
IconMemberBinding="{Binding ItemType}"
|
||||
IconTemplate="{StaticResource IconSelector}"
|
||||
ItemsSource="{Binding Items}"
|
||||
TimeMemberBinding="{ReflectionBinding Time}" >
|
||||
TimeMemberBinding="{Binding Time}" >
|
||||
</u:Timeline>
|
||||
<u:Timeline HorizontalAlignment="Left" Mode="Alternate">
|
||||
<u:TimelineItem
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<AvaloniaUseCompiledBindingsByDefault>false</AvaloniaUseCompiledBindingsByDefault>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -19,7 +19,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>
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:contracts="https://irihi.tech/shared"
|
||||
xmlns:u="https://irihi.tech/ursa">
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
x:CompileBindings="True">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="{x:Type u:DateRangePicker}" TargetType="u:DateRangePicker">
|
||||
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
|
||||
@@ -59,7 +60,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"
|
||||
@@ -68,9 +69,9 @@
|
||||
Name="{x:Static u:DateRangePicker.PART_Button}"
|
||||
Grid.Column="3"
|
||||
Padding="8,0"
|
||||
IsVisible="{Binding !#ClearButton.IsVisible}"
|
||||
Content="{DynamicResource CalendarDatePickerIconGlyph}"
|
||||
Focusable="False"
|
||||
IsVisible="{Binding !#ClearButton.IsVisible}"
|
||||
Theme="{DynamicResource InnerIconButton}" />
|
||||
</Grid>
|
||||
<Popup
|
||||
@@ -120,18 +121,18 @@
|
||||
Grid.Column="0"
|
||||
Margin="8"
|
||||
BorderThickness="0"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
CornerRadius="{Binding $parent[Border].CornerRadius}"
|
||||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
|
||||
<u:CalendarView
|
||||
Name="{x:Static u:DateRangePicker.PART_EndCalendar}"
|
||||
Grid.Column="1"
|
||||
Margin="8"
|
||||
BorderThickness="0"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
CornerRadius="{Binding $parent[Border].CornerRadius}"
|
||||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
|
||||
FontSize="{DynamicResource DefaultFontSize}"
|
||||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" />
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
@@ -144,7 +145,7 @@
|
||||
|
||||
<Style Selector="^.clearButton, ^.ClearButton">
|
||||
<Style Selector="^:not(:empty):pointerover /template/ Button#ClearButton">
|
||||
<Setter Property="IsVisible" Value="{Binding $parent[u:DatePicker].start, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
<Setter Property="TextElement.FontFamily" Value="{TemplateBinding FontFamily}" />
|
||||
<Setter Property="TextElement.FontWeight" Value="{TemplateBinding FontWeight}" />
|
||||
<Setter Property="TextElement.FontSize" Value="{TemplateBinding FontSize}" />
|
||||
<Setter Property="ContentPresenter.IsVisible" Value="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||
<Setter Property="ContentPresenter.Margin" Value="{DynamicResource ThicknessDividerTextMargin}" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</ControlTheme>
|
||||
@@ -48,7 +47,10 @@
|
||||
Height="{TemplateBinding Height}"
|
||||
ColumnDefinitions="Auto,Auto,*">
|
||||
<Rectangle Theme="{StaticResource DividerLeftLine}" />
|
||||
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
|
||||
<ContentPresenter
|
||||
Grid.Column="1"
|
||||
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Theme="{StaticResource DividerContentPresenter}" />
|
||||
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
@@ -62,7 +64,10 @@
|
||||
Height="{TemplateBinding Height}"
|
||||
ColumnDefinitions="*,Auto,Auto">
|
||||
<Rectangle Theme="{StaticResource DividerLeftLine}" />
|
||||
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
|
||||
<ContentPresenter
|
||||
Grid.Column="1"
|
||||
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Theme="{StaticResource DividerContentPresenter}" />
|
||||
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
@@ -76,7 +81,10 @@
|
||||
Height="{TemplateBinding Height}"
|
||||
ColumnDefinitions="*,Auto,*">
|
||||
<Rectangle Theme="{StaticResource DividerLeftLine}" />
|
||||
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
|
||||
<ContentPresenter
|
||||
Grid.Column="1"
|
||||
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Theme="{StaticResource DividerContentPresenter}" />
|
||||
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
@@ -90,7 +98,10 @@
|
||||
Height="{TemplateBinding Height}"
|
||||
ColumnDefinitions="*,Auto,*">
|
||||
<Rectangle Theme="{StaticResource DividerLeftLine}" />
|
||||
<ContentPresenter Grid.Column="1" Theme="{StaticResource DividerContentPresenter}" />
|
||||
<ContentPresenter
|
||||
Grid.Column="1"
|
||||
IsVisible="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}"
|
||||
Theme="{StaticResource DividerContentPresenter}" />
|
||||
<Rectangle Grid.Column="2" Theme="{StaticResource DividerRightLine}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
<Style Selector="^ /template/ Panel#PART_TitleArea">
|
||||
<Setter Property="ContextFlyout">
|
||||
<MenuFlyout>
|
||||
<MenuItem Command="{Binding $parent[u:CustomDialogControl].CloseDialog}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
|
||||
<MenuItem Command="{Binding $parent[u:CustomDialogControl].Close}" Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
|
||||
<MenuItem.Icon>
|
||||
<PathIcon
|
||||
Width="12"
|
||||
|
||||
@@ -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}"
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
RowDefinitions="Auto,Auto,Auto">
|
||||
<Grid.Styles>
|
||||
<Style Selector="TickBar">
|
||||
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.LowerThumb.Bounds}" />
|
||||
<Setter Property="ReservedSpace" Value="{ReflectionBinding #PART_Track.LowerThumb.Bounds}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<TickBar
|
||||
@@ -50,7 +50,7 @@
|
||||
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
|
||||
Ticks="{TemplateBinding Ticks}" />
|
||||
<u:RangeTrack
|
||||
Name="{x:Static u:RangeSlider.PART_Track}"
|
||||
Name="PART_Track"
|
||||
Grid.Row="1"
|
||||
Cursor="Hand"
|
||||
HorizontalAlignment="Stretch"
|
||||
@@ -110,7 +110,7 @@
|
||||
ColumnDefinitions="Auto,Auto,Auto">
|
||||
<Grid.Styles>
|
||||
<Style Selector="TickBar">
|
||||
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.LowerThumb.Bounds}" />
|
||||
<Setter Property="ReservedSpace" Value="{ReflectionBinding #PART_Track.LowerThumb.Bounds}" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
<TickBar
|
||||
@@ -142,7 +142,7 @@
|
||||
TickFrequency="{TemplateBinding u:RangeSlider.TickFrequency}"
|
||||
Ticks="{TemplateBinding Ticks}" />
|
||||
<u:RangeTrack
|
||||
Name="{x:Static u:RangeSlider.PART_Track}"
|
||||
Name="PART_Track"
|
||||
Cursor="Hand"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<Setter Property="VerticalAlignment" Value="Top" />
|
||||
<Setter Property="ItemTemplate">
|
||||
<DataTemplate>
|
||||
<u:ClosableTag Command="{Binding $parent[u:TagInput].Close}" Content="{Binding}" />
|
||||
<u:ClosableTag Command="{Binding $parent[u:TagInput].Close}" Content="{ReflectionBinding}" />
|
||||
</DataTemplate>
|
||||
</Setter>
|
||||
<Setter Property="Template">
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
}
|
||||
@@ -13,6 +13,7 @@
|
||||
<PackageIcon>irihi.png</PackageIcon>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
<PackageProjectUrl>https://github.com/irihitech/Ursa.Avalonia</PackageProjectUrl>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ControlClassesInput: TemplatedControl
|
||||
internal static readonly DirectProperty<ControlClassesInput, ObservableCollection<string>> TargetClassesProperty = AvaloniaProperty.RegisterDirect<ControlClassesInput, ObservableCollection<string>>(
|
||||
nameof(TargetClasses), o => o.TargetClasses, (o, v) => o.TargetClasses = v);
|
||||
|
||||
internal ObservableCollection<string> TargetClasses
|
||||
public ObservableCollection<string> TargetClasses
|
||||
{
|
||||
get => _targetClasses;
|
||||
set => SetAndRaise(TargetClassesProperty, ref _targetClasses, value);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -124,7 +124,7 @@ public class NavMenuItem: HeaderedItemsControl
|
||||
internal static readonly DirectProperty<NavMenuItem, int> LevelProperty = AvaloniaProperty.RegisterDirect<NavMenuItem, int>(
|
||||
nameof(Level), o => o.Level, (o, v) => o.Level = v);
|
||||
private int _level;
|
||||
internal int Level
|
||||
public int Level
|
||||
{
|
||||
get => _level;
|
||||
set => SetAndRaise(LevelProperty, ref _level, 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