ListBook.xaml 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <Page x:Class="modulekz.ListBook"
  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:modulekz"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="ListBook">
  10. <Page.Resources>
  11. <DataTemplate x:Key="Book">
  12. <Border BorderBrush="Black" BorderThickness="1" MinWidth="600" MaxWidth="680" MaxHeight="680">
  13. <StackPanel Orientation="Horizontal">
  14. <Image Source="{Binding Img}" Width="120" Margin="0 0 10 0"/>
  15. <StackPanel Orientation="Vertical" MaxWidth="450" MinWidth="450" >
  16. <TextBlock Text="Название: ">
  17. <Run Text="{Binding Title}"/>
  18. <Run Text=" | Жанр:"/>
  19. <Run Text="{Binding Style}"/>
  20. </TextBlock>
  21. <TextBlock Text="Автор: ">
  22. <Run Text="{Binding Author}"/>
  23. </TextBlock>
  24. <TextBlock Text="Цена: ">
  25. <Run Text="{Binding Cost}"/>
  26. </TextBlock>
  27. <TextBlock Text="Количество в магазине: ">
  28. <Run Text="{Binding CountStore}"/>
  29. </TextBlock>
  30. <TextBlock Text="Количество на складе: ">
  31. <Run Text="{Binding CountStock}"/>
  32. </TextBlock>
  33. <TextBlock Text="Описание: " TextWrapping="Wrap" MaxWidth="450">
  34. <Run Text="{Binding Description}" />
  35. </TextBlock>
  36. </StackPanel>
  37. <Button x:Name="AddCart" Content="Заказать" Height="50" VerticalAlignment="Bottom" Margin="15 0 0 0 " Uid="{Binding Id}" Click="AddCart_Click" Width="75"/>
  38. </StackPanel>
  39. </Border>
  40. </DataTemplate>
  41. </Page.Resources>
  42. <Grid>
  43. <Grid.RowDefinitions>
  44. <RowDefinition Height="75"/>
  45. <RowDefinition Height="*"/>
  46. </Grid.RowDefinitions>
  47. <Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Right">
  48. <StackPanel Orientation="Vertical" Margin="0 0 10 0">
  49. <TextBlock Text="Количество выбранных книг: ">
  50. <Run Name="RKol_v" Text=""/>
  51. </TextBlock>
  52. <TextBlock Text="Стоимость покупки: ">
  53. <Run Name="FirstCost" Text=""/>
  54. <Run Text=" "/>
  55. <Run Name="SecCost" Text=""/>
  56. </TextBlock>
  57. <TextBlock Text="Размер скидки: ">
  58. <Run Name="Rsale" Text="0"/>
  59. <Run Text="%"/>
  60. </TextBlock>
  61. <Button x:Name="Gocart" Content="Корзина" Click="Gocart_Click"/>
  62. </StackPanel>
  63. </Border>
  64. <ListBox x:Name="ListBooks" ItemTemplate="{StaticResource Book}" Grid.Row="1" />
  65. </Grid>
  66. </Page>