diff --git a/src/CommunityToolkit.Maui/Converters/IsInRangeConverter.shared.cs b/src/CommunityToolkit.Maui/Converters/IsInRangeConverter.shared.cs index d2e47057d..57acb1a9d 100644 --- a/src/CommunityToolkit.Maui/Converters/IsInRangeConverter.shared.cs +++ b/src/CommunityToolkit.Maui/Converters/IsInRangeConverter.shared.cs @@ -10,20 +10,56 @@ public sealed class IsInRangeConverter : IsInRangeConverter /// Converts the incoming value to a indicating whether or not the value is within a range. public abstract class IsInRangeConverter : BaseConverterOneWay { + /// + /// Bindable property for + /// + public static readonly BindableProperty MinValueProperty = BindableProperty.Create(nameof(MinValue), typeof(IComparable), typeof(IsInRangeConverter)); + + /// + /// Bindable property for + /// + public static readonly BindableProperty MaxValueProperty = BindableProperty.Create(nameof(MaxValue), typeof(IComparable), typeof(IsInRangeConverter)); + + /// + /// Bindable property for + /// + public static readonly BindableProperty TrueObjectProperty = BindableProperty.Create(nameof(TrueObject), typeof(TObject?), typeof(IsInRangeConverter)); + + /// + /// Bindable property for + /// + public static readonly BindableProperty FalseObjectProperty = BindableProperty.Create(nameof(FalseObject), typeof(TObject?), typeof(IsInRangeConverter)); + /// public override object DefaultConvertReturnValue { get; set; } = new(); /// Minimum value. - public IComparable? MinValue { get; set; } + public IComparable? MinValue + { + get => (IComparable?)GetValue(MinValueProperty); + set => SetValue(MinValueProperty, value); + } /// Maximum value. - public IComparable? MaxValue { get; set; } + public IComparable? MaxValue + { + get => (IComparable?)GetValue(MaxValueProperty); + set => SetValue(MaxValueProperty, value); + } /// The object that corresponds to True value. - public TObject? TrueObject { get; set; } + public TObject? TrueObject + { + get => (TObject?)GetValue(TrueObjectProperty); + set => SetValue(TrueObjectProperty, value); + } /// The object that corresponds to False value. - public TObject? FalseObject { get; set; } + public TObject? FalseObject + { + get => (TObject?)GetValue(FalseObjectProperty); + set => SetValue(FalseObjectProperty, value); + } /// Converts an object that implemented IComparable to a based on the object being within a and range. /// The value to convert. diff --git a/src/CommunityToolkit.Maui/Extensions/ValueConverterExtension.shared.cs b/src/CommunityToolkit.Maui/Extensions/ValueConverterExtension.shared.cs index b0566fb9c..5533baabf 100644 --- a/src/CommunityToolkit.Maui/Extensions/ValueConverterExtension.shared.cs +++ b/src/CommunityToolkit.Maui/Extensions/ValueConverterExtension.shared.cs @@ -4,7 +4,7 @@ namespace CommunityToolkit.Maui.Extensions; /// -public abstract class ValueConverterExtension : IMarkupExtension +public abstract class ValueConverterExtension : BindableObject, IMarkupExtension { /// public ICommunityToolkitValueConverter ProvideValue(IServiceProvider serviceProvider)