Beispiel #1
0
        public override void Initialize()
        {
            base.Initialize();

            var template = new ListViewItem()
            {
            };

            template.AddChild(new Checkbox()
            {
                Text = ""
            });
            template.AddChild(new Label()
            {
                Text     = "",
                Location = new Point()
                {
                    Left = 4
                }
            });
            template.AddChild(new Label()
            {
                Text     = "",
                Location = new Point()
                {
                    Left = 14
                }
            });
            template.AddChild(new Button()
            {
                Text     = "Edit",
                Location = new Point()
                {
                    Left = 30
                }
            });

            _listView = new ListView <Item>()
            {
                Location = new Point()
                {
                    Left = 2, Top = 2
                },
                Template = template
            };
            _listView.ItemDataBound += _listView_ItemDataBound;

            _listView.Items = new List <Item>()
            {
                new Item()
                {
                    BoolValue         = true,
                    StringValue       = "Value 1",
                    SecondStringValue = "Long Value 1"
                }, new Item()
                {
                    BoolValue         = false,
                    StringValue       = "Value 2",
                    SecondStringValue = "Long Value 2"
                }
            };
            RootPanel.AddChild(_listView);

            _button = new Button()
            {
                Location = new Point()
                {
                    Left = 2, Top = Size.Height - 3
                },
                Text = "Button"
            };
            RootPanel.AddChild(_button);
        }