3 changed files with 35 additions and 1 deletions
@ -0,0 +1,33 @@ |
|||
// Copyright (c) The Perspex Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System; |
|||
using System.Globalization; |
|||
using OmniXaml.TypeConversion; |
|||
using Perspex.Media; |
|||
|
|||
namespace Perspex.Markup.Xaml.Converters |
|||
{ |
|||
public class SolidColorBrushTypeConverter : ITypeConverter |
|||
{ |
|||
public bool CanConvertFrom(ITypeConverterContext context, Type sourceType) |
|||
{ |
|||
return sourceType == typeof(string); |
|||
} |
|||
|
|||
public bool CanConvertTo(ITypeConverterContext context, Type destinationType) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
public object ConvertFrom(ITypeConverterContext context, CultureInfo culture, object value) |
|||
{ |
|||
return Brush.Parse((string)value); |
|||
} |
|||
|
|||
public object ConvertTo(ITypeConverterContext context, CultureInfo culture, object value, Type destinationType) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
} |
|||
} |
|||
@ -1 +1 @@ |
|||
Subproject commit 27005c8b4d41f2a6d3b85da7eb6ed994b57e0138 |
|||
Subproject commit e1a5fb60b09862183ba5c48c36a52bea7a66bd42 |
|||
Loading…
Reference in new issue