MainPage.xaml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <Page x:Class="WpfApp1.MainPage"
  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="MainPage" DataContext ="{Binding RelativeSource={RelativeSource Mode=Self}}">
  10. <Page.Resources>
  11. <DataTemplate x:Key="allBooks">
  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=" | Жанр: "/>
  20. <TextBlock Text="{Binding tittleGenre}"/>
  21. </StackPanel>
  22. <StackPanel Orientation="Horizontal">
  23. <TextBlock Text="Автор: "></TextBlock>
  24. <TextBlock Text="{Binding nameAuthor}"/>
  25. </StackPanel>
  26. <StackPanel Orientation="Horizontal">
  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. <TextBlock Text="{Binding Store}"/>
  34. </StackPanel>
  35. <StackPanel Orientation="Horizontal">
  36. <TextBlock Text="Количество на складе: "></TextBlock>
  37. <TextBlock Text="{Binding Stock}"/>
  38. </StackPanel>
  39. <StackPanel Orientation="Horizontal">
  40. <TextBlock Text="{Binding allDescription}" TextWrapping="Wrap" Width="1500" />
  41. </StackPanel>
  42. </StackPanel>
  43. <Button x:Name="Add" Content="Добавить в корзину" Click="Add_Click" Uid="{Binding IdBook}" Height="50"></Button>
  44. </StackPanel>
  45. </Border>
  46. </DataTemplate>
  47. </Page.Resources>
  48. <Grid>
  49. <Grid.RowDefinitions>
  50. <RowDefinition Height="90"/>
  51. <RowDefinition Height="127*"/>
  52. </Grid.RowDefinitions>
  53. <ListBox x:Name="ListBoksAllBooks" Grid.Row="1" ItemTemplate="{StaticResource allBooks}"></ListBox>
  54. <Border Grid.Row="0" HorizontalAlignment="Right" BorderBrush="Black" BorderThickness="1" Margin="0,0,50,0">
  55. <StackPanel Orientation="Vertical">
  56. <StackPanel Orientation="Horizontal">
  57. <TextBlock Text="Количество выбранных книг: "></TextBlock>
  58. <TextBlock x:Name="kolbook"/>
  59. </StackPanel>
  60. <StackPanel Orientation="Horizontal">
  61. <TextBlock Text="Стоимость покупки: "></TextBlock>
  62. <TextBlock x:Name="price" TextDecorations="{Binding OldPrise}"/>
  63. <TextBlock Text=" "/>
  64. <TextBlock x:Name="newprice" Visibility="Collapsed"/>
  65. <TextBlock Text=" руб."/>
  66. </StackPanel>
  67. <StackPanel Orientation="Horizontal">
  68. <TextBlock Text="Размер скидки: "></TextBlock>
  69. <TextBlock x:Name="sale"/>
  70. <TextBlock Text="%"/>
  71. </StackPanel>
  72. <Button Content="Посмотреть содержание карзины" Name="Basket" Click="Basket_Click"></Button>
  73. </StackPanel>
  74. </Border>
  75. </Grid>
  76. </Page>