<Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Componentes de acceso a datos" Height="300" Width="400" ResizeMode="NoResize" Loaded="Window_Loaded" Closing="Window_Closing">
  <Grid>
    <StackPanel>
      <TextBlock Name="tbTitulo" FontSize="20" Margin="4" Text="Lista de teléfonos:"/>
      <DataGrid Name="dgTelefonos" Margin="5" MaxHeight="230"
              AutoGenerateColumns="False"
              ItemsSource="{Binding}" SelectionChanged="dgTelefonos_SelectionChanged" RowEditEnding="dgTelefonos_RowEditEnding">
        <DataGrid.Columns>
          <DataGridTextColumn Header="Nombre" Binding="{Binding Path=Nombre}" MinWidth="240"/>
          <DataGridTextColumn Header="Teléfono" Binding="{Binding Path=Telefono}" MinWidth="120"/>
        </DataGrid.Columns>
        <!-- Sección de detalles de la fila -->
        <DataGrid.RowDetailsTemplate>
          <DataTemplate>
            <Border BorderThickness="0" Background="BlanchedAlmond" Padding="5">
              <StackPanel>
                <TextBox Name="ctDir" Padding="2" Text="{Binding Path=Direccion, UpdateSourceTrigger=PropertyChanged}" />
                <TextBox Name="ctObs" Padding="2" Text="{Binding Path=Observaciones, UpdateSourceTrigger=PropertyChanged}" />
              </StackPanel>
            </Border>
          </DataTemplate>
        </DataGrid.RowDetailsTemplate>
      </DataGrid>
    </StackPanel>
  </Grid>
</Window>
