diff options
author | Stephane Delcroix <stephane@delcroix.org> | 2016-12-23 08:50:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-23 08:50:19 +0100 |
commit | b96df000db76ba3490589c37e93224271249bc88 (patch) | |
tree | 6389cd652ebe395b51829ee2ec1d41d285ed2fab /Xamarin.Forms.Core | |
parent | 2c91b0facd2a25d0de9a283b44cf818329d4c06f (diff) | |
download | xamarin-forms-b96df000db76ba3490589c37e93224271249bc88.tar.gz xamarin-forms-b96df000db76ba3490589c37e93224271249bc88.tar.bz2 xamarin-forms-b96df000db76ba3490589c37e93224271249bc88.zip |
[Xaml] support short Properties for PropertyCondition (#645)
Diffstat (limited to 'Xamarin.Forms.Core')
4 files changed, 7 insertions, 5 deletions
diff --git a/Xamarin.Forms.Core/BindablePropertyConverter.cs b/Xamarin.Forms.Core/BindablePropertyConverter.cs index a7398e08..08201b01 100644 --- a/Xamarin.Forms.Core/BindablePropertyConverter.cs +++ b/Xamarin.Forms.Core/BindablePropertyConverter.cs @@ -50,6 +50,8 @@ namespace Xamarin.Forms } else if (parentValuesProvider.TargetObject is Trigger) type = (parentValuesProvider.TargetObject as Trigger).TargetType; + else if (parentValuesProvider.TargetObject is PropertyCondition && (parent as TriggerBase) != null) + type = (parent as TriggerBase).TargetType; if (type == null) throw new XamlParseException($"Can't resolve {parts [0]}", lineinfo); diff --git a/Xamarin.Forms.Core/IValueConverterProvider.cs b/Xamarin.Forms.Core/IValueConverterProvider.cs index 1221ce74..b8c684c6 100644 --- a/Xamarin.Forms.Core/IValueConverterProvider.cs +++ b/Xamarin.Forms.Core/IValueConverterProvider.cs @@ -3,7 +3,7 @@ using System.Reflection; namespace Xamarin.Forms.Xaml { - internal interface IValueConverterProvider + interface IValueConverterProvider { object Convert(object value, Type toType, Func<MemberInfo> minfoRetriever, IServiceProvider serviceProvider); } diff --git a/Xamarin.Forms.Core/Interactivity/BindingCondition.cs b/Xamarin.Forms.Core/Interactivity/BindingCondition.cs index 88b7cf36..1d111850 100644 --- a/Xamarin.Forms.Core/Interactivity/BindingCondition.cs +++ b/Xamarin.Forms.Core/Interactivity/BindingCondition.cs @@ -12,7 +12,7 @@ namespace Xamarin.Forms public BindingCondition() { - _boundProperty = BindableProperty.CreateAttached("Bound", typeof(object), typeof(DataTrigger), null, propertyChanged: OnBoundPropertyChanged); + _boundProperty = BindableProperty.CreateAttached("Bound", typeof(object), typeof(BindingCondition), null, propertyChanged: OnBoundPropertyChanged); } public BindingBase Binding @@ -23,7 +23,7 @@ namespace Xamarin.Forms if (_binding == value) return; if (IsSealed) - throw new InvalidOperationException("Can not change Binding once the Trigger has been applied."); + throw new InvalidOperationException("Can not change Binding once the Condition has been applied."); _binding = value; } } @@ -36,7 +36,7 @@ namespace Xamarin.Forms if (_triggerValue == value) return; if (IsSealed) - throw new InvalidOperationException("Can not change Value once the Trigger has been applied."); + throw new InvalidOperationException("Can not change Value once the Condition has been applied."); _triggerValue = value; } } diff --git a/Xamarin.Forms.Core/Interactivity/MultiCondition.cs b/Xamarin.Forms.Core/Interactivity/MultiCondition.cs index 23ca41c5..1a80190a 100644 --- a/Xamarin.Forms.Core/Interactivity/MultiCondition.cs +++ b/Xamarin.Forms.Core/Interactivity/MultiCondition.cs @@ -8,7 +8,7 @@ namespace Xamarin.Forms public MultiCondition() { - _aggregatedStateProperty = BindableProperty.CreateAttached("AggregatedState", typeof(bool), typeof(DataTrigger), false, propertyChanged: OnAggregatedStatePropertyChanged); + _aggregatedStateProperty = BindableProperty.CreateAttached("AggregatedState", typeof(bool), typeof(MultiCondition), false, propertyChanged: OnAggregatedStatePropertyChanged); Conditions = new TriggerBase.SealedList<Condition>(); } |