From c8b3b135e0439e9bc0ab6ba030cfbeccd19f434c Mon Sep 17 00:00:00 2001 From: "rina6350.you" Date: Wed, 31 May 2017 18:58:29 +0900 Subject: [PATCH] Add some scenario for checking the clicked event of ToolbarItem Change-Id: I55c9513b411643535192ec94a9d9b280f1a28746 --- test/ElmSharp.Test/TC/ToolbarTest3.cs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/test/ElmSharp.Test/TC/ToolbarTest3.cs b/test/ElmSharp.Test/TC/ToolbarTest3.cs index 6261aed..5568088 100755 --- a/test/ElmSharp.Test/TC/ToolbarTest3.cs +++ b/test/ElmSharp.Test/TC/ToolbarTest3.cs @@ -52,13 +52,6 @@ namespace ElmSharp.Test toolbar.Show(); outterBox.PackEnd(toolbar); - for (int i = 0; i < 5; i++) - { - ToolbarItem item = toolbar.Append(string.Format("{0} home", i), "home"); - Color bgColor = Color.FromRgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - item.SetPartColor("bg", bgColor); - } - toolbar.Selected += (s, e) => { e.Item.DeletePartColor("bg"); @@ -70,6 +63,20 @@ namespace ElmSharp.Test }; lb.Show(); outterBox.PackEnd(lb); + + for (int i = 0; i < 5; i++) + { + ToolbarItem item = toolbar.Append(string.Format("{0} home", i), "home"); + Color bgColor = Color.FromRgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); + item.SetPartColor("bg", bgColor); + + item.Clicked += (s, e) => + { + lb.Text = (s as ToolbarItem).Text+" clicked"; + }; + } + + conformant.SetContent(outterBox); } } -- 2.7.4