Mejorado de la estetica
This commit is contained in:
parent
e2ab9ef6d6
commit
ec2c0a9969
|
@ -17,20 +17,23 @@ namespace Microsoft.Windows.Controls
|
||||||
{
|
{
|
||||||
Title = title,
|
Title = title,
|
||||||
Width = 400,
|
Width = 400,
|
||||||
Height = 150,
|
Height = 200, // Aumentado para dar más espacio
|
||||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||||
Owner = Application.Current.MainWindow,
|
Owner = Application.Current.MainWindow,
|
||||||
ResizeMode = ResizeMode.NoResize
|
ResizeMode = ResizeMode.NoResize
|
||||||
};
|
};
|
||||||
|
|
||||||
var grid = new Grid { Margin = new Thickness(10) };
|
var grid = new Grid { Margin = new Thickness(10) };
|
||||||
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // Prompt
|
||||||
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(10) });
|
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(10) }); // Spacing
|
||||||
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // TextBox
|
||||||
|
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(20) }); // Spacing
|
||||||
|
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); // Buttons
|
||||||
|
|
||||||
var promptLabel = new TextBlock
|
var promptLabel = new TextBlock
|
||||||
{
|
{
|
||||||
Text = promptText,
|
Text = promptText,
|
||||||
|
TextWrapping = TextWrapping.Wrap,
|
||||||
Margin = new Thickness(0, 0, 0, 5)
|
Margin = new Thickness(0, 0, 0, 5)
|
||||||
};
|
};
|
||||||
Grid.SetRow(promptLabel, 0);
|
Grid.SetRow(promptLabel, 0);
|
||||||
|
@ -38,15 +41,14 @@ namespace Microsoft.Windows.Controls
|
||||||
var inputBox = new TextBox
|
var inputBox = new TextBox
|
||||||
{
|
{
|
||||||
Text = defaultValue,
|
Text = defaultValue,
|
||||||
Margin = new Thickness(0)
|
Height = 23
|
||||||
};
|
};
|
||||||
Grid.SetRow(inputBox, 2);
|
Grid.SetRow(inputBox, 2);
|
||||||
|
|
||||||
var buttonPanel = new StackPanel
|
var buttonPanel = new StackPanel
|
||||||
{
|
{
|
||||||
Orientation = Orientation.Horizontal,
|
Orientation = Orientation.Horizontal,
|
||||||
HorizontalAlignment = HorizontalAlignment.Right,
|
HorizontalAlignment = HorizontalAlignment.Right
|
||||||
Margin = new Thickness(0, 10, 0, 0)
|
|
||||||
};
|
};
|
||||||
Grid.SetRow(buttonPanel, 4);
|
Grid.SetRow(buttonPanel, 4);
|
||||||
|
|
||||||
|
|
|
@ -3,86 +3,87 @@
|
||||||
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="450" Width="700" WindowStartupLocation="CenterScreen" MinWidth="600" MinHeight="400">
|
Height="550" Width="800" WindowStartupLocation="CenterScreen" MinWidth="600" MinHeight="400">
|
||||||
|
|
||||||
<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">
|
||||||
<Grid Margin="20">
|
<Grid Margin="25">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="20" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="20" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="20" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="20" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Configuration Section -->
|
<!-- Configuration Section -->
|
||||||
<Border Grid.Row="0" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="15">
|
<Border Grid.Row="0" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<TextBlock Text="Configuración:" VerticalAlignment="Center" MinWidth="100" />
|
<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"
|
||||||
Padding="20,8" Margin="10,0,0,0" />
|
Padding="25,8" Margin="15,0,0,0" />
|
||||||
<ComboBox ItemsSource="{Binding AvailableConfigurations}"
|
<ComboBox ItemsSource="{Binding AvailableConfigurations}"
|
||||||
SelectedItem="{Binding SelectedConfiguration}" DisplayMemberPath="Description" Height="30"
|
SelectedItem="{Binding SelectedConfiguration}" DisplayMemberPath="Description" Height="35"
|
||||||
Margin="5,0" />
|
Margin="5,0" VerticalContentAlignment="Center" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Project Management Section -->
|
<!-- Project Management Section -->
|
||||||
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="15">
|
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<TextBlock Text="Proyecto Actual:" VerticalAlignment="Center" MinWidth="100" />
|
<TextBlock Text="Proyecto Actual:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
||||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="10,0,0,0">
|
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="15,0,0,0">
|
||||||
<Button Content="Renombrar" Command="{Binding RenameProjectCommand}" Padding="15,8"
|
<Button Content="Renombrar" Command="{Binding RenameProjectCommand}" Padding="20,8"
|
||||||
Margin="0,0,10,0" />
|
Margin="0,0,10,0" />
|
||||||
<Button Content="Eliminar" Command="{Binding DeleteProjectCommand}" Padding="15,8"
|
<Button Content="Eliminar" Command="{Binding DeleteProjectCommand}" Padding="20,8"
|
||||||
Background="LightPink" />
|
Background="LightPink" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<ComboBox ItemsSource="{Binding ExistingProjects}" SelectedItem="{Binding SelectedProject}"
|
<ComboBox ItemsSource="{Binding ExistingProjects}" SelectedItem="{Binding SelectedProject}"
|
||||||
Height="30" Margin="5,0" />
|
Height="35" Margin="5,0" VerticalContentAlignment="Center" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Project Info Section -->
|
<!-- Project Info Section -->
|
||||||
<Border Grid.Row="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="15">
|
<Border Grid.Row="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<DockPanel Margin="0,0,0,10">
|
<DockPanel Margin="0,0,0,15">
|
||||||
<TextBlock Text="Último Proyecto:" MinWidth="100" />
|
<TextBlock Text="Último Proyecto:" MinWidth="120" FontWeight="SemiBold" />
|
||||||
<TextBlock Text="{Binding LastProjectNumber}" Margin="5,0" />
|
<TextBlock Text="{Binding LastProjectNumber}" Margin="5,0" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<TextBlock Text="Ruta Base:" MinWidth="100" />
|
<TextBlock Text="Ruta Base:" MinWidth="120" FontWeight="SemiBold" />
|
||||||
<Button Content="Abrir" Command="{Binding OpenBaseFolderCommand}" DockPanel.Dock="Right"
|
<Button Content="Abrir" Command="{Binding OpenBaseFolderCommand}" DockPanel.Dock="Right"
|
||||||
Padding="15,5" />
|
Padding="20,5" />
|
||||||
<TextBlock Text="{Binding BasePath}" Margin="5,0" TextWrapping="Wrap" />
|
<TextBlock Text="{Binding BasePath}" Margin="5,0" TextWrapping="Wrap" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- New Project Section -->
|
<!-- New Project Section -->
|
||||||
<Border Grid.Row="6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="15">
|
<Border Grid.Row="6" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="20" CornerRadius="4">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<TextBlock Text="Nuevo Proyecto:" VerticalAlignment="Center" MinWidth="100" />
|
<TextBlock Text="Nuevo Proyecto:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
||||||
<TextBox Text="{Binding NewProjectName, UpdateSourceTrigger=PropertyChanged}" Height="30"
|
<TextBox Text="{Binding NewProjectName, UpdateSourceTrigger=PropertyChanged}" Height="35"
|
||||||
Margin="5,0" />
|
Margin="5,0" VerticalContentAlignment="Center" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Actions Section -->
|
<!-- Actions Section -->
|
||||||
<Border Grid.Row="8" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Padding="15">
|
<Border Grid.Row="8" BorderBrush="{DynamicResource BorderBrush}" 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}"
|
||||||
DockPanel.Dock="Right" Padding="20,8" Background="{DynamicResource ButtonBackground}" />
|
DockPanel.Dock="Right" Padding="25,10" Background="{DynamicResource ButtonBackground}"
|
||||||
|
FontWeight="SemiBold" />
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
|
@ -253,6 +253,19 @@ namespace DirectoryCreator.ViewModels
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
ExistingProjects = new ObservableCollection<string>(directories);
|
ExistingProjects = new ObservableCollection<string>(directories);
|
||||||
|
|
||||||
|
// Seleccionar el LastProjectNumber si existe
|
||||||
|
if (ExistingProjects.Count > 0)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(LastProjectNumber) && ExistingProjects.Contains(LastProjectNumber))
|
||||||
|
{
|
||||||
|
SelectedProject = LastProjectNumber;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SelectedProject = ExistingProjects[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue