KsWare.Presentation.Resources.Core 0.1.9

dotnet add package KsWare.Presentation.Resources.Core --version 0.1.9                
NuGet\Install-Package KsWare.Presentation.Resources.Core -Version 0.1.9                
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="KsWare.Presentation.Resources.Core" Version="0.1.9" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KsWare.Presentation.Resources.Core --version 0.1.9                
#r "nuget: KsWare.Presentation.Resources.Core, 0.1.9"                
#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.
// Install KsWare.Presentation.Resources.Core as a Cake Addin
#addin nuget:?package=KsWare.Presentation.Resources.Core&version=0.1.9

// Install KsWare.Presentation.Resources.Core as a Cake Tool
#tool nuget:?package=KsWare.Presentation.Resources.Core&version=0.1.9                

KsWare.Presentation.Resources.Core

Extended ResourceDictionaries

Name Fuction
CoreResourceDictionary A base class which extens the ResourceDictionary class
ResourceDictionaryEx A feature-rich ResourceDictionary
ThemeResourceDictionary Root for theme resources
SharedResourceDictionary Reuseable resources
PlaceholderResourceDictionary A placeholder
SourceResourceDictionary The root für XAML resources
MergedResourceDictionary The root for merged resources
LookupResourceDictionary Lookups for an other ResourceDictionary defined as resource
FlatResourceDictionary Flattens all contained resources into one ResourceDictionary
OverrideDefaultStylesResourceDictionary Generates Styles

designed to:

  • create maintainable structured themes
  • avoid DynamicResource references
  • fixes few issues from ResourceDictionary

Usage

<SourceResourceDictionary
  <ResourceDictionary.MergedDictionary>
    
    <SharedResourceDictionary Source="shared.xaml

    
    <MergedResourceDictionary Name="Brushes">
        <SolidColorBrush x:Key="Acme.Control.Border" Color="Gree"/>
        ...
    </MergedResourceDictionary>

    
    <LookupResourceDictionary ResourceKey="Acme.Brushes.Overides"/>
    
    
    <MergedResourceDictionary Name="Styles">
      <Style x:Key="Acme.ControlStyle" TargetType="Control">
         ...
      </Style>
    </MergedResourceDictionary

    
    <OverrideDefaultStylesResourceDictionary>
      
      <Style TargetType="Control" BasedOn="{StaticResource Acme.ControlStyle}"/>
    </OverrideDefaultStylesResourceDictionary>

  </ResourceDictionary.MergedDictionary>
</SourceResourceDictionary>

ThemeLoader

A loader for themes.
You can load any resource dictionary. RegisterTheme is otional.

App.xaml.cs / App.xaml

public partial class App : Application {
    public App() {
        // optional
        ThemeLoader.RegisterTheme("Aero2Dark.NormalColor", "/KsWare.Presentation.Themes.Aero2Dark;component/Resources/Aero2Dark.NormalColor.xaml");
        ThemeLoader.RegisterTheme("Aero2Dark","Aero2Dark.NormalColor") // alias
        ThemeLoader.RegisterTheme("Aero", "/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml");
    }
<Application 
	...
	ThemeLoader.Source="/KsWare.Presentation.Themes.Aero2Dark;component/Resources/Aero2Dark.NormalColor.xaml"
>

MainWindow.cs / MainWindow.xaml.cs

public MainWindow() {
    // optional
    ThemeLoader.RegisterTheme("Aero2Dark.NormalColor", "/KsWare.Presentation.Themes.Aero2Dark;component/Resources/Aero2Dark.NormalColor.xaml");
    ThemeLoader.RegisterTheme("Aero2Dark","Aero2Dark.NormalColor") // alias
    ThemeLoader.RegisterTheme("Aero", "/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml");

	InitializeComponent();
}
<Window 
  ...
  ThemeLoader.Source="Aero2Dark" >
  
  <Grid ThemeLoader.Source="Aero">
     
  </Grid>
  <Grid ThemeLoader.Source="/PresentationFramework.Luna;component/themes/Luna.Metallic.xaml">
     
  </Grid>
</Window>

License

© 2024 by KsWare. All rights reserved.
Licensed under KsWare Open Commercial License.

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.  net8.0-windows7.0 is compatible. 
.NET Framework net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.6.2

  • .NETFramework 4.8

    • No dependencies.
  • net6.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on KsWare.Presentation.Resources.Core:

Package Downloads
KsWare.Presentation.Themes.Aero2Dark

A dark theme based on Aero2

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.9 77 9/16/2024
0.1.8 73 9/13/2024
0.1.6 53 9/13/2024
0.1.5 60 9/13/2024