From 9fed14988e9207054fc2deae63b291d703012ddd Mon Sep 17 00:00:00 2001 From: syneffort Date: Fri, 3 Nov 2023 15:40:25 +0900 Subject: [PATCH] fix ux --- MySolution/MySolution.sln | 8 +++++- MySolution/ToDoApp/MainWindow.xaml.cs | 27 +++++++++++++++---- MySolution/WeatherApp/App.xaml | 9 +++++++ MySolution/WeatherApp/App.xaml.cs | 17 ++++++++++++ MySolution/WeatherApp/AssemblyInfo.cs | 10 +++++++ MySolution/WeatherApp/MainWindow.xaml | 24 +++++++++++++++++ MySolution/WeatherApp/MainWindow.xaml.cs | 34 ++++++++++++++++++++++++ MySolution/WeatherApp/WeatherApp.csproj | 14 ++++++++++ 8 files changed, 137 insertions(+), 6 deletions(-) create mode 100644 MySolution/WeatherApp/App.xaml create mode 100644 MySolution/WeatherApp/App.xaml.cs create mode 100644 MySolution/WeatherApp/AssemblyInfo.cs create mode 100644 MySolution/WeatherApp/MainWindow.xaml create mode 100644 MySolution/WeatherApp/MainWindow.xaml.cs create mode 100644 MySolution/WeatherApp/WeatherApp.csproj diff --git a/MySolution/MySolution.sln b/MySolution/MySolution.sln index a9bc715..4072640 100644 --- a/MySolution/MySolution.sln +++ b/MySolution/MySolution.sln @@ -25,7 +25,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "InventoryManagement_MariaDB EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DBCreateEF", "DBCreateEF\DBCreateEF.csproj", "{A3960078-A866-414F-B039-FCD4065E8F74}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToDoApp", "ToDoApp\ToDoApp.csproj", "{D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ToDoApp", "ToDoApp\ToDoApp.csproj", "{D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WeatherApp", "WeatherApp\WeatherApp.csproj", "{E0032CFE-5591-4195-828B-5D2ED602A208}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -81,6 +83,10 @@ Global {D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}.Debug|Any CPU.Build.0 = Debug|Any CPU {D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}.Release|Any CPU.ActiveCfg = Release|Any CPU {D500F21E-3B7B-47DA-9D0C-69EB8A8FA3B1}.Release|Any CPU.Build.0 = Release|Any CPU + {E0032CFE-5591-4195-828B-5D2ED602A208}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0032CFE-5591-4195-828B-5D2ED602A208}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0032CFE-5591-4195-828B-5D2ED602A208}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0032CFE-5591-4195-828B-5D2ED602A208}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MySolution/ToDoApp/MainWindow.xaml.cs b/MySolution/ToDoApp/MainWindow.xaml.cs index 9ea5aeb..38577d3 100644 --- a/MySolution/ToDoApp/MainWindow.xaml.cs +++ b/MySolution/ToDoApp/MainWindow.xaml.cs @@ -201,12 +201,29 @@ namespace ToDoApp private void btnUpdate_Click(object sender, RoutedEventArgs e) { - _selectedItem.Title = tbxItemName.Text; - _selectedItem.IsToday = chkItemToday.IsChecked == true ? true : false; - _selectedItem.DueDate = dpItemDueDate.SelectedDate; - _selectedItem.Description = tbxItemDescription.Text; + if (_selectedItem == null) + { + Item newItem = new Item() + { + UserId = _user.Id, + Title = tbxItemName.Text, + IsToday = chkItemToday.IsChecked, + DueDate = dpItemDueDate.SelectedDate, + Description = tbxItemDescription.Text, + }; + + ItemService.Instance.CreateItem(newItem); + ClearSelectedItem(); + } + else + { + _selectedItem.Title = tbxItemName.Text; + _selectedItem.IsToday = chkItemToday.IsChecked == true ? true : false; + _selectedItem.DueDate = dpItemDueDate.SelectedDate; + _selectedItem.Description = tbxItemDescription.Text; - ItemService.Instance.UpdateItem(_selectedItem); + ItemService.Instance.UpdateItem(_selectedItem); + } RefreshList(); } diff --git a/MySolution/WeatherApp/App.xaml b/MySolution/WeatherApp/App.xaml new file mode 100644 index 0000000..e0d8e53 --- /dev/null +++ b/MySolution/WeatherApp/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/MySolution/WeatherApp/App.xaml.cs b/MySolution/WeatherApp/App.xaml.cs new file mode 100644 index 0000000..8add251 --- /dev/null +++ b/MySolution/WeatherApp/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace WeatherApp +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/MySolution/WeatherApp/AssemblyInfo.cs b/MySolution/WeatherApp/AssemblyInfo.cs new file mode 100644 index 0000000..8b5504e --- /dev/null +++ b/MySolution/WeatherApp/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/MySolution/WeatherApp/MainWindow.xaml b/MySolution/WeatherApp/MainWindow.xaml new file mode 100644 index 0000000..392ea8e --- /dev/null +++ b/MySolution/WeatherApp/MainWindow.xaml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + diff --git a/MySolution/WeatherApp/MainWindow.xaml.cs b/MySolution/WeatherApp/MainWindow.xaml.cs new file mode 100644 index 0000000..40ebca5 --- /dev/null +++ b/MySolution/WeatherApp/MainWindow.xaml.cs @@ -0,0 +1,34 @@ +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 WeatherApp +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + + private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) + { + if (e.LeftButton == MouseButtonState.Pressed) + DragMove(); + } + } +} diff --git a/MySolution/WeatherApp/WeatherApp.csproj b/MySolution/WeatherApp/WeatherApp.csproj new file mode 100644 index 0000000..b0ae643 --- /dev/null +++ b/MySolution/WeatherApp/WeatherApp.csproj @@ -0,0 +1,14 @@ + + + + WinExe + net6.0-windows + enable + true + + + + + + +