示例#1
0
        private RotatableControl CreateTickMark(bool major)
        {
            RotatableControl result   = new RotatableControl();
            TickMark         tickMark = new TickMark();

            tickMark.SetBinding(FrameworkElement.StyleProperty, (BindingBase) new Binding(major ? "MajorTickMarkStyle" : "MinorTickMarkStyle")
            {
                Source = (object)this.Axis
            });
            result.Child              = (FrameworkElement)tickMark;
            tickMark.PositionChanged += (EventHandler)((s, e) =>
            {
                this.PrepareTickMark(result);
                XYAxisElementsPanel.SetPosition((UIElement)result, ((TickMark)s).Position);
            });
            return(result);
        }
示例#2
0
 protected AxisPresenter(Axis axis)
 {
     this.Axis = axis;
     this.PanelsDictionary = new Dictionary<AxisPresenter.AxisPanelType, Func<Panel>>();
     this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.Gridlines, (Func<Panel>)(() => this.CreateGridView()));
     this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.AxisAndTickMarks, (Func<Panel>)(() => this.CreateAxisTickMarksView()));
     this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.AxisAlignment, (Func<Panel>)(() => (Panel)new Grid()));
     this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.Labels, (Func<Panel>)(() => this.CreateLabelsView()));
     this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.DisplayUnit, (Func<Panel>)(() => this.CreateDisplayUnitView()));
     this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.Title, (Func<Panel>)(() => this.CreateTitleView()));
     this.AggregatedSeriesMargins = AxisMargin.Empty;
     this.SeriesMarginInfos = new Dictionary<int, AxisMargin>();
     TickMark tickMark = new TickMark();
     tickMark.Visibility = Visibility.Collapsed;
     this.TickMarkForStyling = tickMark;
     this.TickMarkForStyling.SetBinding(FrameworkElement.StyleProperty, (BindingBase)new Binding("MajorTickMarkStyle")
     {
         Source = (object)this.Axis
     });
 }
示例#3
0
        protected AxisPresenter(Axis axis)
        {
            this.Axis             = axis;
            this.PanelsDictionary = new Dictionary <AxisPresenter.AxisPanelType, Func <Panel> >();
            this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.Gridlines, (Func <Panel>)(() => this.CreateGridView()));
            this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.AxisAndTickMarks, (Func <Panel>)(() => this.CreateAxisTickMarksView()));
            this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.AxisAlignment, (Func <Panel>)(() => (Panel) new Grid()));
            this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.Labels, (Func <Panel>)(() => this.CreateLabelsView()));
            this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.DisplayUnit, (Func <Panel>)(() => this.CreateDisplayUnitView()));
            this.PanelsDictionary.Add(AxisPresenter.AxisPanelType.Title, (Func <Panel>)(() => this.CreateTitleView()));
            this.AggregatedSeriesMargins = AxisMargin.Empty;
            this.SeriesMarginInfos       = new Dictionary <int, AxisMargin>();
            TickMark tickMark = new TickMark();

            tickMark.Visibility     = Visibility.Collapsed;
            this.TickMarkForStyling = tickMark;
            this.TickMarkForStyling.SetBinding(FrameworkElement.StyleProperty, (BindingBase) new Binding("MajorTickMarkStyle")
            {
                Source = (object)this.Axis
            });
        }
示例#4
0
 private RotatableControl CreateTickMark(bool major)
 {
     RotatableControl result = new RotatableControl();
     TickMark tickMark = new TickMark();
     tickMark.SetBinding(FrameworkElement.StyleProperty, (BindingBase)new Binding(major ? "MajorTickMarkStyle" : "MinorTickMarkStyle")
     {
         Source = (object)this.Axis
     });
     result.Child = (FrameworkElement)tickMark;
     tickMark.PositionChanged += (EventHandler)((s, e) =>
        {
        this.PrepareTickMark(result);
        XYAxisElementsPanel.SetPosition((UIElement)result, ((TickMark)s).Position);
        });
     return result;
 }