public VerticalScrollBarMargin(HexScrollMapFactoryService scrollMapFactoryService, WpfHexViewHost wpfHexViewHost) { if (scrollMapFactoryService is null) { throw new ArgumentNullException(nameof(scrollMapFactoryService)); } theScrollBar = new TheScrollBar(this); this.wpfHexViewHost = wpfHexViewHost ?? throw new ArgumentNullException(nameof(wpfHexViewHost)); scrollMap = scrollMapFactoryService.Create(wpfHexViewHost.HexView); theScrollBar.IsVisibleChanged += VerticalScrollBarMargin_IsVisibleChanged; wpfHexViewHost.HexView.Options.OptionChanged += Options_OptionChanged; theScrollBar.SetResourceReference(FrameworkElement.StyleProperty, typeof(ScrollBar)); theScrollBar.HorizontalAlignment = HorizontalAlignment.Center; theScrollBar.Orientation = System.Windows.Controls.Orientation.Vertical; theScrollBar.SmallChange = 1; UpdateVisibility(); }
VerticalScrollBarMarginProvider(HexScrollMapFactoryService scrollMapFactoryService) => this.scrollMapFactoryService = scrollMapFactoryService;