PgBooks.xaml 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <Page x:Class="TestDemo.PgBooks"
  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:TestDemo"
  7. mc:Ignorable="d"
  8. d:DesignHeight="700" d:DesignWidth="800"
  9. Title="PgBooks"
  10. DataContext="{Binding RelativeSource={RelativeSource Mode=Self}}"
  11. Background="Bisque">
  12. <Page.Resources>
  13. <DataTemplate x:Key="ListView">
  14. <Border BorderBrush="Black" BorderThickness="1" Width="1000">
  15. <StackPanel Orientation="Horizontal">
  16. <Image Source="{Binding cover}" Width="150" Height="150"></Image>
  17. <StackPanel Orientation="Vertical">
  18. <StackPanel Orientation="Horizontal">
  19. <TextBlock Text="Название: "></TextBlock>
  20. <TextBlock Text="{Binding title_book}"></TextBlock>
  21. <TextBlock Text=" | "></TextBlock>
  22. <TextBlock Text="Жанр: "></TextBlock>
  23. <TextBlock Text="{Binding genres.title_genre}"></TextBlock>
  24. </StackPanel>
  25. <StackPanel Orientation="Horizontal">
  26. <TextBlock Text="Автор: "></TextBlock>
  27. <TextBlock Text="{Binding authors.name_author}"></TextBlock>
  28. </StackPanel>
  29. <StackPanel Orientation="Horizontal">
  30. <TextBlock Text="Цена: "></TextBlock>
  31. <TextBlock Text="{Binding price, StringFormat=0.00}" ></TextBlock>
  32. </StackPanel>
  33. <StackPanel Orientation="Horizontal">
  34. <TextBlock Text="Количество в магазине: "></TextBlock>
  35. <TextBlock Text="{Binding CountInMagazine}"></TextBlock>
  36. </StackPanel>
  37. <StackPanel Orientation="Horizontal">
  38. <TextBlock Text="Количество на складе: "></TextBlock>
  39. <TextBlock Text="{Binding CountInStock}"></TextBlock>
  40. </StackPanel>
  41. <StackPanel Orientation="Horizontal">
  42. <TextBlock Text="{Binding description}" TextWrapping="WrapWithOverflow" Width="600" Height="100"></TextBlock>
  43. </StackPanel>
  44. </StackPanel>
  45. <Button Uid="{Binding id_book}" Content="Добавить книгу в корзину" Height="50" x:Name="BtnAddCart" Click="BtnAddCart_Click" ></Button>
  46. </StackPanel>
  47. </Border>
  48. </DataTemplate>
  49. </Page.Resources>
  50. <Grid>
  51. <Grid.RowDefinitions>
  52. <RowDefinition Height="4*"/>
  53. <RowDefinition Height="31*"/>
  54. </Grid.RowDefinitions>
  55. <ListView ItemTemplate="{StaticResource ListView}" Background="Bisque" x:Name="MailList" Grid.Row="1"/>
  56. <Border Grid.Row="0" BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,6,20,4" Height="70" Width="250" >
  57. <StackPanel Orientation="Vertical">
  58. <StackPanel Orientation="Horizontal">
  59. <TextBlock Text="Количество выбранных книг:" FontSize="13" ></TextBlock>
  60. <TextBlock Text="{Binding CountTakedBooks}" FontSize="13"></TextBlock>
  61. </StackPanel>
  62. <StackPanel Orientation="Horizontal">
  63. <TextBlock Text="Стоимость покупки " FontSize="13"></TextBlock>
  64. <TextBlock Text="{Binding ItogPriceNonSale , StringFormat=0.00}" x:Name="TxtNonSale" TextDecorations="{Binding TextDecor}" FontSize="13" ></TextBlock>
  65. <TextBlock Text=" " FontSize="13"></TextBlock>
  66. <TextBlock Text="{Binding PriceSale , StringFormat=0.00}" FontSize="13" x:Name="TxtYesSale" Visibility="Hidden"></TextBlock>
  67. </StackPanel>
  68. <StackPanel Orientation="Horizontal">
  69. <TextBlock Text="Размер скидки " FontSize="13"></TextBlock>
  70. <TextBlock Text="{Binding Sale}" FontSize="13"></TextBlock>
  71. <TextBlock Text="%" FontSize="13"></TextBlock>
  72. </StackPanel>
  73. <Button x:Name="BtnGoCart" Click="BtnGoCart_Click" Content="Перейти в корзину"></Button>
  74. </StackPanel>
  75. </Border>
  76. </Grid>
  77. </Page>