Browse Source

StringFormatConverter -> StringFormatValueConverter

pull/1684/head
Steven Kirk 8 years ago
parent
commit
6a14747eb6
  1. 4
      src/Avalonia.Base/Data/Converters/StringFormatValueConverter.cs
  2. 2
      src/Markup/Avalonia.Markup/Data/Binding.cs
  3. 4
      tests/Avalonia.Markup.UnitTests/Data/BindingTests_Converters.cs

4
src/Avalonia.Base/Data/Converters/StringFormatConverter.cs → src/Avalonia.Base/Data/Converters/StringFormatValueConverter.cs

@ -3,9 +3,9 @@ using System.Globalization;
namespace Avalonia.Data.Converters
{
public class StringFormatConverter : IValueConverter
public class StringFormatValueConverter : IValueConverter
{
public StringFormatConverter(string format, IValueConverter inner)
public StringFormatValueConverter(string format, IValueConverter inner)
{
Contract.Requires<ArgumentNullException>(format != null);

2
src/Markup/Avalonia.Markup/Data/Binding.cs

@ -172,7 +172,7 @@ namespace Avalonia.Data
if (!string.IsNullOrWhiteSpace(StringFormat) &&
(targetType == typeof(string) || targetType == typeof(object)))
{
converter = new StringFormatConverter(StringFormat, converter);
converter = new StringFormatValueConverter(StringFormat, converter);
}
var subject = new BindingExpression(

4
tests/Avalonia.Markup.UnitTests/Data/BindingTests_Converters.cs

@ -51,7 +51,7 @@ namespace Avalonia.Markup.UnitTests.Data
textBlock,
TextBlock.TextProperty).Observable;
Assert.IsType<StringFormatConverter>(expressionObserver.Converter);
Assert.IsType<StringFormatValueConverter>(expressionObserver.Converter);
}
}
@ -74,7 +74,7 @@ namespace Avalonia.Markup.UnitTests.Data
textBlock,
TextBlock.TagProperty).Observable;
Assert.IsType<StringFormatConverter>(expressionObserver.Converter);
Assert.IsType<StringFormatValueConverter>(expressionObserver.Converter);
}
}

Loading…
Cancel
Save