Anarchie.Themes 2.0.4

dotnet add package Anarchie.Themes --version 2.0.4
                    
NuGet\Install-Package Anarchie.Themes -Version 2.0.4
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Anarchie.Themes" Version="2.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Anarchie.Themes" Version="2.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Anarchie.Themes" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Anarchie.Themes --version 2.0.4
                    
#r "nuget: Anarchie.Themes, 2.0.4"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Anarchie.Themes@2.0.4
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Anarchie.Themes&version=2.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Anarchie.Themes&version=2.0.4
                    
Install as a Cake Tool

Themes

About

A library for easily(ish) created themes in Windows Forms .NET to allow you to easily change colours of lots of controls

This package requires .NET 6, and can only be used on Windows version 7 or greater

Usage: Github wiki

Getting started:

Replace

internal partial class Form1 : Form

With

internal partial class Form1 : ThemeableForm<Theme>

Theme is the implementation of the Theme class used for this form. If you want to define your own schema for a theme, put that class inside the <>. You can see how to create a new schema here

ThemeableButton myButton = new();
myButton.ThemeBackColor = () => CurrentTheme.PrimaryColor;
myButton.ThemeForeColor = () => CurrentTheme.SecondaryColor;
myButton.ThemeImage = () => CurrentTheme.someImage;

myButton.Click += (sender, e) =>
{
    if (CurrentTheme == Themes.Dark)
        CurrentTheme = Themes.Light;
    else
        CurrentTheme = Themes.Dark;
};
this.Controls.Add(myButton);

Creates a ThemeableButton that swaps the theme between light and dark. When the Theme changes, the colours and image of the button will also update. This code is inside the Form1 class.

Themes is a class defined by the project using the Themes library, which contains instances of the Theme used for this form

Contributing

Created by anarchie347

Issue tracker: Github issue tracker

Contribute on Github

Credits

Icon: Photo by RhondaK Native Florida Folk Artist on Unsplash

Product Compatible and additional computed target framework versions.
.NET net6.0-windows7.0 is compatible.  net7.0-windows was computed.  net8.0-windows was computed.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0-windows7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.4 398 5/15/2023
2.0.3 333 4/25/2023
2.0.2 325 4/25/2023
2.0.1 312 4/24/2023
2.0.0 277 4/24/2023
1.1.0 333 4/22/2023
1.0.0.2 312 4/15/2023
1.0.0.1 322 4/15/2023
1.0.0 331 4/14/2023

Readme now uses formatted code blocks