Пример #1
0
 protected override void OnLoaded()
 {
     base.OnLoaded();
     this.rangeInfo   = (this.Parent as TrackBarIndicatorElement).RangeInfo;
     this.ToolTipText = this.rangeInfo.ToolTipText;
     this.rangeInfo.PropertyChanged += new PropertyChangedEventHandler(this.rangeInfo_PropertyChanged);
 }
Пример #2
0
        public void UpdateIndicatorElements()
        {
            this.Children.Clear();
            switch (this.TrackBarElement.TrackBarMode)
            {
            case TrackBarRangeMode.SingleThumb:
                if (this.TrackBarElement.Ranges.Count <= 0)
                {
                    break;
                }
                TrackBarIndicatorElement indicatorElement1 = new TrackBarIndicatorElement(this.TrackBarElement.Ranges[0]);
                indicatorElement1.IsSelected = this.TrackBarElement.Ranges[0].IsSelected;
                indicatorElement1.StartThumbElement.Visibility = ElementVisibility.Collapsed;
                this.Children.Add((RadElement)indicatorElement1);
                break;

            case TrackBarRangeMode.StartFromTheBeginning:
                using (IEnumerator <TrackBarRange> enumerator = this.TrackBarElement.Ranges.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        TrackBarRange            current           = enumerator.Current;
                        TrackBarIndicatorElement indicatorElement2 = new TrackBarIndicatorElement(current);
                        indicatorElement2.IsSelected = current.IsSelected;
                        indicatorElement2.EndThumbElement.IsSelected   = false;
                        indicatorElement2.StartThumbElement.Visibility = ElementVisibility.Collapsed;
                        this.Children.Add((RadElement)indicatorElement2);
                    }
                    break;
                }

            case TrackBarRangeMode.Range:
                using (IEnumerator <TrackBarRange> enumerator = this.TrackBarElement.Ranges.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        TrackBarRange current = enumerator.Current;
                        this.Children.Add((RadElement) new TrackBarIndicatorElement(current)
                        {
                            IsSelected = current.IsSelected
                        });
                    }
                    break;
                }
            }
        }
 public TrackBarIndicatorElement(TrackBarRange rangeInfo)
 {
     this.RangeInfo = rangeInfo;
 }