<Window 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="ShortName Mappings Editor" Height="520" Width="620"
    WindowStartupLocation="CenterOwner" Background="#F0F0F0"
    ResizeMode="CanResizeWithGrip" MinWidth="500" MinHeight="400">

    <Grid Margin="12">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <!-- ListView showing all mappings -->
        <ListView Name="LstMappings" Grid.Row="0" FontFamily="Consolas" FontSize="11"
                  SelectionMode="Single">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Model / Type" Width="270"
                                    DisplayMemberBinding="{Binding Model}"/>
                    <GridViewColumn Header="Short Name" Width="150"
                                    DisplayMemberBinding="{Binding ShortName}"/>
                </GridView>
            </ListView.View>
        </ListView>

        <!-- Edit area -->
        <Grid Grid.Row="1" Margin="0,10,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <TextBlock Text="Model:" Grid.Row="0" Grid.Column="0"
                       FontWeight="Bold" FontSize="11" Margin="0,0,0,3"/>
            <TextBox Name="TxtEditModel" Grid.Row="1" Grid.Column="0"
                     Height="26" Margin="0,0,6,0" FontSize="11"/>

            <TextBlock Text="Short Name:" Grid.Row="0" Grid.Column="1"
                       FontWeight="Bold" FontSize="11" Margin="0,0,0,3"/>
            <TextBox Name="TxtEditShortName" Grid.Row="1" Grid.Column="1"
                     Height="26" Margin="0,0,6,0" FontSize="11"
                     CharacterCasing="Upper"/>

            <StackPanel Grid.Row="1" Grid.Column="2" VerticalAlignment="Center">
                <Button Name="BtnAddUpdate" Content="Add / Update" Height="26"
                        Width="100" Margin="0,0,0,3"
                        Background="#007ACC" Foreground="White"
                        FontSize="11" FontWeight="Bold"/>
                <Button Name="BtnRemove" Content="Remove" Height="26"
                        Width="100" Background="#D9534F" Foreground="White"
                        FontSize="11"/>
            </StackPanel>
        </Grid>

        <!-- Action buttons -->
        <WrapPanel Grid.Row="2" Margin="0,12,0,0" HorizontalAlignment="Right">
            <Button Name="BtnImportMap" Content="Import" Width="80"
                    Height="28" Margin="0,0,8,0" FontSize="11"/>
            <Button Name="BtnExportMap" Content="Export" Width="80"
                    Height="28" Margin="0,0,16,0" FontSize="11"/>
            <Button Name="BtnSaveMap" Content="Save" Width="80"
                    Height="28" Margin="0,0,8,0"
                    Background="#198754" Foreground="White"
                    FontSize="11" FontWeight="Bold"/>
            <Button Name="BtnCloseMap" Content="Close" Width="80"
                    Height="28" FontSize="11"/>
        </WrapPanel>
    </Grid>
</Window>
