Exemplo n.º 1
0
 // сброс
 public void Reset(Models.Page page = null)
 {
     //System.Diagnostics.Debug.WriteLine("Reset");
     VerticalOffset = 0;
     MinHeight      = 0;
     ItemsData.Clear();
     Children.Clear();
     Models.Images Images = DataContext as Models.Images;
     Images.ClearSelf(page);
     busy = false;
     ImagesLoad();
 }
Exemplo n.º 2
0
        public async Task ImagesLoad()
        {
            if (busy)
            {
                return;
            }
            busy = true;
            //System.Diagnostics.Debug.WriteLine("ImageLoad:begin");

            Pages.MainPage.ShowListLoading();
            Models.Images Images = DataContext as Models.Images;

            while (CheckHeights())
            {
                //System.Diagnostics.Debug.WriteLine("while");
                uint c = await Images.Load();

                if (c == 0)
                {
                    Pages.MainPage.HideListLoading();
                    return;
                }
                System.Diagnostics.Debug.WriteLine("c.Count:" + c);
                for (int i = Images.Count() - (int)c; i < Images.Count(); i++)
                {
                    KeyValuePair <int, double> columnHeight = GetMinColumn();

                    ItemData itemData = new ItemData()
                    {
                        Column    = columnHeight.Key,
                        MarginTop = columnHeight.Value,
                        ImageData = Images[i]
                    };
                    await itemData.Show(GetImage());

                    ItemsData.Add(itemData);
                }
            }
            Pages.MainPage.HideListLoading();
            //System.Diagnostics.Debug.WriteLine("ImageLoad:end");
            busy = false;
        }