books.xaml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <Page x:Class="test.books"
  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:test"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="books">
  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 Source="{Binding Image}" Width="100" Height="100"></Image>
  15. <StackPanel Orientation="Vertical">
  16. <StackPanel Orientation="Horizontal">
  17. <TextBlock Text="Название: "></TextBlock>
  18. <TextBlock Text="{Binding Title}"></TextBlock>
  19. <TextBlock Text=" | Жанр: "></TextBlock>
  20. <TextBlock Text="{Binding titleGenre}"></TextBlock>
  21. </StackPanel>
  22. <StackPanel Orientation="Horizontal">
  23. <TextBlock Text="Автор: "></TextBlock>
  24. <TextBlock Text="{Binding nameAuthor}"></TextBlock>
  25. </StackPanel>
  26. <StackPanel Orientation="Horizontal">
  27. <TextBlock Text="Цена: "></TextBlock>
  28. <TextBlock Text="{Binding Cost, StringFormat=0}"></TextBlock>
  29. <TextBlock Text=" руб."></TextBlock>
  30. </StackPanel>
  31. <StackPanel Orientation="Horizontal">
  32. <TextBlock Text="Кол-во в магазе: "></TextBlock>
  33. <TextBlock Text="{Binding Store}"></TextBlock>
  34. </StackPanel>
  35. <StackPanel Orientation="Horizontal">
  36. <TextBlock Text="Кол-во на складе: "></TextBlock>
  37. <TextBlock Text="{Binding Stock}"></TextBlock>
  38. </StackPanel>
  39. <StackPanel Orientation="Horizontal">
  40. <TextBlock Text="Описание: "></TextBlock>
  41. <TextBlock Text="{Binding des}"></TextBlock>
  42. </StackPanel>
  43. </StackPanel>
  44. <Button x:Name="add" Click="add_Click" Uid="{Binding IdBook}" Content="Добавление в корзину"></Button>
  45. </StackPanel>
  46. </Border>
  47. </DataTemplate>
  48. </Page.Resources>
  49. <Grid>
  50. <Grid.RowDefinitions>
  51. <RowDefinition Height="91*"/>
  52. <RowDefinition Height="359*"/>
  53. </Grid.RowDefinitions>
  54. <ListBox x:Name="lb" Grid.Row="1" ItemTemplate="{Binding allbooks}"></ListBox>
  55. <Border Grid.Row="0" HorizontalAlignment="Right" BorderBrush="Black" BorderThickness="1" Height="75" Margin="0,0,50,0">
  56. <StackPanel Orientation="Vertical">
  57. <StackPanel Orientation="Horizontal">
  58. <TextBlock Text="Количество выбранных книг: "></TextBlock>
  59. <TextBlock x:Name="kolbook"/>
  60. </StackPanel>
  61. <StackPanel Orientation="Horizontal">
  62. <TextBlock Text="Стоимость покупки: "></TextBlock>
  63. <TextBlock x:Name="price" TextDecorations="{Binding op}"/>
  64. <TextBlock Text=" "/>
  65. <TextBlock x:Name="newprice" Visibility="Hidden"/>
  66. <TextBlock Text=" руб."/>
  67. </StackPanel>
  68. <StackPanel Orientation="Horizontal">
  69. <TextBlock Text="Размер скидки: "></TextBlock>
  70. <TextBlock x:Name="sale"/>
  71. <TextBlock Text="%"/>
  72. </StackPanel>
  73. <Button Content="Посмотреть содержание карзины" Name="korzina" Click="korz_Click"></Button>
  74. </StackPanel>
  75. </Border>
  76. </Grid>
  77. </Page>