コード例 #1
0
        protected sealed override void OnInitialize()
        {
            store = OnCreateListStore();

            listView = new Xwt.ListView(store)
            {
                GridLinesVisible = Xwt.GridLines.Both,
                SelectionMode    = Xwt.SelectionMode.Multiple,
            };
            listView.SelectionChanged += (sender, e) => {
                if (oldRows != null)
                {
                    foreach (var row in oldRows)
                    {
                        if (row == store.RowCount - 1)
                        {
                            store.SetValue(row, countField, "*");
                        }
                        else if (string.IsNullOrWhiteSpace(store.GetValue(row, nameField)) && !string.IsNullOrEmpty(store.GetValue(row, valueField)))
                        {
                            store.SetValue(row, countField, "!");
                        }
                        else
                        {
                            store.SetValue(row, countField, string.Empty);
                        }
                    }
                }

                oldRows = listView.SelectedRows;
                foreach (var row in oldRows)
                {
                    store.SetValue(row, countField, "▶");
                }
            };
            listView.ButtonPressed += OnButtonPress;
            listView.Show();

            AddListViewColumns(listView.Columns);
        }