如何将一个属性分配给另一个元素的属性. [英] How to assign a property to another element's property.

查看:127
本文介绍了如何将一个属性分配给另一个元素的属性.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个问题,有必要将一个元素的属性分配给另一个元素的属性:

Hi, I meet a problem and it''s necessary to assign a property of a element to the property of another element:

<TextBlock Name="tb" Text="s">
<TextBlock Text=tb.Text>



当然,这些代码不起作用,那么,如何使这些代码运行?

此处不允许使用绑定.

并且不允许将该元素的属性定义为静态.



Of course, these codes are not going to work, so, how can I make these codes run?

Binding is not allowed to use here.

And the property of the element is not allowed to be defined as static.

推荐答案

好吧,因为您不想使用Binding.我不确定您能做到这一点.没有TextChanged事件.

更多信息 [
Well, since you don''t want to use Binding. I''m not sure you can do that. There is no TextChanged event.

more info[^]


我从MSDN得到了答案:

http://social.msdn.microsoft.com/论坛/en-US/wpf/thread/ca33c511-d833-4264-9534-6ef9a73078f7 [
I got the answer from the MSDN:

http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/ca33c511-d833-4264-9534-6ef9a73078f7[^]


这篇关于如何将一个属性分配给另一个元素的属性.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆