Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NonScrollingDataGrid.cs
1using System.Windows.Controls;
2using System.Windows;
3using System.Windows.Input;
4using System.Windows.Media;
5
7{
11 public class NonScrollingDataGrid : DataGrid
12 {
17 : base()
18 {
19 }
20
22 protected override void OnPreviewMouseWheel(MouseWheelEventArgs e)
23 {
24 if (!e.Handled)
25 {
26 e.Handled = true;
27 MouseWheelEventArgs e2 = new(e.MouseDevice, e.Timestamp, e.Delta)
28 {
29 RoutedEvent = UIElement.MouseWheelEvent,
30 Source = this
31 };
32 UIElement Parent = VisualTreeHelper.GetParent(this) as UIElement;
33
34 while (Parent is not null && Parent is not ScrollViewer)
35 Parent = VisualTreeHelper.GetParent(Parent) as UIElement;
36
37 Parent?.RaiseEvent(e2);
38 }
39 }
40 }
41}