title: WPF Zoom control
body: <p>How to implement zooming in wpf? Creating an application in which user can upload and draw on the map.On using zoom slider, user is not able to draw on the map. Without zoom slider the user is able to draw. Instead of third party controls, is there any way to implement zooming? I tried implementing it and i can see the slider in xaml but when i run it,the slider disappears</p>
  
  <p><a href="http://i.stack.imgur.com/o8a9d.png" rel="nofollow">enter image description here</a>
  Any ideas are greatly appreciated. Thanks a lot.</p>
  
  <pre><code>     &lt;Grid&gt;
                                  &lt;Grid.ColumnDefinitions&gt;
                                      &lt;ColumnDefinition Width="273.333"/&gt;
                                      &lt;ColumnDefinition Width="1026.667"/&gt;
                                  &lt;/Grid.ColumnDefinitions&gt;
  
                                  &lt;Slider x:Name="uiScaleSlider" ToolTip="Determines the UI scale factor." Value="1" Minimum="0.1" Maximum="4" Margin="67,0,-67,-0.333" Grid.ColumnSpan="2"/&gt;
                                  &lt;DockPanel Grid.Column="0" Grid.ColumnSpan="2" LastChildFill="True" Margin="0,0,0,-0.333"&gt;
                                      &lt;DockPanel.LayoutTransform&gt;
  
                                          &lt;ScaleTransform 
          CenterX="0" CenterY="0"
          ScaleX="{Binding ElementName=uiScaleSlider,Path=Value}"
          ScaleY="{Binding ElementName=uiScaleSlider,Path=Value}"
      /&gt;
                                      &lt;/DockPanel.LayoutTransform&gt;
                                      &lt;Canvas x:Name="drawingCanvas" Margin="0,10,85,33"&gt;
                                          &lt;Canvas.Background&gt;
                                              &lt;ImageBrush ImageSource="../Images/canvas.png" AlignmentX="Center" AlignmentY="Center" Stretch="Fill"/&gt;
                                          &lt;/Canvas.Background&gt;
                                      &lt;/Canvas&gt;
                                  &lt;/DockPanel&gt;
                              &lt;/Grid&gt;
                          &lt;/ScrollViewer&gt;
                          &lt;GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Top" ResizeDirection="Rows" /&gt;
  
                      &lt;/Grid&gt;
  </code></pre>