No funciona bien
This commit is contained in:
parent
ec2c0a9969
commit
4ffa474247
11
App.xaml
11
App.xaml
|
@ -1,7 +1,12 @@
|
||||||
<Application x:Class="DirectoryCreator.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<Application x:Class="DirectoryCreator.App"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:DirectoryCreator"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
StartupUri="MainWindow.xaml">
|
StartupUri="MainWindow.xaml">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ResourceDictionary Source="/Themes/LightTheme.xaml"/>
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Resource Include="Assets\app.png" />
|
<Resource Include="Assets\app.png" />
|
||||||
|
<Resource Include="Themes\*.xaml" />
|
||||||
<None Remove="Themes\**" />
|
<None Remove="Themes\**" />
|
||||||
<Resource Include="Themes\**" />
|
<Resource Include="Themes\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -3,14 +3,15 @@
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:viewmodels="clr-namespace:DirectoryCreator.ViewModels" mc:Ignorable="d" Title="Crear Directorios Base"
|
xmlns:viewmodels="clr-namespace:DirectoryCreator.ViewModels" mc:Ignorable="d" Title="Crear Directorios Base"
|
||||||
Height="550" Width="800" WindowStartupLocation="CenterScreen" MinWidth="600" MinHeight="400">
|
Height="550" Width="800" WindowStartupLocation="CenterScreen" MinWidth="600" MinHeight="400"
|
||||||
|
Background="{DynamicResource WindowBackground}" Foreground="{DynamicResource WindowForeground}">
|
||||||
|
|
||||||
<Window.Icon>
|
<Window.Icon>
|
||||||
<BitmapImage UriSource="/Assets/app.png" />
|
<BitmapImage UriSource="/Assets/app.png" />
|
||||||
</Window.Icon>
|
</Window.Icon>
|
||||||
|
|
||||||
<Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Margin="0">
|
<Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Margin="0" Background="{DynamicResource WindowBackground}">
|
||||||
<Grid Margin="25">
|
<Grid Margin="25" Background="{DynamicResource WindowBackground}">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Configuration Section -->
|
<!-- Configuration Section -->
|
||||||
<Border Grid.Row="0" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<Border Grid.Row="0" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource WindowBackground}" BorderThickness="1" Padding="20" CornerRadius="4">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<TextBlock Text="Configuración:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
<TextBlock Text="Configuración:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
||||||
<Button Content="Editar" Command="{Binding EditConfigurationsCommand}" DockPanel.Dock="Right"
|
<Button Content="Editar" Command="{Binding EditConfigurationsCommand}" DockPanel.Dock="Right"
|
||||||
|
@ -38,7 +39,7 @@
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Project Management Section -->
|
<!-- Project Management Section -->
|
||||||
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource WindowBackground}" BorderThickness="1" Padding="20" CornerRadius="4">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<TextBlock Text="Proyecto Actual:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
<TextBlock Text="Proyecto Actual:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
||||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="15,0,0,0">
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="15,0,0,0">
|
||||||
|
@ -53,7 +54,7 @@
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Project Info Section -->
|
<!-- Project Info Section -->
|
||||||
<Border Grid.Row="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<Border Grid.Row="4" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource WindowBackground}" BorderThickness="1" Padding="20" CornerRadius="4">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<DockPanel Margin="0,0,0,15">
|
<DockPanel Margin="0,0,0,15">
|
||||||
<TextBlock Text="Último Proyecto:" MinWidth="120" FontWeight="SemiBold" />
|
<TextBlock Text="Último Proyecto:" MinWidth="120" FontWeight="SemiBold" />
|
||||||
|
@ -69,7 +70,7 @@
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- New Project Section -->
|
<!-- New Project Section -->
|
||||||
<Border Grid.Row="6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<Border Grid.Row="6" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource WindowBackground}" BorderThickness="1" Padding="20" CornerRadius="4">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<TextBlock Text="Nuevo Proyecto:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
<TextBlock Text="Nuevo Proyecto:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
||||||
<TextBox Text="{Binding NewProjectName, UpdateSourceTrigger=PropertyChanged}" Height="35"
|
<TextBox Text="{Binding NewProjectName, UpdateSourceTrigger=PropertyChanged}" Height="35"
|
||||||
|
@ -78,7 +79,7 @@
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Actions Section -->
|
<!-- Actions Section -->
|
||||||
<Border Grid.Row="8" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
<Border Grid.Row="8" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource WindowBackground}" BorderThickness="1" Padding="20" CornerRadius="4">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<CheckBox Content="Tema Oscuro" IsChecked="{Binding IsDarkTheme}" VerticalAlignment="Center" />
|
<CheckBox Content="Tema Oscuro" IsChecked="{Binding IsDarkTheme}" VerticalAlignment="Center" />
|
||||||
<Button Content="Crear Directorios" Command="{Binding CreateDirectoriesCommand}"
|
<Button Content="Crear Directorios" Command="{Binding CreateDirectoriesCommand}"
|
||||||
|
|
|
@ -4,33 +4,37 @@ namespace DirectoryCreator
|
||||||
{
|
{
|
||||||
public static class ThemeManager
|
public static class ThemeManager
|
||||||
{
|
{
|
||||||
|
private static readonly Uri DarkThemeUri = new Uri("/Themes/DarkTheme.xaml", UriKind.Relative);
|
||||||
|
private static readonly Uri LightThemeUri = new Uri("/Themes/LightTheme.xaml", UriKind.Relative);
|
||||||
|
|
||||||
public static void SetTheme(bool isDarkTheme)
|
public static void SetTheme(bool isDarkTheme)
|
||||||
{
|
{
|
||||||
var app = Application.Current;
|
var app = Application.Current;
|
||||||
|
if (app == null) return;
|
||||||
|
|
||||||
var mergedDicts = app.Resources.MergedDictionaries;
|
var mergedDicts = app.Resources.MergedDictionaries;
|
||||||
|
|
||||||
// Ruta al tema oscuro
|
// Buscar y eliminar los temas existentes
|
||||||
var darkThemeUri = new Uri("Themes/DarkTheme.xaml", UriKind.Relative);
|
ResourceDictionary themeToRemove = null;
|
||||||
|
foreach (ResourceDictionary dict in mergedDicts)
|
||||||
// Primero, removemos el tema oscuro si existe
|
|
||||||
for (int i = mergedDicts.Count - 1; i >= 0; i--)
|
|
||||||
{
|
{
|
||||||
var currentDict = mergedDicts[i];
|
if (dict.Source != null && (dict.Source.OriginalString.Contains("LightTheme") || dict.Source.OriginalString.Contains("DarkTheme")))
|
||||||
if (currentDict.Source != null && currentDict.Source.Equals(darkThemeUri))
|
|
||||||
{
|
{
|
||||||
mergedDicts.RemoveAt(i);
|
themeToRemove = dict;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Si se solicita el tema oscuro, lo agregamos
|
if (themeToRemove != null)
|
||||||
if (isDarkTheme)
|
|
||||||
{
|
{
|
||||||
var darkTheme = new ResourceDictionary
|
mergedDicts.Remove(themeToRemove);
|
||||||
{
|
|
||||||
Source = darkThemeUri
|
|
||||||
};
|
|
||||||
mergedDicts.Add(darkTheme);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Agregar el nuevo tema
|
||||||
|
mergedDicts.Add(new ResourceDictionary
|
||||||
|
{
|
||||||
|
Source = isDarkTheme ? DarkThemeUri : LightThemeUri
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -97,6 +97,13 @@
|
||||||
<Setter Property="Background" Value="{StaticResource PrimaryBackground}" />
|
<Setter Property="Background" Value="{StaticResource PrimaryBackground}" />
|
||||||
<Setter Property="Foreground" Value="{StaticResource WindowForeground}" />
|
<Setter Property="Foreground" Value="{StaticResource WindowForeground}" />
|
||||||
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}" />
|
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}" />
|
||||||
|
<Style.Resources>
|
||||||
|
<SolidColorBrush x:Key="{x:Static SystemColors.WindowBrushKey}" Color="#2D2D2D"/>
|
||||||
|
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#404040"/>
|
||||||
|
<SolidColorBrush x:Key="{x:Static SystemColors.ControlTextBrushKey}" Color="White"/>
|
||||||
|
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="White"/>
|
||||||
|
<SolidColorBrush x:Key="{x:Static SystemColors.WindowTextBrushKey}" Color="White"/>
|
||||||
|
</Style.Resources>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="ComboBox">
|
<ControlTemplate TargetType="ComboBox">
|
||||||
|
@ -147,7 +154,17 @@
|
||||||
<Style TargetType="ComboBoxItem">
|
<Style TargetType="ComboBoxItem">
|
||||||
<Setter Property="Background" Value="Transparent" />
|
<Setter Property="Background" Value="Transparent" />
|
||||||
<Setter Property="Foreground" Value="{StaticResource WindowForeground}" />
|
<Setter Property="Foreground" Value="{StaticResource WindowForeground}" />
|
||||||
<Setter Property="Padding" Value="5,2" />
|
<Setter Property="Height" Value="30" />
|
||||||
|
<Setter Property="Margin" Value="0" />
|
||||||
|
<Setter Property="Padding" Value="8,4" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="{StaticResource ButtonBackground}" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsSelected" Value="True">
|
||||||
|
<Setter Property="Background" Value="{StaticResource ButtonBackgroundHover}" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="ComboBoxItem">
|
<ControlTemplate TargetType="ComboBoxItem">
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<!-- Base Colors -->
|
||||||
|
<SolidColorBrush x:Key="WindowBackground" Color="#FFFFFF"/>
|
||||||
|
<SolidColorBrush x:Key="WindowForeground" Color="#000000"/>
|
||||||
|
<SolidColorBrush x:Key="PrimaryBackground" Color="#F5F5F5"/>
|
||||||
|
<SolidColorBrush x:Key="SecondaryBackground" Color="#EEEEEE"/>
|
||||||
|
<SolidColorBrush x:Key="BorderBrush" Color="#DDDDDD"/>
|
||||||
|
<SolidColorBrush x:Key="ButtonBackground" Color="#E0E0E0"/>
|
||||||
|
<SolidColorBrush x:Key="ButtonBackgroundHover" Color="#D0D0D0"/>
|
||||||
|
<SolidColorBrush x:Key="TextBoxBackground" Color="#FFFFFF"/>
|
||||||
|
|
||||||
|
<!-- ScrollBar Colors -->
|
||||||
|
<SolidColorBrush x:Key="ScrollBarBackground" Color="#F5F5F5"/>
|
||||||
|
<SolidColorBrush x:Key="ScrollBarBorder" Color="#E0E0E0"/>
|
||||||
|
<SolidColorBrush x:Key="ScrollBarThumb" Color="#CCCCCC"/>
|
||||||
|
<SolidColorBrush x:Key="ScrollBarThumbHover" Color="#BBBBBB"/>
|
||||||
|
<SolidColorBrush x:Key="ScrollBarThumbPressed" Color="#AAAAAA"/>
|
||||||
|
|
||||||
|
<!-- Base Control Styles -->
|
||||||
|
<Style TargetType="Window">
|
||||||
|
<Setter Property="Background" Value="{StaticResource WindowBackground}"/>
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource WindowForeground}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="Grid">
|
||||||
|
<Setter Property="Background" Value="{StaticResource WindowBackground}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="Border">
|
||||||
|
<Setter Property="Background" Value="{StaticResource WindowBackground}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="Button">
|
||||||
|
<Setter Property="Background" Value="{StaticResource ButtonBackground}"/>
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource WindowForeground}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="TextBox">
|
||||||
|
<Setter Property="Background" Value="{StaticResource TextBoxBackground}"/>
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource WindowForeground}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="TextBlock">
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource WindowForeground}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="ComboBox">
|
||||||
|
<Setter Property="Background" Value="{StaticResource PrimaryBackground}"/>
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource WindowForeground}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="ComboBoxItem">
|
||||||
|
<Setter Property="Background" Value="Transparent"/>
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource WindowForeground}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style TargetType="CheckBox">
|
||||||
|
<Setter Property="Foreground" Value="{StaticResource WindowForeground}"/>
|
||||||
|
<Setter Property="Background" Value="{StaticResource PrimaryBackground}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
|
||||||
|
</Style>
|
||||||
|
</ResourceDictionary>
|
Loading…
Reference in New Issue