<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="UseRestService.Pages.AddPartPage"
             xmlns:viewmodel="clr-namespace:UseRestService.ViewModels"
             x:DataType="viewmodel:AddPartViewModel"
             Title="Edit Part">

    <Grid RowDefinitions="*,Auto" ColumnDefinitions="*,*,*" ColumnSpacing="5" Padding="10">
        <TableView Intent="Data" Grid.Row="0" Grid.ColumnSpan="3">
            <TableRoot>
                <TableSection Title="Part Info">
                    <EntryCell Label="Part ID" Text="{Binding PartID}" IsEnabled="False" />
                    <EntryCell Label="Part Name" Text="{Binding PartName}" />
                    <EntryCell Label="Part Type" Text="{Binding PartType}" />
                    <EntryCell Label="Supplier" Text="{Binding Suppliers}" />
                </TableSection>
            </TableRoot>
        </TableView>

        <Button Text="Save" Grid.Row="1" Grid.Column="0" Command="{Binding SaveDataCommand}" Margin="20,0"/>
        <Button Text="Delete" Grid.Row="1" Grid.Column="1" Command="{Binding DeletePartCommand}"/>
        <Button Text="Cancel" Grid.Row="1" Grid.Column="2" Command="{Binding DoneEditingCommand}" Margin="20,0"/>
    </Grid>
    
</ContentPage>