Skip to content

A basic example of a WPF app with gradient visuals. Used by me as a template for future projects

License

Notifications You must be signed in to change notification settings

jonteohr/GradientThemeWPF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GradientThemeWPF Build Status

NOTE: This project is currently under development and is not yet complete. Pre-releases are available for download, but they are not stability tested and should not be used in production.

A WPF theme library with modern and smooth-looking gradient colors. A base foundation for a modern-looking UI!

Installation

Use NuGet to acquire the library to your project:

.Net CLI:

dotnet add package GradientThemeWPF

Package Manager

NuGet\Install-Package GradientThemeWPF

Usage

Styles

To use the styles in your own project, make sure to import the correct styles in your App.xaml:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/GradientTheme;component/Theme/Colors.xaml" />
            <ResourceDictionary Source="pack://application:,,,/GradientTheme;component/Theme/Controls.xaml" />
            <ResourceDictionary Source="pack://application:,,,/GradientTheme;component/Theme/Window.xaml" />
            <ResourceDictionary Source="pack://application:,,,/GradientTheme;component/Theme/ControlColors.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

Later in the window you want to be gradient colored, add the style GradientWindow to the window.

Example of styles for each control is available in the example project.

Controls

In order to use the custom controls you need to import the "namespace" in the window header, which is quite simple:

xmlns:controls="clr-namespace:GradientTheme.Controls;assembly=GradientTheme"

Later on the controls can be instantiated by prefixing <controls:, for example:

<controls:TyperLabel Style="{DynamicResource TitleStyle}" >
    <!-- Important that we supply at least one title, if not we will crash! -->
    <controls:TyperLabel.Titles>
        <x:Array Type="{x:Type sys:String}">
            <sys:String>One Title</sys:String>
            <sys:String>Another Title</sys:String>
            <sys:String>Great Title</sys:String>
        </x:Array>
    </controls:TyperLabel.Titles>
</controls:TyperLabel>

About

A basic example of a WPF app with gradient visuals. Used by me as a template for future projects

Topics

Resources

License

Stars

Watchers

Forks

Languages