summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeungkeun Lee <sngn.lee@samsung.com>2017-01-09 05:27:44 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2017-01-09 05:27:44 (GMT)
commit528f14b38dbe3543249e5a4a22974fbf69964373 (patch)
tree5c16d8aad5c1982f4cf0fa8b6249aec0e99899a0
parent8cdaca67ac9fb56dea295e3ed2bbaadf553b7612 (diff)
parentc0d90757699475eb6d9a04c0bbce35b2f83d25c9 (diff)
downloadxamarin-forms-528f14b38dbe3543249e5a4a22974fbf69964373.zip
xamarin-forms-528f14b38dbe3543249e5a4a22974fbf69964373.tar.gz
xamarin-forms-528f14b38dbe3543249e5a4a22974fbf69964373.tar.bz2
Merge "Fix Label.LineBreakMode" into 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;
+ }
}
}
}