Browse Source
Add support for ConverterParameter to MultiBinding
pull/2385/head
OronDF343
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
7 additions and
2 deletions
-
src/Markup/Avalonia.Markup/Data/MultiBinding.cs
|
|
|
@ -23,10 +23,15 @@ namespace Avalonia.Data |
|
|
|
public IList<IBinding> Bindings { get; set; } = new List<IBinding>(); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the <see cref="IValueConverter"/> to use.
|
|
|
|
/// Gets or sets the <see cref="IMultiValueConverter"/> to use.
|
|
|
|
/// </summary>
|
|
|
|
public IMultiValueConverter Converter { get; set; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets a parameter to pass to <see cref="Converter"/>.
|
|
|
|
/// </summary>
|
|
|
|
public object ConverterParameter { get; set; } |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets or sets the value to use when the binding is unable to produce a value.
|
|
|
|
/// </summary>
|
|
|
|
@ -79,7 +84,7 @@ namespace Avalonia.Data |
|
|
|
|
|
|
|
private object ConvertValue(IList<object> values, Type targetType) |
|
|
|
{ |
|
|
|
var converted = Converter.Convert(values, targetType, null, CultureInfo.CurrentCulture); |
|
|
|
var converted = Converter.Convert(values, targetType, ConverterParameter, CultureInfo.CurrentCulture); |
|
|
|
|
|
|
|
if (converted == AvaloniaProperty.UnsetValue && FallbackValue != null) |
|
|
|
{ |
|
|
|
|