Binding Property Of Control From Other Control Using XAML in WPF

Hello, today i am going to tell you how to bind "Content" property of label to the textbox "Text" property.........
hmmmmm, i know that you are thinking what new in this , this can be achieved using simple coding but in this post i am going to tell you how can you achieve this using XAML(a strong part of wpf) , this is a new way of  binding , so plz take a look at this post.....
Well , lets do it with an example....... what we do is that we enter some text in textbox and at the same time the content of the label changes.. to achieve this use this part of code to set in content property of label in xaml window :-

<Label Name="lbl1" Content="{Binding ElementName=textbox1, Path=Text}"></Label>

here, ElementName tells -- to which control should the label control bind and the Path tells -- to which property it is binded

Hope, you all enjoy this and understood the motive of posting this post...... :-p



Total Pageviews