From 08238766b0228450a79e257e7753bd09cdedda13 Mon Sep 17 00:00:00 2001 From: PhilJollans Date: Sat, 20 Nov 2021 23:22:40 +0100 Subject: [PATCH 01/15] Fix configuration error Add Debug to the tag. This fixes an error message "Current solution contains incorrect configurations mappings" on opening Visual Studio. --- RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj | 2 +- RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj | 2 +- RealTimeGraphX/RealTimeGraphX.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj b/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj index 35a4a01..a51fdb6 100644 --- a/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj +++ b/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj @@ -11,7 +11,7 @@ RealTimeGraphX.UWP.Demo en-US UAP - 10.0.17134.0 + 10.0.17763.0 10.0.17134.0 14 512 diff --git a/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj b/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj index 65d5daa..52802ad 100644 --- a/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj +++ b/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj @@ -11,7 +11,7 @@ RealTimeGraphX.UWP en-US UAP - 10.0.17134.0 + 10.0.17763.0 10.0.17134.0 14 512 diff --git a/RealTimeGraphX/RealTimeGraphX.csproj b/RealTimeGraphX/RealTimeGraphX.csproj index 3dc4555..672b49f 100644 --- a/RealTimeGraphX/RealTimeGraphX.csproj +++ b/RealTimeGraphX/RealTimeGraphX.csproj @@ -12,7 +12,7 @@ Chart;Graph;Plotting;RealTime;WPF;UWP Roy Ben Shabat Roy Ben Shabat - Release + Release;Debug From ea29428730b3878d988fd2825e5c08ae036e984d Mon Sep 17 00:00:00 2001 From: PhilJollans Date: Sat, 20 Nov 2021 23:40:58 +0100 Subject: [PATCH 02/15] Revert "Fix configuration error" This reverts commit 08238766b0228450a79e257e7753bd09cdedda13. --- RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj | 2 +- RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj | 2 +- RealTimeGraphX/RealTimeGraphX.csproj | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj b/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj index a51fdb6..35a4a01 100644 --- a/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj +++ b/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj @@ -11,7 +11,7 @@ RealTimeGraphX.UWP.Demo en-US UAP - 10.0.17763.0 + 10.0.17134.0 10.0.17134.0 14 512 diff --git a/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj b/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj index 52802ad..65d5daa 100644 --- a/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj +++ b/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj @@ -11,7 +11,7 @@ RealTimeGraphX.UWP en-US UAP - 10.0.17763.0 + 10.0.17134.0 10.0.17134.0 14 512 diff --git a/RealTimeGraphX/RealTimeGraphX.csproj b/RealTimeGraphX/RealTimeGraphX.csproj index 672b49f..3dc4555 100644 --- a/RealTimeGraphX/RealTimeGraphX.csproj +++ b/RealTimeGraphX/RealTimeGraphX.csproj @@ -12,7 +12,7 @@ Chart;Graph;Plotting;RealTime;WPF;UWP Roy Ben Shabat Roy Ben Shabat - Release;Debug + Release From 72a71bf5ee8428dccb308f075591e4655e17f416 Mon Sep 17 00:00:00 2001 From: PhilJollans Date: Sat, 20 Nov 2021 23:45:03 +0100 Subject: [PATCH 03/15] Fix configuration error Add Debug to the tag. This fixes an error message "Current solution contains incorrect configurations mappings" on opening Visual Studio. --- RealTimeGraphX/RealTimeGraphX.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RealTimeGraphX/RealTimeGraphX.csproj b/RealTimeGraphX/RealTimeGraphX.csproj index 3dc4555..672b49f 100644 --- a/RealTimeGraphX/RealTimeGraphX.csproj +++ b/RealTimeGraphX/RealTimeGraphX.csproj @@ -12,7 +12,7 @@ Chart;Graph;Plotting;RealTime;WPF;UWP Roy Ben Shabat Roy Ben Shabat - Release + Release;Debug From 1294f425b47b53ecf035f1dc0579ab1ec30d5a75 Mon Sep 17 00:00:00 2001 From: PhilJollans Date: Sun, 21 Nov 2021 00:13:23 +0100 Subject: [PATCH 04/15] Modify the target platform version in the two UWP projects. I do not have version 10.0.17134.0 installed on my machine, so I have switched to 10.0.17763.0, which I do have installed. This change is purely for my own convenience. --- RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj | 2 +- RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj b/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj index 35a4a01..a51fdb6 100644 --- a/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj +++ b/RealTimeGraphX.UWP.Demo/RealTimeGraphX.UWP.Demo.csproj @@ -11,7 +11,7 @@ RealTimeGraphX.UWP.Demo en-US UAP - 10.0.17134.0 + 10.0.17763.0 10.0.17134.0 14 512 diff --git a/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj b/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj index 65d5daa..52802ad 100644 --- a/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj +++ b/RealTimeGraphX.UWP/RealTimeGraphX.UWP.csproj @@ -11,7 +11,7 @@ RealTimeGraphX.UWP en-US UAP - 10.0.17134.0 + 10.0.17763.0 10.0.17134.0 14 512 From d6a98e80e8b02b60e6f3936e580f74ce8c564d5f Mon Sep 17 00:00:00 2001 From: PhilJollans Date: Sun, 21 Nov 2021 00:15:24 +0100 Subject: [PATCH 05/15] Move WpfGraphControl into the project RealTimeGraphX.WPF In my opinion, the control WpfGraphControl belongs in the core DLL RealTimeGraphX.WPF and not in the demo project. --- RealTimeGraphX.WPF.Demo/MainWindow.xaml | 8 +- .../RealTimeGraphX.WPF.Demo.csproj | 5 -- RealTimeGraphX.WPF.Demo/Themes/Generic.xaml | 55 -------------- RealTimeGraphX.WPF.Demo/WpfGraphControl.cs | 73 ------------------- RealTimeGraphX.WPF/RealTimeGraphX.WPF.csproj | 1 + RealTimeGraphX.WPF/Themes/Generic.xaml | 51 ++++++++++++- RealTimeGraphX.WPF/WpfGraphControl.cs | 73 +++++++++++++++++++ 7 files changed, 128 insertions(+), 138 deletions(-) delete mode 100644 RealTimeGraphX.WPF.Demo/Themes/Generic.xaml delete mode 100644 RealTimeGraphX.WPF.Demo/WpfGraphControl.cs create mode 100644 RealTimeGraphX.WPF/WpfGraphControl.cs diff --git a/RealTimeGraphX.WPF.Demo/MainWindow.xaml b/RealTimeGraphX.WPF.Demo/MainWindow.xaml index b194b28..d755543 100644 --- a/RealTimeGraphX.WPF.Demo/MainWindow.xaml +++ b/RealTimeGraphX.WPF.Demo/MainWindow.xaml @@ -38,7 +38,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -139,7 +139,7 @@ - + @@ -192,7 +192,7 @@ - + diff --git a/RealTimeGraphX.WPF.Demo/RealTimeGraphX.WPF.Demo.csproj b/RealTimeGraphX.WPF.Demo/RealTimeGraphX.WPF.Demo.csproj index 352ea02..684db45 100644 --- a/RealTimeGraphX.WPF.Demo/RealTimeGraphX.WPF.Demo.csproj +++ b/RealTimeGraphX.WPF.Demo/RealTimeGraphX.WPF.Demo.csproj @@ -58,7 +58,6 @@ - MSBuild:Compile Designer @@ -71,10 +70,6 @@ MainWindow.xaml Code - - MSBuild:Compile - Designer - diff --git a/RealTimeGraphX.WPF.Demo/Themes/Generic.xaml b/RealTimeGraphX.WPF.Demo/Themes/Generic.xaml deleted file mode 100644 index 1174e5b..0000000 --- a/RealTimeGraphX.WPF.Demo/Themes/Generic.xaml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - diff --git a/RealTimeGraphX.WPF.Demo/WpfGraphControl.cs b/RealTimeGraphX.WPF.Demo/WpfGraphControl.cs deleted file mode 100644 index cbace56..0000000 --- a/RealTimeGraphX.WPF.Demo/WpfGraphControl.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Data; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Imaging; -using System.Windows.Navigation; -using System.Windows.Shapes; - -namespace RealTimeGraphX.WPF.Demo -{ - public class WpfGraphControl : Control - { - /// - /// Gets or sets the graph controller. - /// - public IGraphController Controller - { - get { return (IGraphController)GetValue(ControllerProperty); } - set { SetValue(ControllerProperty, value); } - } - public static readonly DependencyProperty ControllerProperty = - DependencyProperty.Register("Controller", typeof(IGraphController), typeof(WpfGraphControl), new PropertyMetadata(null)); - - /// - /// Gets or sets a value indicating whether to display a tool tip with the current cursor value. - /// - public bool DisplayToolTip - { - get { return (bool)GetValue(DisplayToolTipProperty); } - set { SetValue(DisplayToolTipProperty, value); } - } - public static readonly DependencyProperty DisplayToolTipProperty = - DependencyProperty.Register("DisplayToolTip", typeof(bool), typeof(WpfGraphControl), new PropertyMetadata(false)); - - /// - /// Gets or sets the string format for the X Axis. - /// - public String StringFormatX - { - get { return (String)GetValue(StringFormatXProperty); } - set { SetValue(StringFormatXProperty, value); } - } - public static readonly DependencyProperty StringFormatXProperty = - DependencyProperty.Register("StringFormatX", typeof(String), typeof(WpfGraphControl), new PropertyMetadata("0.0")); - - /// - /// Gets or sets the string format for the Y Axis. - /// - public String StringFormatY - { - get { return (String)GetValue(StringFormatYProperty); } - set { SetValue(StringFormatYProperty, value); } - } - public static readonly DependencyProperty StringFormatYProperty = - DependencyProperty.Register("StringFormatY", typeof(String), typeof(WpfGraphControl), new PropertyMetadata("hh\\:mm\\:ss")); - - - /// - /// Initializes the class. - /// - static WpfGraphControl() - { - DefaultStyleKeyProperty.OverrideMetadata(typeof(WpfGraphControl), new FrameworkPropertyMetadata(typeof(WpfGraphControl))); - } - } -} diff --git a/RealTimeGraphX.WPF/RealTimeGraphX.WPF.csproj b/RealTimeGraphX.WPF/RealTimeGraphX.WPF.csproj index 6287cae..6127f07 100644 --- a/RealTimeGraphX.WPF/RealTimeGraphX.WPF.csproj +++ b/RealTimeGraphX.WPF/RealTimeGraphX.WPF.csproj @@ -57,6 +57,7 @@ + diff --git a/RealTimeGraphX.WPF/Themes/Generic.xaml b/RealTimeGraphX.WPF/Themes/Generic.xaml index a309fc0..bfecd99 100644 --- a/RealTimeGraphX.WPF/Themes/Generic.xaml +++ b/RealTimeGraphX.WPF/Themes/Generic.xaml @@ -1,4 +1,4 @@ - @@ -171,4 +171,53 @@ + + + diff --git a/RealTimeGraphX.WPF/WpfGraphControl.cs b/RealTimeGraphX.WPF/WpfGraphControl.cs new file mode 100644 index 0000000..085180b --- /dev/null +++ b/RealTimeGraphX.WPF/WpfGraphControl.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace RealTimeGraphX.WPF +{ + public class WpfGraphControl : Control + { + /// + /// Gets or sets the graph controller. + /// + public IGraphController Controller + { + get { return (IGraphController)GetValue(ControllerProperty); } + set { SetValue(ControllerProperty, value); } + } + public static readonly DependencyProperty ControllerProperty = + DependencyProperty.Register("Controller", typeof(IGraphController), typeof(WpfGraphControl), new PropertyMetadata(null)); + + /// + /// Gets or sets a value indicating whether to display a tool tip with the current cursor value. + /// + public bool DisplayToolTip + { + get { return (bool)GetValue(DisplayToolTipProperty); } + set { SetValue(DisplayToolTipProperty, value); } + } + public static readonly DependencyProperty DisplayToolTipProperty = + DependencyProperty.Register("DisplayToolTip", typeof(bool), typeof(WpfGraphControl), new PropertyMetadata(false)); + + /// + /// Gets or sets the string format for the X Axis. + /// + public String StringFormatX + { + get { return (String)GetValue(StringFormatXProperty); } + set { SetValue(StringFormatXProperty, value); } + } + public static readonly DependencyProperty StringFormatXProperty = + DependencyProperty.Register("StringFormatX", typeof(String), typeof(WpfGraphControl), new PropertyMetadata("0.0")); + + /// + /// Gets or sets the string format for the Y Axis. + /// + public String StringFormatY + { + get { return (String)GetValue(StringFormatYProperty); } + set { SetValue(StringFormatYProperty, value); } + } + public static readonly DependencyProperty StringFormatYProperty = + DependencyProperty.Register("StringFormatY", typeof(String), typeof(WpfGraphControl), new PropertyMetadata("hh\\:mm\\:ss")); + + + /// + /// Initializes the class. + /// + static WpfGraphControl() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(WpfGraphControl), new FrameworkPropertyMetadata(typeof(WpfGraphControl))); + } + } +} From 7da507cca6caa4b91f93f167bdffc70b25b78d51 Mon Sep 17 00:00:00 2001 From: PhilJollans Date: Sun, 21 Nov 2021 09:27:48 +0100 Subject: [PATCH 06/15] Add properties AxisCaptionX and AxisCaptionY Define two new properties on the WpfGraphControl: - AxisCaptionX - AxisCaptionY In the control template for WpfGraphControl, define a grid column for the Y caption and a row for the X caption and show the captions using TextBlock controls. The new column and row auto size, and collapse to zero width or height respectively if the caption is empty. --- RealTimeGraphX.WPF.Demo/MainWindow.xaml | 2 +- RealTimeGraphX.WPF/Themes/Generic.xaml | 33 ++++++++++++++++++++++--- RealTimeGraphX.WPF/WpfGraphControl.cs | 22 +++++++++++++++++ 3 files changed, 53 insertions(+), 4 deletions(-) diff --git a/RealTimeGraphX.WPF.Demo/MainWindow.xaml b/RealTimeGraphX.WPF.Demo/MainWindow.xaml index d755543..51ebda1 100644 --- a/RealTimeGraphX.WPF.Demo/MainWindow.xaml +++ b/RealTimeGraphX.WPF.Demo/MainWindow.xaml @@ -38,7 +38,7 @@ - + diff --git a/RealTimeGraphX.WPF/Themes/Generic.xaml b/RealTimeGraphX.WPF/Themes/Generic.xaml index bfecd99..e0c1abd 100644 --- a/RealTimeGraphX.WPF/Themes/Generic.xaml +++ b/RealTimeGraphX.WPF/Themes/Generic.xaml @@ -3,6 +3,23 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:RealTimeGraphX.WPF"> + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/RealTimeGraphX.WPF/Themes/Generic.xaml b/RealTimeGraphX.WPF/Themes/Generic.xaml index a2d0ff0..8e1be53 100644 --- a/RealTimeGraphX.WPF/Themes/Generic.xaml +++ b/RealTimeGraphX.WPF/Themes/Generic.xaml @@ -3,12 +3,15 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:RealTimeGraphX.WPF"> + + +