跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

浏览文件

HextoColorConverter.cs

29 行 · 814 B历史下载
1using System;
2using System.Collections.Generic;
3using System.Globalization;
4using System.Linq;
5using System.Text;
6using System.Threading.Tasks;
7using System.Windows.Data;
8using System.Windows.Media;
9
10namespace UI.Controls.Converters
11{
12 [ValueConversion(typeof(string), typeof(Brush))]
13 public class HextoColorConverter : IValueConverter
14 {
15 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
16 {
17 if(value == null)
18 {
19 return null;
20 }
21 return UI.Base.Color.Colors.GetFromString(value.ToString());
22 }
23
24 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
25 {
26 throw new NotImplementedException();
27 }
28 }
29}