Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My project have two WPF Forms: Form1 and Form2. In Form1 I have 1 button to call Form2, textBox1, textBox2, textBox3, textBox4, Form2 has only one textBox and a Save button. So when I click button, it show Form2. In textBox I make a template text like:
"blablabla %txt1% blablabla %txt2% blabla %txt3% blabla"


I click Save button to Save it. When return Form1, textBox4 will display content in template text in which %txt1%, %txt2%,%txt3% will change depend on textBox1, textBox2, textBox3. I intend to use MultiBinding to bind content in textBox1,2,3 into textBox4, it like that:
XML
<TextBox Name="textBox4">
 <TextBox.Text>
  <MultiBinding StringFormat = "blablabla {0} blablabla {1} blabla {2} blabla"
   <Binding ElementName = "textBox1" Path="Text"/>
   <Binding ElementName = "textBox2" Path="Text"/>
   <Binding ElementName = "textBox3" Path="Text"/>
  </MultiBinding>
 </TextBox.Text>
</TextBox>


And my problem: how to get
"blablabla {0} blablabla {1} blabla {2} blabla"

from textBox in Form2 and put it to StringFormat? I'm mean I can't use Bind data from textBox in Form2 to MultiBinding.
Posted

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