Example #1
0
 /// <summary>
 /// Attach Href with a framework elements
 /// </summary>
 /// <param name="control">Chart Control</param>
 /// <param name="visualElements">List of FrameworkElement</param>
 /// <param name="href">Href</param>
 /// <param name="hrefTarget">HrefTarget</param>
 internal void AttachHref(VisifireControl control, System.Collections.Generic.List <FrameworkElement> visualElements, String href, HrefTargets hrefTarget)
 {
     // Attach Href with a framework elements
     foreach (FrameworkElement visualElement in visualElements)
     {
         AttachHref(control, visualElement, href, hrefTarget);
     }
 }
Example #2
0
 /// <summary>
 /// Attach tooltip with a framework element
 /// </summary>
 /// <param name="control">Control reference</param>
 /// <param name="element">Object reference</param>
 /// <param name="visualElements">FrameworkElements list</param>
 public void AttachToolTip(VisifireControl control, ObservableObject element, System.Collections.Generic.List <FrameworkElement> visualElements)
 {
     // Show ToolTip on mouse move over the chart element
     foreach (FrameworkElement visualElement in visualElements)
     {
         AttachToolTip(control, element, visualElement);
     }
 }
Example #3
0
        /// <summary>
        /// MouseLeftButtonUp event handler for href
        /// </summary>
        /// <param name="sender">FrameworkElement</param>
        /// <param name="e">MouseButtonEventArgs</param>
        private void Element_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
#if WPF
            System.Diagnostics.Process.Start("explorer.exe", _tempHref);
#else
            System.Windows.Browser.HtmlPage.Window.Navigate(new Uri(VisifireControl.GetAbsolutePath(_tempHref)), _tempHrefTarget.ToString());
#endif
        }
        /// <summary>
        /// SaveIconEnabledProperty changed call back function
        /// </summary>
        /// <param name="d">Chart</param>
        /// <param name="e">DependencyPropertyChangedEventArgs</param>
        private static void OnSaveIconEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VisifireControl c = d as VisifireControl;

            if (c._saveIconImage != null)
            {
                c._saveIconImage.Visibility = ((Boolean)e.NewValue) ? Visibility.Visible : Visibility.Collapsed;
            }
        }
Example #5
0
        /// <summary>
        /// Attach tooltip with a framework element
        /// </summary>
        /// <param name="control">Control reference</param>
        /// <param name="element">FrameworkElement</param>
        /// <param name="visualObject">FrameworlElement</param>
        internal void AttachToolTip(VisifireControl control, VisifireElement element, FrameworkElement visualObject)
        {
            if (visualObject == null || control == null || element == null)
            {
                return;
            }

            _control      = control;
            _element      = element;
            _visualObject = visualObject;

            visualObject.MouseMove  += new MouseEventHandler(VisualObject_MouseMove);
            visualObject.MouseEnter += new MouseEventHandler(VisualObject_MouseEnter);

            // Hide ToolTip on mouse leave from the chart element
            visualObject.MouseLeave += new MouseEventHandler(VisualObject_MouseLeave);
        }
        /// <summary>
        /// Apply specific style from theme
        /// </summary>
        /// <param name="Control">Control</param>
        /// <param name="KeyName">Style key name</param>
        public void ApplyStyleFromTheme(VisifireControl control, String keyName)
        {
            Chart chart = control as Chart;

            if (chart != null && !chart.ThemeEnabled)
            {
                return;
            }

            bool oldIsNotificationEnable = IsNotificationEnable;

            IsNotificationEnable = false;

            if (chart.StyleDictionary != null)
            {
                //#if SL
                //                if (Style == null)
                //                {
                //                    Style myStyle = chart.StyleDictionary[keyName] as Style;

                //                    if (myStyle != null)
                //                        Style = myStyle;
                //                }
                //#else

                Style myStyle = chart.StyleDictionary[keyName] as Style;

                //System.Diagnostics.Debug.WriteLine(keyName);
                if (myStyle != null)
                {
                    if ((Chart as Chart)._isThemeChanged)
                    {
                        Style = myStyle;
                    }
                    else if (Style == null)
                    {
                        Style = myStyle;
                    }
                }

                //#endif
            }

            IsNotificationEnable = oldIsNotificationEnable;
        }
Example #7
0
        /// <summary>
        /// Attach Href with a framework element
        /// </summary>
        /// <param name="control">Chart Control</param>
        /// <param name="element">FrameworkElement</param>
        /// <param name="href">Href</param>
        /// <param name="hrefTarget">HrefTarget</param>
        internal void AttachHref(VisifireControl control, FrameworkElement visualElement, String href, HrefTargets hrefTarget)
        {
            if (visualElement == null)
            {
                return;
            }

            if (!String.IsNullOrEmpty(href))
            {
                _tempHref       = href;
                _tempHrefTarget = hrefTarget;
                //visualElement.MouseEnter -= Element_MouseEnter;
                //visualElement.MouseEnter += Element_MouseEnter;

                //visualElement.MouseLeftButtonUp -= Element_MouseLeftButtonUp;
                //visualElement.MouseLeftButtonUp += new MouseButtonEventHandler(Element_MouseLeftButtonUp);
            }
        }
Example #8
0
        /// <summary>
        /// Attach tooltip with a framework element
        /// </summary>
        /// <param name="control">Control reference</param>
        /// <param name="elements">FrameworkElement list</param>
        internal void AttachAreaToolTip(VisifireControl control, List<FrameworkElement> elements)
        {
            // Show ToolTip on mouse move over the chart element
            foreach (FrameworkElement element in elements)
            {
                element.MouseMove += delegate(object sender, MouseEventArgs e)
                {
                    Point position = e.GetPosition(this.Faces.Visual);
                    Double xValue = Graphics.PixelPositionToValue(0, this.Faces.Visual.Width, (Double)(control as Chart).ChartArea.AxisX.AxisManager.AxisMinimumValue, (Double)(control as Chart).ChartArea.AxisX.AxisManager.AxisMaximumValue, position.X);
                    DataPoint dataPoint = GetNearestDataPoint(xValue);

                    control._toolTip.CallOutVisiblity = Visibility.Collapsed;

                    if (dataPoint.ToolTipText == null)
                    {
                        control._toolTip.Text = "";
                        control._toolTip.Hide();
                        return;
                    }
                    else
                    {
                        control._toolTip.Text = dataPoint.ParseToolTipText(dataPoint.ToolTipText);

                        if (control.ToolTipEnabled)
                            control._toolTip.Show();

                        (control as Chart).UpdateToolTipPosition(sender, e);
                    }
                };

                // Hide ToolTip on mouse out from the chart element
                element.MouseLeave += delegate(object sender, MouseEventArgs e)
                {
                    control._toolTip.Hide();
                };
            }
        }
        /// <summary>
        /// WaterMarkElementProperty changed call back function
        /// </summary>
        /// <param name="d">Chart</param>
        /// <param name="e">DependencyPropertyChangedEventArgs</param>
        protected static void OnWatermarkPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            VisifireControl vc = d as VisifireControl;

            vc.OnWatermarkPropertyValueChanged((Boolean)e.NewValue);
        }
Example #10
0
        /// <summary>
        /// Attach tooltip with a framework element
        /// </summary>
        /// <param name="control">Control reference</param>
        /// <param name="element">FrameworkElement</param>
        /// <param name="visualObject">FrameworlElement</param>
        internal void AttachToolTip(VisifireControl control, VisifireElement element, FrameworkElement visualObject)
        {
            if (visualObject == null || control == null || element == null)
                return;

            _control = control;
            _element = element;
            _visualObject = visualObject;

            visualObject.MouseMove += new MouseEventHandler(VisualObject_MouseMove);
            visualObject.MouseEnter += new MouseEventHandler(VisualObject_MouseEnter);

            // Hide ToolTip on mouse leave from the chart element
            visualObject.MouseLeave += new MouseEventHandler(VisualObject_MouseLeave);
        }
Example #11
0
        /// <summary>
        /// Attach Href with a framework element
        /// </summary>
        /// <param name="control">Chart Control</param>
        /// <param name="element">FrameworkElement</param>
        /// <param name="href">Href</param>
        /// <param name="hrefTarget">HrefTarget</param>
        internal void AttachHref(VisifireControl control, FrameworkElement visualElement, String href, HrefTargets hrefTarget)
        {
            if (visualElement == null)
                return;

            if (!String.IsNullOrEmpty(href))
            {
                _tempHref = href;
                _tempHrefTarget = hrefTarget;
                visualElement.MouseEnter -= Element_MouseEnter;
                visualElement.MouseEnter += Element_MouseEnter;

                visualElement.MouseLeftButtonUp -= Element_MouseLeftButtonUp;
                visualElement.MouseLeftButtonUp += new MouseButtonEventHandler(Element_MouseLeftButtonUp);
            }
        }
Example #12
0
 /// <summary>
 /// Attach Href with a framework elements
 /// </summary>
 /// <param name="control">Chart Control</param>
 /// <param name="visualElements">List of FrameworkElement</param>
 /// <param name="href">Href</param>
 /// <param name="hrefTarget">HrefTarget</param>
 internal void AttachHref(VisifireControl control, System.Collections.Generic.List<FrameworkElement> visualElements, String href, HrefTargets hrefTarget)
 {
     // Attach Href with a framework elements
     foreach (FrameworkElement visualElement in visualElements)
         AttachHref(control, visualElement, href, hrefTarget);
 }
Example #13
0
 /// <summary>
 /// Attach tooltip with a framework element
 /// </summary>
 /// <param name="control">Control reference</param>
 /// <param name="element">Object reference</param>
 /// <param name="visualElements">FrameworkElements list</param>
 public void AttachToolTip(VisifireControl control, ObservableObject element, System.Collections.Generic.List<FrameworkElement> visualElements)
 {
     // Show ToolTip on mouse move over the chart element
     foreach (FrameworkElement visualElement in visualElements)
         AttachToolTip(control, element, visualElement);
 }