summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2016-12-23 07:50:19 (GMT)
committerGitHub <noreply@github.com>2016-12-23 07:50:19 (GMT)
commitb96df000db76ba3490589c37e93224271249bc88 (patch)
tree6389cd652ebe395b51829ee2ec1d41d285ed2fab /Xamarin.Forms.Core
parent2c91b0facd2a25d0de9a283b44cf818329d4c06f (diff)
downloadxamarin-forms-b96df000db76ba3490589c37e93224271249bc88.zip
xamarin-forms-b96df000db76ba3490589c37e93224271249bc88.tar.gz
xamarin-forms-b96df000db76ba3490589c37e93224271249bc88.tar.bz2
[Xaml] support short Properties for PropertyCondition (#645)
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/BindablePropertyConverter.cs2
-rw-r--r--Xamarin.Forms.Core/IValueConverterProvider.cs2
-rw-r--r--Xamarin.Forms.Core/Interactivity/BindingCondition.cs6
-rw-r--r--Xamarin.Forms.Core/Interactivity/MultiCondition.cs2
4 files changed, 7 insertions, 5 deletions
diff --git a/Xamarin.Forms.Core/BindablePropertyConverter.cs b/Xamarin.Forms.Core/BindablePropertyConverter.cs
index a7398e0..08201b0 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 1221ce7..b8c684c 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 88b7cf3..1d11185 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 23ca41c..1a80190 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>();
}