summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen
diff options
context:
space:
mode:
authorchungryeol lim <cdark.lim@samsung.com>2017-01-23 17:05:50 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-02-03 13:28:05 +0900
commit9df852ecbf0a87e126b8168408f10231920539ea (patch)
tree2b37f2eab181d7179921816dc963e0ab5ec7a2f6 /Xamarin.Forms.Platform.Tizen
parent0ffd74b83f6383f803551940f105122844da6939 (diff)
downloadxamarin-forms-9df852ecbf0a87e126b8168408f10231920539ea.tar.gz
xamarin-forms-9df852ecbf0a87e126b8168408f10231920539ea.tar.bz2
xamarin-forms-9df852ecbf0a87e126b8168408f10231920539ea.zip
Fixed Label.HorizontalTextAlignment issue
- HorizontalTextAlignment is not working for Label - Task=TCAPI-2201 Change-Id: I6bb509a865a57c774f3de4d43fff8e90cc7c90ca Signed-off-by: chungryeol lim <cdark.lim@samsung.com>
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen')
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs14
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)