1
Vote

No photo displayed in selected album

description

If the number of photos in the Album is inferior than var "_loadThreadhold (value=28)" the photos are not added to the list. The problem is here (Method "LoadAlbumByName" in "MediaLibraryPage.xaml.cs"):
if (_currentIndex >= _loadThreadhold)
                                    loopCount = _currentIndex - _loadThreadhold;
                                else
                                    loopCount = _currentIndex - 1;

                                for (int i = _currentIndex - 1; i > loopCount; i--)
                                {
If the Album has, for example, 7 pictures, the code inside the "for" loop is never executed.

file attachments

comments

CabuxaMapache wrote Jun 21, 2014 at 5:01 PM

I've changed the code like this:
if (_currentIndex < _loadThreadhold)
                                {
                                    _loadThreadhold = _currentIndex;
                                }

                                loopCount = _currentIndex - _loadThreadhold;

                                for (int i = _currentIndex - 1; i > loopCount; i--)
                                {
...
// Initialize the var again
_loadThreadhold = 28;
And it works ok.
Greetings.

alanfeng99 wrote Jul 7, 2014 at 2:10 AM

Thanks!

I will check on that.

alanfeng99 wrote Jul 7, 2014 at 3:01 AM

Hi, I've fixed the code like following :

if (_currentIndex <= _loadThreadhold)
{
     loopCount = - 1;
}
else
{
     loopCount = _currentIndex - _loadThreadhold;
}

loopCount need to be -1 in order to load the photo at index 0 position when currentIndex <= loadThreadhold.

Thanks.