Silverlight / WPF - the following binding is not working plz help

Asked By aman on 02-Mar-11 01:19 AM
   <StackPanel HorizontalAlignment="Center">
        <Slider x:Name="slider1" Minimum="30" Maximum="300" Value="150" Width="300"/>
        <Rectangle Fill="Black" Height="200" Width="{Binding value, Mode=OneWay, ElementName=slider1}"/>
        <TextBlock FontSize="24" Text="{Binding value, Mode=OneWay, ElementName=slider1}"/>
        <TextBox x:Name="tbage"/>
        <HyperlinkButton Content="Enter Site" Visibility="Visible"/>
      </StackPanel>

thanxs,

regards,
Jatin Prajapati replied to aman on 02-Mar-11 11:26 AM
Hi aman,
There is a mistake in your code. You missed to write the Path in Binding expression. See the below updated one. Notice the changes in bold text.

<StackPanel HorizontalAlignment="Center">
      <Slider x:Name="slider1" Minimum="30" Maximum="300" Value="150" Width="300"/>
      <Rectangle Fill="Black" Height="200" Width="{Binding Path=Value, Mode=OneWay, ElementName=slider1}"/>
      <TextBlock FontSize="24" Text="{Binding Path=Value, Mode=OneWay, ElementName=slider1}"/>
      <TextBox x:Name="tbage"/>
      <HyperlinkButton Content="Enter Site" Visibility="Visible"/>
    </StackPanel>


Let me know the results.
aman replied to Jatin Prajapati on 03-Mar-11 11:15 PM
tnx for ur help, its working now................

regards,