Skip to content

PrimeEagle/Citrus.Avalonia-v2

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status netstandard nuget downloads License Size

Citrus

Avalonia experimental theme.

What's Different from the Base Repository?

This v2 fork is updated to work with Avalonia 11.0.5 and supports embedded (pre-made) themes, just like the original, but also dynamic themes that can be loaded at runtime. It also supports asynchronous code for loading and changing themes.

Getting Started

The easiest way to get started is to install the library as a NuGet package:

Install-Package Citrus.Avalonia
# Or 'dotnet add package Citrus.Avalonia'

Then, reference the preffered theme from your App.xaml file:

<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Class="YourNamespace.App">
  <Application.Styles>
    <!-- The line below is the only thing you need to get started.
         Tested with Avalonia 0.9.0 only, although not with all controls. -->
    <StyleInclude Source="avares://Citrus.Avalonia/Citrus.xaml"/>

    <!-- To use other themes:
         1. Comment out *all* of the <StyleInclude /> lines.
         2. Uncomment *one* of the <StyleInclude /> lines below. -->
    <!-- <StyleInclude Source="avares://Citrus.Avalonia/Sea.xaml"/> -->
    <!-- <StyleInclude Source="avares://Citrus.Avalonia/Rust.xaml"/> -->
    <!-- <StyleInclude Source="avares://Citrus.Avalonia/Candy.xaml"/> -->
    <!-- <StyleInclude Source="avares://Citrus.Avalonia/Magma.xaml"/> -->
  </Application.Styles>
</Application>

Done! Now the templates of all default controls are updated. See the sandbox project for more examples. See StyleManager.cs to learn how to change color scheme at runtime.

Getting Started without NuGet

Another way to get started is to add this repo as a submodule to your existing git repository:

mkdir ./external
git submodule add git@github.com:worldbeater/Citrus.Avalonia.git ./external/citrus
# Reference the ../external/citrus/src/Citrus.Avalonia/Citrus.Avalonia.csproj project then.
# The ../external/citrus/src/Citrus.Avalonia.Sandbox/Citrus.Avalonia.Sandbox.csproj is 
# the sandbox where you can browse the markup samples.

Technologies and Tools Used

About

Modern styles for Avalonia controls.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%