Skip to content

russkyc/modern-controls-wpf

Repository files navigation

ModernControls.WPF

Nuget

Russkyc.ModernControls.WPF is an easy to use and highly customizable modern control library for wpf

What sets this apart from the default WPF controls?

The default wpf control library is awesome when it comes to ui customization, but theres only one problem --you need to write a handful of style setters, dependency properties, and triggers to have a truly customized control. Which is why Russkyc.ModernControls.WPF is created. It saves you from having to write all of the style, templates, and triggers by providing controls that are highly customizable all using properties. Perfect for quick and easy UI Development.


image


Setup

Add This Reference to App.xaml

xmlns:russkyc="clr-namespace:org.russkyc.moderncontrols.Styles;assembly=Russkyc.ModernControls.WPF"

Add the Resource and set default theme in App.xaml

    <Application.Resources>
        <!--  ModernControls WPF  -->
        <styles:ModernControlsWpf BaseTheme="Dark" ColorTheme="Green" />
    </Application.Resources>

Add the following to your window

xmlns:russkyc="clr-namespace:org.russkyc.moderncontrols;assembly=Russkyc.ModernControls.WPF"

Sample Usage

<russkyc:ModernButton Width="70" Text="Modern Button" />

A Taste of ModernControls Customization

<russkyc:ModernButton Width="70"
                             CornerRadius="5"
                             FontWeight="SemiBold"
                             HoverBackground="#3d88ff"
                             HoverForeground="#7BFFA3" 
                             PressedBackground="#1F5ABD"
                             PressedForeground="#FFBE46"
                             Text="Modern Button" />

Control Library

  • ModernWindow - New! in 1.5.0
  • ModernTextBox - Updated! in 1.5.0
  • ModernButton
  • ModernToggleButton
  • ModernRadio
  • ModernSwitch - New! in 1.5.0
  • ModernRadioButton
  • ModernComboBox - Updated! in 1.5.0

Global Theme Management

image

Using the Theme Manager

Breaking Changes in 1.5.2

  • ThemeManager is now uses Instance
  • There are now 2 Theme resources. Base Theme corresponds to the overall base(dark/light) and ColorTheme corresponds to the theme colors (blue/red/etc.)
  • Default Base Themes are now located in pack://application:,,,/Russkyc.ModernControls.WPF;component/Themes/BaseTheme/
  • Color Themes are in pack://application:,,,/Russkyc.ModernControls.WPF;component/Themes/ColorThemes/

Imports

using org.russkyc.moderncontrols.Helpers;

Adding Base or Color Themes

ThemeManager.Instance.AddBaseTheme("Light","pack://application:,,,/Russkyc.ModernControls.WPF;component/Themes/BaseTheme/DefaultLight.xaml");
ThemeManager.Instance.AddColorTheme("Blue","pack://application:,,,/Russkyc.ModernControls.WPF;component/Themes/ColorThemes/Blue.xaml");

Changing Base or Color Themes (Live)

ThemeManager.Instance.SetBaseTheme(Dark);
ThemeManager.Instance.SetColorTheme(Blue);

Get List of Base or Color Themes (names)

ThemeManager.Instance.GetBaseThemes();
ThemeManager.Instance.GetColorThemes();

Removing Base or Color Themes

ThemeManager.Instance.RemoveBaseTheme(Light);
ThemeManager.Instance.RemoveColorTheme(Blue);

Default Color Themes

Base Themes:

  • Light
  • Dark

Color Themes:

  • Blue
  • Gray
  • Green
  • Lime
  • Orange
  • Pink
  • Purple
  • Red
  • Teal
  • Yellow

Documentation, API References, and More

Head over to the Wiki


Sponsors

Special thanks to JetBrains for supporting this project by providing licences to the JetBrains Suite!

JetBrains Logo (Main) logo.