<UserControl x:Class="ModuleC.ModuleCView"
             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:prism="clr-namespace:Microsoft.Practices.Prism.Mvvm;assembly=Microsoft.Practices.Prism.Mvvm.Desktop"
             prism:ViewModelLocator.AutoWireViewModel="True"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="900">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="5*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="550*"/>
            <ColumnDefinition Width="30*"/>
            <ColumnDefinition Width="300*"/>
            <ColumnDefinition Width="300*"/>
            <ColumnDefinition Width="300*"/>

        </Grid.ColumnDefinitions>
        <StackPanel Orientation="Horizontal" Grid.Row="0" Grid.Column="0">
            <Button Content="Add to Cart" Command="{Binding AddToCartCommand}" CommandParameter="{Binding ElementName=ListV, Path=SelectedItem}" Margin="0,0,5,0"/>
            <Button Content="Remove form  Cart" Command="{Binding RemoveFromCartCommand}" CommandParameter="{Binding ElementName=Cart, Path=SelectedItem}" Width="114"/>
        </StackPanel>
        <StackPanel Grid.Row="1" Grid.Column="3">
            <Label>Suma</Label>
            <TextBox Text="{Binding Suma}" />
            <Button Content="Sum" Command="{Binding SumCommand}"/>
        </StackPanel>
        
        <ListView ItemsSource="{Binding Products}" Background="Azure" Grid.Row="1" x:Name="ListV">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Name}"/>
                        <TextBlock Text="{Binding Price}"/>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <Label Content="Cart" Grid.Row="0" Grid.Column="2" Height="40" Background="Tomato"/>
        <ListView ItemsSource="{Binding ProductsInChart}" Background="Azure" Grid.Row="1" Grid.Column="2" x:Name="Cart">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Name}"/>
                        <TextBlock Text="{Binding Price}"/>
                    </StackPanel>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
    </Grid>
</UserControl>
