anagram4wander / VirtualizingObservableCollection

.NET PCL With Virtualizing Observable Collection
http://alphachitech.wordpress.com/2015/01/31/virtualizing-observable-collection/
57 stars 28 forks source link

PartitionManager.GetCount(bool asyncOK) never set _LocalCount when a synchronous source is used #1

Closed plv-zz closed 9 years ago

plv-zz commented 9 years ago

Since your las commit, Count value is alway 0 if a synchronous source is used. I have corrected it like this :

...... public int GetCount(bool asyncOK) { int ret = 0;

        if (!_HasGotCount)
        {
            lock (this)
            {
                if (!IsAsync)
                {
                    ret = this.Provider.Count;
                    _LocalCount = ret;   // line added to make the correction
                }
                else
                {
                    if (!asyncOK)
                    {

.....

anagram4wander commented 9 years ago

Thanks so much for finding that.. The nuget is also fixed.

I guess you just made the case that it's time to put together a test suite for this now.

On Feb 25, 2015, at 6:36 AM, plv notifications@github.com wrote:

Since your las commit, Count value is alway 0 if a synchronous source is used. I have corrected it like this :

...... public int GetCount(bool asyncOK) { int ret = 0;

    if (!_HasGotCount)
    {
        lock (this)
        {
            if (!IsAsync)
            {
                ret = this.Provider.Count;
                _LocalCount = ret;   // line added to make the correction
            }
            else
            {
                if (!asyncOK)
                {

.....

— Reply to this email directly or view it on GitHub.