private void BtnSetHorizontalScrollController_Click(object sender, RoutedEventArgs e) { if (horizontalScrollController == null) { horizontalScrollController = new ScrollBarController(horizontalScrollBar, lstLog, chkLog.IsChecked.Value); } ((ScrollBarController)horizontalScrollController).IsEnabled = true; if (cmbIScrollControllerConsumer.SelectedIndex == 0) { if (scroller.HorizontalScrollController != horizontalScrollController) { scroller.HorizontalScrollController = horizontalScrollController; LogMessage("Scroller.HorizontalScrollController set"); } } else if (canvasScrollControllerConsumer.HorizontalScrollController != horizontalScrollController) { canvasScrollControllerConsumer.HorizontalScrollController = horizontalScrollController; LogMessage("CanvasScrollControllerConsumer.HorizontalScrollController set"); } }