Пример #1
0
        public SeriesDataItem(SeriesDataItems itemParent, double itemValue)
        {
            _itemParent = itemParent;
            DependencyObject dob = new DependencyObject();

            this.SetValue(SeriesDataItem.ValueProperty, itemValue);
        }
Пример #2
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            if (this.ItemsSource != null)
            {
                _seriesDataItems = this.ItemsSource as SeriesDataItems;
            }

            if (this.Items != null)
            {
            }
        }
Пример #3
0
        private void OnInitialized(object sender, EventArgs e)
        {
            _updateInterval = TimeSpan.FromMilliseconds(this.UpdateInterval);

            //init the items collection
            _seriesDataItems = new SeriesDataItems();

            // initialize chart points buffer
            _chartPoints = new List <double>(this.Points + 2);

            // are there items provided inline
            if (this.ItemsSource == null && this.Items.Count > 0)
            {
                foreach (object item in this.Items)
                {
                    if (item.GetType() == typeof(SeriesDataItem))
                    {
                        SeriesDataItem dataItem = item as SeriesDataItem;

                        _chartPoints.Add(100.0 - dataItem.Value);
                    }
                }
            }
            else
            {
                for (int i = 0; i < _chartPoints.Capacity; i++)
                {
                    _chartPoints.Add(100.0);
                }
            }

            if (_updateInterval.Ticks > 0)
            {
                //start the uitimer
                uiTimer          = new System.Windows.Threading.DispatcherTimer();
                uiTimer.Interval = TimeSpan.FromMilliseconds(timerFrameRate);
                uiTimer.Tick    += new EventHandler(uiTimer_Tick);
                uiTimer.Stop();
            }
        }