/// <summary> /// /// </summary> protected override void ReSetLineStudyValue() { //set outside of if. cause it can be set by client program. //this code is called only once LineStudyValue.AttachDataSupplier(this, new[] { typeof(double) }); if (_vp != null) { _vp.DataContext = LineStudyValue; } SetDisplayValue(); }
private void SetDisplayValue() { if (_line == null || _vp == null) { return; } Action a = () => { _vp.Visibility = _textVisible ? Visibility.Visible : Visibility.Collapsed; if (!_textVisible) { return; } LineStudyValue.NotifyDataChanged(_chartPanel.GetReverseY(_line.Y2)); #if WPF if (!_vp.IsLoaded) #endif _vp.UpdateLayout(); switch (ValuePresenterAlignment) { case ValuePresenterAlignmentType.Right: Canvas.SetLeft(_vp, C.ActualWidth - _vp.ActualWidth); break; case ValuePresenterAlignmentType.Left: Canvas.SetLeft(_vp, 0); break; } Canvas.SetTop(_vp, _line.Y2 - _vp.ActualHeight); }; #if WPF Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Normal, a); #endif #if SILVERLIGHT a(); #endif }