summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-01-06 02:01:27 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-01-06 02:30:27 (GMT)
commitc0d90757699475eb6d9a04c0bbce35b2f83d25c9 (patch)
tree0b759c072029d921d0e1bf72caa300f5056f8e84 /Xamarin.Forms.Platform.Tizen
parentb729a649523c1acba03a4fccd30fac93d5f7b77e (diff)
downloadxamarin-forms-c0d90757699475eb6d9a04c0bbce35b2f83d25c9.zip
xamarin-forms-c0d90757699475eb6d9a04c0bbce35b2f83d25c9.tar.gz
xamarin-forms-c0d90757699475eb6d9a04c0bbce35b2f83d25c9.tar.bz2
Fix Label.LineBreakModerefs/changes/17/108817/4
TASK=TCAPI-2182 - Head/Middle/TailTruncation are working fine. Change-Id: I9f3b2381d22c3c50063a668fcc3569fdc7e2f751
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen')
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/LabelRenderer.cs29
1 files changed, 21 insertions, 8 deletions
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;
+ }
}
}
}