From b90acacb7dbef7d088d57a200cc4d71148bffd1e Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Sun, 15 Jul 2018 15:10:08 +0300 Subject: Implemented custom min max on single and multiple graphs on tech board. --- .../SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs') diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs b/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs index f0c612608..a2060d10e 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphEx/RealTimeGraphExBase.cs @@ -71,6 +71,11 @@ namespace RealTimeGraphEx /// public new event MouseEventHandler MouseLeave; + /// + /// Occurs when [minimum maximum changed]. + /// + public event EventHandler MinMaxChanged; + #endregion #region Protected Fields @@ -141,7 +146,12 @@ namespace RealTimeGraphEx set { SetValue(MaximumProperty, value); } } public static readonly DependencyProperty MaximumProperty = - DependencyProperty.Register("Maximum", typeof(double), typeof(RealTimeGraphExBase), new PropertyMetadata(255.0, new PropertyChangedCallback(CrossModelChanged))); + DependencyProperty.Register("Maximum", typeof(double), typeof(RealTimeGraphExBase), new PropertyMetadata(255.0, (d, e) => + { + var control = d as RealTimeGraphExBase; + CrossModelChanged(d, e); + control.MinMaxChanged?.Invoke(control, new EventArgs()); + })); /// /// Gets or sets the minimum expected value to be plotted on the graph (default 0). @@ -152,7 +162,12 @@ namespace RealTimeGraphEx set { SetValue(MinimumProperty, value); } } public static readonly DependencyProperty MinimumProperty = - DependencyProperty.Register("Minimum", typeof(double), typeof(RealTimeGraphExBase), new PropertyMetadata(0.0, new PropertyChangedCallback(CrossModelChanged))); + DependencyProperty.Register("Minimum", typeof(double), typeof(RealTimeGraphExBase), new PropertyMetadata(0.0, (d, e) => + { + var control = d as RealTimeGraphExBase; + CrossModelChanged(d, e); + control.MinMaxChanged?.Invoke(control, new EventArgs()); + })); /// /// Gets or sets the graph refresh rate in milliseconds (default 30, affects performance). -- cgit v1.3.1