# MetroRadiance
**Repository Path**: rmbgame/MetroRadiance
## Basic Information
- **Project Name**: MetroRadiance
- **Description**: Modern WPF Themes (like Visual Studio 2012 or later).
- **Primary Language**: C#
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2021-03-15
- **Last Updated**: 2021-03-15
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# MetroRadiance
[](https://ci.appveyor.com/project/Grabacr07/MetroRadiance)
[](https://www.nuget.org/packages/MetroRadiance.Core/)
[](https://www.nuget.org/packages/MetroRadiance.Core/)
[](https://github.com/Grabacr07/MetroRadiance/blob/master/LICENSE.txt)
UI control libraries for create WPF window like Visual Studio 2012/2013/2015.

## Installation
Install NuGet package(s).
```powershell
PM> Install-Package MetroRadiance
```
* [MetroRadiance.Core](https://www.nuget.org/packages/MetroRadiance.Core/) - MetroRadiance core library.
* [MetroRadiance.Chrome](https://www.nuget.org/packages/MetroRadiance.Chrome/) - Chrome library for WPF Window.
* [MetroRadiance](https://www.nuget.org/packages/MetroRadiance/) - WPF custom control library.
## Features / How to use
### MetroRadiance.Core
* DPI / Per-Monitor DPI support
- Get system DPI
- Get monitor DPI from HwndSource or window handle
```csharp
using MetroRadiance.Interop;
```
```csharp
// Get system dpi
var systemDpi = window.GetSystemDpi();
if (PerMonitorDpi.IsSupported)
{
// Get monitor dpi.
var hwndSource = (HwndSource)PresentationSource.FromVisual(this);
var monitorDpi = hwndSource.GetDpi();
}
```
* Windows theme support
- Get Windows theme (Light or Dark, only Windows 10)
- Get Windows accent color
- Subscribe color change event from Windows
```csharp
using MetroRadiance.Platform;
```
```csharp
// Get Windows accent color
var color = WindowsTheme.GetAccentColor();
// Subscribe accent color change event from Windows theme.
var disposable = WindowsTheme.RegisterAccentColorListener(color =>
{
// apply color to your app.
});
// Unsubscribe color change event.
disposable.Dispose();
```
* HSV color model support
```csharp
using MetroRadiance.Media;
```
```csharp
// Get Windows accent color (using MetroRadiance.Platform;)
var rgbColor = WindowsTheme.GetAccentColor();
// Convert from RGB to HSV color.
var hsvColor = rgbColor.ToHsv();
hsvColor.V *= 0.8;
// Convert from HSV to RGB color.
var newColor = hsvColor.ToRgb();
```
### MetroRadiance.Chrome
* Add window chrome like Visual Studio to WPF Window
- `MetroRadiance.Chrome.WindowChrome`
```XAML
```
* Add any UI elements to window chrome
- `MetroRadiance.Chrome.WindowChrome.Top` / `.Left` / `.Right` / `.Bottom`
```XAML
```

### MetroRadiance
* Theme support
```csharp
// Change theme.
ThemeService.Current.ChangeTheme(Theme.Dark);
// Change theme (sync Windows)
ThemeService.Current.ChangeTheme(Theme.Windows);
// Change Accent
ThemeService.Current.ChangeAccent(Accent.Blue);
// Change accent (sync Windows)
ThemeService.Current.ChangeAccent(Accent.Windows);
// Change accent (from RGB Color)
var accent = Colors.Red.ToAccent();
ThemeService.Current.ChangeAccent(accent);
```
* Custom controls
* Custom behaviors
* Custom converters
## License
This library is under [the MIT License (MIT)](LICENSE.txt).