From 634a27ff34ce3c5964b9cffd2586ad28d64ddc70 Mon Sep 17 00:00:00 2001 From: Tolly <34184902+TollyH@users.noreply.github.com> Date: Sat, 26 Nov 2022 17:47:53 +0000 Subject: [PATCH] Implement config editor fully --- CSMazeConfigEditor/ControlTag.cs | 20 ++++- CSMazeConfigEditor/MainWindow.xaml | 64 +++++++-------- CSMazeConfigEditor/MainWindow.xaml.cs | 114 +++++++++++++++++++++++--- 3 files changed, 150 insertions(+), 48 deletions(-) diff --git a/CSMazeConfigEditor/ControlTag.cs b/CSMazeConfigEditor/ControlTag.cs index 74b20b0..a95f46e 100644 --- a/CSMazeConfigEditor/ControlTag.cs +++ b/CSMazeConfigEditor/ControlTag.cs @@ -5,10 +5,10 @@ namespace CSMaze.ConfigEditor { internal class ControlTag : DependencyObject { - public static readonly DependencyProperty HeaderLabelProperty = DependencyProperty.Register("HeaderLabel", typeof(Label), typeof(ControlTag)); - public Label HeaderLabel + public static readonly DependencyProperty HeaderLabelProperty = DependencyProperty.Register("HeaderLabel", typeof(string), typeof(ControlTag)); + public string HeaderLabel { - get => (Label)GetValue(HeaderLabelProperty); + get => (string)GetValue(HeaderLabelProperty); set => SetValue(HeaderLabelProperty, value); } @@ -18,5 +18,19 @@ public string ConfigOption get => (string)GetValue(ConfigOptionProperty); set => SetValue(ConfigOptionProperty, value); } + + public static readonly DependencyProperty DecimalPlacesProperty = DependencyProperty.Register("DecimalPlaces", typeof(int), typeof(ControlTag)); + public int DecimalPlaces + { + get => (int)GetValue(DecimalPlacesProperty); + set => SetValue(DecimalPlacesProperty, value); + } + + public static readonly DependencyProperty DefaultValueProperty = DependencyProperty.Register("DefaultValue", typeof(double), typeof(ControlTag)); + public double DefaultValue + { + get => (double)GetValue(DefaultValueProperty); + set => SetValue(DefaultValueProperty, value); + } } } diff --git a/CSMazeConfigEditor/MainWindow.xaml b/CSMazeConfigEditor/MainWindow.xaml index 63b5c55..cfe9168 100644 --- a/CSMazeConfigEditor/MainWindow.xaml +++ b/CSMazeConfigEditor/MainWindow.xaml @@ -10,142 +10,142 @@