YourBasket.xaml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <Page x:Class="WpfApp1.YourBasket"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:WpfApp1"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="YourBasket" DataContext ="{Binding RelativeSource={RelativeSource Mode=Self}}">
  10. <Page.Resources>
  11. <DataTemplate x:Key="ListBookBasket">
  12. <Border BorderBrush="Black" BorderThickness="1" Width="1700">
  13. <StackPanel Uid="{Binding IdBook}" Orientation="Horizontal">
  14. <Image Height="100" Source="{Binding Image}"></Image>
  15. <StackPanel Orientation="Vertical">
  16. <StackPanel Orientation="Horizontal">
  17. <TextBlock Text="Название: "></TextBlock>
  18. <TextBlock Text="{Binding Title}"/>
  19. <TextBlock Text=" | Жанр: "></TextBlock>
  20. <TextBlock Text="{Binding Genres.GenreName}"/>
  21. </StackPanel>
  22. <StackPanel Orientation="Horizontal">
  23. <TextBlock Text="Автор: "></TextBlock>
  24. <TextBlock Text="{Binding Authors.Name}"/>
  25. </StackPanel>
  26. <StackPanel Orientation="Horizontal" Visibility="{Binding Visible}">
  27. <TextBlock Text="Цена: "></TextBlock>
  28. <TextBlock Text="{Binding Cost, StringFormat=0}" />
  29. <TextBlock Text=" руб."/>
  30. </StackPanel>
  31. <StackPanel Orientation="Horizontal">
  32. <TextBlock Text="Количество: "></TextBlock>
  33. <Button x:Name="Plus" Uid="{Binding IdBook}" Content="+" Click="Plus_Click"/>
  34. <TextBlock Text="{Binding CountInBasket}"/>
  35. <Button x:Name="Minus" Uid="{Binding IdBook}" Content="-" Click="Minus_Click"/>
  36. </StackPanel>
  37. <StackPanel Orientation="Horizontal">
  38. <TextBlock Text="Цена: "></TextBlock>
  39. <TextBlock Text="{Binding TotalPriseOrder, StringFormat=0}" TextDecorations="{Binding newDecoration}" Visibility="{Binding Visible2}"/>
  40. <TextBlock Text=" "/>
  41. <TextBlock Text="{Binding TotalPriseOrderWithSale, StringFormat=0}"/>
  42. <TextBlock Text=" руб."/>
  43. </StackPanel>
  44. </StackPanel>
  45. <Button x:Name="Delit" Content="Удалить позицию" Click="Delit_Click" Uid="{Binding IdBook}"></Button>
  46. </StackPanel>
  47. </Border>
  48. </DataTemplate>
  49. </Page.Resources>
  50. <Grid>
  51. <Grid.RowDefinitions>
  52. <RowDefinition Height="30"/>
  53. <RowDefinition Height="209*"/>
  54. </Grid.RowDefinitions>
  55. <StackPanel Orientation="Horizontal" Grid.Row="0">
  56. <Button Content="На главную" Name="MainPage" Height="25" Click="MainPage_Click"></Button>
  57. <Button Content="Оформить заказ" Name="Order" Height="25" Click="Order_Click" Margin="20,0,20,0"></Button>
  58. <Button Content="Очичтить корзину" Name="Clear" Height="25" Click="Clear_Click"></Button>
  59. </StackPanel>
  60. <ListBox x:Name="ListBasket" ItemTemplate="{StaticResource ListBookBasket}" Grid.Row="1" Visibility="Visible"></ListBox>
  61. <StackPanel x:Name="Info" Grid.Row="1" Visibility="Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center">
  62. <TextBlock x:Name="number"></TextBlock>
  63. <TextBlock x:Name="dateOrder"></TextBlock>
  64. <TextBlock x:Name="DateRezerv"></TextBlock>
  65. <TextBlock x:Name="totalCostOrder"></TextBlock>
  66. <TextBlock x:Name="totalCostSaleOrder"></TextBlock>
  67. <TextBlock x:Name="totalCostWithSaleOrder"></TextBlock>
  68. <TextBlock x:Name="totalCount"></TextBlock>
  69. </StackPanel>
  70. </Grid>
  71. </Page>