Пример #1
0
 internal XYAxisTickMarksPanel(XYAxisPresenter presenter)
     : base(presenter)
 {
     this._majorTickMarkPool = new PanelElementPool<RotatableControl, Axis>((Panel)this, (Func<RotatableControl>)(() => this.CreateTickMark(true)), (Action<RotatableControl, Axis>)((item, axis) => this.PrepareTickMark(item)), (Action<RotatableControl>)null)
     {
         ReservedTopElements = 1
     };
     this._minorTickMarkPool = new PanelElementPool<RotatableControl, Axis>((Panel)this, (Func<RotatableControl>)(() => this.CreateTickMark(false)), (Action<RotatableControl, Axis>)((item, axis) => this.PrepareTickMark(item)), (Action<RotatableControl>)null)
     {
         ReservedTopElements = 1
     };
     this._axisLine = this.CreateAxisLine();
     this._scrollBar = this.CreateScrollBar();
     this._scrollBar.ValueChanged += new RoutedPropertyChangedEventHandler<double>(this.ScrollBar_ValueChanged);
     this._scrollBar.ViewportSizeChangeCompleted += new RoutedPropertyChangedEventHandler<double>(this.ScrollBar_ViewportSizeDragCompleted);
     this.Axis.ScaleChanged += new EventHandler(this.Axis_ScaleChanged);
 }
Пример #2
0
 private ScrollZoomBar CreateScrollBar()
 {
     ScrollZoomBar scrollZoomBar = new ScrollZoomBar();
     scrollZoomBar.SetBinding(FrameworkElement.StyleProperty, (BindingBase)new Binding("ScrollZoomBarStyle")
     {
         Source = (object)this.Axis
     });
     scrollZoomBar.SetBinding(ScrollZoomBar.IsAllwaysMaximizedProperty, (BindingBase)new Binding("IsScrollZoomBarAllwaysMaximized")
     {
         Source = (object)this.Axis
     });
     scrollZoomBar.SetBinding(ScrollZoomBar.ResizeViewHandlesVisibilityProperty, (BindingBase)new Binding("ActualIsZoomEnabled")
     {
         Source = (object)this.Axis,
         Converter = (IValueConverter)new BooleanToVisibilityConverter()
     });
     this.Children.Add((UIElement)scrollZoomBar);
     return scrollZoomBar;
 }