From 11bbf7922f1f9221a72cf71ce9f75725d529c128 Mon Sep 17 00:00:00 2001 From: hj615 Date: Wed, 13 Aug 2025 14:14:17 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=ED=95=84=ED=84=B0=20=ED=83=AD=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=EC=8B=9C=20DataGrid=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controls/SegmentedControl.xaml.cs | 13 +++- SmartAquaViewer/Model/Enums.cs | 10 ++-- SmartAquaViewer/Resources/Generic.xaml | 15 ++++- SmartAquaViewer/View/MonitoringView.xaml | 58 +++++++++++++++--- SmartAquaViewer/View/MonitoringView.xaml.cs | 60 +++++++------------ .../ViewModel/DataGridSectionViewModel.cs | 45 ++++++++++++++ .../ViewModel/MonitoringViewModel.cs | 26 ++++++-- 7 files changed, 170 insertions(+), 57 deletions(-) create mode 100644 SmartAquaViewer/ViewModel/DataGridSectionViewModel.cs diff --git a/SmartAquaViewer/Controls/SegmentedControl.xaml.cs b/SmartAquaViewer/Controls/SegmentedControl.xaml.cs index 09dde83..2015411 100644 --- a/SmartAquaViewer/Controls/SegmentedControl.xaml.cs +++ b/SmartAquaViewer/Controls/SegmentedControl.xaml.cs @@ -13,6 +13,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using static SmartAquaViewer.Model.Enums; namespace SmartAquaViewer.Controls { @@ -36,11 +37,21 @@ namespace SmartAquaViewer.Controls DependencyProperty.Register(nameof(SelectedValue), typeof(string), typeof(SegmentedControl), new PropertyMetadata(null)); + public MonitorTab SelectedTab + { + get { return (MonitorTab)GetValue(SelectedTabProperty); } + set { SetValue(SelectedTabProperty, value); } + } + + public static readonly DependencyProperty SelectedTabProperty = + DependencyProperty.Register(nameof(SelectedTab), typeof(MonitorTab), typeof(SegmentedControl), + new PropertyMetadata(null)); + private void RadioButton_Checked(object sender, RoutedEventArgs e) { if (sender is RadioButton rb && rb.Tag != null) { - SelectedValue = rb.Tag.ToString(); + SelectedTab = (MonitorTab)Enum.Parse(typeof(MonitorTab), rb.Tag.ToString()); } } } diff --git a/SmartAquaViewer/Model/Enums.cs b/SmartAquaViewer/Model/Enums.cs index c5e42fc..139b68e 100644 --- a/SmartAquaViewer/Model/Enums.cs +++ b/SmartAquaViewer/Model/Enums.cs @@ -6,13 +6,13 @@ using System.Threading.Tasks; namespace SmartAquaViewer.Model { - class Enums + public class Enums { - public enum PanelState + public enum MonitorTab { - Hidden, - Normal, - Expanded + Tank, + Filter, + Sterilizer } } } diff --git a/SmartAquaViewer/Resources/Generic.xaml b/SmartAquaViewer/Resources/Generic.xaml index 133b2d2..3b5e037 100644 --- a/SmartAquaViewer/Resources/Generic.xaml +++ b/SmartAquaViewer/Resources/Generic.xaml @@ -1,6 +1,9 @@  + xmlns:helper="clr-namespace:SmartAquaViewer.Helper" + xmlns:vm="clr-namespace:SmartAquaViewer.ViewModel" + xmlns:model="clr-namespace:SmartAquaViewer.Model" + xmlns:da="clr-namespace:SmartAquaViewer.DataAnalysis"> pack://application:,,,/Fonts/#S-Core Dream 1 Thin pack://application:,,,/Fonts/#S-Core Dream 2 ExtraLight @@ -104,4 +107,14 @@ + + \ No newline at end of file diff --git a/SmartAquaViewer/View/MonitoringView.xaml b/SmartAquaViewer/View/MonitoringView.xaml index 98e6c52..77983c7 100644 --- a/SmartAquaViewer/View/MonitoringView.xaml +++ b/SmartAquaViewer/View/MonitoringView.xaml @@ -21,12 +21,12 @@ + SelectedTab="{Binding SelectedTab, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/> - + HorizontalAlignment="Center" Visibility="Collapsed"> @@ -44,11 +44,7 @@ + Style="{StaticResource DataGridStyle}"> @@ -58,7 +54,7 @@ - + @@ -71,6 +67,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +