52 Star 382 Fork 147

csharpui/CPF

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ListBoxTemplate.cs 1.39 KB
一键复制 编辑 原始数据 按行查看 历史
xhm 提交于 2023-11-21 23:05 +08:00 . 初始化
using CPF;
using CPF.Animation;
using CPF.Controls;
using CPF.Drawing;
using CPF.Shapes;
using CPF.Styling;
using System;
using System.Collections.Generic;
using System.Text;
namespace ClassLibrary1
{
public class ListBoxTemplate : Control
{
protected override void InitializeComponent()
{
BorderThickness = "0,0,0,1";
BorderType = BorderType.BorderThickness;
BorderFill = "#B4B4B4";
Height = 37.8f;
Width = 245.7f;
//模板定义
Children.Add(new TextBlock
{
MarginLeft = 42.1f,
MarginRight = 13.7f,
Width = 190f,
Text = "CPF控件322",
Bindings =
{
{
"Text",
"Item1"
},
},
});
Children.Add(new Picture
{
MarginLeft = 6.1f,
Width = 28.2f,
Height = 26.9f,
Bindings =
{
{
nameof(Picture.Source),
"Item2"
}
}
});
Bindings.Add("a","b");
Bindings.Add("a1","b2",null,BindingMode.OneTime);
Bindings.Add("a3","b4");
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C#
1
https://gitee.com/csharpui/CPF.git
git@gitee.com:csharpui/CPF.git
csharpui
CPF
CPF
master

搜索帮助