ShoppingCart.xaml 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <Window x:Class="WriteErase.Windows.ShoppingCart"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:WriteErase.Windows"
  7. mc:Ignorable="d"
  8. Title="ShoppingCart" Height="450" Width="800">
  9. <Grid>
  10. <Grid.RowDefinitions>
  11. <RowDefinition Height="10*"/>
  12. <RowDefinition Height="*"/>
  13. </Grid.RowDefinitions>
  14. <ListView Grid.Row="0" Name="CartList" d:ItemsSource="{d:SampleData ItemCount=5}" >
  15. <ListView.ItemsPanel>
  16. <ItemsPanelTemplate>
  17. <WrapPanel Orientation="Vertical" HorizontalAlignment="Center"/>
  18. </ItemsPanelTemplate>
  19. </ListView.ItemsPanel>
  20. <ListView.ItemTemplate>
  21. <DataTemplate>
  22. <Border Width="800" Height="170" CornerRadius="10" BorderThickness="1" BorderBrush="Black">
  23. <Grid Width="800" Height="170">
  24. <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
  25. <Image Width="150" Height="150" Margin="10 0 0 0" Uid="{Binding ProductArticleNumber}" Loaded="Photo"/>
  26. <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
  27. <TextBlock FontSize="15" Margin="30,0,0,0" Width="100" TextWrapping="Wrap" Text="{Binding StringFormat=Артикул: {0}, Path=ProductArticleNumber}"/>
  28. <TextBlock FontSize="15" Margin="10,0,0,0" Width="100" TextWrapping="Wrap" Text="{Binding ProductName}"/>
  29. <TextBlock FontSize="15" Margin="10,0,0,0" Width="100" TextWrapping="Wrap" Uid="{Binding ProductArticleNumber}" Loaded="CostCalculate"/>
  30. <TextBlock FontSize="15" Margin="10,0,0,0" Width="100" TextWrapping="Wrap" Text="{Binding ProductDescription}"/>
  31. <StackPanel Margin="10,0,0,0" Orientation="Vertical">
  32. <StackPanel Orientation="Horizontal">
  33. <Border BorderThickness="1" CornerRadius="7" BorderBrush="#bababa" Width="30" Height="30" Background="LightGray" Margin="5,0,0,0" >
  34. <Button HorizontalAlignment="Center" VerticalAlignment="Center" Background="#0000" BorderBrush="#0000" FontSize="14" Uid="{Binding ProductArticleNumber}" Click="MinusAmount" Content="➖"/>
  35. </Border>
  36. <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="15" Margin="10,0,0,0" Uid="{Binding ProductArticleNumber}" Loaded="AmountCalculate"/>
  37. <Border BorderThickness="1" CornerRadius="7" BorderBrush="#bababa" Width="30" Height="30" Background="LightGray" Margin="10,0,0,0" >
  38. <Button HorizontalAlignment="Center" VerticalAlignment="Center" Background="#0000" BorderBrush="#0000" FontSize="14" Uid="{Binding ProductArticleNumber}" Click="PlusAmount" Content="➕"/>
  39. </Border>
  40. </StackPanel>
  41. <Border BorderThickness="1" CornerRadius="7" BorderBrush="#bababa" Width="80" Height="30" Background="LightGray" Margin="5,5,0,0" >
  42. <Button HorizontalAlignment="Center" VerticalAlignment="Center" Background="#0000" BorderBrush="#0000" FontSize="14" Uid="{Binding ProductArticleNumber}" Click="DeleteProduct" Content="Удалить"/>
  43. </Border>
  44. </StackPanel>
  45. </StackPanel>
  46. </StackPanel>
  47. </Grid>
  48. </Border>
  49. </DataTemplate>
  50. </ListView.ItemTemplate>
  51. </ListView>
  52. <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
  53. <TextBlock FontSize="15" VerticalAlignment="Center" Name="CostOrder"/>
  54. <Border BorderThickness="1" CornerRadius="7" BorderBrush="#bababa" Width="100" Height="30" Background="LightGray" Margin="5,0,0,0" >
  55. <Button HorizontalAlignment="Center" VerticalAlignment="Center" Background="#0000" BorderBrush="#0000" FontSize="14" Click="CreateOrder" Content="Заказать"/>
  56. </Border>
  57. </StackPanel>
  58. </Grid>
  59. </Window>