Example #1
0
        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
        }