예제 #1
0
        /// <summary>
        /// Handles changes to the DataValues property.
        /// </summary>
        private static void OnDataValuesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SimpleGraph instance = (SimpleGraph)d;

            instance.DataValues = (DispatchingObservableCollection <byte>)e.NewValue;
            instance.DataValues.CollectionChanged += instance.DataValues_CollectionChanged;
            instance.UpdateLineGraph();
        }
예제 #2
0
        /// <summary>
        /// Called when [line color value changed].
        /// </summary>
        /// <param name="d">The d.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void OnLineColorValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SimpleGraph graph = (SimpleGraph)d;

            if (e.NewValue != null)
            {
                graph.GraphLine.Stroke = (Brush)e.NewValue;
            }
        }
예제 #3
0
        /// <summary>
        /// Called when [threshold value changed].
        /// </summary>
        /// <param name="d">The d.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void OnThresholdValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SimpleGraph graph = (SimpleGraph)d;

            if (e.NewValue != null)
            {
                graph.UpdateThresholdLine();
            }
        }
예제 #4
0
        /// <summary>
        /// Called when [max value changed].
        /// </summary>
        /// <param name="d">The d.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        private static void OnMaxValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SimpleGraph graph = (SimpleGraph)d;

            if (e.NewValue != null)
            {
                graph.y1Label.Content = graph.MaxValue.ToString("N0");
                graph.y2Label.Content = (graph.MaxValue / 2).ToString("N0");
                graph.y3Label.Content = graph.MinValue.ToString("N0");
                graph.UpdateThresholdLine();
            }
        }