public void ClearPhotoStream()
        {
            App.PhotoStreamHelper.RemoveAll();

            _currentMosaicViewModel = null;

            if (_pictures != null)
            {
                _pictures.Dispose();
                _pictures = null;
            }

            if (_enumerator != null)
            {
                _enumerator.Dispose();
                _enumerator = null;
            }

            try
            {
                ListBoxItems.Clear();
            }
            catch (Exception)
            {
            }

            GC.Collect();
        }
        public void ClearPhotoStream()
        {
            App.PhotoStreamHelper.RemoveAll();

            _currentMosaicViewModel = null;

            if (_pictures != null)
            {
                _pictures.Dispose();
                _pictures = null;
            }

            if (_enumerator != null)
            {
                _enumerator.Dispose();
                _enumerator = null;
            }

            try
            {
                ListBoxItems.Clear();
            }
            catch (Exception)
            {
            }

            GC.Collect();
        }
        private void AddItemToViewModel(StreamItemModel item)
        {
            if (_currentMosaicViewModel == null || _currentMosaicViewModel.Count == PhotoMosaicViewModel.MaxItems)
            {
                _currentMosaicViewModel = new PhotoMosaicViewModel()
                {
                    StreamItemTapped = PhotoMosaicViewModel_PhotoStreamItemTapped
                };

                ListBoxItems.Add(_currentMosaicViewModel);
            }

            StreamItemViewModel m = new StreamItemViewModel(item);

            //m.Render(StreamItemViewModel.Size.Small); // pre-render

            _currentMosaicViewModel.Add(m);
        }
        private void AddItemToViewModel(StreamItemModel item)
        {
            if (_currentMosaicViewModel == null || _currentMosaicViewModel.Count == PhotoMosaicViewModel.MaxItems)
            {
                _currentMosaicViewModel = new PhotoMosaicViewModel()
                {
                    StreamItemTapped = PhotoMosaicViewModel_PhotoStreamItemTapped
                };

                ListBoxItems.Add(_currentMosaicViewModel);
            }

            StreamItemViewModel m = new StreamItemViewModel(item);
            //m.Render(StreamItemViewModel.Size.Small); // pre-render

            _currentMosaicViewModel.Add(m);
        }