108 lines
6.0 KiB
XML
108 lines
6.0 KiB
XML
<Window x:Class="DirectoryCreator.ConfigEditorWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
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="Editor de Configuraciones"
|
|
Height="600" Width="800" WindowStartupLocation="CenterOwner">
|
|
|
|
<Window.Resources>
|
|
<Style TargetType="Button">
|
|
<Setter Property="Padding" Value="10,5" />
|
|
<Setter Property="Margin" Value="5" />
|
|
</Style>
|
|
</Window.Resources>
|
|
|
|
<Grid Margin="20">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="20" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="20" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Configuración general -->
|
|
<StackPanel Grid.Row="0">
|
|
<DockPanel>
|
|
<TextBlock Text="Nombre de Configuración:" VerticalAlignment="Center" />
|
|
<TextBox Text="{Binding ConfigDescription, UpdateSourceTrigger=PropertyChanged}" Margin="10,0,0,0"
|
|
MinWidth="200" />
|
|
</DockPanel>
|
|
<DockPanel Margin="0,10,0,0">
|
|
<TextBlock Text="Ruta Base:" VerticalAlignment="Center" />
|
|
<Button Content="..." Command="{Binding SelectBasePathCommand}" DockPanel.Dock="Right" Padding="5,0"
|
|
Margin="5,0" />
|
|
<TextBox Text="{Binding BasePath, UpdateSourceTrigger=PropertyChanged}" Margin="10,0,5,0" />
|
|
</DockPanel>
|
|
</StackPanel>
|
|
|
|
<!-- Header para la lista de estructuras -->
|
|
<TextBlock Grid.Row="2" Text="Estructuras de Carpetas:" FontWeight="Bold" />
|
|
|
|
<!-- Lista de estructuras de carpetas -->
|
|
<ScrollViewer Grid.Row="4">
|
|
<ItemsControl ItemsSource="{Binding FolderStructures}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border BorderBrush="LightGray" BorderThickness="1" Margin="0,5" Padding="10">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="10" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<!-- Ruta base de la estructura -->
|
|
<DockPanel>
|
|
<Button Content="..." Command="{Binding DataContext.SelectStructurePathCommand,
|
|
RelativeSource={RelativeSource AncestorType=Window}}"
|
|
CommandParameter="{Binding}" DockPanel.Dock="Right" />
|
|
<Button Content="X" Command="{Binding DataContext.RemoveStructureCommand,
|
|
RelativeSource={RelativeSource AncestorType=Window}}"
|
|
CommandParameter="{Binding}" DockPanel.Dock="Right" Background="LightPink" />
|
|
<TextBox Text="{Binding BasePath, UpdateSourceTrigger=PropertyChanged}"
|
|
Margin="0,0,5,0" />
|
|
</DockPanel>
|
|
|
|
<!-- Lista de subcarpetas -->
|
|
<Grid Grid.Row="2">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<ItemsControl ItemsSource="{Binding Subfolders}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<DockPanel Margin="0,2">
|
|
<Button Content="X" Command="{Binding DataContext.RemoveSubfolderCommand,
|
|
RelativeSource={RelativeSource AncestorType=Window}}"
|
|
CommandParameter="{Binding}" DockPanel.Dock="Right"
|
|
Background="LightPink" />
|
|
<TextBox Text="{Binding Name, UpdateSourceTrigger=PropertyChanged}"
|
|
Margin="0,0,5,0" />
|
|
</DockPanel>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
|
|
<Button Grid.Column="1" Content="+ Subcarpeta" Command="{Binding DataContext.AddSubfolderCommand,
|
|
RelativeSource={RelativeSource AncestorType=Window}}"
|
|
CommandParameter="{Binding}" />
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
|
|
<!-- Botones de acción -->
|
|
<StackPanel Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Right">
|
|
<Button Content="+ Nueva Estructura" Command="{Binding AddStructureCommand}" />
|
|
<Button Content="Guardar" Command="{Binding SaveCommand}" />
|
|
<Button Content="Cancelar" Command="{Binding CancelCommand}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Window> |