Suppose I have usercontrol with textbox:
<UserControl x:Class="WpfApp5.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
...
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<TextBox Name="MyTextBox" Height="30"/>
</Grid>
</UserControl>
From the mainwindow I want to bind this TextBox to diffrerent properties, I need something like:
<Window x:Class="WpfApp5.MainWindow"
...
Title="MainWindow" Height="200" Width="200">
<Grid DataContext="{Binding Source={StaticResource Locator}, Path=MyViewModel}">
<UserControl MyTextBox.Text="{Binding Prop1}"/>
<UserControl MyTextBox.Text="{Binding Prop2}"/>
<UserControl MyTextBox.Text="{Binding Prop3}"/><!---->
</Grid>
</Window>
how to achive that?