更新整理
This commit is contained in:
@@ -6,7 +6,7 @@ using System.Windows.Data;
|
||||
|
||||
namespace WPFluent.Converters;
|
||||
|
||||
public class StringToColorConverter : IValueConverter
|
||||
internal class StringToColorConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{ return value.ToString(); }
|
||||
@@ -15,7 +15,7 @@ public class StringToColorConverter : IValueConverter
|
||||
{
|
||||
string str = value.ToString();
|
||||
Regex regex = new Regex("^#(?:[0-9a-fA-F]{3}){1,2}$");
|
||||
if(regex.IsMatch(str))
|
||||
if (regex.IsMatch(str))
|
||||
{
|
||||
var color = ColorConverter.ConvertFromString(str);
|
||||
return color;
|
||||
|
||||
Reference in New Issue
Block a user