Ejemplo n.º 1
0
        /// <summary>
        /// LineThicknessProperty changed call back function
        /// </summary>
        /// <param name="d">DependencyObject</param>
        /// <param name="e">DependencyPropertyChangedEventArgs</param>
        private static void OnLineThicknessPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TrendLine source = d as TrendLine;

            //source.FirePropertyChanged(VcProperties.LineThickness");
            source.UpdateVisual(VcProperties.LineThickness, e.NewValue);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// ValueProperty changed call back function
        /// </summary>
        /// <param name="d">DependencyObject</param>
        /// <param name="e">DependencyPropertyChangedEventArgs</param>
        private static void OnValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TrendLine trendLine = d as TrendLine;


            // Double / Int32 value entered in Managed Code
            if (e.NewValue.GetType().Equals(typeof(Double)) || e.NewValue.GetType().Equals(typeof(Int32)))
            {
                trendLine.InternalNumericValue = Convert.ToDouble(e.NewValue);
            }
            // DateTime value entered in Managed Code
            else if ((e.NewValue.GetType().Equals(typeof(DateTime))))
            {
                trendLine.InternalDateValue = (DateTime)e.NewValue;
            }
            // Double / Int32 / DateTime entered in XAML
            else if ((e.NewValue.GetType().Equals(typeof(String))))
            {
                DateTime dateTimeresult;
                Double   doubleResult;

                if (String.IsNullOrEmpty(e.NewValue.ToString()))
                {
                    trendLine.InternalNumericValue = Double.NaN;
                }
                // Double entered in XAML
                else if (Double.TryParse((string)e.NewValue, System.Globalization.NumberStyles.Number, System.Globalization.CultureInfo.InvariantCulture, out doubleResult))
                {
                    trendLine.InternalNumericValue = doubleResult;
                }
                // DateTime entered in XAML
                else if (DateTime.TryParse((string)e.NewValue, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out dateTimeresult))
                {
                    trendLine.InternalDateValue = dateTimeresult;
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine("Invalid Input for AxisMaximum");
                    throw new Exception("Invalid Input for AxisMaximum");
                }
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("Invalid Input for AxisMaximum");
                throw new Exception("Invalid Input for AxisMaximum");
            }

            trendLine.UpdateVisual(VcProperties.Value, e.NewValue);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// ShadowEnabledProperty changed call back function
        /// </summary>
        /// <param name="d">DependencyObject</param>
        /// <param name="e">DependencyPropertyChangedEventArgs</param>
        private static void OnShadowEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TrendLine trendLine = d as TrendLine;

            trendLine.UpdateVisual(VcProperties.ShadowEnabled, e.NewValue);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// LineStyleProperty changed call back function
        /// </summary>
        /// <param name="d">DependencyObject</param>
        /// <param name="e">DependencyPropertyChangedEventArgs</param>
        private static void OnLineStylePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TrendLine source = d as TrendLine;

            source.UpdateVisual(VcProperties.LineStyle, e.NewValue);
        }