Is there a way to link (if that is the correct word to use) a button to a slider? I’m trying to create an image viewer which would be able to zoom through an image. I was able to accomplish this by using a slider which Tick is set as .25,.50 all the way up to 2 which would be a 25% to 200% image scale. But I would also like to implement a zoom in and out button (just like Microsoft Paint) that when clicked would make the slider arrow move to the next or previous tick (depending if zoom in or out) thus incrementing or decrementing the image scale by 25%. I’m new to WPF so I’m not familiar with all the properties I could use but I read that I could animate it by using Storyboard. Besides using storyboard is there another method of accomplishing what I intend to do. Right now my ZoomIn function is just a dummy and throws an exception since I'm still researching on how to do this. I'm Thanks for your help in advance.

XAML:

```
<Window x:Class="kazoom.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Zoom Window">
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition/>
        <RowDefinition Height="auto"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition/>
        <ColumnDefinition Width="auto"/>
    </Grid.ColumnDefinitions>
    <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
        <Grid x:Name="GridLoadedImage" HorizontalAlignment="Left" VerticalAlignment="Top">
            <Grid.LayoutTransform>
                <ScaleTransform ScaleX="{Binding ElementName=slider1, Path=Value}" ScaleY="{Binding ElementName=slider1, Path=Value}"/>
            </Grid.LayoutTransform>
            <Image Name="loaded" Grid.Column="1" Source="image/Desert.jpg" Stretch="Fill" />
        </Grid>
    </ScrollViewer>
    <StackPanel Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button x:Name="Import" Width="93" Height="20" Content="Import" Margin="10" />
        <Button x:Name="ZoomIn" Width="93" Height="20" Content="ZoomIn" Margin="10" />
    </StackPanel>

    <Slider Name="slider1"
            Grid.Row="1"
            Maximum="2"
            Minimum=".15"
            IsMoveToPointEnabled="True"
            TickPlacement="BottomRight"
            TickFrequency="2"
            Ticks=".15,.30,.45,.60,.75,1,1.15,1.30,1.45,1.60,1.75,2"
            Width="200"
            Margin="20"
            HorizontalAlignment="Center"
            SelectionStart="1" IsSnapToTickEnabled="True"/>

</Grid>
</Window>

```

Code Behind:

```
using Microsoft.Win32;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;

namespace kazoom
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {

    public MainWindow()
    {
        InitializeComponent();
        ZoomIn.AddHandler(Button.ClickEvent, new RoutedEventHandler(ZoomIn_Click));
        Import.AddHandler(Button.ClickEvent, new RoutedEventHandler(Import_Click));

    }

    private void Import_Click(object sender, RoutedEventArgs e)
    {
        OpenFileDialog image = new OpenFileDialog();
        image.FileName = "Picture";
        image.Filter = "Pictures (*.jpeg)|*.jpg";

        if (image.ShowDialog() == true)
        {
            loaded.Source = new BitmapImage(new Uri(image.FileName));
        }
    }
    private void ZoomIn_Click(object sender, RoutedEventArgs e)
    {
        throw new System.NotImplementedException();
    }
}

```

}