ShoppingCart.xaml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <Window x:Class="SergechevExam.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:SergechevExam"
  7. mc:Ignorable="d"
  8. Title="НАЗВАНИЕ ОРГАНИЗАЦИИ" Height="450" Width="800">
  9. <Window.Resources>
  10. <BitmapImage x:Key="defaultImage" UriSource="/Resources/nolog.png"></BitmapImage>
  11. </Window.Resources>
  12. <Grid>
  13. <Grid.RowDefinitions>
  14. <RowDefinition Height="Auto"></RowDefinition>
  15. <RowDefinition></RowDefinition>
  16. </Grid.RowDefinitions>
  17. <Grid.ColumnDefinitions>
  18. <ColumnDefinition/>
  19. <ColumnDefinition Width="auto"/>
  20. </Grid.ColumnDefinitions>
  21. <TextBlock Text="Корзина" FontSize="18" FontWeight="Bold" VerticalAlignment="Center" Margin="5" Grid.Row="0"></TextBlock>
  22. <ListView Name="productList" Grid.Row="1" Background="Transparent" HorizontalContentAlignment="Stretch">
  23. <ListView.ContextMenu>
  24. <ContextMenu>
  25. <MenuItem Name="addToCart" Header="Удалить из корзины" Click="addToCart_Click"></MenuItem>
  26. </ContextMenu>
  27. </ListView.ContextMenu>
  28. <ListView.ItemsPanel>
  29. <ItemsPanelTemplate>
  30. <StackPanel></StackPanel>
  31. </ItemsPanelTemplate>
  32. </ListView.ItemsPanel>
  33. <ListView.ItemTemplate>
  34. <DataTemplate>
  35. <DockPanel>
  36. <Image Source="{Binding Photo_Product, TargetNullValue={StaticResource defaultImage}, FallbackValue={StaticResource defaultImage}}" DockPanel.Dock="Left" Width="150"></Image>
  37. <StackPanel DockPanel.Dock="Top">
  38. <TextBlock Text="{Binding Name_Product}"></TextBlock>
  39. <TextBlock Text="{Binding Description_Product}"></TextBlock>
  40. <WrapPanel>
  41. <TextBlock Text="Производитель:" Margin="0,0,5,0"></TextBlock>
  42. <TextBlock Text="{Binding Manufacturer.Name_Manufacturer}"></TextBlock>
  43. </WrapPanel>
  44. <WrapPanel>
  45. <TextBlock Text="Цена:" Margin="0,0,5,0"></TextBlock>
  46. <TextBlock Uid="{Binding Code_Product}" Name="oldPrice" Margin="0,0,5,0" Text="{Binding Price_Product}" Visibility="Collapsed" TextDecorations="Strikethrough" Loaded="oldPrice_Loaded"></TextBlock>
  47. <TextBlock Uid="{Binding Code_Product}" Name="mainPrice" Loaded="mainPrice_Loaded"></TextBlock>
  48. </WrapPanel>
  49. <WrapPanel>
  50. <TextBlock Text="Количество: " Margin="0,0,5,0"></TextBlock>
  51. <TextBox Uid="{Binding Code_Product}" Text="{Binding Count}" Width="150"></TextBox>
  52. </WrapPanel>
  53. </StackPanel>
  54. <TextBlock Uid="{Binding Code_Product}" Name="discount" Visibility="Collapsed" Text="{Binding Discount_Product}" Loaded="discount_Loaded" HorizontalAlignment="Right" DockPanel.Dock="Top" VerticalAlignment="Center"></TextBlock>
  55. </DockPanel>
  56. </DataTemplate>
  57. </ListView.ItemTemplate>
  58. </ListView>
  59. </Grid>
  60. </Window>