99 lines
2.6 KiB
Markdown
99 lines
2.6 KiB
Markdown
# Ursa
|
|
|
|
<p align="center">
|
|
<img src="./assets/Ursa.svg" alt="drawing" width="150" />
|
|
</p>
|
|
|
|
[](https://www.nuget.org/packages/Irihi.Ursa/)
|
|
[](https://www.nuget.org/packages/Irihi.Ursa/)
|
|
|
|
Ursa is a UI library for building cross-platform UIs with Avalonia UI.
|
|
|
|

|
|
|
|
## How to use
|
|
1. Ursa
|
|
|
|
Add nuget package:
|
|
```bash
|
|
dotnet add package Irihi.Ursa
|
|
```
|
|
|
|
2. Ursa.Themes.Semi
|
|
|
|
To make Ursa controls show up in your application, you need to reference to a theme package designed for Ursa.
|
|
Ursa.Themes.Semi is a theme package for Ursa inspired by Semi Design. You can add it to your project by following steps.
|
|
|
|
Add nuget package:
|
|
```bash
|
|
dotnet add package Semi.Avalonia
|
|
dotnet add package Irihi.Ursa.Themes.Semi
|
|
```
|
|
|
|
Include Styles in application:
|
|
```xaml
|
|
<Application...
|
|
xmlns:semi="https://irihi.tech/semi"
|
|
xmlns:u-semi="https://irihi.tech/ursa/themes/semi"
|
|
....>
|
|
|
|
<Application.Styles>
|
|
<semi:SemiTheme Locale="zh-CN" />
|
|
<u-semi:SemiTheme Locale="zh-CN"/>
|
|
</Application.Styles>
|
|
```
|
|
|
|
|
|
You can now use Ursa controls in your Avalonia Application.
|
|
```xaml
|
|
<Window
|
|
...
|
|
xmlns:u="https://irihi.tech/ursa"
|
|
...>
|
|
<StackPanel Margin="20">
|
|
<u:ButtonGroup Classes="Solid Warning">
|
|
<Button Content="Hello" />
|
|
<Button Content="World" />
|
|
</u:ButtonGroup>
|
|
<u:TagInput />
|
|
</StackPanel>
|
|
</Window>
|
|
```
|
|
|
|

|
|
|
|
## Compatibility Notice
|
|
Ursa currently is compatible with both Avalonia 11.1.x and 11.2.x, but specifically does not support Avalonia 11.2.0.
|
|
|
|
## Extensions
|
|
|
|
### Prism Extension
|
|
If you need to integrate Ursa with Prism.Avalonia, you can use the Irihi.Ursa.PrismExtension package. This package provide Dialog related services to utilize Ursa Dialogs with Prism flavor.
|
|
|
|
### ReactiveUI Extension
|
|
If need to integrate Ursa with Avalonia.ReactiveUI, you can use the Irihi.Ursa.ReactiveUIExtension package. This package implements the ReactiveUI versions of UrsaWindow and UrsaView.
|
|
|
|
You just need to replace ReactiveWindow or ReactiveUserControl with ReactiveUrsaWindow or ReactiveUrsaView.
|
|
|
|
```xaml
|
|
<u:ReactiveUrsaWindow
|
|
...
|
|
xmlns:u="https://irihi.tech/ursa"
|
|
x:TypeArguments="TViewModel"
|
|
...>
|
|
...
|
|
</u:ReactiveUrsaWindow>
|
|
```
|
|
```csharp
|
|
public partial class WindowHome : ReactiveUrsaWindow<TViewModel>
|
|
{
|
|
|
|
}
|
|
```
|
|
|
|
## Support
|
|
|
|
We offer limited free community support for Semi Avalonia and Ursa. Please join our group via FeiShu(Lark)
|
|
|
|

|