From: Kangho Hur Date: Fri, 6 Jan 2017 02:01:27 +0000 (+0900) Subject: Fix Label.LineBreakMode X-Git-Tag: accepted/tizen/common/20170324.122620~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e4a6be891d01401e668aeddc76239fbb52844167;p=platform%2Fupstream%2Fxamarin-forms.git Fix Label.LineBreakMode TASK=TCAPI-2182 - Head/Middle/TailTruncation are working fine. Change-Id: I9f3b2381d22c3c50063a668fcc3569fdc7e2f751 --- diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs index 5a4744f..d21d3d7 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs @@ -90,14 +90,27 @@ namespace Xamarin.Forms.Platform.Tizen void UpdateLineBreakMode() { - if (Element.LineBreakMode == LineBreakMode.CharacterWrap) - Control.LineBreakMode = Native.LineBreakMode.CharacterWrap; - else if (Element.LineBreakMode == LineBreakMode.WordWrap) - Control.LineBreakMode = Native.LineBreakMode.WordWrap; - else if (Element.LineBreakMode == LineBreakMode.NoWrap) - Control.LineBreakMode = Native.LineBreakMode.NoWrap; - else - Control.LineBreakMode = Native.LineBreakMode.MixedWrap; + Control.LineBreakMode = ConvertToNativeLineBreakMode(Element.LineBreakMode); + } + + Native.LineBreakMode ConvertToNativeLineBreakMode(LineBreakMode mode) + { + switch (mode) + { + case LineBreakMode.CharacterWrap: + return Native.LineBreakMode.CharacterWrap; + case LineBreakMode.HeadTruncation: + return Native.LineBreakMode.HeadTruncation; + case LineBreakMode.MiddleTruncation: + return Native.LineBreakMode.MiddleTruncation; + case LineBreakMode.NoWrap: + return Native.LineBreakMode.NoWrap; + case LineBreakMode.TailTruncation: + return Native.LineBreakMode.TailTruncation; + case LineBreakMode.WordWrap: + default: + return Native.LineBreakMode.WordWrap; + } } } }