数据绑定
来源:互联网 发布:网络外教一对一 编辑:程序博客网 时间:2024/05/10 00:44
<Window x:Class="WpfApplication11.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:WpfApplication11" xmlns:sys="clr-namespace:System;assembly=mscorlib" mc:Ignorable="d" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <sys:String x:Key="stringData">1234</sys:String> </Window.Resources> <StackPanel> <TextBox x:Name="textBox1" Text="Hi! XiaoIce!"> </TextBox> <TextBox x:Name="textBox2" Text="{Binding ElementName=textBox1,UpdateSourceTrigger=Explicit,Path=Text, Mode=TwoWay}"> </TextBox> <TextBox x:Name="textBox3" Text="{StaticResource ResourceKey=stringData}"> </TextBox> <TextBox x:Name="textBox4" Text="{Binding TEXT}"> </TextBox> </StackPanel></Window>
using System.Windows;namespace WpfApplication11{ /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); this.DataContext = this; TEXT = "12345"; } public string TEXT { set; get; } }}
0 0
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 数据绑定
- 工作小结
- 如何根据银行卡号判断卡的真伪
- Packet Tracer
- 快速查询图片
- 一个简单的命令行聊天程序
- 数据绑定
- MFC定时器
- 帝国备份王放到空间以后打开index.php显示空白页的解决办法
- PMP杂谈--进度数据,进度工具,进度方法,进度模型
- PCB打烊Gerber文件生成方法
- SPOJ 题目7528 SUBLEX - Lexicographical Substring Search(后缀自动机求排名k的子串)
- 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失
- Android强制设置横屏或竖屏
- CDN内容分发网络