using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace XamlTest
{
    /// <summary>
    /// Interaction logic for Window10.xaml
    /// </summary>
    public partial class Window10 : Window
    {
        public Window10()
        {
            InitializeComponent();
            List<string> lst = new List<string>() {"zhangsan","lisi","wangwu"};
            this.txt1.SetBinding(TextBox.TextProperty,new Binding("/"){Source=lst, Mode= BindingMode.OneWay});
            this.txt2.SetBinding(TextBox.TextProperty, new Binding("/Length") { Source = lst, Mode = BindingMode.OneWay });
            this.txt3.SetBinding(TextBox.TextProperty, new Binding("/[3]") { Source = lst, Mode = BindingMode.OneWay });

        }
    }
}

WPF Binding Path妙用代码实现的更多相关文章

  1. WPF Binding Path妙用

    <Window x:Class="XamlTest.Window9"        xmlns="http://schemas.microsoft.com/winf ...

  2. Wpf Binding.Path设置

    Binding.Path 获取或设置绑定源属性的路径. 每个绑定通常都具有四个组件:绑定目标对象.目标属性.绑定源,以及要使用的绑定源值的路径.有关这些数据绑定概念的更多信息,请参见数据绑定概述. 使 ...

  3. .NET: WPF Binding对数据的校验和转换以及多路Binding

    一.校验 一般需要对target上的值进行校验. xaml: <Window x:Class="WpfApplication1.MainWindow" xmlns=" ...

  4. WPF入门教程系列(二) 深入剖析WPF Binding的使用方法

    WPF入门教程系列(二) 深入剖析WPF Binding的使用方法 同一个对象(特指System.Windows.DependencyObject的子类)的同一种属性(特指DependencyProp ...

  5. WPF Binding

    winform有binding, WPF也有binding,区别在哪呢?这里暂时不提.以前也检查接触WPF binding, 但为什么过段时间就忘记了呢? 可能主要原因自己的知识体系不够完善吧,下面我 ...

  6. WPF Binding学习(二)

    Binding作为数据的桥梁,连通业务逻辑层的对象(源对象)和UI的控件对象(目标对象).在这座桥梁上,我们不仅可以控制在源对象与目标对象是双向通行还是单向通行.还可以控制数据的放行时机,甚至可以在这 ...

  7. WPF Binding ElementName方式无效的解决方法--x:Reference绑定

    原文:WPF Binding ElementName方式无效的解决方法--x:Reference绑定 需求: 背景:Grid的有一个TextBlock name:T1和一个ListBox,ListBo ...

  8. WPF binding 参考

    Introduction This is an article on WPF Binding Cheat Sheet. Some of the Binding won't work for Silve ...

  9. WPF Binding值转换器ValueConverter使用简介(二)-IMultiValueConverter

    注: 需要继承IMultiValueConverter接口,接口使用和IValueConverter逻辑相同. 一.MultiBinding+Converter 多值绑定及多值转换实例 当纵向流量大于 ...

随机推荐

  1. 【编程】常见概念的理解 —— inplace、vanity url、vanilla(code/software)、编译、链接、build、(delegate、proxy)

    inplace: 如修改一个文件等对象时, inplace=True,不创建新的对象,直接在原始对象上尽心修改: inplace=False,在对原始对象进行修改,而会创建新的对象: vanity u ...

  2. [Compose] 13. Lift into a Pointed Functor with of

    We examine the of function we've seen on a few types and discover it's the Pointed interface. Instea ...

  3. 数组filter方法对数组元素进行过滤

    Array.prototype.filter对数组中元素进行过滤 /** * @method reduce * @param {number} item 当前迭代的数组元素 * @param {num ...

  4. springmvc使用和经验总结(长沙师说网络科技有限公司)

    springmvc 先分析下代码,高速学习.先要把配置文件写好, 给上2个类详细看看 package com.shishuo.studio.action; import org.apache.log4 ...

  5. 20+ 个很有用的 jQuery 的 Google 地图插件 (英语)

    20+ 个很有用的 jQuery 的 Google 地图插件 (英语) 一.总结 一句话总结:英语提上来我才能快速去google上面找资源啊.google上面的资源要比百度丰富很多,然后有了英语就可以 ...

  6. c#代码01--控制台的简单输入与输出及日期的格式输出

    /* 使用ReadLine()完成控制台的输入输出内容 */ using System; namespace Test { class Test1 { static void Main(string[ ...

  7. findbugs静态代码分析工具使用教程

    FindBugs 是一个静态分析工具,很多程序猿都在使用,再次详细列出findbugs的使用教程,希望对大家有帮助. 1 安装 FindBugs通过检查类文件或 JAR文件,将字节码与一组缺陷模式进行 ...

  8. 快来看看Google出品的Protocol Buffer,别仅仅会用Json和XML了

    前言 习惯用 Json.XML 数据存储格式的你们,相信大多都没听过Protocol Buffer Protocol Buffer 事实上 是 Google出品的一种轻量 & 高效的结构化数据 ...

  9. asp.net webform中的ext.net使用

    ext.net是对ext.js进行封装的net控件库,能够砸webform 和mvc中使用,从今天器我会对这一年多的ext.net开发进行一些对应的总结. 首先针对ext.net进行引用: <% ...

  10. hadoop 3.x 配置日志聚集功能

    打开$HADOOP_HOME/etc/hadoop/yarn-site.xml,增加以下配置(在此配置文件中尽量不要使用中文注释) <!--logs--> <property> ...