123456789101112131415161718192021222324252627282930313233343536 |
- ///////////////////////////////////////////////////////////////////////////////
- //Copyright (c) 2015, 北京探索者软件公司
- //All rights reserved.
- //文件名称:
- //文件描述: 颜色显示字符转换 分开显示█RGB 000 255 255
- //创 建 者: mxg
- //创建日期: 2016-03-29
- //版 本 号:1.0.0.0
- ////////////////////////////////////////////////////////////////////////////////
- using System;
- using System.Globalization;
- using System.Windows.Data;
- namespace FWindSoft.Wpf
- {
- public class ColorStringConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- var inputString = value as string;
- if (string.IsNullOrWhiteSpace(inputString)) return "";
- var outString = inputString.Substring(1);
- return outString;
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- var inputString = value as string;
- if (string.IsNullOrWhiteSpace(inputString)) return "";
- var outString = "█" + inputString;
- return outString;
- }
- }
- }
|