public ItemDetailPage(SampleDataItem item) { InitializeComponent(); labelTitle.Text = item.Title; labelSubtitle.Text = item.Subtitle; imageControl.Image = DevExpress.Utils.ResourceImageHelper.CreateImageFromResources(item.ImagePath, typeof(ItemDetailPage).Assembly); labelContent.Text = item.Content; }
public bool AddItem(SampleDataItem tile) { if (!itemsCore.Contains(tile)) { itemsCore.Add(tile); return(true); } return(false); }
public GroupItemDetailPage(SampleDataItem 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(SampleDataItem tile) { if (tile == null) { return(false); } string groupName = tile.GroupName == null ? "" : tile.GroupName; SampleDataGroup thisGroup = GetGroup(groupName); if (thisGroup == null) { thisGroup = new SampleDataGroup(groupName); groupsCore.Add(thisGroup); } return(thisGroup.AddItem(tile)); }
void CreateLayoutCore(SampleDataItem 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(); }
Tile CreateTile(Document document, SampleDataItem item) { Tile tile = new Tile(); tile.Group = item.GroupName; tile.Tag = item; var dataItem = (SampleDataItem)tile.Tag; tile.Name = dataItem.Subtitle; switch (dataItem.Subtitle) { case "交接班": tile.Properties.ItemSize = TileItemSize.Wide; tile.Elements.Add(CreateTileItemElement(item.Subtitle, TileItemContentAlignment.TopLeft, new Point(20, 50), 26)); tile.Elements.Add(new TileItemElement() { Image = ((Image)(Properties.Resources.ResourceManager.GetObject("ico-系统设置"))), ImageSize = new Size(64, 64), ImageAlignment = TileItemContentAlignment.MiddleRight }); tile.Elements.Add(new TileItemElement() { Text = "进入快速销售收银", TextAlignment = TileItemContentAlignment.BottomLeft, TextLocation = new Point(20, -25) }); break; case "开始收银": tile.Properties.ItemSize = TileItemSize.Large; tile.Padding = new Padding(30); tile.Elements.Add(CreateTileItemElement(item.Subtitle, TileItemContentAlignment.TopLeft, new Point(20, 50), 26)); tile.Elements.Add(new TileItemElement() { Image = ((Image)(Properties.Resources.ResourceManager.GetObject("ico-系统设置"))), Height = 32, Width = 32, ImageSize = new Size(32, 32), ImageToTextAlignment = TileControlImageToTextAlignment.Right, ImageLocation = new Point(120, -50) }); tile.Elements.Add(new TileItemElement() { Text = "进入快速销售收银", TextAlignment = TileItemContentAlignment.BottomLeft, TextLocation = new Point(20, -25) }); break; //case "系统设置": // tile.Properties.ItemSize = TileItemSize.Wide; // tile.Elements.Add(CreateTileItemElement(item.Subtitle, TileItemContentAlignment.TopLeft, new Point(20, 50), 26)); // tile.Elements.Add(new TileItemElement() { Image = ((Image)(Properties.Resources.ResourceManager.GetObject("ico-" + dataItem.Subtitle))), ImageSize = new Size(64, 64), ImageToTextAlignment = TileControlImageToTextAlignment.Default }); // tile.Elements.Add(new TileItemElement() { Text = "系统相关参数设置", TextAlignment = TileItemContentAlignment.BottomLeft, TextLocation = new Point(20, -25) }); // break; //case "退出系统": // tile.Properties.ItemSize = TileItemSize.Medium; // tile.Properties.ItemSize = TileItemSize.Wide; // tile.Elements.Add(CreateTileItemElement(item.Subtitle, TileItemContentAlignment.TopLeft, new Point(20, 50), 26)); // tile.Elements.Add(new TileItemElement() { Image = ((Image)(Properties.Resources.ResourceManager.GetObject("ico-"+dataItem.Subtitle))), ImageSize = new Size(64, 64), ImageToTextAlignment=TileControlImageToTextAlignment.Default }); // tile.Elements.Add(new TileItemElement() { Text = "商品信息和库存信息查询", TextAlignment = TileItemContentAlignment.BottomLeft, TextLocation = new Point(20, -25) }); // break; //default: // tile.Properties.ItemSize = TileItemSize.Wide; // tile.Elements.Add(CreateTileItemElement(item.Subtitle, TileItemContentAlignment.TopLeft, new Point(20, 50), 26)); // tile.Elements.Add(new TileItemElement() { Image = ((Image)(Properties.Resources.ResourceManager.GetObject("ico-" + dataItem.Subtitle))), ImageSize = new Size(64, 64), ImageToTextAlignment = TileControlImageToTextAlignment.Default }); // tile.Elements.Add(new TileItemElement() { Text = "商品信息和库存信息查询", TextAlignment = TileItemContentAlignment.BottomLeft, TextLocation = new Point(20, -25) }); // break; } //tile.BackgroundImage = ((Image)(Properties.Resources.ResourceManager.GetObject("ico-"+dataItem.Subtitle))); item.Subtitle = string.Empty; //tile.Properties.BackgroundImageScaleMode = TileItemImageScaleMode.Default; tile.Elements.Add(CreateTileItemElement(item.Subtitle, TileItemContentAlignment.MiddleCenter, Point.Empty, 24)); tile.Appearances.Selected.BackColor = tile.Appearances.Hovered.BackColor = tile.Appearances.Normal.BackColor = RandomColor; tile.Appearances.Selected.BorderColor = tile.Appearances.Hovered.BorderColor = tile.Appearances.Normal.BorderColor = RandomColor; tile.Click += new TileClickEventHandler(tile_Click); //CreateAnimation(tile); tile.Padding = new System.Windows.Forms.Padding(0, 0, 0, 0); tileContainer.Items.Add(tile); return(tile); }