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. linux 系统升级中的一些配置

    1. 关闭IPV6 vi /etc/sysconfig/network NETWORKING_IPV6=no    #掉 source /etc/sysconfig/network vi /etc/m ...

  2. java基本类型(内置类型)取值范围

    例1: public class PrimitiveTypeTest { public static void main(String[] args) { // byte System.out.pri ...

  3. IDEA使用从Eclipse过来的快捷键

    1.Eclipse中的ctrl+shift+o --------> Ctrl + Alt + O 2.Eclipse中快捷键是Ctrl+O ---------> MacOS 下是 cmd+ ...

  4. 【u028】数列的整除性

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 对于任意一个整数数列,我们可以在每两个整数中间任意放一个符号'+'或'-',这样就可以构成一个表达式, ...

  5. 为什么未来是全栈project师的世界?

    谨以此文献给每个为成为优秀全栈project师奋斗的人. 节选自<Growth: 全栈增长project师指南> 技术在过去的几十年里进步非常快,也将在未来的几十年里发展得更快. 今天技术 ...

  6. JS前端图形化插件之利器Gojs组件(php中文网)

    JS前端图形化插件之利器Gojs组件(php中文网) 一.总结 一句话总结:php中文网我可以好好走一波 二.JS前端图形化插件之利器Gojs组件 参考: JS前端图形化插件之利器Gojs组件-js教 ...

  7. Erlang/OTP 中文手册

    http://erldoc.com/ Open Telecom Platform application array asn1rt base64 binary calendar code dbg di ...

  8. 【t087】公共汽车

    Time Limit: 1 second Memory Limit: 128 MB [问题描述] 路人丁成为了一名新公交车司机,每个司机都有一张牌子,牌子的正面写了拥有这个牌子的司机开的线路号,另外一 ...

  9. Windows 平台下 LiteIDE 的安装和使用

    1. 安装 Go 语言并设置环境变量 参考博客<Windows 平台下 Go 语言的安装和环境变量设置>. 2. MinGW 的下载和安装 Windows 下的 Go 调试还需要安装 Mi ...

  10. Linux下用GCC

    Linux下用GCC 前言 离职前对做过的支付系统进行了一番#总结,继续完善我的C服务器. 本想着接下来大概实现一下 CGI 协议,但是实现过程中被一个问题卡住了: C进程与php进程的交互数据类型问 ...