Mejorado de la estetica
This commit is contained in:
parent
e2ab9ef6d6
commit
ec2c0a9969
|
@ -17,20 +17,23 @@ namespace Microsoft.Windows.Controls
|
|||
{
|
||||
Title = title,
|
||||
Width = 400,
|
||||
Height = 150,
|
||||
Height = 200, // Aumentado para dar más espacio
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
Owner = Application.Current.MainWindow,
|
||||
ResizeMode = ResizeMode.NoResize
|
||||
};
|
||||
|
||||
var grid = new Grid { Margin = new Thickness(10) };
|
||||
grid.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
|
||||
grid.RowDefinitions.Add(new RowDefinition { Height = new GridLength(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) }); // Spacing
|
||||
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
|
||||
{
|
||||
Text = promptText,
|
||||
TextWrapping = TextWrapping.Wrap,
|
||||
Margin = new Thickness(0, 0, 0, 5)
|
||||
};
|
||||
Grid.SetRow(promptLabel, 0);
|
||||
|
@ -38,15 +41,14 @@ namespace Microsoft.Windows.Controls
|
|||
var inputBox = new TextBox
|
||||
{
|
||||
Text = defaultValue,
|
||||
Margin = new Thickness(0)
|
||||
Height = 23
|
||||
};
|
||||
Grid.SetRow(inputBox, 2);
|
||||
|
||||
var buttonPanel = new StackPanel
|
||||
{
|
||||
Orientation = Orientation.Horizontal,
|
||||
HorizontalAlignment = HorizontalAlignment.Right,
|
||||
Margin = new Thickness(0, 10, 0, 0)
|
||||
HorizontalAlignment = HorizontalAlignment.Right
|
||||
};
|
||||
Grid.SetRow(buttonPanel, 4);
|
||||
|
||||
|
|
|
@ -3,86 +3,87 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
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>
|
||||
<BitmapImage UriSource="/Assets/app.png" />
|
||||
</Window.Icon>
|
||||
|
||||
<Border BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Margin="0">
|
||||
<Grid Margin="20">
|
||||
<Grid Margin="25">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- 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>
|
||||
<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"
|
||||
Padding="20,8" Margin="10,0,0,0" />
|
||||
Padding="25,8" Margin="15,0,0,0" />
|
||||
<ComboBox ItemsSource="{Binding AvailableConfigurations}"
|
||||
SelectedItem="{Binding SelectedConfiguration}" DisplayMemberPath="Description" Height="30"
|
||||
Margin="5,0" />
|
||||
SelectedItem="{Binding SelectedConfiguration}" DisplayMemberPath="Description" Height="35"
|
||||
Margin="5,0" VerticalContentAlignment="Center" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 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>
|
||||
<TextBlock Text="Proyecto Actual:" VerticalAlignment="Center" MinWidth="100" />
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="10,0,0,0">
|
||||
<Button Content="Renombrar" Command="{Binding RenameProjectCommand}" Padding="15,8"
|
||||
<TextBlock Text="Proyecto Actual:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
||||
<StackPanel DockPanel.Dock="Right" Orientation="Horizontal" Margin="15,0,0,0">
|
||||
<Button Content="Renombrar" Command="{Binding RenameProjectCommand}" Padding="20,8"
|
||||
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" />
|
||||
</StackPanel>
|
||||
<ComboBox ItemsSource="{Binding ExistingProjects}" SelectedItem="{Binding SelectedProject}"
|
||||
Height="30" Margin="5,0" />
|
||||
Height="35" Margin="5,0" VerticalContentAlignment="Center" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 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>
|
||||
<DockPanel Margin="0,0,0,10">
|
||||
<TextBlock Text="Último Proyecto:" MinWidth="100" />
|
||||
<DockPanel Margin="0,0,0,15">
|
||||
<TextBlock Text="Último Proyecto:" MinWidth="120" FontWeight="SemiBold" />
|
||||
<TextBlock Text="{Binding LastProjectNumber}" Margin="5,0" />
|
||||
</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"
|
||||
Padding="15,5" />
|
||||
Padding="20,5" />
|
||||
<TextBlock Text="{Binding BasePath}" Margin="5,0" TextWrapping="Wrap" />
|
||||
</DockPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 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>
|
||||
<TextBlock Text="Nuevo Proyecto:" VerticalAlignment="Center" MinWidth="100" />
|
||||
<TextBox Text="{Binding NewProjectName, UpdateSourceTrigger=PropertyChanged}" Height="30"
|
||||
Margin="5,0" />
|
||||
<TextBlock Text="Nuevo Proyecto:" VerticalAlignment="Center" MinWidth="120" FontWeight="SemiBold" />
|
||||
<TextBox Text="{Binding NewProjectName, UpdateSourceTrigger=PropertyChanged}" Height="35"
|
||||
Margin="5,0" VerticalContentAlignment="Center" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
|
||||
<!-- 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>
|
||||
<CheckBox Content="Tema Oscuro" IsChecked="{Binding IsDarkTheme}" VerticalAlignment="Center" />
|
||||
<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>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
|
|
@ -253,6 +253,19 @@ namespace DirectoryCreator.ViewModels
|
|||
.ToList();
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue