aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/SideChains/RealTimeGraphX.WPF/Components/GraphGridLines.cs
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-10-10 16:55:44 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-10-10 16:55:44 +0300
commit79eb19cbd10785a7dbc972bc0b26817932237419 (patch)
treee36176fc94ce6f26efc89b006d7e6faf7e4398cb /Software/Visual_Studio/SideChains/RealTimeGraphX.WPF/Components/GraphGridLines.cs
parentdf9197240ba5a643ce1599f36b7e3dd34aad6a60 (diff)
downloadTango-79eb19cbd10785a7dbc972bc0b26817932237419.tar.gz
Tango-79eb19cbd10785a7dbc972bc0b26817932237419.zip
Sign-out works !
Fixed issue where color conversion was busy while not in research module but research module in job view. Added new RealTimeGraphX !
Diffstat (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphX.WPF/Components/GraphGridLines.cs')
-rw-r--r--Software/Visual_Studio/SideChains/RealTimeGraphX.WPF/Components/GraphGridLines.cs103
1 files changed, 103 insertions, 0 deletions
diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX.WPF/Components/GraphGridLines.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX.WPF/Components/GraphGridLines.cs
new file mode 100644
index 000000000..25b00664f
--- /dev/null
+++ b/Software/Visual_Studio/SideChains/RealTimeGraphX.WPF/Components/GraphGridLines.cs
@@ -0,0 +1,103 @@
+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.Components
+{
+ /// <summary>
+ /// Represents a graph grid lines component.
+ /// </summary>
+ /// <seealso cref="RealTimeGraphX.GraphSurfaceComponentBase" />
+ public class GraphGridLines : GraphSurfaceComponentBase
+ {
+ /// <summary>
+ /// Gets or sets the number of grid rows.
+ /// </summary>
+ public int Rows
+ {
+ get { return (int)GetValue(RowsProperty); }
+ set { SetValue(RowsProperty, value); }
+ }
+ public static readonly DependencyProperty RowsProperty =
+ DependencyProperty.Register("Rows", typeof(int), typeof(GraphGridLines), new PropertyMetadata(8, (d, e) => (d as GraphGridLines).UpdateGridLines()));
+
+ /// <summary>
+ /// Gets or sets the number of grid columns.
+ /// </summary>
+ public int Columns
+ {
+ get { return (int)GetValue(ColumnsProperty); }
+ set { SetValue(ColumnsProperty, value); }
+ }
+ public static readonly DependencyProperty ColumnsProperty =
+ DependencyProperty.Register("Columns", typeof(int), typeof(GraphGridLines), new PropertyMetadata(8, (d, e) => (d as GraphGridLines).UpdateGridLines()));
+
+ /// <summary>
+ /// Gets or sets the vertical items.
+ /// </summary>
+ internal IEnumerable<int> VerticalItems
+ {
+ get { return (IEnumerable<int>)GetValue(VerticalItemsProperty); }
+ set { SetValue(VerticalItemsProperty, value); }
+ }
+ public static readonly DependencyProperty VerticalItemsProperty =
+ DependencyProperty.Register("VerticalItems", typeof(IEnumerable<int>), typeof(GraphGridLines), new PropertyMetadata(null));
+
+ /// <summary>
+ /// Gets or sets the horizontal items.
+ /// </summary>
+ internal IEnumerable<int> HorizontalItems
+ {
+ get { return (IEnumerable<int>)GetValue(HorizontalItemsProperty); }
+ set { SetValue(HorizontalItemsProperty, value); }
+ }
+ public static readonly DependencyProperty HorizontalItemsProperty =
+ DependencyProperty.Register("HorizontalItems", typeof(IEnumerable<int>), typeof(GraphGridLines), new PropertyMetadata(null));
+
+ /// <summary>
+ /// Initializes the <see cref="GraphGridLines"/> class.
+ /// </summary>
+ static GraphGridLines()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(GraphGridLines), new FrameworkPropertyMetadata(typeof(GraphGridLines)));
+ }
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="GraphGridLines"/> class.
+ /// </summary>
+ public GraphGridLines()
+ {
+ Loaded += GridLines_Loaded;
+ }
+
+ /// <summary>
+ /// Handles the Loaded event of the GridLines control.
+ /// </summary>
+ /// <param name="sender">The source of the event.</param>
+ /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
+ private void GridLines_Loaded(object sender, RoutedEventArgs e)
+ {
+ UpdateGridLines();
+ }
+
+ /// <summary>
+ /// Updates the grid lines.
+ /// </summary>
+ private void UpdateGridLines()
+ {
+ VerticalItems = Enumerable.Range(0, Rows).ToList();
+ HorizontalItems = Enumerable.Range(0, Columns).ToList();
+ }
+ }
+}