diff options
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs index 24e93bca..0f723790 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs @@ -18,7 +18,7 @@ namespace Xamarin.Forms.Platform.Tizen RegisterPropertyHandler(Label.LineBreakModeProperty, UpdateLineBreakMode); RegisterPropertyHandler(Label.HorizontalTextAlignmentProperty, UpdateTextAlignment); RegisterPropertyHandler(Label.VerticalTextAlignmentProperty, UpdateTextAlignment); - RegisterPropertyHandler(Label.FormattedTextProperty, () => Control.FormattedText = ConvertFormattedText(Element.FormattedText)); + RegisterPropertyHandler(Label.FormattedTextProperty, UpdateFormattedText); } protected override void OnElementChanged(ElementChangedEventArgs<Label> e) @@ -61,6 +61,8 @@ namespace Xamarin.Forms.Platform.Tizen nativeSpan.FontAttributes = span.FontAttributes == FontAttributes.None ? Element.FontAttributes : span.FontAttributes; nativeSpan.FontFamily = span.FontFamily == null ? Element.FontFamily : span.FontFamily; nativeSpan.FontSize = span.FontSize == Device.GetNamedSize(NamedSize.Default, typeof(Label), true) ? Element.FontSize : span.FontSize; + nativeSpan.LineBreakMode = Control.LineBreakMode; + nativeSpan.HorizontalTextAlignment = Control.HorizontalTextAlignment; if (span.ForegroundColor.IsDefault) nativeSpan.ForegroundColor = Element.TextColor.IsDefault ? s_defaultForegroundColor : Element.TextColor.ToNative(); @@ -78,15 +80,23 @@ namespace Xamarin.Forms.Platform.Tizen return nativeString; } + void UpdateFormattedText() + { + if(Element.FormattedText != null) + Control.FormattedText = ConvertFormattedText(Element.FormattedText); + } + void UpdateTextColor() { Control.TextColor = Element.TextColor.IsDefault ? s_defaultTextColor : Element.TextColor.ToNative(); + UpdateFormattedText(); } void UpdateTextAlignment() { Control.HorizontalTextAlignment = Element.HorizontalTextAlignment.ToNative(); Control.VerticalTextAlignment = Element.VerticalTextAlignment.ToNative(); + UpdateFormattedText(); } void UpdateFontProperties() @@ -94,11 +104,13 @@ namespace Xamarin.Forms.Platform.Tizen Control.FontSize = Element.FontSize; Control.FontAttributes = Element.FontAttributes; Control.FontFamily = Element.FontFamily; + UpdateFormattedText(); } void UpdateLineBreakMode() { Control.LineBreakMode = ConvertToNativeLineBreakMode(Element.LineBreakMode); + UpdateFormattedText(); } Native.LineBreakMode ConvertToNativeLineBreakMode(LineBreakMode mode) |