protected override void InitializeBinding(DataPointBindingEntry binding)
        {
            if (this.valueBinding != null)
            {
                object value = this.valueBinding.GetValue(binding.DataItem);
                double doubleValue;
                if (NumericConverter.TryConvertToDouble(value, out doubleValue))
                {
                    (binding.DataPoint as SingleValueDataPoint).Value = doubleValue;
                }
            }

            base.InitializeBinding(binding);
        }
Esempio n. 2
0
        protected override void InitializeBinding(DataPointBindingEntry binding)
        {
            OhlcDataPoint dataPoint = binding.DataPoint as OhlcDataPoint;

            if (this.highBinding != null)
            {
                object value = this.highBinding.GetValue(binding.DataItem);
                double doubleValue;
                if (NumericConverter.TryConvertToDouble(value, out doubleValue))
                {
                    dataPoint.High = doubleValue;
                }
            }

            if (this.lowBinding != null)
            {
                object value = this.lowBinding.GetValue(binding.DataItem);
                double doubleValue;
                if (NumericConverter.TryConvertToDouble(value, out doubleValue))
                {
                    dataPoint.Low = doubleValue;
                }
            }

            if (this.openBinding != null)
            {
                object value = this.openBinding.GetValue(binding.DataItem);
                double doubleValue;
                if (NumericConverter.TryConvertToDouble(value, out doubleValue))
                {
                    dataPoint.Open = doubleValue;
                }
            }

            if (this.closeBinding != null)
            {
                object value = this.closeBinding.GetValue(binding.DataItem);
                double doubleValue;
                if (NumericConverter.TryConvertToDouble(value, out doubleValue))
                {
                    dataPoint.Close = doubleValue;
                }
            }

            base.InitializeBinding(binding);
        }
Esempio n. 3
0
        protected override void InitializeBinding(DataPointBindingEntry binding)
        {
            bool highIsValidNumber = true;
            bool lowIsValidNumber  = true;

            RangeDataPoint rangeDataPoint = (RangeDataPoint)binding.DataPoint;

            if (this.highBinding != null)
            {
                object value = this.highBinding.GetValue(binding.DataItem);
                double doubleValue;
                if (NumericConverter.TryConvertToDouble(value, out doubleValue))
                {
                    rangeDataPoint.High = doubleValue;
                }
                else
                {
                    rangeDataPoint.High = 0d;
                    highIsValidNumber   = false;
                }
            }

            if (this.lowBinding != null)
            {
                object value = this.lowBinding.GetValue(binding.DataItem);
                double doubleValue;
                if (NumericConverter.TryConvertToDouble(value, out doubleValue))
                {
                    rangeDataPoint.Low = doubleValue;
                }
                else
                {
                    rangeDataPoint.Low = 0d;
                    lowIsValidNumber   = false;
                }
            }

            rangeDataPoint.isEmpty = !lowIsValidNumber && !highIsValidNumber;

            base.InitializeBinding(binding);
        }
 protected override void UpdateBinding(DataPointBindingEntry binding)
 {
     this.BindCore();
 }
 protected override void UpdateBinding(DataPointBindingEntry binding)
 {
     this.BindCore(this.Bindings.IndexOf(binding));
 }
 protected override void UpdateBinding(DataPointBindingEntry binding)
 {
     //// TODO: Optimize this to update only the effected points.
     this.BindCore();
 }