[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_CUTOUT_get")]
public static extern int CutoutGet();
+ [global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_Property_RENDER_MODE_get")]
+ public static extern int RenderModeGet();
+
[global::System.Runtime.InteropServices.DllImport(NDalicPINVOKE.Lib, EntryPoint = "CSharp_Dali_TextLabel_RequestAsyncRenderWithFixedSize")]
public static extern void RequestAsyncRenderWithFixedSize(global::System.Runtime.InteropServices.HandleRef textLabelRef, float width, float height);
CutoutProperty = BindableProperty.Create(nameof(Cutout), typeof(bool), typeof(TextLabel), false,
propertyChanged: SetInternalCutoutProperty, defaultValueCreator: GetInternalCutoutProperty);
+
+ RenderModeProperty = BindableProperty.Create(nameof(RenderMode), typeof(TextRenderMode), typeof(TextLabel), TextRenderMode.Sync,
+ propertyChanged: SetInternalRenderModeProperty, defaultValueCreator: GetInternalRenderModeProperty);
}
}
/// <param name="width">The width of text to render.</param>
/// <param name="height">The height of text to render.</param>
/// <remarks>
- /// Only works when AsyncLoad is true.
+ /// Only works when AsyncMode.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
public void RequestAsyncRenderWithFixedSize(float width, float height)
/// <param name="width">The width of text to render.</param>
/// <param name="heightConstraint">The maximum available height of text to render.</param>
/// <remarks>
- /// Only works when AsyncLoad is true.<br />
+ /// Only works when AsyncMode.<br />
/// The height is determined by the content of the text when rendered with the given width.<br />
/// The result will be the same as the height returned by GetHeightForWidth.
/// If the heightConstraint is given, the maximum height will be the heightConstraint.
}
}
+ /// <summary>
+ /// The RenderMode property.
+ /// </summary>
+ /// <remarks>
+ /// Sync : default, synchronous text loading.<br />
+ /// AsyncAuto : automatically requests an asynchronous text load in OnRelayout.<br />
+ /// AsyncManual : users should manually request rendering using the async text method.<br />
+ /// All text rendering processes (update/layout/render) are performed asynchronously in AsyncAuto and AsyncManual.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public TextRenderMode RenderMode
+ {
+ get
+ {
+ if (NUIApplication.IsUsingXaml)
+ {
+ return (TextRenderMode)GetValue(RenderModeProperty);
+ }
+ else
+ {
+ return (TextRenderMode)GetInternalRenderModeProperty(this);
+ }
+ }
+ set
+ {
+ if (NUIApplication.IsUsingXaml)
+ {
+ SetValue(RenderModeProperty, value);
+ }
+ else
+ {
+ SetInternalRenderModeProperty(this, null, value);
+ }
+ NotifyPropertyChanged();
+ }
+ }
+
+
private TextLabelSelectorData EnsureSelectorData() => selectorData ?? (selectorData = new TextLabelSelectorData());
/// <summary>
internal static readonly int RemoveFrontInset = Interop.TextLabel.RemoveFrontInsetGet();
internal static readonly int RemoveBackInset = Interop.TextLabel.RemoveBackInsetGet();
internal static readonly int Cutout = Interop.TextLabel.CutoutGet();
+ internal static readonly int RenderMode = Interop.TextLabel.RenderModeGet();
internal static void Preload()
return Object.InternalGetPropertyBool(textLabel.SwigCPtr, TextLabel.Property.Cutout);
}
+ /// <summary>
+ /// RenderModeProperty
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public static readonly BindableProperty RenderModeProperty = null;
+ internal static void SetInternalRenderModeProperty(BindableObject bindable, object oldValue, object newValue)
+ {
+ var textLabel = (TextLabel)bindable;
+ if (newValue != null)
+ {
+ Object.InternalSetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.RenderMode, (int)newValue);
+ }
+ }
+ internal static object GetInternalRenderModeProperty(BindableObject bindable)
+ {
+ var textLabel = (TextLabel)bindable;
+
+ return (TextRenderMode)Object.InternalGetPropertyInt(textLabel.SwigCPtr, TextLabel.Property.RenderMode);
+ }
+
internal Selector<string> TranslatableTextSelector
{
get => GetSelector<string>(selectorData?.TranslatableText, TextLabel.TranslatableTextProperty);