From 99eb505d726d0184850356d25611691d4fdcb33c Mon Sep 17 00:00:00 2001 From: hj615 Date: Fri, 25 Jul 2025 11:21:51 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20view=20swap=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SmartAquaViewer/App.xaml | 16 +++++ SmartAquaViewer/MainWindow.xaml | 33 +++++++-- SmartAquaViewer/Reources/Generic.xaml | 30 ++++++++ SmartAquaViewer/Reources/Images/ListImage.png | Bin 0 -> 1412 bytes SmartAquaViewer/SmartAquaViewer.csproj | 8 +++ SmartAquaViewer/View/CCTVView.xaml | 16 +++++ SmartAquaViewer/View/CCTVView.xaml.cs | 28 ++++++++ SmartAquaViewer/View/EnegyView.xaml | 16 +++++ SmartAquaViewer/View/EnegyView.xaml.cs | 28 ++++++++ SmartAquaViewer/View/FileListView.xaml | 62 ++++++++++------- SmartAquaViewer/View/GreenHouseView.xaml | 16 +++++ SmartAquaViewer/View/GreenHouseView.xaml.cs | 28 ++++++++ SmartAquaViewer/View/MonitoringView.xaml | 16 +++++ SmartAquaViewer/View/MonitoringView.xaml.cs | 28 ++++++++ SmartAquaViewer/ViewModel/CCTVViewModel.cs | 22 ++++++ SmartAquaViewer/ViewModel/EnergyViewModel.cs | 19 +++++ .../ViewModel/GreenHouseGasViewModel.cs | 22 ++++++ SmartAquaViewer/ViewModel/MainViewModel.cs | 65 ++++++++++++++++++ .../ViewModel/MonitoringViewModel.cs | 22 ++++++ 19 files changed, 447 insertions(+), 28 deletions(-) create mode 100644 SmartAquaViewer/Reources/Generic.xaml create mode 100644 SmartAquaViewer/Reources/Images/ListImage.png create mode 100644 SmartAquaViewer/View/CCTVView.xaml create mode 100644 SmartAquaViewer/View/CCTVView.xaml.cs create mode 100644 SmartAquaViewer/View/EnegyView.xaml create mode 100644 SmartAquaViewer/View/EnegyView.xaml.cs create mode 100644 SmartAquaViewer/View/GreenHouseView.xaml create mode 100644 SmartAquaViewer/View/GreenHouseView.xaml.cs create mode 100644 SmartAquaViewer/View/MonitoringView.xaml create mode 100644 SmartAquaViewer/View/MonitoringView.xaml.cs create mode 100644 SmartAquaViewer/ViewModel/CCTVViewModel.cs create mode 100644 SmartAquaViewer/ViewModel/EnergyViewModel.cs create mode 100644 SmartAquaViewer/ViewModel/GreenHouseGasViewModel.cs create mode 100644 SmartAquaViewer/ViewModel/MainViewModel.cs create mode 100644 SmartAquaViewer/ViewModel/MonitoringViewModel.cs diff --git a/SmartAquaViewer/App.xaml b/SmartAquaViewer/App.xaml index af590e0..a067e94 100644 --- a/SmartAquaViewer/App.xaml +++ b/SmartAquaViewer/App.xaml @@ -2,13 +2,29 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:SmartAquaViewer" + xmlns:view="clr-namespace:SmartAquaViewer.View" + xmlns:vm="clr-namespace:SmartAquaViewer.ViewModel" StartupUri="MainWindow.xaml"> + + + + + + + + + + + + + + diff --git a/SmartAquaViewer/MainWindow.xaml b/SmartAquaViewer/MainWindow.xaml index ed8fa39..d37aa6d 100644 --- a/SmartAquaViewer/MainWindow.xaml +++ b/SmartAquaViewer/MainWindow.xaml @@ -6,25 +6,48 @@ xmlns:local="clr-namespace:SmartAquaViewer" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:view="clr-namespace:SmartAquaViewer.View" + xmlns:vm="clr-namespace:SmartAquaViewer.ViewModel" mc:Ignorable="d" Title="MainWindow" Height="1080" Width="1920" WindowStartupLocation="CenterScreen"> + + + + + - + - + - - + + + + + + + - + diff --git a/SmartAquaViewer/Reources/Generic.xaml b/SmartAquaViewer/Reources/Generic.xaml new file mode 100644 index 0000000..b35ade7 --- /dev/null +++ b/SmartAquaViewer/Reources/Generic.xaml @@ -0,0 +1,30 @@ + + + + + \ No newline at end of file diff --git a/SmartAquaViewer/Reources/Images/ListImage.png b/SmartAquaViewer/Reources/Images/ListImage.png new file mode 100644 index 0000000000000000000000000000000000000000..648d86c00db65c6f6e227adf0b2d517e5d45336a GIT binary patch literal 1412 zcmV-~1$+95P)(;i)Mw0SwMuSxQz`%x3bnjYh~{_WFtePTZ|Zk z(S!sQ6S}C;pnsV#MKu2BE0M&k=y=5O*oHa{>_xk7s|y;UiGNJS;se)BU>m!B_uPB# zy{xzGWt6t}Hp}U^bM86c?|kobilBKOePYl90@Nd*RS<-9Li#V;G{d|8-wtCx7SOC7{CeFOzuYSF}}A7`iQj~{mY$^cY97VuGHPlcT}D)CuC z@V6aY>%i*A10F)ON2^L^`A&Q{V$~MEkCfcb^o8WXcfb@hkSbMf@n0ck(?#YrD$l@} zfS$tgI-el&Dht4LEde+qY7J?Ts6HlaOE>okjCp1P-0z!*#*)pws=GIf`_b@;#kDpgK+-BWtJ;(4-o17 zo7Io*n$xlu;?9)waxHzT)fHwTFTFktf#AQ4w`EIjgU>(A2TMlU4O`N=-zI5uhGgfi z&kx%)F=umaIz@3nOx$?Frr+uTc=5Gi=nr0G-pgiP1RuS#=7yQ)6FgLNT23gV^My_V zU?c!^9d(B>x8v0y^#3%@wx}@wj<^DF5db56;rfj~N?wRdfJd`Abaw;*{-KM^RxBB} zKttVfHKcR6Jj7oI9U}Yk9vM;MQZ)W>od`flAR@0)?97Cm`z`VS0VXD|Li6Dfg-%xT zghkbzOah7a9`RZa9~1$Y_(A(4-?2ELCUU$6=80Wu(^yCVL=)f%9TSEQy=!|8tWsrmwMv-=w;ab z-dQ$ptU3j4RVSGQlt&G~(!XRn&|V$};CW9!10cTdC|C?1HxpOa(zYy<(9UxO^n2ka&jdC;N>KrSdTu}SsS+Q)}7tZJMb5?o%Oa%*uO7+ z09KWV0Jup?YN|(L)`la7ypSG%r+0Qik1T=ZOK*oxZ+NsevfFdVj9j<`#ZPt^iZ2X+ zfm8@uKP`dP*^&{9PiS%)YPS6VqP`k=pT8F&)l%lY?*5ezA2N46a329MP!cDrS2#5;J8yG0vw6!&bXnut|xB%mKxxV|>`{lE&>S4!Mf{cOsrJY!Lt zHRIjR16L@LrYAa!jMI8kxXkHgm)wakxVWz&-q_#eZ1#}C>=6?(epAnHY*L*jN7Kj> zj3w)ueUy)p6x4cvAE>HIr-_kF36o2c=kbsAG&m#xuI4P^>a3R%CVQ-Vg4E~-Kg=ws zAM-azKlb2HX3>`(M4?^~&`KTYj9Gqt#4kaTL=z|Ua~mPJ0MI+u_muK;oBsg?Pl(p_ Sm)k)A0000AnyCPU;x64 + + + + + + + + diff --git a/SmartAquaViewer/View/CCTVView.xaml b/SmartAquaViewer/View/CCTVView.xaml new file mode 100644 index 0000000..269d9c1 --- /dev/null +++ b/SmartAquaViewer/View/CCTVView.xaml @@ -0,0 +1,16 @@ + + + + + diff --git a/SmartAquaViewer/View/CCTVView.xaml.cs b/SmartAquaViewer/View/CCTVView.xaml.cs new file mode 100644 index 0000000..fccdc06 --- /dev/null +++ b/SmartAquaViewer/View/CCTVView.xaml.cs @@ -0,0 +1,28 @@ +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 SmartAquaViewer.View +{ + /// + /// CCTVView.xaml에 대한 상호 작용 논리 + /// + public partial class CCTVView : UserControl + { + public CCTVView() + { + InitializeComponent(); + } + } +} diff --git a/SmartAquaViewer/View/EnegyView.xaml b/SmartAquaViewer/View/EnegyView.xaml new file mode 100644 index 0000000..3c3af99 --- /dev/null +++ b/SmartAquaViewer/View/EnegyView.xaml @@ -0,0 +1,16 @@ + + + + + diff --git a/SmartAquaViewer/View/EnegyView.xaml.cs b/SmartAquaViewer/View/EnegyView.xaml.cs new file mode 100644 index 0000000..4da873d --- /dev/null +++ b/SmartAquaViewer/View/EnegyView.xaml.cs @@ -0,0 +1,28 @@ +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 SmartAquaViewer.View +{ + /// + /// EnegyView.xaml에 대한 상호 작용 논리 + /// + public partial class EnegyView : UserControl + { + public EnegyView() + { + InitializeComponent(); + } + } +} diff --git a/SmartAquaViewer/View/FileListView.xaml b/SmartAquaViewer/View/FileListView.xaml index 0cb149c..4dce29a 100644 --- a/SmartAquaViewer/View/FileListView.xaml +++ b/SmartAquaViewer/View/FileListView.xaml @@ -7,32 +7,48 @@ xmlns:vm="clr-namespace:SmartAquaViewer.ViewModel" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" mc:Ignorable="d" - d:DesignHeight="1080" d:DesignWidth="300"> + d:DesignHeight="1040" d:DesignWidth="270"> - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SmartAquaViewer/View/GreenHouseView.xaml b/SmartAquaViewer/View/GreenHouseView.xaml new file mode 100644 index 0000000..3e98376 --- /dev/null +++ b/SmartAquaViewer/View/GreenHouseView.xaml @@ -0,0 +1,16 @@ + + + + + diff --git a/SmartAquaViewer/View/GreenHouseView.xaml.cs b/SmartAquaViewer/View/GreenHouseView.xaml.cs new file mode 100644 index 0000000..8f558eb --- /dev/null +++ b/SmartAquaViewer/View/GreenHouseView.xaml.cs @@ -0,0 +1,28 @@ +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 SmartAquaViewer.View +{ + /// + /// GreenHouseView.xaml에 대한 상호 작용 논리 + /// + public partial class GreenHouseView : UserControl + { + public GreenHouseView() + { + InitializeComponent(); + } + } +} diff --git a/SmartAquaViewer/View/MonitoringView.xaml b/SmartAquaViewer/View/MonitoringView.xaml new file mode 100644 index 0000000..52e27e7 --- /dev/null +++ b/SmartAquaViewer/View/MonitoringView.xaml @@ -0,0 +1,16 @@ + + + + + diff --git a/SmartAquaViewer/View/MonitoringView.xaml.cs b/SmartAquaViewer/View/MonitoringView.xaml.cs new file mode 100644 index 0000000..d63f58e --- /dev/null +++ b/SmartAquaViewer/View/MonitoringView.xaml.cs @@ -0,0 +1,28 @@ +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 SmartAquaViewer.View +{ + /// + /// MonitoringView.xaml에 대한 상호 작용 논리 + /// + public partial class MonitoringView : UserControl + { + public MonitoringView() + { + InitializeComponent(); + } + } +} diff --git a/SmartAquaViewer/ViewModel/CCTVViewModel.cs b/SmartAquaViewer/ViewModel/CCTVViewModel.cs new file mode 100644 index 0000000..607e8f1 --- /dev/null +++ b/SmartAquaViewer/ViewModel/CCTVViewModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace SmartAquaViewer.ViewModel +{ + public class CCTVViewModel : INotifyPropertyChanged + { + public CCTVViewModel() + { + + } + + public event PropertyChangedEventHandler? PropertyChanged; + private void OnPropertyChanged([CallerMemberName] string? name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } +} diff --git a/SmartAquaViewer/ViewModel/EnergyViewModel.cs b/SmartAquaViewer/ViewModel/EnergyViewModel.cs new file mode 100644 index 0000000..3ac2e56 --- /dev/null +++ b/SmartAquaViewer/ViewModel/EnergyViewModel.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace SmartAquaViewer.ViewModel +{ + public class EnergyViewModel : INotifyPropertyChanged + { + public EnergyViewModel() { } + + public event PropertyChangedEventHandler? PropertyChanged; + private void OnPropertyChanged([CallerMemberName] string? name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } +} diff --git a/SmartAquaViewer/ViewModel/GreenHouseGasViewModel.cs b/SmartAquaViewer/ViewModel/GreenHouseGasViewModel.cs new file mode 100644 index 0000000..8b25718 --- /dev/null +++ b/SmartAquaViewer/ViewModel/GreenHouseGasViewModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace SmartAquaViewer.ViewModel +{ + public class GreenHouseGasViewModel : INotifyPropertyChanged + { + public GreenHouseGasViewModel() + { + // Initialization logic for GreenHouseGasViewModel can go here + } + + public event PropertyChangedEventHandler? PropertyChanged; + private void OnPropertyChanged([CallerMemberName] string? name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } +} diff --git a/SmartAquaViewer/ViewModel/MainViewModel.cs b/SmartAquaViewer/ViewModel/MainViewModel.cs new file mode 100644 index 0000000..1532240 --- /dev/null +++ b/SmartAquaViewer/ViewModel/MainViewModel.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Input; +using SmartAquaViewer.Controls; + +namespace SmartAquaViewer.ViewModel +{ + public class MainViewModel : INotifyPropertyChanged + { + private object? _selectedViewModel; + public object? SelectedViewModel + { + get => _selectedViewModel; + set + { + if (_selectedViewModel != value) + { + _selectedViewModel = value; + OnPropertyChanged(nameof(SelectedViewModel)); + } + } + } + + public ICommand SwapViewCommand { get; } + + public MainViewModel() + { + SwapViewCommand = new RelayCommand(SwapView); + + SelectedViewModel = new MonitoringViewModel(); // Default view + } + + private void SwapView(object obj) + { + var tag = (string)obj; + + switch (tag) + { + case "monitoring": + SelectedViewModel = new MonitoringViewModel(); + break; + case "energy": + SelectedViewModel = new EnergyViewModel(); + break; + case "greenHouseGas": + SelectedViewModel = new GreenHouseGasViewModel(); + break; + case "cctv": + SelectedViewModel = new CCTVViewModel(); + break; + default: + throw new ArgumentException("Unknown view tag", nameof(obj)); + } + } + + public event PropertyChangedEventHandler? PropertyChanged; + private void OnPropertyChanged([CallerMemberName] string? name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } +} diff --git a/SmartAquaViewer/ViewModel/MonitoringViewModel.cs b/SmartAquaViewer/ViewModel/MonitoringViewModel.cs new file mode 100644 index 0000000..af32925 --- /dev/null +++ b/SmartAquaViewer/ViewModel/MonitoringViewModel.cs @@ -0,0 +1,22 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; +using System.Threading.Tasks; + +namespace SmartAquaViewer.ViewModel +{ + public class MonitoringViewModel : INotifyPropertyChanged + { + public MonitoringViewModel() + { + // Initialization logic for MonitoringViewModel can go here + } + + public event PropertyChangedEventHandler? PropertyChanged; + private void OnPropertyChanged([CallerMemberName] string? name = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name)); + } +}