Esempio n. 1
0
        void additems(int index)
        {
            for (int i = index; i < _learningObjectsList.Count; i++)
            {
                Grid container = new Grid()
                {
                    Width = ItemWitdh + Separation, Height = ItemHeight + Separation
                };
                LOItem item = new LOItem()
                {
                    Index           = i,
                    RenderTransform = new TranslateTransform()
                    {
                        X = Separation,
                        Y = Separation
                    },
                    Title       = _learningObjectsList[i].lo.title,
                    Author      = _learningObjectsList[i].lo.name + " " + _learningObjectsList[i].lo.lastname,
                    LikeThis    = _learningObjectsList[i].lo.like,
                    BorderColor = StaticStyles.Colors[_learningObjectsList[i].lo.color_id % 4].MainColor
                };

                item.Selected += item_Selected;
                item.DoLike   += item_DoLike;
                _itemsList.Add(item);
                //
                item.ImageBytes = _learningObjectsList[i].cover_bytes;
                _learningObjectsList[i].PropertyChanged += (s, e) =>
                {
                    if (e.PropertyName == "cover_bytes")
                    {
                        item.ImageBytes = (s as MainViewModel.lo_by_circle_wrapper).cover_bytes;
                    }

                    if (e.PropertyName == "background_bytes")
                    {
                    }
                };

                container.Children.Add(item);
                _mainpanel.Children.Add(container);
            }
        }
Esempio n. 2
0
        void additems(int index)
        {         
            for (int i = index; i < _learningObjectsList.Count; i++)
            {
                Grid container = new Grid() { Width = ItemWitdh + Separation , Height = ItemHeight + Separation };
                LOItem item = new LOItem()
                {
                    Index = i,
                    RenderTransform = new TranslateTransform()
                    {
                        X = Separation ,
                        Y = Separation
                    },
                    Title = _learningObjectsList[i].lo.title,
                    Author = _learningObjectsList[i].lo.name + " " + _learningObjectsList[i].lo.lastname,
                    LikeThis = _learningObjectsList[i].lo.like,
                    BorderColor = StaticStyles.Colors[_learningObjectsList[i].lo.color_id%4].MainColor
                };

                item.Selected += item_Selected;
                item.DoLike += item_DoLike;
                _itemsList.Add(item);
                //
                item.ImageBytes = _learningObjectsList[i].cover_bytes;
                _learningObjectsList[i].PropertyChanged += (s, e) =>
                {
                    if (e.PropertyName == "cover_bytes")
                        item.ImageBytes = (s as MainViewModel.lo_by_circle_wrapper).cover_bytes;

                    if (e.PropertyName == "background_bytes")
                    { }
                };

                container.Children.Add(item);
                _mainpanel.Children.Add(container);
            }
        }