示例#1
0
        /// <summary>
        /// Initializes a new instance of <see cref="Axis"/> class with double <see cref="LabelProvider"/>
        /// and <see cref="TicksProvider"/>.
        /// </summary>
        public Axis()
        {
            DataTransform = new IdentityDataTransform();
            Ticks         = new double[0];

            majorTicksPath = new Path();
            minorTicksPath = new Path();
            Children.Add(majorTicksPath);
            Children.Add(minorTicksPath);

            BindingOperations.SetBinding(majorTicksPath, Path.StrokeProperty, new Binding("Foreground")
            {
                Source = this, Mode = BindingMode.TwoWay
            });
            BindingOperations.SetBinding(minorTicksPath, Path.StrokeProperty, new Binding("Foreground")
            {
                Source = this, Mode = BindingMode.TwoWay
            });

            if (labelProvider == null)
            {
                this.labelProvider = new LabelProvider();
            }
            if (ticksProvider == null)
            {
                this.ticksProvider = new TicksProvider();
            }
        }
示例#2
0
 /// <summary>
 /// Initializes a new instance of <see cref="Axis"/> class.
 /// </summary>
 /// <param name="labelProvider">A <see cref="LabelProvider"/> to create labels.</param>
 /// <param name="ticksProvider">A <see cref="TicksProvider"/> to create ticks.</param>
 public Axis(ILabelProvider labelProvider, TicksProvider ticksProvider)
     : this()
 {
     this.labelProvider = labelProvider;
     this.ticksProvider = ticksProvider;
 }