public ItemDetailPage(ArticleDataItem item)
 {
     acNo = item.acNo;
     InitializeComponent();
     BindData();
     BindControls();
 }
 public bool AddItem(ArticleDataItem tile)
 {
     if (!itemsCore.Contains(tile))
     {
         itemsCore.Add(tile);
         return(true);
     }
     return(false);
 }
 public GroupItemDetailPage(ArticleDataItem item, PageGroup child, int index)
 {
     InitializeComponent();
     pageGroupCore         = child;
     indexCore             = index;
     labelTitle.Text       = item.Title;
     labelSubtitle.Text    = item.Subtitle;
     imageControl.Image    = DevExpress.Utils.ResourceImageHelper.CreateImageFromResources(item.ImagePath, typeof(ItemDetailPage).Assembly);
     labelDescription.Text = item.Description;
 }
        public bool AddItem(ArticleDataItem tile)
        {
            if (tile == null)
            {
                return(false);
            }
            string        groupName = tile.GroupName == null ? "" : tile.GroupName;
            PageDataGroup thisGroup = GetGroup(groupName);

            if (thisGroup == null)
            {
                thisGroup = new PageDataGroup(groupName);
                groupsCore.Add(thisGroup);
            }
            return(thisGroup.AddItem(tile));
        }
Exemple #5
0
        private void CreateLayoutCore(ArticleDataItem item, PageGroup child, int index)
        {
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).BeginInit();
            DevExpress.XtraLayout.LayoutControlItem layoutTileItem = new DevExpress.XtraLayout.LayoutControlItem();
            GroupItemDetailPage page = new GroupItemDetailPage(item, child, index);

            page.Tag = pageGroupCore;
            layoutTileItem.Control               = page;
            layoutTileItem.Location              = new System.Drawing.Point(0, 0);
            layoutTileItem.MinSize               = new System.Drawing.Size(winLayoutControl1.Width, page.Height);
            layoutTileItem.MaxSize               = new System.Drawing.Size(0, page.Height);
            layoutTileItem.SizeConstraintsType   = DevExpress.XtraLayout.SizeConstraintsType.Custom;
            layoutTileItem.TextSize              = new System.Drawing.Size(0, 0);
            layoutTileItem.TextToControlDistance = 0;
            layoutTileItem.TextVisible           = false;
            layoutControlGroup2.Add(layoutTileItem);
            ((System.ComponentModel.ISupportInitialize)(this.layoutControlItem2)).EndInit();
        }
        private Tile CreateTile(Document document, ArticleDataItem item)
        {
            Tile tile = new Tile();

            tile.Document = document;
            tile.Group    = item.GroupName;
            tile.Tag      = item;
            tile.Elements.Add(CreateTileItemElement(item.Subtitle, TileItemContentAlignment.BottomLeft, Point.Empty, 9));
            tile.Elements.Add(CreateTileItemElement(item.Title, TileItemContentAlignment.MiddleLeft, Point.Empty, 14));
            tile.Appearances.Selected.BackColor   = tile.Appearances.Hovered.BackColor = tile.Appearances.Normal.BackColor = Color.FromArgb(140, 140, 140);
            tile.Appearances.Selected.BorderColor = tile.Appearances.Hovered.BorderColor = tile.Appearances.Normal.BorderColor = Color.FromArgb(140, 140, 140);
            if (item.commentCount == "0")
            {
                tile.Appearances.Selected.BorderColor = tile.Appearances.Hovered.BorderColor = tile.Appearances.Normal.BorderColor = Color.FromArgb(156, 184, 180);
            }
            else if (item.commentCount.Length > 2)
            {
                tile.Appearances.Selected.BorderColor = tile.Appearances.Hovered.BorderColor = tile.Appearances.Normal.BorderColor = Color.FromArgb(197, 31, 31);
            }
            tile.Click += new TileClickEventHandler(tile_Click);
            windowsUIView.Tiles.Add(tile);
            tileContainer.Items.Add(tile);
            return(tile);
        }