/// <since_tizen> 3 </since_tizen>
public partial class View : Container, IResourcesProvider
{
+ private static HashSet<BindableProperty> positionPropertyGroup = new HashSet<BindableProperty>();
+ private static HashSet<BindableProperty> sizePropertyGroup = new HashSet<BindableProperty>();
+ private static HashSet<BindableProperty> scalePropertyGroup = new HashSet<BindableProperty>();
+
internal BackgroundExtraData backgroundExtraData;
private bool layoutSet = false;
public ViewSelectorData selectorData;
}
- static View() { }
+ static View()
+ {
+ RegisterPropertyGroup(PositionProperty, positionPropertyGroup);
+ RegisterPropertyGroup(Position2DProperty, positionPropertyGroup);
+ RegisterPropertyGroup(PositionXProperty, positionPropertyGroup);
+ RegisterPropertyGroup(PositionYProperty, positionPropertyGroup);
+
+ RegisterPropertyGroup(SizeProperty, sizePropertyGroup);
+ RegisterPropertyGroup(Size2DProperty, sizePropertyGroup);
+ RegisterPropertyGroup(SizeWidthProperty, sizePropertyGroup);
+ RegisterPropertyGroup(SizeHeightProperty, sizePropertyGroup);
+
+ RegisterPropertyGroup(ScaleProperty, scalePropertyGroup);
+ RegisterPropertyGroup(ScaleXProperty, scalePropertyGroup);
+ RegisterPropertyGroup(ScaleYProperty, scalePropertyGroup);
+ RegisterPropertyGroup(ScaleZProperty, scalePropertyGroup);
+ }
/// <summary>
/// Creates a new instance of a view.
}
/// <summary>
+ /// Register the properties which can effect each other in Binding to same group.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static void RegisterPropertyGroup(BindableProperty property, HashSet<BindableProperty> group)
+ {
+ if (!PropertyToGroup.ContainsKey(property))
+ {
+ PropertyToGroup.Add(property, group);
+ }
+ }
+ /// <summary>
/// Apply the bindings to BindingContext.
/// </summary>
/// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API.
context.Attributes &= ~BindableContextAttributes.IsSetFromStyle;
}
else
+ {
context.Attributes &= ~BindableContextAttributes.IsManuallySet;
+ }
if (fromStyle)
+ {
context.Attributes |= BindableContextAttributes.IsSetFromStyle;
+ }
// else omitted on purpose
bool currentlyApplying = applying;
}
}
+ PropertyToGroup.TryGetValue(property, out HashSet<BindableProperty> propertyGroup);
+
if (!silent)
{
if ((!same || raiseOnEqual))
}
OnPropertyChanged(property.PropertyName);
+
+ if (null != propertyGroup)
+ {
+ foreach (var relativeProperty in propertyGroup)
+ {
+ if (relativeProperty != property)
+ {
+ var relativeContext = GetOrCreateContext(relativeProperty);
+ var relativeBinding = relativeContext.Binding;
+
+ if (null != relativeBinding)
+ {
+ applying = true;
+ relativeBinding.Apply(true);
+ applying = false;
+ }
+
+ OnPropertyChanged(relativeProperty.PropertyName);
+ }
+ }
+ }
}
else if (true == same && true == forceSendChangeSignal)
{
}
OnPropertyChanged(property.PropertyName);
+
+ if (null != propertyGroup)
+ {
+ foreach (var relativeProperty in propertyGroup)
+ {
+ if (relativeProperty != property)
+ {
+ var relativeContext = GetOrCreateContext(relativeProperty);
+ var relativeBinding = relativeContext.Binding;
+
+ if (null != relativeBinding)
+ {
+ applying = true;
+ relativeBinding.Apply(true);
+ applying = false;
+ }
+
+ OnPropertyChanged(relativeProperty.PropertyName);
+ }
+ }
+ }
}
OnPropertyChangedWithData(property);
}
}
+ private static Dictionary<BindableProperty, HashSet<BindableProperty>> PropertyToGroup { get; }
+ = new Dictionary<BindableProperty, HashSet<BindableProperty>>();
+
[Flags]
enum BindableContextAttributes
{