Click here to Skip to main content
15,890,336 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I meet a problem and it's necessary to assign a property of a element to the property of another element:

XML
<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.
Posted

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

more info[^]
 
Share this answer
 
Comments
xnacs@foxmail.com 18-Jul-10 9:14am    
Maybe there is a misunderstanding.
I don't need the TextChanged event or else.

For this inline [TextBlock Name="2ndtb" Text=tb.Text], I want the "2ndtb".Text is assigned once by tb.Text, and separated for tb.Text.

That means the binding is doing just the opposite thing from what I wanted.
Xmen Real 18-Jul-10 9:17am    
You mean, once you set textblock1 it set textblock2 but only first time ?
xnacs@foxmail.com 21-Jul-10 11:45am    
I am sorry for being late.

There is no alert when adding comments.

For your question, yes, it sets only the first time.
 
Share this answer
 
Comments
Xmen Real 23-Jul-10 9:22am    
glad you found the solution, even I got something to learn about OneTime binding ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900