WinCart.xaml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <Window x:Class="TestDemo.WinCart"
  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:TestDemo"
  7. mc:Ignorable="d"
  8. Title="Корзина" Height="670" Width="1000"
  9. DataContext="{Binding RelativeSource= {RelativeSource Mode=Self}}"
  10. Background="Bisque">
  11. <Window.Resources>
  12. <DataTemplate x:Key="ListView">
  13. <Border BorderBrush="Black" BorderThickness="1" Width="1000">
  14. <StackPanel Orientation="Horizontal">
  15. <Image Source="{Binding cover}" Width="150" Height="150"></Image>
  16. <StackPanel Orientation="Vertical">
  17. <StackPanel Orientation="Horizontal">
  18. <TextBlock Text="Название: "></TextBlock>
  19. <TextBlock Text="{Binding title_book}"></TextBlock>
  20. <TextBlock Text=" | "></TextBlock>
  21. <TextBlock Text="Жанр: "></TextBlock>
  22. <TextBlock Text="{Binding genres.title_genre}"></TextBlock>
  23. </StackPanel>
  24. <StackPanel Orientation="Horizontal">
  25. <TextBlock Text="Автор: "></TextBlock>
  26. <TextBlock Text="{Binding authors.name_author}"></TextBlock>
  27. </StackPanel>
  28. <StackPanel Orientation="Horizontal">
  29. <TextBlock Text="Цена: " Visibility="{Binding VisibleMainPrice}"></TextBlock>
  30. <TextBlock Text="{Binding price, StringFormat=0.00}" Visibility="{Binding VisibleMainPrice}"></TextBlock>
  31. </StackPanel>
  32. <StackPanel Orientation="Horizontal">
  33. <TextBlock Text="Количество: "></TextBlock>
  34. <Button x:Name="BtnPlus" Content="+" Click="BtnPlus_Click" Uid="{Binding id_book}"></Button>
  35. <TextBlock Text="{Binding CountInCart}" ></TextBlock>
  36. <Button x:Name="BtnMinus" Content="-" Click="BtnMinus_Click" Uid="{Binding id_book}"></Button>
  37. <Button x:Name="BtnDelete" Content="Удалить из корзины" Click="BtnDelete_Click" Uid="{Binding id_book}"></Button>
  38. </StackPanel>
  39. <StackPanel Orientation="Horizontal">
  40. <TextBlock Text="Цена: "></TextBlock>
  41. <TextBlock Text="{Binding OldPrice , StringFormat=0.00}" TextDecorations="{Binding TextDecor}" ></TextBlock>
  42. <TextBlock Text=" "></TextBlock>
  43. <TextBlock Text="{Binding NewPrice, StringFormat=0.00}" Visibility="{Binding VisibleNewPrice}" ></TextBlock>
  44. </StackPanel>
  45. </StackPanel>
  46. </StackPanel>
  47. </Border>
  48. </DataTemplate>
  49. </Window.Resources>
  50. <Grid x:Name="MainGrid">
  51. <Grid.RowDefinitions>
  52. <RowDefinition Height="473*"/>
  53. <RowDefinition Height="166*"/>
  54. </Grid.RowDefinitions>
  55. <StackPanel Grid.Row="1" Height="100">
  56. <Button x:Name="BtnClearAllList" Click="BtnClearAllList_Click" Content="Очистить корзину" ></Button>
  57. <Button x:Name="BtnZakazat" Click="BtnZakazat_Click" Content="Оформить заказ" ></Button>
  58. <Button x:Name="BtnGoBack" Click="BtnGoBack_Click" Content="Выйти и очистить корзину" ></Button>
  59. </StackPanel>
  60. <ListView x:Name="ListCart" ItemTemplate="{StaticResource ListView}" Grid.Row="0" Visibility="Visible" Background="Bisque"></ListView>
  61. <StackPanel Grid.Row="0" Orientation="Vertical" x:Name="StackInfo" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center">
  62. <StackPanel Orientation="Horizontal">
  63. <TextBlock Text="Номер заказа: "></TextBlock>
  64. <TextBlock x:Name="TxtNumber"></TextBlock>
  65. </StackPanel>
  66. <StackPanel Orientation="Horizontal">
  67. <TextBlock Text="Заказ можно забрать: "></TextBlock>
  68. <TextBlock x:Name="TxtDateZakaza"></TextBlock>
  69. </StackPanel>
  70. <StackPanel Orientation="Horizontal">
  71. <TextBlock Text="Заказ зарезервирован до "></TextBlock>
  72. <TextBlock x:Name="TxtDateReserv"></TextBlock>
  73. </StackPanel>
  74. <StackPanel Orientation="Horizontal">
  75. <TextBlock Text="Итоговое количество книг: "></TextBlock>
  76. <TextBlock x:Name="TxtCount"></TextBlock>
  77. </StackPanel>
  78. <StackPanel Orientation="Horizontal">
  79. <TextBlock Text="Итоговая сумма заказа со скидкой: "></TextBlock>
  80. <TextBlock x:Name="TxtTotalPrice"></TextBlock>
  81. </StackPanel>
  82. <StackPanel Orientation="Horizontal">
  83. <TextBlock Text="Итоговая сумма заказа без скидки: "></TextBlock>
  84. <TextBlock x:Name="TxtTotalPriceNonSale"></TextBlock>
  85. </StackPanel>
  86. <StackPanel Orientation="Horizontal">
  87. <TextBlock Text="Скидка: "></TextBlock>
  88. <TextBlock x:Name="TxtSale"></TextBlock>
  89. <TextBlock Text=" %"></TextBlock>
  90. </StackPanel>
  91. </StackPanel>
  92. </Grid>
  93. </Window>