Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.StyleName, new Tizen.NUI.PropertyValue(styleName));
view.styleName = styleName;
- view.UpdateStyle();
- view.ThemeChangeSensitive = true;
+
+ if (string.IsNullOrEmpty(styleName)) return;
+
+ var style = ThemeManager.GetUpdateStyleWithoutClone(styleName);
+
+ if (style == null) return;
+
+ view.ApplyStyle(style);
+ view.SetThemeApplied();
}
}),
defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
});
/// <summary>
+ /// FocusableChildrenProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FocusableChildrenProperty = BindableProperty.Create(nameof(FocusableChildren), typeof(bool), typeof(View), true, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null) { view.SetKeyboardFocusableChildren((bool)newValue); }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.AreChildrenKeyBoardFocusable();
+ });
+
+ /// <summary>
+ /// FocusableInTouchProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty FocusableInTouchProperty = BindableProperty.Create(nameof(FocusableInTouch), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ if (newValue != null) { view.SetFocusableInTouch((bool)newValue); }
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.IsFocusableInTouch();
+ });
+
+ /// <summary>
/// Size2DProperty
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
var view = (View)bindable;
if (newValue != null)
{
- Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.WidthResizePolicy, new Tizen.NUI.PropertyValue((int)newValue));
+ if((ResizePolicyType)newValue == ResizePolicyType.KeepSizeFollowingParent)
+ {
+ if(view.widthConstraint == null)
+ {
+ view.widthConstraint = new EqualConstraintWithParentFloat((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SizeWidth, View.Property.SizeWidth);
+ view.widthConstraint.Apply();
+ }
+ Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.WidthResizePolicy, new Tizen.NUI.PropertyValue((int)ResizePolicyType.FillToParent));
+ }
+ else
+ {
+ view.widthConstraint?.Remove();
+ view.widthConstraint?.Dispose();
+ view.widthConstraint = null;
+ Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.WidthResizePolicy, new Tizen.NUI.PropertyValue((int)newValue));
+ }
// Match ResizePolicy to new Layouting.
// Parent relative policies can not be mapped at this point as parent size unknown.
switch ((ResizePolicyType)newValue)
var view = (View)bindable;
if (newValue != null)
{
- Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.HeightResizePolicy, new Tizen.NUI.PropertyValue((int)newValue));
+ if((ResizePolicyType)newValue == ResizePolicyType.KeepSizeFollowingParent)
+ {
+ if(view.heightConstraint == null)
+ {
+ view.heightConstraint = new EqualConstraintWithParentFloat((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SizeHeight, View.Property.SizeHeight);
+ view.heightConstraint.Apply();
+ }
+ Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.HeightResizePolicy, new Tizen.NUI.PropertyValue((int)ResizePolicyType.FillToParent));
+ }
+ else
+ {
+ view.heightConstraint?.Remove();
+ view.heightConstraint?.Dispose();
+ view.heightConstraint = null;
+ Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.HeightResizePolicy, new Tizen.NUI.PropertyValue((int)newValue));
+ }
// Match ResizePolicy to new Layouting.
// Parent relative policies can not be mapped at this point as parent size unknown.
switch ((ResizePolicyType)newValue)
if (newValue != null)
{
Size size = (Size)newValue;
- Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue(size));
// Set Specification so when layouts measure this View it matches the value set here.
// All Views are currently Layouts.
view.WidthSpecification = (int)System.Math.Ceiling(size.Width);
view.HeightSpecification = (int)System.Math.Ceiling(size.Height);
+ Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.SIZE, new Tizen.NUI.PropertyValue(size));
}
}),
defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
}
else
{
- view.SetShadow((ImageShadow)newValue);
+ view.SetShadow((ImageShadow)newValue);
}
}),
defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
}
else
{
- view.SetShadow((Shadow)newValue);
+ view.SetShadow((Shadow)newValue);
}
}),
defaultValueCreator: (BindableProperty.CreateDefaultValueDelegate)((bindable) =>
defaultValueCreator: (bindable) =>
{
var view = (View)bindable;
- return view.backgroundExtraData == null ? 0 : view.backgroundExtraData.CornerRadius;
+ return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.CornerRadius;
});
/// <summary>
});
/// <summary>
+ /// BorderlineWidth Property
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BorderlineWidthProperty = BindableProperty.Create(nameof(BorderlineWidth), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BorderlineWidth = (float)newValue;
+ view.ApplyBorderline();
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.BorderlineWidth;
+ });
+
+ /// <summary>
+ /// BorderlineColor Property
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BorderlineColorProperty = BindableProperty.Create(nameof(BorderlineColor), typeof(Color), typeof(View), null, propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BorderlineColor = (Color)newValue;
+ view.ApplyBorderline();
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.backgroundExtraData == null ? Color.Black : view.backgroundExtraData.BorderlineColor;
+ });
+
+ /// <summary>
+ /// BorderlineOffset Property
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty BorderlineOffsetProperty = BindableProperty.Create(nameof(BorderlineOffset), typeof(float), typeof(View), default(float), propertyChanged: (bindable, oldValue, newValue) =>
+ {
+ var view = (View)bindable;
+ (view.backgroundExtraData ?? (view.backgroundExtraData = new BackgroundExtraData())).BorderlineOffset = (float)newValue;
+ view.ApplyBorderline();
+ },
+ defaultValueCreator: (bindable) =>
+ {
+ var view = (View)bindable;
+ return view.backgroundExtraData == null ? 0.0f : view.backgroundExtraData.BorderlineOffset;
+ });
+
+ /// <summary>
/// EnableControlState property
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
if (view.themeData == null) view.themeData = new ThemeData();
- view.themeData.themeChangeSensitive = (bool)newValue;
+ view.themeData.ThemeChangeSensitive = (bool)newValue;
- if (view.themeData.themeChangeSensitive)
+ if (!view.themeData.ThemeApplied) return;
+
+ if (view.themeData.ThemeChangeSensitive && !view.themeData.ListeningThemeChangeEvent)
{
+ view.themeData.ListeningThemeChangeEvent = true;
ThemeManager.ThemeChangedInternal.Add(view.OnThemeChanged);
}
- else
+ else if (!view.themeData.ThemeChangeSensitive && view.themeData.ListeningThemeChangeEvent)
{
+ view.themeData.ListeningThemeChangeEvent = false;
ThemeManager.ThemeChangedInternal.Remove(view.OnThemeChanged);
}
},
defaultValueCreator: (bindable) =>
{
- return ((View)bindable).themeData?.themeChangeSensitive ?? false;
+ return ((View)bindable).themeData?.ThemeChangeSensitive ?? ThemeManager.ApplicationThemeChangeSensitive;
});
/// <summary>
return temp;
});
- /// <summary>
- /// AccessibilityAnimatedProperty
- /// </summary>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public static readonly BindableProperty AccessibilityAnimatedProperty = BindableProperty.Create(nameof(AccessibilityAnimated), typeof(bool), typeof(View), false, propertyChanged: (bindable, oldValue, newValue) =>
- {
- var view = (View)bindable;
- if (newValue != null)
- {
- Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.AccessibilityAnimated, new Tizen.NUI.PropertyValue((bool)newValue));
- }
- },
- defaultValueCreator: (bindable) =>
- {
- var view = (View)bindable;
- bool temp = false;
- Tizen.NUI.Object.GetProperty((System.Runtime.InteropServices.HandleRef)view.SwigCPtr, View.Property.AccessibilityAnimated).Get(out temp);
- return temp;
- });
-
private void SetBackgroundImage(string value)
{
if (string.IsNullOrEmpty(value))
map.Add(ImageVisualProperty.URL, new PropertyValue(value))
.Add(Visual.Property.CornerRadius, new PropertyValue(backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius)))
.Add(Visual.Property.CornerRadiusPolicy, new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)))
+ .Add(Visual.Property.BorderlineWidth, new PropertyValue(backgroundExtraData.BorderlineWidth))
+ .Add(Visual.Property.BorderlineColor, new PropertyValue(backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor)))
+ .Add(Visual.Property.BorderlineOffset, new PropertyValue(backgroundExtraData.BorderlineOffset))
.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue(backgroundImageSynchronosLoading));
if (backgroundExtraData.BackgroundImageBorder != null)
PropertyMap map = new PropertyMap();
map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Color))
- .Add(ColorVisualProperty.MixColor, new PropertyValue(value))
- .Add(Visual.Property.CornerRadius, new PropertyValue(new PropertyValue(backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius))))
- .Add(Visual.Property.CornerRadiusPolicy, new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)));
+ .Add(ColorVisualProperty.MixColor, new PropertyValue(value))
+ .Add(Visual.Property.CornerRadius, new PropertyValue(new PropertyValue(backgroundExtraData.CornerRadius == null ? new PropertyValue() : new PropertyValue(backgroundExtraData.CornerRadius))))
+ .Add(Visual.Property.CornerRadiusPolicy, new PropertyValue((int)(backgroundExtraData.CornerRadiusPolicy)))
+ .Add(Visual.Property.BorderlineWidth, new PropertyValue(backgroundExtraData.BorderlineWidth))
+ .Add(Visual.Property.BorderlineColor, new PropertyValue(backgroundExtraData.BorderlineColor == null ? new PropertyValue(Color.Black) : new PropertyValue(backgroundExtraData.BorderlineColor)))
+ .Add(Visual.Property.BorderlineOffset, new PropertyValue(backgroundExtraData.BorderlineOffset));
+
Tizen.NUI.Object.SetProperty((System.Runtime.InteropServices.HandleRef)SwigCPtr, View.Property.BACKGROUND, new PropertyValue(map));
}