Beispiel #1
0
        private static (IModelColumn modelColumn, IModelPositionInListViewListViewItem item) PositionMember(this ListView listView)
        {
            var item = listView.Application().Model.ModelPositionInListView()
                       .ListViewItems.First(rule => rule.ListView.Id() == listView.Id);
            var modelColumn = listView.Model.Columns.FirstOrDefault(column => column.ModelMember == item.PositionMember);

            if (modelColumn == null)
            {
                modelColumn = listView.Model.Columns.AddNode <IModelColumn>();
                modelColumn.PropertyName = item.PositionMember.Name;
                modelColumn.Index        = -1;
            }
            return(modelColumn, item);
        }