1 Star 0 Fork 0

RMBGAME / MetroRadiance

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

MetroRadiance

Build status NuGet Downloads License

UI control libraries for create WPF window like Visual Studio 2012/2013/2015.

ss150730085651kd

Installation

Install NuGet package(s).

PM> Install-Package MetroRadiance

Features / How to use

MetroRadiance.Core

  • DPI / Per-Monitor DPI support
    • Get system DPI
    • Get monitor DPI from HwndSource or window handle
using MetroRadiance.Interop;
// 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
using MetroRadiance.Platform;
// 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
using MetroRadiance.Media;
// 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
<Window xmlns:chrome="http://schemes.grabacr.net/winfx/2014/chrome">
    <chrome:WindowChrome.Instance>
        <chrome:WindowChrome />
    </chrome:WindowChrome.Instance>
</Window>
  • Add any UI elements to window chrome
    • MetroRadiance.Chrome.WindowChrome.Top / .Left / .Right / .Bottom
<Window xmlns:chrome="http://schemes.grabacr.net/winfx/2014/chrome">
    <chrome:WindowChrome.Instance>
        <chrome:WindowChrome>
            <chrome:WindowChrome.Top>
                <Border Background="DarkRed"
                        Padding="24,3"
                        Margin="8,0"
                        HorizontalAlignment="Right">
                    <TextBlock Text="any UI elements"
                               Foreground="White" />
                </Border>
            </chrome:WindowChrome.Top>
        </chrome:WindowChrome>
    </chrome:WindowChrome.Instance>
</Window>

ss160128005316ls

MetroRadiance

  • Theme support
// 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).

The MIT License (MIT) Copyright (c) 2014 Manato KAMEYA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Modern WPF Themes (like Visual Studio 2012 or later). 展开 收起
C#
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/rmbgame/MetroRadiance.git
git@gitee.com:rmbgame/MetroRadiance.git
rmbgame
MetroRadiance
MetroRadiance
master

搜索帮助