diff --git a/App.xaml b/App.xaml
index a8442ea..017fb10 100644
--- a/App.xaml
+++ b/App.xaml
@@ -1,9 +1,7 @@
-
+
-
+
-
+
\ No newline at end of file
diff --git a/Assets/app.png b/Assets/app.png
new file mode 100644
index 0000000..29a23a4
Binary files /dev/null and b/Assets/app.png differ
diff --git a/ConfigEditorWindow.xaml b/ConfigEditorWindow.xaml
index eec762c..ca1e393 100644
--- a/ConfigEditorWindow.xaml
+++ b/ConfigEditorWindow.xaml
@@ -5,12 +5,9 @@
xmlns:viewmodels="clr-namespace:DirectoryCreator.ViewModels" mc:Ignorable="d" Title="Editor de Configuraciones"
Height="600" Width="800" WindowStartupLocation="CenterOwner">
-
-
-
+
+
+
@@ -21,14 +18,15 @@
-
-
+
+
+
+
+
+
+
+
+
PreserveNewest
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+
+ True
+ True
+ Settings.settings
+
diff --git a/MainWindow.xaml b/MainWindow.xaml
index 27fe651..bcf5899 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -5,43 +5,63 @@
xmlns:viewmodels="clr-namespace:DirectoryCreator.ViewModels" mc:Ignorable="d" Title="Crear Directorios Base"
Height="300" Width="500" WindowStartupLocation="CenterScreen">
-
-
-
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs
index 9c11a97..973ccff 100644
--- a/MainWindow.xaml.cs
+++ b/MainWindow.xaml.cs
@@ -1,12 +1,28 @@
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using DirectoryCreator.Models;
+using DirectoryCreator.ViewModels;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.IO;
using System.Text.Json;
using System.Windows;
+namespace DirectoryCreator
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ DataContext = new MainWindowViewModel();
+ }
+ }
+}
+
namespace DirectoryCreator.ViewModels
{
public partial class MainWindowViewModel : ObservableObject
@@ -31,6 +47,8 @@ namespace DirectoryCreator.ViewModels
public MainWindowViewModel()
{
+ IsDarkTheme = Properties.Settings.Default.IsDarkTheme;
+ ThemeManager.SetTheme(IsDarkTheme);
AvailableConfigurations = new ObservableCollection();
LoadConfigurations();
}
@@ -165,11 +183,11 @@ namespace DirectoryCreator.ViewModels
}
LastProjectNumber = lastProject;
- NewProjectName = lastValidNumber >= 0 ? $"{(lastValidNumber + 1):000} - " : "001 - ";
+ NewProjectName = lastValidNumber >= 0 ? $"{(lastValidNumber + 1):00} - " : "01 - ";
if (lastValidNumber < 0)
{
- MessageBox.Show("No se encontró una secuencia válida de al menos 3 números consecutivos.\nSe iniciará desde 001.",
+ MessageBox.Show("No se encontró una secuencia válida de al menos 3 números consecutivos.\nSe iniciará desde 01.",
"Información", MessageBoxButton.OK, MessageBoxImage.Information);
}
}
@@ -212,6 +230,17 @@ namespace DirectoryCreator.ViewModels
}
}
+ [ObservableProperty]
+ private bool isDarkTheme;
+
+ partial void OnIsDarkThemeChanged(bool value)
+ {
+ ThemeManager.SetTheme(value);
+ // Opcional: Guardar la preferencia del usuario
+ Properties.Settings.Default.IsDarkTheme = value;
+ Properties.Settings.Default.Save();
+ }
+
[RelayCommand]
private void CreateDirectories()
{
diff --git a/Properties/Settings.Designer.cs b/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..bee7751
--- /dev/null
+++ b/Properties/Settings.Designer.cs
@@ -0,0 +1,44 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace DirectoryCreator.Properties
+{
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+
+ [global::System.Configuration.UserScopedSettingAttribute()]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ public bool IsDarkTheme
+ {
+ get
+ {
+ return ((bool)(this["IsDarkTheme"]));
+ }
+ set
+ {
+ this["IsDarkTheme"] = value;
+ }
+ }
+ }
+}
diff --git a/Properties/Settings.settings b/Properties/Settings.settings
new file mode 100644
index 0000000..52303ed
--- /dev/null
+++ b/Properties/Settings.settings
@@ -0,0 +1,9 @@
+
+
+
+
+
+ False
+
+
+
\ No newline at end of file
diff --git a/ThemeManager.cs b/ThemeManager.cs
new file mode 100644
index 0000000..b0d6369
--- /dev/null
+++ b/ThemeManager.cs
@@ -0,0 +1,36 @@
+using System.Windows;
+
+namespace DirectoryCreator
+{
+ public static class ThemeManager
+ {
+ public static void SetTheme(bool isDarkTheme)
+ {
+ var app = Application.Current;
+ var mergedDicts = app.Resources.MergedDictionaries;
+
+ // Ruta al tema oscuro
+ var darkThemeUri = new Uri("Themes/DarkTheme.xaml", UriKind.Relative);
+
+ // Primero, removemos el tema oscuro si existe
+ for (int i = mergedDicts.Count - 1; i >= 0; i--)
+ {
+ var currentDict = mergedDicts[i];
+ if (currentDict.Source != null && currentDict.Source.Equals(darkThemeUri))
+ {
+ mergedDicts.RemoveAt(i);
+ }
+ }
+
+ // Si se solicita el tema oscuro, lo agregamos
+ if (isDarkTheme)
+ {
+ var darkTheme = new ResourceDictionary
+ {
+ Source = darkThemeUri
+ };
+ mergedDicts.Add(darkTheme);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Themes/DarkTheme.xaml b/Themes/DarkTheme.xaml
new file mode 100644
index 0000000..dc9301d
--- /dev/null
+++ b/Themes/DarkTheme.xaml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Window1.xaml b/Window1.xaml
deleted file mode 100644
index 99862ed..0000000
--- a/Window1.xaml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
diff --git a/Window1.xaml.cs b/Window1.xaml.cs
deleted file mode 100644
index ef20a17..0000000
--- a/Window1.xaml.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-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.Shapes;
-
-namespace DirectoryCreator
-{
- ///
- /// Interaction logic for Window1.xaml
- ///
- public partial class Window1 : Window
- {
- public Window1()
- {
- InitializeComponent();
- }
- }
-}