WPF 后台设置数据绑定

来源:互联网 发布:安卓ehviewer网络错误 编辑:程序博客网 时间:2024/05/29 18:33
            Button btn = new Button();
            btn.Background = null;
            btn.Height = 32;

            Binding binding = new Binding();
            binding.Path = new PropertyPath("Height");
            binding.RelativeSource = RelativeSource.Self;
            btn.SetBinding(Button.ContentProperty, binding);

转自:http://blog.sina.com.cn/s/blog_a57b4c240101g0sj.html
0 0