Beispiel #1
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            // We are binding an item
            DataItem item = value as DataItem;

            if (item != null)
            {
                return(item.Owner.Where(i => i.ParentId == item.Id));
            }
            // We are binding the treeview
            DataItemCollection items = value as DataItemCollection;

            if (items != null)
            {
                return(items.Where(i => i.ParentId == 0));
            }
            return(null);
        }
Beispiel #2
0
 internal void SetOwner(DataItemCollection collection)
 {
     this.Owner = collection;
 }