private void ScrollContent(ICommand command) { if (ScrollViewerHelperEx.GetIsAnimating(ContentScrollViewer)) { return; } double offset = 0; Orientation orientation = Orientation.Horizontal; if (command == ScrollBar.LineUpCommand) { offset = Math.Min(Math.Max(0, ContentScrollViewer.VerticalOffset - UIManager.DefaultSessionControlHeight - UIManager.DefaultSessionsPanelVerticalSpacing), ContentScrollViewer.ScrollableHeight); orientation = Orientation.Vertical; } else if (command == ScrollBar.LineDownCommand) { offset = Math.Min(Math.Max(0, ContentScrollViewer.VerticalOffset + UIManager.DefaultSessionControlHeight + UIManager.DefaultSessionsPanelVerticalSpacing), ContentScrollViewer.ScrollableHeight); orientation = Orientation.Vertical; } else if (command == ScrollBar.LineLeftCommand) { offset = Math.Min(Math.Max(0, ContentScrollViewer.HorizontalOffset - UIManager.FlyoutWidth), ContentScrollViewer.ScrollableWidth); orientation = Orientation.Horizontal; } else if (command == ScrollBar.LineRightCommand) { offset = Math.Min(Math.Max(0, ContentScrollViewer.HorizontalOffset + UIManager.FlyoutWidth), ContentScrollViewer.ScrollableWidth); orientation = Orientation.Horizontal; } ScrollViewerHelperEx.ScrollToOffset(ContentScrollViewer, orientation, offset, 367); }
protected override void OnMouseWheel(MouseWheelEventArgs e) { if (e.Handled) { return; } ScrollViewerHelperEx.OnMouseWheel(this, e); e.Handled = true; }