原文:WPF Bind 绑定

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/koloumi/article/details/74332515

用过WPF的童鞋应该都是知道WPF最好用的就是这个 绑定了,这里简单记录一下关于绑定的。
/// <summary>
/// 绑定元素的属性到一个对象的属性中
/// </summary>
/// <param name="orgObj">绑定到的对象</param>
/// <param name="bindName">要绑定到的对象的属性的名称</param>
/// <param name="binded">被绑定的的元素</param>
/// <param name="proDep">被绑定的依赖</param>
/// <param name="mode">绑定的模式</param>
public static void BindElementToData(object orgObj, string bindName, FrameworkElement binded, DependencyProperty proDep, BindingMode mode = BindingMode.Default)
{
Binding bind = new Binding()
{
Source = orgObj,
Path = new PropertyPath(bindName),
Mode = mode,
};
BindingOperations.SetBinding(binded, proDep, bind);
}
简单的上一个我自己写的绑定的函数。

WPF Bind 绑定的更多相关文章

  1. 背水一战 Windows 10 (21) - 绑定: x:Bind 绑定, x:Bind 绑定之 x:Phase, 使用绑定过程中的一些技巧

    [源码下载] 背水一战 Windows 10 (21) - 绑定: x:Bind 绑定, x:Bind 绑定之 x:Phase, 使用绑定过程中的一些技巧 作者:webabcd 介绍背水一战 Wind ...

  2. 绑定: x:Bind 绑定, x:Bind 绑定之 x:Phase, 使用绑定过程中的一些技巧

    背水一战 Windows 10 之 绑定 x:Bind 绑定 x:Bind 绑定之 x:Phase 使用绑定过程中的一些技巧 示例1.演示 x:Bind 绑定的相关知识点Bind/BindDemo.x ...

  3. 【WPF】最近在学习wpf 的绑定,,

    最近在学习wpf 的绑定,,1.简单的说就是版前端和后端用自己的方法给分开了2.baseVm 模型 baseCmd 命令3.命令传参修改的只是界面里的属性,而不修改其它的值4.前端改变后端, 后端改变 ...

  4. jquery中bind()绑定多个事件

    bind()绑定事件 $(selector).bind(event,data,function): 参数event为事件名称(如"click,mouseover....."),da ...

  5. 背水一战 Windows 10 (22) - 绑定: 通过 Binding 绑定对象, 通过 x:Bind 绑定对象, 通过 Binding 绑定集合, 通过 x:Bind 绑定集合

    [源码下载] 背水一战 Windows 10 (22) - 绑定: 通过 Binding 绑定对象, 通过 x:Bind 绑定对象, 通过 Binding 绑定集合, 通过 x:Bind 绑定集合 作 ...

  6. wpf直接绑定xml生成应用程序

    目的:在vs2010下用wpf完成一个配置工具,配置文件为xml格式,xml文件作为数据源,直接和wpf前台绑定,生成exe后,运行exe能够加载同路径下的xml配置文件并显示 xml文件在项目中的设 ...

  7. 绑定: 通过 Binding 绑定对象, 通过 x:Bind 绑定对象, 通过 Binding 绑定集合, 通过 x:Bind 绑定集合

    背水一战 Windows 10 之 绑定 通过 Binding 绑定对象 通过 x:Bind 绑定对象 通过 Binding 绑定集合 通过 x:Bind 绑定集合 示例1.演示如何通过 Bindin ...

  8. WPF DataGrid绑定一个组合列

    WPF DataGrid绑定一个组合列 前台: <Page.Resources>        <local:InfoConverter x:Key="converter& ...

  9. WPF DataGrid 绑定行双击行命令

    WPF DataGrid 绑定行双击行命令 <DataGrid ...> <DataGrid.InputBindings> <MouseBinding MouseActi ...

随机推荐

  1. windows版 nginx配置反向代理实例教程 跳转tomcat和php网站

    抄自 https://www.cnblogs.com/j-star/p/8785334.html 个人理解 nginx端口设置为80,简称n tomcat端口设置为其他,例如8080,简称t php网 ...

  2. AES 加密解密

    package XX.XX.XX.test; import java.io.IOException; import java.io.UnsupportedEncodingException; impo ...

  3. [Angular] Step-By-Step Implementation of a Structural Directive - Learn ViewContainerRef

    For example we have two buttons: When we click nether one of those tow button, the modal should show ...

  4. java測试网络连接是否成功并设置超时时间

    /** * 获取RMI接口状态 * * @return "0":服务正常,"1": 连接报错,"2":连接超时 */ @Override p ...

  5. Internet连接共享只能上qq不能打开网页的问题解决

    作者:朱金灿 来源:http://blog.csdn.net/clever101 之前我写过一篇<Windows共享上网的做法>,在设置共享网络时是有一个家庭网络连接的选项的,如下图: 但 ...

  6. 翻译《虚幻引擎4艺术大师 - 蓝图 II 》 中文版

    本文章由cartzhang编写,转载请注明出处. 所有权利保留. 文章链接: http://blog.csdn.net/cartzhang/article/details/46504583 作者:ca ...

  7. 神经网络 vs 大脑

    海马区域(负责记忆的关键区域) 0. 常见概念 神经递质:neurotransmitter 在突触传递中是担当"信使"的特定化学物质.简称递质. 重要的神经递质有:乙酰胆碱: 1. ...

  8. 【69.77%】【codeforces 723A】The New Year: Meeting Friends

    time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard ou ...

  9. Kolya and Tandem Repeat

     Kolya and Tandem Repeat time limit per test 2 seconds memory limit per test 256 megabytes input s ...

  10. 如何去掉windows2003的自动锁定(每离开一会都会出现这个界面,不想让它出现)

    http://zhidao.baidu.com/link?url=SOCv57C-hX_3f0Xl0J0RFIVXpowXk73zdQd2B-wMUzYOm5E_N397bw_UkX4uLPlAiWQ ...