⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bindingtoctrl.xaml.cs

📁 学习WPF的好东西
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
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 DTSample
{    

    public partial class BindingToCtrl : System.Windows.Window
    {

        public BindingToCtrl()
        {
            InitializeComponent();
        }
        BindingClass BindPath = new BindingClass("I'm a textBox", 100);
        
        private void Onload(Object sender, EventArgs e)
        {
            MyTextBox.DataContext = BindPath;
            MyTextBlock.DataContext = BindPath;            
        }

        private void OnClick(object sender, RoutedEventArgs e)
        {
            BindingExpression be = MyTextBox.GetBindingExpression(TextBox.TextProperty);
            be.UpdateSource();
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -