1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
ExecutedRoutedEventHandler executedRoutedEventHandler = new ExecutedRoutedEventHandler(Window1.CommandHandler);
CanExecuteRoutedEventHandler canExecuteRoutedEventHandler = new CanExecuteRoutedEventHandler(Window1.OnQueryScrollCommand);
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.LineLeftCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.LineRightCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.PageLeftCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.PageRightCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.LineUpCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.LineDownCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.PageUpCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.PageDownCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.ScrollToLeftEndCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.ScrollToRightEndCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.ScrollToEndCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.ScrollToHomeCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.ScrollToTopCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.ScrollToBottomCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.ScrollToHorizontalOffsetCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.ScrollToVerticalOffsetCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.DeferScrollToHorizontalOffsetCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler));
CommandManager.RegisterClassCommandBinding(typeof(Window1), new CommandBinding(ScrollBar.DeferScrollToVerticalOffsetCommand, executedRoutedEventHandler, canExecuteRoutedEventHandler)); |
Partager