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) =>
if (view.themeData == null) view.themeData = new ThemeData();
- view.themeData.themeChangeSensitive = (bool)newValue;
+ view.themeData.ThemeChangeSensitive = (bool)newValue;
+
+ if (!view.themeData.ThemeApplied) return;
- if (view.themeData.themeChangeSensitive)
+ 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))
.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));
}