Books.xaml 5.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <Page x:Class="Books_Shop_Kopey.Pages.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:Books_Shop_Kopey.Pages"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="Books" IsVisibleChanged="Page_IsVisibleChanged">
  10. <Page.Resources>
  11. <Style x:Key="TextBD">
  12. <Setter Property="Control.FontSize" Value="10" />
  13. <Setter Property="Control.Foreground" Value="Black" />
  14. <Setter Property="Control.IsEnabled" Value="False" />
  15. </Style>
  16. <Style x:Key="Border">
  17. <Setter Property="Control.BorderBrush" Value="#FF444242" />
  18. <Setter Property="Control.OpacityMask" Value="#FF939393" />
  19. <Setter Property="Control.BorderThickness" Value="1" />
  20. <Setter Property="Control.Margin" Value="2" />
  21. </Style>
  22. </Page.Resources>
  23. <Grid>
  24. <Grid.RowDefinitions>
  25. <RowDefinition Height="43*"/>
  26. <RowDefinition Height="407*"/>
  27. </Grid.RowDefinitions>
  28. <Button x:Name="DobvKorz" Grid.Row="0" Click="DobvKorz_Click">Добавить в корзину</Button>
  29. <ListView x:Name="list" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Path=DataListGet, UpdateSourceTrigger=PropertyChanged}" Grid.Row="1">
  30. <ItemsControl.ItemsPanel>
  31. <ItemsPanelTemplate>
  32. <UniformGrid Columns="1" />
  33. </ItemsPanelTemplate>
  34. </ItemsControl.ItemsPanel>
  35. <ItemsControl.ItemTemplate>
  36. <DataTemplate>
  37. <Border Style="{StaticResource Border}" >
  38. <StackPanel Background="{x:Null}" HorizontalAlignment="Stretch" Orientation="Horizontal">
  39. <Border Style="{StaticResource Border}">
  40. <Image Width="140" Height="140" Source="{Binding image}" x:Name="IMG" Stretch="Uniform"/>
  41. </Border>
  42. <StackPanel Background="{x:Null}" Style="{StaticResource TextBD}" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="1">
  43. <StackPanel Orientation="Horizontal" >
  44. <TextBlock Margin="5 0 5 0">Название книги:</TextBlock>
  45. <TextBlock Height="20" TextWrapping="Wrap" x:Name="booksname" Text="{Binding name_books}"/>
  46. <TextBlock Height="20" TextWrapping="Wrap" Text="|"/>
  47. <TextBlock Margin="5 0 5 0">Жанр:</TextBlock>
  48. <TextBlock Height="20" TextWrapping="Wrap" x:Name="gen" Text="{Binding genre}"/>
  49. </StackPanel>
  50. <StackPanel Orientation="Horizontal" >
  51. </StackPanel>
  52. <StackPanel Orientation="Horizontal">
  53. <TextBlock Margin="5 0 5 0">Автор:</TextBlock>
  54. <TextBlock Height="20" x:Name="Aut" Text="{Binding autor}"/>
  55. </StackPanel>
  56. <StackPanel Orientation="Horizontal">
  57. <TextBlock Margin="5 0 5 0">Цена:</TextBlock>
  58. <TextBlock Height="20" x:Name="costonebooks" Text="{Binding cost, ValidatesOnExceptions=True, StringFormat={}{0:F0} руб.}"/>
  59. </StackPanel>
  60. <StackPanel Orientation="Horizontal">
  61. <TextBlock Height="20" Margin="5 0 5 0" Text="Количество в магазине: "></TextBlock>
  62. <TextBlock Height="20" TextWrapping="Wrap" Text="{Binding count_books_magaz}"/>
  63. </StackPanel>
  64. <StackPanel Orientation="Horizontal">
  65. <TextBlock Height="20" Margin="5 0 5 0" Text="Количество на складе: "></TextBlock>
  66. <TextBlock Height="20" TextWrapping="Wrap" Text="{Binding count_books_sklad}"/>
  67. </StackPanel>
  68. <StackPanel Orientation="Horizontal" >
  69. <TextBlock Height="20" Margin="5 0 5 0" Text="Описание: "></TextBlock>
  70. <TextBlock Height="20" TextWrapping="Wrap" Text="{Binding description}"/>
  71. </StackPanel>
  72. </StackPanel>
  73. </StackPanel>
  74. </Border>
  75. </DataTemplate>
  76. </ItemsControl.ItemTemplate>
  77. </ListView>
  78. </Grid>
  79. </Page>