summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-02-07 00:44:40 (GMT)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>2017-02-07 00:44:40 (GMT)
commit92d363dd7d7a3bd23f31a0bbda936b00e9b4fd33 (patch)
tree5a819334102c20a34d5f62c8a3a6e69b2da9a0d4
parent832294236c52463ba581e19f9dd1592381cca4d5 (diff)
parent3ee1beef9bd0c56a871a3ff9561632c4ed80e2d0 (diff)
downloadxamarin-forms-92d363dd7d7a3bd23f31a0bbda936b00e9b4fd33.zip
xamarin-forms-92d363dd7d7a3bd23f31a0bbda936b00e9b4fd33.tar.gz
xamarin-forms-92d363dd7d7a3bd23f31a0bbda936b00e9b4fd33.tar.bz2
Merge "[Page] Change alert dialog message text wrap type" into tizen
-rwxr-xr-x[-rw-r--r--]Xamarin.Forms.Platform.Tizen/FormsApplication.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/FormsApplication.cs b/Xamarin.Forms.Platform.Tizen/FormsApplication.cs
index fe8c4fd..806f6a8 100644..100755
--- a/Xamarin.Forms.Platform.Tizen/FormsApplication.cs
+++ b/Xamarin.Forms.Platform.Tizen/FormsApplication.cs
@@ -165,17 +165,33 @@ namespace Xamarin.Forms.Platform.Tizen
MessagingCenter.Subscribe<Page, AlertArguments>(this, Page.AlertSignalName, delegate (Page sender, AlertArguments arguments)
{
Native.Dialog alert = new Native.Dialog(Forms.Context.MainWindow);
-
alert.Title = arguments.Title;
var label = new ELabel(alert)
{
Text = "<span font_size=30 color=#000000>" + arguments.Message + "<\\span>",
};
+
label.Show();
var box = new Box(alert);
- box.PackEnd(label);
box.Show();
+
+ bool labelAdded = false;
+ box.Resized += (s, e) =>
+ {
+ label.LineWrapType = WrapType.Word;
+ //set 2% padding for alert text message width
+ label.LineWrapWidth = (int)Math.Round(box.Geometry.Width * 0.98);
+ if (!labelAdded)
+ {
+ /*Adding label to the box (box.PackEnd(label)) has been placed in box.Resized()
+ event due to get better performance. For some reason (probably EFL bug) when
+ it's placed outside of it, box.Resized() event is called far too many times.*/
+ box.PackEnd(label);
+ labelAdded = true;
+ }
+ };
+
alert.Content = box;
Native.Button cancel = new Native.Button(alert) { Text = arguments.Cancel };