« first day  last day (15 days later) » 

6:19 PM
Good day to you sir!
I've been debugging this code selection like you said:
var ordered = node.Children.OrderBy(n => n.TreeView_LocValue);
node.Children.Clear();
node.Children.Load(ordered.ToList());
and through that, I found that ordered gets set to a System.Linq.OrderedEnumerable<> with a source that seems to have all of the properties that a usual collection item sent to that function would have. But still, when sent to the UICollection.Load method, items gets a count of 0.
Do I need to use an IOrderedEnumerable<T> instead of an IEnumerable<T> in the load method?
        public virtual void Load(IOrderedEnumerable<T> items)
        {
            if (items == null)
                throw new ArgumentNullException("items");

            this.IsNotifying = false;

            foreach (var item in items)
                this.Add(item);

            this.IsNotifying = true;

            this.Refresh();
        }
 
7:17 PM
asdasadasdasdas!!!!!!!!!!!!!!!!!!
that code is wrong
it's my fault
sorry
.OrderBy() is lazy
so it's going to be executed when you .ToList()
and by that time the node.Children collection is already empty
var ordered = node.Children.OrderBy(n => n.TreeView_LocValue).ToList();
node.Children.Clear();
node.Children.Load(ordered);
 
fjkhsflhsadfjhk????
Perfect
 
that's the correct code
 
It is correct
Thank you
 
LINQ can bite your ass if you overlook it
still a million times better than java crap
 
7:53 PM
I see that, lol.
Sorry if my responses are a little late. Today has been busy, and I haven't quite got a moment to myself yet, lol
 
8:46 PM
You ditched! lol. Okay so I believe I've gotten as far as I can with your solution. Now I have some questions, if you wouldn't mind.
 

« first day  last day (15 days later) »