Zoom In and Zoom out
Zoom In and Zoom out On mouse wheel move in silverlight
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Lalit MRank #1,186 · 1.5K reputationPosted Mar 11, 2010, 11:36 PM EST
Try this code sample bool zooming = ctrlKey && (Keyboard.Modifiers & ModifierKeys.Shift) == ModifierKeys.Shift; if (zooming) { // go through all element beneath the current mouse position IEnumerable elements = VisualTreeHelper.FindElementsInHostCoordinates(currentPoint, s_rootElement); foreach (UIElement element in elements) { IMouseWheelZoom mouseZooming = element as IMouseWheelZoom; if (mouseZooming != null) { mouseZooming.OnMouseWheelZooming( new MouseWheelZoomingEventArgs(currentPoint, e.Delta)); break; } } } else { // normal.... } for reference http://blog.thekieners.com/2009/04/06/how-to-enable-mouse-wheel-scrolling-in-silverlight-without-extending-controls/ http://www.hanselman.com/blog/TheWeeklySourceCode18DeepZoomSeadragonSilverlight2MultiScaleImageMouseWheelZoomingAndPanningEdition.aspxDeivaMurugan D4 reputationPosted May 12, 2010, 5:14 AM EDT
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
d:DesignWidth="640" d:DesignHeight="480"
Title="ZoomIn Page">
XAML.CS
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Navigation;
namespace BillingFinance
{
public partial class ZoomIn : Page
{
public ZoomIn()
{
InitializeComponent();
}
// Executes when the user navigates to this page.
protected override void OnNavigatedTo(NavigationEventArgs e)
{
}
private void ZoomIn_Click(object sender, RoutedEventArgs e)
{
storyboard.Begin();
}
private void ZoomOut_Click(object sender, RoutedEventArgs e)
{
storyboard.Stop();
}
private void Image_MouseWheel(object sender, MouseWheelEventArgs e)
{
storyboard.Begin();
}
}
}