コード例 #1
0
 /// <summary>
 /// This should be called exactly one time in the constructor of the application's main XAML
 /// code behind file, immediately after the call to InitializeComponent().
 /// </summary>
 /// <param name="applicationRootVisual">The application root visual. Just give a name to the root element of your application and pass it in here.</param>
 /// <param name="activationMode">Specifies whether the mouse wheel is associated with a <see cref="ScrollViewer" /> by simply hovering over it (OnHover) or if the user must explicitly assign focus to it before the wheel affects it (OnFocus).</param>
 public static void Initialize(FrameworkElement applicationRootVisual, MouseWheelAssociationMode activationMode)
 {
     MouseWheelSupport.RegisterRootVisual(applicationRootVisual);
     MouseWheelSupport.UseFocusBehaviorModel = (activationMode == MouseWheelAssociationMode.OnFocus);
 }
コード例 #2
0
 /// <summary>
 /// This should be called exactly one time in the constructor of the application's main XAML
 /// code behind file, immediately after the call to InitializeComponent().
 /// </summary>
 /// <param name="applicationRootVisual">The application root visual. Just give a name to the root element of your application and pass it in here.</param>
 /// <param name="activationMode">Specifies whether the mouse wheel is associated with a <see cref="ScrollViewer" /> by simply hovering over it (OnHover) or if the user must explicitly assign focus to it before the wheel affects it (OnFocus).</param>
 public static void Initialize(FrameworkElement applicationRootVisual, MouseWheelAssociationMode activationMode)
 {
     MouseWheelSupport.RegisterRootVisual(applicationRootVisual);
     MouseWheelSupport.UseFocusBehaviorModel = (activationMode == MouseWheelAssociationMode.OnFocus);
 }