Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 3
0
        void IScrollProvider.Scroll(ScrollAmount horizontalAmount, ScrollAmount verticalAmount)
        {
            if (horizontalAmount != ScrollAmount.NoAmount && ((IScrollProvider)this).HorizontallyScrollable)
            {
                ScrollZoomBar scrollBar = this.GetScrollBar(this.HorizontalAxis);
                if (scrollBar != null)
                {
                    scrollBar.ScrollByAmount(horizontalAmount);
                }
            }
            if (verticalAmount == ScrollAmount.NoAmount || !((IScrollProvider)this).VerticallyScrollable)
            {
                return;
            }
            ScrollZoomBar scrollBar1 = this.GetScrollBar(this.VerticalAxis);

            if (scrollBar1 == null)
            {
                return;
            }
            scrollBar1.ScrollByAmount(verticalAmount);
        }