C# WPF TextBox绑定数据的简单应用
2015-06-25 23:26
501 查看
public class RWhiteBoard
{
public string MCode
{
get { return publicPro.strMCode; }
set { publicPro.strMCode = value; }
}
public string RCode
{
get { return publicPro.strRCode; }
set { publicPro.strRCode = value; }
}
}
public class AA
{
...
RWhiteBoard rw = new RWhiteBoard();
Binding bi = new Binding();
bi.Source = rw;
bi.Path = new PropertyPath("MCode");
this.textBox1.SetBinding(TextBox.TextProperty, bi);
...
}
{
public string MCode
{
get { return publicPro.strMCode; }
set { publicPro.strMCode = value; }
}
public string RCode
{
get { return publicPro.strRCode; }
set { publicPro.strRCode = value; }
}
}
public class AA
{
...
RWhiteBoard rw = new RWhiteBoard();
Binding bi = new Binding();
bi.Source = rw;
bi.Path = new PropertyPath("MCode");
this.textBox1.SetBinding(TextBox.TextProperty, bi);
...
}
相关文章推荐
- csharp: get Web.Services WebMethod
- C# 操作office
- WP8.1发送Post或Get请求顺带文件上传
- C# 函数式编程
- ArcGIS / C#开发 无法读取Excel(*.xlsx)文件
- C# 只允许运行一个实例
- C# 实体类序列化与反序列化一 (XmlSerializer)
- C# 实体类序列化与反序列化一 (XmlSerializer)
- c# des 加密 解密
- C#读取文件路径
- 在C#中子线程如何操作主窗口线程上的控件
- C#中五个序列聚合运算(Sum, Average, Min, Max,Aggregate)
- c# datetime 格式化大全与使用总结
- c#sdk的pfop使用代码说明
- 【C#】打印机 printDocument、printDialog、PageSetupDialog、printPreviewDialog
- 第二章 深入 C# 数据类型
- .NET: C#: Datetime
- C# 计算时间差 用timespan函数
- C# 里用到的scalar variable
- 用c#读取excel文件缺少第一行数据解决方法