<UserControl x:Class="OrderEntrySystem.ProductView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:OrderEntrySystem"
             mc:Ignorable="d" 
             d:DesignWidth="300">
    <UserControl.Resources>
        <ResourceDictionary Source="SharedResources.xaml" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid Margin="4">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="4" />
                <ColumnDefinition Width="200" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="4" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="4" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="4" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="4" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="4" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="4" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Label Grid.Row="0" Grid.Column="0" Content="Name:" HorizontalAlignment="Right" Target="{Binding ElementName=nameTextBox}" />
            <TextBox x:Name="nameTextBox" Grid.Row="0" Grid.Column="2" Text="{Binding Path=Name, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ResourceKey=ValidationStyleTextBox}" />
            <Label Grid.Row="2" Grid.Column="0" Content="Description:" HorizontalAlignment="Right" Target="{Binding ElementName=descriptionTextBox}" />
            <TextBox x:Name="descriptionTextBox" Grid.Row="2" Grid.Column="2" Text="{Binding Path=Description, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ResourceKey=ValidationStyleTextBox}" />
            <Label Grid.Row="4" Grid.Column="0" Content="Price:" HorizontalAlignment="Right" Target="{Binding ElementName=priceTextBox}" />
            <TextBox x:Name="priceTextBox" Grid.Row="4" Grid.Column="2" Text="{Binding Path=Price, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ResourceKey=ValidationStyleTextBox}" />
            <Label Grid.Row="6" Grid.Column="0" Content="Location:" HorizontalAlignment="Right" Target="{Binding ElementName=locationComboBox}" />
            <ComboBox x:Name="locationComboBox" Grid.Row="6" Grid.Column="2" ItemsSource="{Binding Path=Locations}" SelectedItem="{Binding Path=Location}" />
            <Label Grid.Row="8" Grid.Column="0" Content="Condition:" HorizontalAlignment="Right" Target="{Binding ElementName=conditionComboBox}" />
            <ComboBox x:Name="conditionComboBox" Grid.Row="8" Grid.Column="2" ItemsSource="{Binding Path=Conditions}" SelectedItem="{Binding Path=Condition}" />
            <Label Grid.Row="10" Grid.Column="0" Content="Quantity:" HorizontalAlignment="Right" Target="{Binding ElementName=quantityTextBox}" />
            <TextBox x:Name="quantityTextBox" Grid.Row="10" Grid.Column="2" Text="{Binding Path=Quantity, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource ResourceKey=ValidationStyleTextBox}" />
            <local:MultiCategoryView Grid.Row="12" Grid.Column="2" DataContext="{Binding Path=FilteredCategoryViewModel}" />
        </Grid>
        <ContentControl Grid.Row="1" Grid.Column="2" Content="{Binding Path=Commands}" ContentTemplate="{StaticResource NestedCommandTemplate}" VerticalAlignment="Bottom" Margin="0,0,4,4" />
    </Grid>
</UserControl>
