class Window1
{
void OpenSecondWindow()
{
var window = new Window2();
window.SetTextboxContext(textbox);
window.Show();
}
}
class Window2
{
public void SetTextboxContext(object context)
{
textblock.DataContext = context;
}
}
XAML:
Окно1:
<Window>
<TextBox x:Name="textbox" />
</Window>
Окно2:
<Window>
<TextBlock x:Name="textblock" Text="{Binding Text}" />
</Window>