2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 using System.Collections.Generic;
21 namespace ElmSharp.Test
23 class GenListTest8 : TestCaseBase
26 Dictionary<EvasObject, Button> _cacheMap = new Dictionary<EvasObject, Button>();
27 public override string TestName => "GenListTest8";
28 public override string TestDescription => "To test group operation of GenList";
30 public override void Run(Window window)
32 Background bg = new Background(window)
43 window.AddResizeObject(bg);
44 Conformant conformant = new Conformant(window);
46 Box box = new Box(window)
53 Check check = new Check(window);
55 check.IsChecked = true;
56 check.Text = "Reuse?";
58 GenList list = new GenList(window)
67 GenItemClass fullyCustomizeClass = new GenItemClass("full")
69 GetContentHandler = (obj, part) =>
71 Console.WriteLine("{0} part create requested", part);
72 var btn = new Button(window)
80 ReusableContentHandler = (object data, string part, EvasObject old) =>
82 Console.WriteLine("{0} part reuse requested", part);
87 var btn = old as Button;
88 btn.Text = (string)data;
93 for (int i = 0; i < 100; i++)
95 list.Append(fullyCustomizeClass, string.Format("{0} Item", i), GenListItemType.Normal);
99 list.ItemSelected += List_ItemSelected; ;
103 conformant.SetContent(box);
106 private void List_ItemSelected(object sender, GenListItemEventArgs e)
108 Console.WriteLine("{0} Item was selected", (string)(e.Item.Data));