Results 1 to 3 of 3

Thread: [RESOLVED] Slider

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2009
    Posts
    904

    Resolved [RESOLVED] Slider

    i just binded the slider with an image so that when i am sliding the slider,then the image will enlarge or shrink (Sorry for not using the proper terms but i am sure that one using the wpf can understand what i am trying to say)

    here is what i did:
    Code:
    <Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
        <StackPanel>
            <Slider x:Name="imageslider" Minimum="100" Maximum="500" Width="200"></Slider>
            <Image Source="Untitled.jpg" Width="{Binding ElementName=imageslider,Path=value}" Height="{Binding ElementName=imageslider,Path=value}" HorizontalAlignment="Center" Stretch="None" DataContext="{Binding}"></Image>
        </StackPanel>
    </Window>
    unfortunately when i am sliding the slider,then the image is not enlarging or shrinking

    any help please?

    Name:  Untitled.jpg
Views: 364
Size:  21.0 KB
    Last edited by HowTo; May 15th, 2010 at 06:49 AM.

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2009
    Posts
    904

    Re: Slider

    Property names are casesensitive

    Code:
    <Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525">
        <StackPanel>
            <Slider x:Name="imageslider" Minimum="100" Maximum="500" Width="200"/>
            <Image Source="Untitled.jpg" Width="{Binding ElementName=imageslider,Path=Value}" Height="{Binding ElementName=imageslider,Path=Value}" HorizontalAlignment="Center" Stretch="UniformToFill" />
        </StackPanel>
    
    </Window>
    Last edited by HowTo; May 15th, 2010 at 10:32 AM.

  3. #3
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] Slider

    Property names are casesensitive
    lol I found this out the hard way as well
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width