新增Breadcrumb面包屑

This commit is contained in:
czz_y 2024-09-14 12:59:27 +08:00
parent 575de39050
commit c888cc778c
6 changed files with 318 additions and 0 deletions

View File

@ -170,6 +170,9 @@ namespace AntdUIDemo
case "StackPanel": case "StackPanel":
control = new StackPanelDemo(); control = new StackPanelDemo();
break; break;
case "Breadcrumb":
control = new BreadcrumbDemo();
break;
case "Dropdown": case "Dropdown":
control = new DropDownDemo(); control = new DropDownDemo();
break; break;

View File

@ -28,6 +28,7 @@ namespace AntdUIDemo.Models
}, },
{ "导航", new List<MenuItems> { "导航", new List<MenuItems>
{ {
new MenuItems { Text = "Breadcrumb 面包屑", Tag = "Breadcrumb"},
new MenuItems { Text = "Dropdown 下拉菜单", Tag = "Dropdown"}, new MenuItems { Text = "Dropdown 下拉菜单", Tag = "Dropdown"},
new MenuItems { Text = "Menu 导航菜单", Tag = "Menu"}, new MenuItems { Text = "Menu 导航菜单", Tag = "Menu"},
new MenuItems { Text = "Pagination 分页", Tag = "Pagination"}, new MenuItems { Text = "Pagination 分页", Tag = "Pagination"},

View File

@ -55,6 +55,8 @@
#### VirtualPanel 虚拟布局 #### VirtualPanel 虚拟布局
### 导航 ### 导航
#### Breadcrumb 面包屑
![Breadcrumb](assets/screenshots/Breadcrumb.png)
#### Dropdown 下拉菜单 #### Dropdown 下拉菜单
![Dropdown](assets/screenshots/Dropdown.png) ![Dropdown](assets/screenshots/Dropdown.png)
#### Menu 导航菜单 #### Menu 导航菜单

172
Views/BreadcrumbDemo.Designer.cs generated Normal file
View File

@ -0,0 +1,172 @@
namespace AntdUIDemo.Views
{
partial class BreadcrumbDemo
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region
/// <summary>
/// 设计器支持所需的方法 - 不要修改
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
AntdUI.BreadcrumbItem breadcrumbItem8 = new AntdUI.BreadcrumbItem();
AntdUI.BreadcrumbItem breadcrumbItem9 = new AntdUI.BreadcrumbItem();
AntdUI.BreadcrumbItem breadcrumbItem10 = new AntdUI.BreadcrumbItem();
AntdUI.BreadcrumbItem breadcrumbItem11 = new AntdUI.BreadcrumbItem();
AntdUI.BreadcrumbItem breadcrumbItem12 = new AntdUI.BreadcrumbItem();
AntdUI.BreadcrumbItem breadcrumbItem13 = new AntdUI.BreadcrumbItem();
AntdUI.BreadcrumbItem breadcrumbItem14 = new AntdUI.BreadcrumbItem();
this.stackPanel1 = new AntdUI.StackPanel();
this.label4 = new AntdUI.Label();
this.divider1 = new AntdUI.Divider();
this.label2 = new AntdUI.Label();
this.label1 = new AntdUI.Label();
this.breadcrumb1 = new AntdUI.Breadcrumb();
this.label3 = new AntdUI.Label();
this.breadcrumb2 = new AntdUI.Breadcrumb();
this.stackPanel1.SuspendLayout();
this.SuspendLayout();
//
// stackPanel1
//
this.stackPanel1.Controls.Add(this.breadcrumb2);
this.stackPanel1.Controls.Add(this.label3);
this.stackPanel1.Controls.Add(this.breadcrumb1);
this.stackPanel1.Controls.Add(this.label4);
this.stackPanel1.Controls.Add(this.divider1);
this.stackPanel1.Controls.Add(this.label2);
this.stackPanel1.Controls.Add(this.label1);
this.stackPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stackPanel1.Location = new System.Drawing.Point(0, 0);
this.stackPanel1.Name = "stackPanel1";
this.stackPanel1.Size = new System.Drawing.Size(700, 505);
this.stackPanel1.TabIndex = 0;
this.stackPanel1.Text = "stackPanel1";
this.stackPanel1.Vertical = true;
//
// label4
//
this.label4.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label4.Location = new System.Drawing.Point(3, 97);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(694, 24);
this.label4.TabIndex = 46;
this.label4.Text = "基本用法";
//
// divider1
//
this.divider1.Location = new System.Drawing.Point(3, 79);
this.divider1.Name = "divider1";
this.divider1.Size = new System.Drawing.Size(694, 12);
this.divider1.TabIndex = 45;
//
// label2
//
this.label2.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label2.Location = new System.Drawing.Point(3, 49);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(694, 24);
this.label2.TabIndex = 44;
this.label2.Text = "显示当前页面在系统层级结构中的位置,并能向上返回。";
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft YaHei UI", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(3, 3);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(694, 40);
this.label1.TabIndex = 43;
this.label1.Text = "Breadcrumb 面包屑";
//
// breadcrumb1
//
this.breadcrumb1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
breadcrumbItem8.ID = null;
breadcrumbItem8.Text = "Home";
breadcrumbItem9.ID = null;
breadcrumbItem9.Text = "Application Center";
breadcrumbItem10.ID = null;
breadcrumbItem10.Text = "Application List";
breadcrumbItem11.ID = null;
breadcrumbItem11.Text = "An Application";
this.breadcrumb1.Items.Add(breadcrumbItem8);
this.breadcrumb1.Items.Add(breadcrumbItem9);
this.breadcrumb1.Items.Add(breadcrumbItem10);
this.breadcrumb1.Items.Add(breadcrumbItem11);
this.breadcrumb1.Location = new System.Drawing.Point(3, 127);
this.breadcrumb1.Name = "breadcrumb1";
this.breadcrumb1.Size = new System.Drawing.Size(694, 32);
this.breadcrumb1.TabIndex = 47;
this.breadcrumb1.Text = "breadcrumb1";
//
// label3
//
this.label3.Font = new System.Drawing.Font("Microsoft YaHei UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label3.Location = new System.Drawing.Point(3, 165);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(694, 24);
this.label3.TabIndex = 48;
this.label3.Text = "图标";
//
// breadcrumb2
//
this.breadcrumb2.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F);
breadcrumbItem12.IconSvg = "HomeOutlined";
breadcrumbItem12.ID = null;
breadcrumbItem12.Text = "";
breadcrumbItem13.IconSvg = "UserOutlined";
breadcrumbItem13.ID = null;
breadcrumbItem13.Text = "Application Center";
breadcrumbItem14.ID = null;
breadcrumbItem14.Text = "Application";
this.breadcrumb2.Items.Add(breadcrumbItem12);
this.breadcrumb2.Items.Add(breadcrumbItem13);
this.breadcrumb2.Items.Add(breadcrumbItem14);
this.breadcrumb2.Location = new System.Drawing.Point(3, 195);
this.breadcrumb2.Name = "breadcrumb2";
this.breadcrumb2.Size = new System.Drawing.Size(694, 32);
this.breadcrumb2.TabIndex = 49;
this.breadcrumb2.Text = "breadcrumb2";
//
// BreadcrumbDemo
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
this.Controls.Add(this.stackPanel1);
this.Name = "BreadcrumbDemo";
this.Size = new System.Drawing.Size(700, 505);
this.stackPanel1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private AntdUI.StackPanel stackPanel1;
private AntdUI.Label label4;
private AntdUI.Divider divider1;
private AntdUI.Label label2;
private AntdUI.Label label1;
private AntdUI.Breadcrumb breadcrumb1;
private AntdUI.Breadcrumb breadcrumb2;
private AntdUI.Label label3;
}
}

20
Views/BreadcrumbDemo.cs Normal file
View File

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace AntdUIDemo.Views
{
public partial class BreadcrumbDemo : UserControl
{
public BreadcrumbDemo()
{
InitializeComponent();
}
}
}

120
Views/BreadcrumbDemo.resx Normal file
View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>