tags:

views:

30

answers:

1

Hi,

Given the code below:

<Window x:Class="Window3"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window3" Height="300" Width="300">
    <StackPanel Background="Yellow" Orientation="Horizontal">
        <TextBlock Background="Green" Text="some text" Width="200"/>
        <TextBox Width="{Binding ???}" />
        <TextBlock Background="Red" Text="some text" Width="50"/>
    </StackPanel>
</Window>

how do you bind second textbox's width as to fill the remaining space?

Please keep in mind I'm looking for a binding solution: I know how to do it using other layouts (like DockPanel or grid) but I'm not interested in that. Also, using ElementName is not of interest.

Thanks.

A: 

Read this link hope you get your answer.

Asim Sajjad