diff --git a/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj b/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj
index a1b75b7..5f6658e 100644
--- a/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj
+++ b/demo/Ursa.Demo.Browser/Ursa.Demo.Browser.csproj
@@ -5,7 +5,9 @@
+
diff --git a/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj b/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
index 6566753..ca92927 100644
--- a/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
+++ b/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
@@ -6,12 +6,16 @@
net8.0
enable
true
- false
+ true
app.manifest
+
+
+
+
diff --git a/demo/Ursa.Demo/Pages/AvatarDemo.axaml b/demo/Ursa.Demo/Pages/AvatarDemo.axaml
index 1a07543..861960f 100644
--- a/demo/Ursa.Demo/Pages/AvatarDemo.axaml
+++ b/demo/Ursa.Demo/Pages/AvatarDemo.axaml
@@ -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">
diff --git a/demo/Ursa.Demo/Pages/BannerDemo.axaml b/demo/Ursa.Demo/Pages/BannerDemo.axaml
index d7a275e..91c8f89 100644
--- a/demo/Ursa.Demo/Pages/BannerDemo.axaml
+++ b/demo/Ursa.Demo/Pages/BannerDemo.axaml
@@ -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">
diff --git a/demo/Ursa.Demo/Pages/IntroductionDemo.axaml b/demo/Ursa.Demo/Pages/IntroductionDemo.axaml
index 3e4c490..ba2bbbf 100644
--- a/demo/Ursa.Demo/Pages/IntroductionDemo.axaml
+++ b/demo/Ursa.Demo/Pages/IntroductionDemo.axaml
@@ -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">
diff --git a/demo/Ursa.Demo/Pages/PaginationDemo.axaml b/demo/Ursa.Demo/Pages/PaginationDemo.axaml
index 77b537e..a90dfbe 100644
--- a/demo/Ursa.Demo/Pages/PaginationDemo.axaml
+++ b/demo/Ursa.Demo/Pages/PaginationDemo.axaml
@@ -8,6 +8,7 @@
xmlns:viewModels="clr-namespace:Ursa.Demo.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
+ x:DataType="viewModels:PaginationDemoViewModel"
mc:Ignorable="d">
diff --git a/demo/Ursa.Demo/Pages/TimelineDemo.axaml b/demo/Ursa.Demo/Pages/TimelineDemo.axaml
index 262ac3e..21e4620 100644
--- a/demo/Ursa.Demo/Pages/TimelineDemo.axaml
+++ b/demo/Ursa.Demo/Pages/TimelineDemo.axaml
@@ -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">
@@ -27,33 +27,33 @@
+ TimeMemberBinding="{Binding Time}" >
+ TimeMemberBinding="{Binding Time}" >
+ TimeMemberBinding="{Binding Time}" >
-
diff --git a/demo/Ursa.Demo/Ursa.Demo.csproj b/demo/Ursa.Demo/Ursa.Demo.csproj
index e95fe55..6631379 100644
--- a/demo/Ursa.Demo/Ursa.Demo.csproj
+++ b/demo/Ursa.Demo/Ursa.Demo.csproj
@@ -3,7 +3,7 @@
net8.0
enable
latest
- false
+ true
@@ -19,7 +19,7 @@
-
+
diff --git a/demo/Ursa.PrismDialogDemo/Ursa.PrismDialogDemo.csproj b/demo/Ursa.PrismDialogDemo/Ursa.PrismDialogDemo.csproj
index d5c5446..5c4eaec 100644
--- a/demo/Ursa.PrismDialogDemo/Ursa.PrismDialogDemo.csproj
+++ b/demo/Ursa.PrismDialogDemo/Ursa.PrismDialogDemo.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/src/Ursa.PrismExtension/Ursa.PrismExtension.csproj b/src/Ursa.PrismExtension/Ursa.PrismExtension.csproj
index 52fc627..071d1bc 100644
--- a/src/Ursa.PrismExtension/Ursa.PrismExtension.csproj
+++ b/src/Ursa.PrismExtension/Ursa.PrismExtension.csproj
@@ -1,7 +1,7 @@
- netstandard2.0
+ net8.0
0.3.0-beta20240226
enable
IRIHI Technology Co., Ltd.
diff --git a/src/Ursa.Themes.Semi/Controls/DateRangePicker.axaml b/src/Ursa.Themes.Semi/Controls/DateRangePicker.axaml
index 72cc4c9..74fcf4e 100644
--- a/src/Ursa.Themes.Semi/Controls/DateRangePicker.axaml
+++ b/src/Ursa.Themes.Semi/Controls/DateRangePicker.axaml
@@ -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">
@@ -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}" />
@@ -144,7 +145,7 @@
diff --git a/src/Ursa.Themes.Semi/Controls/Divider.axaml b/src/Ursa.Themes.Semi/Controls/Divider.axaml
index 9b4af1c..2469b3b 100644
--- a/src/Ursa.Themes.Semi/Controls/Divider.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Divider.axaml
@@ -30,7 +30,6 @@
-
@@ -48,7 +47,10 @@
Height="{TemplateBinding Height}"
ColumnDefinitions="Auto,Auto,*">
-
+
@@ -62,7 +64,10 @@
Height="{TemplateBinding Height}"
ColumnDefinitions="*,Auto,Auto">
-
+
@@ -76,7 +81,10 @@
Height="{TemplateBinding Height}"
ColumnDefinitions="*,Auto,*">
-
+
@@ -90,7 +98,10 @@
Height="{TemplateBinding Height}"
ColumnDefinitions="*,Auto,*">
-
+
diff --git a/src/Ursa.Themes.Semi/Controls/MessageBox.axaml b/src/Ursa.Themes.Semi/Controls/MessageBox.axaml
index ad58ead..ae2e07a 100644
--- a/src/Ursa.Themes.Semi/Controls/MessageBox.axaml
+++ b/src/Ursa.Themes.Semi/Controls/MessageBox.axaml
@@ -248,7 +248,7 @@
-
+
diff --git a/src/Ursa.Themes.Semi/Controls/TimePicker.axaml b/src/Ursa.Themes.Semi/Controls/TimePicker.axaml
index 14c5b6b..b640b65 100644
--- a/src/Ursa.Themes.Semi/Controls/TimePicker.axaml
+++ b/src/Ursa.Themes.Semi/Controls/TimePicker.axaml
@@ -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"
diff --git a/src/Ursa.Themes.Semi/Controls/TimeRangePicker.axaml b/src/Ursa.Themes.Semi/Controls/TimeRangePicker.axaml
index b95972e..a114afe 100644
--- a/src/Ursa.Themes.Semi/Controls/TimeRangePicker.axaml
+++ b/src/Ursa.Themes.Semi/Controls/TimeRangePicker.axaml
@@ -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"
diff --git a/src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml b/src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml
index 23d2641..1e26764 100644
--- a/src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml
+++ b/src/Ursa.Themes.Semi/Controls/TreeComboBox.axaml
@@ -69,7 +69,7 @@
diff --git a/src/Ursa.Themes.Semi/Index.axaml b/src/Ursa.Themes.Semi/Index.axaml
index 92b8e18..f22145c 100644
--- a/src/Ursa.Themes.Semi/Index.axaml
+++ b/src/Ursa.Themes.Semi/Index.axaml
@@ -2,8 +2,8 @@
-
-
+
+
diff --git a/src/Ursa.Themes.Semi/Index.axaml.cs b/src/Ursa.Themes.Semi/Index.axaml.cs
index eec6fa7..9151917 100644
--- a/src/Ursa.Themes.Semi/Index.axaml.cs
+++ b/src/Ursa.Themes.Semi/Index.axaml.cs
@@ -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;
///
public class SemiTheme: Styles
{
- private static readonly Lazy> _localeToResource = new Lazy>(
- () => new Dictionary
+ private static readonly Lazy> _localeToResource = new Lazy>(
+ () => new Dictionary
{
- { 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))
{
diff --git a/src/Ursa.Themes.Semi/Locale/en-us.axaml b/src/Ursa.Themes.Semi/Locale/en-us.axaml
index 5f2389b..feb80a4 100644
--- a/src/Ursa.Themes.Semi/Locale/en-us.axaml
+++ b/src/Ursa.Themes.Semi/Locale/en-us.axaml
@@ -1,4 +1,5 @@
Bring to Front
diff --git a/src/Ursa.Themes.Semi/Locale/en-us.axaml.cs b/src/Ursa.Themes.Semi/Locale/en-us.axaml.cs
new file mode 100644
index 0000000..896620e
--- /dev/null
+++ b/src/Ursa.Themes.Semi/Locale/en-us.axaml.cs
@@ -0,0 +1,8 @@
+using Avalonia.Controls;
+
+namespace Ursa.Themes.Semi.Locale;
+
+public class en_us: ResourceDictionary
+{
+
+}
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Locale/zh-cn.axaml b/src/Ursa.Themes.Semi/Locale/zh-cn.axaml
index 94d2f9e..bd068cd 100644
--- a/src/Ursa.Themes.Semi/Locale/zh-cn.axaml
+++ b/src/Ursa.Themes.Semi/Locale/zh-cn.axaml
@@ -1,4 +1,5 @@
置于顶层
diff --git a/src/Ursa.Themes.Semi/Locale/zh-cn.axaml.cs b/src/Ursa.Themes.Semi/Locale/zh-cn.axaml.cs
new file mode 100644
index 0000000..7d5b9fc
--- /dev/null
+++ b/src/Ursa.Themes.Semi/Locale/zh-cn.axaml.cs
@@ -0,0 +1,8 @@
+using Avalonia.Controls;
+
+namespace Ursa.Themes.Semi.Locale;
+
+public class zh_cn: ResourceDictionary
+{
+
+}
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj b/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj
index 3b663c6..c950a66 100644
--- a/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj
+++ b/src/Ursa.Themes.Semi/Ursa.Themes.Semi.csproj
@@ -13,6 +13,7 @@
irihi.png
MIT
https://github.com/irihitech/Ursa.Avalonia
+ true
diff --git a/src/Ursa/Controls/ControlClassesInput/ControlClassesInput.cs b/src/Ursa/Controls/ControlClassesInput/ControlClassesInput.cs
index 78cf60d..a9251d9 100644
--- a/src/Ursa/Controls/ControlClassesInput/ControlClassesInput.cs
+++ b/src/Ursa/Controls/ControlClassesInput/ControlClassesInput.cs
@@ -39,7 +39,7 @@ public class ControlClassesInput: TemplatedControl
internal static readonly DirectProperty> TargetClassesProperty = AvaloniaProperty.RegisterDirect>(
nameof(TargetClasses), o => o.TargetClasses, (o, v) => o.TargetClasses = v);
- internal ObservableCollection TargetClasses
+ public ObservableCollection TargetClasses
{
get => _targetClasses;
set => SetAndRaise(TargetClassesProperty, ref _targetClasses, value);
diff --git a/src/Ursa/Controls/EnumSelector/EnumSelector.cs b/src/Ursa/Controls/EnumSelector/EnumSelector.cs
index 6c48970..2fb8733 100644
--- a/src/Ursa/Controls/EnumSelector/EnumSelector.cs
+++ b/src/Ursa/Controls/EnumSelector/EnumSelector.cs
@@ -64,7 +64,7 @@ public class EnumSelector: TemplatedControl
nameof(Values), o => o.Values);
private IList? _values;
- internal IList? Values
+ public IList? Values
{
get => _values;
private set => SetAndRaise(ValuesProperty, ref _values, value);
diff --git a/src/Ursa/Controls/NavMenu/NavMenuItem.cs b/src/Ursa/Controls/NavMenu/NavMenuItem.cs
index eed50bf..fc39aa7 100644
--- a/src/Ursa/Controls/NavMenu/NavMenuItem.cs
+++ b/src/Ursa/Controls/NavMenu/NavMenuItem.cs
@@ -124,7 +124,7 @@ public class NavMenuItem: HeaderedItemsControl
internal static readonly DirectProperty LevelProperty = AvaloniaProperty.RegisterDirect(
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);
diff --git a/src/Ursa/Controls/NumberDisplayer/NumberDisplayerBase.cs b/src/Ursa/Controls/NumberDisplayer/NumberDisplayerBase.cs
index 25e817d..b8b174b 100644
--- a/src/Ursa/Controls/NumberDisplayer/NumberDisplayerBase.cs
+++ b/src/Ursa/Controls/NumberDisplayer/NumberDisplayerBase.cs
@@ -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);
diff --git a/src/Ursa/Controls/VerificationCode/VerificationCode.cs b/src/Ursa/Controls/VerificationCode/VerificationCode.cs
index 0a82576..3fcfa46 100644
--- a/src/Ursa/Controls/VerificationCode/VerificationCode.cs
+++ b/src/Ursa/Controls/VerificationCode/VerificationCode.cs
@@ -59,13 +59,13 @@ public class VerificationCode: TemplatedControl
}
public static readonly DirectProperty> DigitsProperty = AvaloniaProperty.RegisterDirect>(
- nameof(Digits), o => o.Digits, (o, v) => o.Digits = v);
+ nameof(Digits), o => o.Digits);
private IList _digits = [];
- internal IList Digits
+ public IList Digits
{
get => _digits;
- set => SetAndRaise(DigitsProperty, ref _digits, value);
+ private set => SetAndRaise(DigitsProperty, ref _digits, value);
}
public static readonly RoutedEvent CompleteEvent =