BasketPage.xaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <Page x:Class="Tren.Pages.BasketPage"
  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:Tren.Pages"
  7. mc:Ignorable="d"
  8. d:DesignHeight="700" d:DesignWidth="1000"
  9. Title="BasketPage">
  10. <Grid>
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="150"/>
  13. <RowDefinition/>
  14. </Grid.RowDefinitions>
  15. <Grid>
  16. <Grid.ColumnDefinitions>
  17. <ColumnDefinition Width="100"/>
  18. <ColumnDefinition Width="250"/>
  19. <ColumnDefinition Width="200"/>
  20. <ColumnDefinition/>
  21. </Grid.ColumnDefinitions>
  22. <Button x:Name="OrderButton" Grid.Column="1" Style="{DynamicResource ButtonStyleBase}" Content="Сформировать заказ" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="15" Click="OrderButton_Click" />
  23. <Button x:Name="ClearButton" Grid.Column="2" Style="{DynamicResource ButtonStyleBase}" Content="Очистить корзину" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="15" Click="ClearButton_Click" />
  24. <Button x:Name="BackButton" Grid.Column="0" Style="{DynamicResource ButtonStyleBase}" Content="Назад" FontSize="20" VerticalAlignment="Center" HorizontalAlignment="Center" Padding="15" Click="BackButton_Click" />
  25. <Grid Grid.Row="0" Grid.Column="3" HorizontalAlignment="Right" Margin="10">
  26. <Grid.RowDefinitions>
  27. <RowDefinition/>
  28. <RowDefinition/>
  29. <RowDefinition/>
  30. </Grid.RowDefinitions>
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition/>
  33. <ColumnDefinition/>
  34. </Grid.ColumnDefinitions>
  35. <Label Content="Количество выбранных книг: " Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0"/>
  36. <TextBlock x:Name="CountOfSelected" Text="0" Grid.Row="0" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="1"/>
  37. <Label Content="Стоимость покупки: " Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0"/>
  38. <TextBlock x:Name="Price" Text="0" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="1"/>
  39. <Label Content="Размер скидки: " Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Center" Grid.Column="0"/>
  40. <TextBlock x:Name="Discount" Text="0" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="1"/>
  41. </Grid>
  42. </Grid>
  43. <ListView Grid.Row="1" x:Name="BasketList">
  44. <ListView.ItemTemplate>
  45. <DataTemplate>
  46. <Border
  47. BorderThickness="1"
  48. BorderBrush="Black">
  49. <Grid HorizontalAlignment="Stretch" >
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition Width="170"/>
  52. <ColumnDefinition Width="650"/>
  53. <ColumnDefinition Width="150"/>
  54. </Grid.ColumnDefinitions>
  55. <Grid.RowDefinitions>
  56. <RowDefinition/>
  57. </Grid.RowDefinitions>
  58. <Image Stretch="Uniform" HorizontalAlignment="Center" Margin="10">
  59. <Image.Source>
  60. <Binding Path="Photo">
  61. <Binding.TargetNullValue>
  62. <ImageSource>/Images/NoPhoto.jpg</ImageSource>
  63. </Binding.TargetNullValue>
  64. </Binding>
  65. </Image.Source>
  66. </Image>
  67. <Grid Grid.Column="1" Margin="5">
  68. <Grid.RowDefinitions>
  69. <RowDefinition/>
  70. <RowDefinition/>
  71. <RowDefinition/>
  72. <RowDefinition/>
  73. <RowDefinition/>
  74. <RowDefinition/>
  75. <RowDefinition/>
  76. </Grid.RowDefinitions>
  77. <TextBlock
  78. Text="{Binding ProductName,StringFormat= {}Название: {0:N2}}"
  79. Grid.Row="0"
  80. FontFamily="Bahnschrift"
  81. FontSize="20"/>
  82. <TextBlock
  83. Grid.Row="1"
  84. Text="{Binding ProductDescription,StringFormat= {}Описание товара: {0:N2}}"
  85. FontFamily="Bahnschrift"
  86. FontSize="20"/>
  87. <TextBlock
  88. Text="{Binding Manufacturers.Name,StringFormat= {}Производитель: {0:N2}}"
  89. Grid.Row="2"
  90. FontFamily="Bahnschrift"
  91. FontSize="20"/>
  92. <TextBlock
  93. Grid.Row="3"
  94. Text="{Binding Price, StringFormat= {}Цена: {0:N2} руб. }"
  95. FontFamily="Bahnschrift"
  96. FontSize="20"/>
  97. <TextBlock
  98. Grid.Row="4"
  99. Text="{Binding CountInShop,StringFormat= {}Количество в магазине: {0:N0} }"
  100. FontFamily="Bahnschrift"
  101. FontSize="20"/>
  102. <TextBlock
  103. Grid.Row="5"
  104. Text="{Binding CountInStock, StringFormat= {}Количество на складе: {0:N0}}"
  105. FontFamily="Bahnschrift"
  106. FontSize="20"/>
  107. <TextBlock
  108. Grid.Row="6"
  109. Text="{Binding Description, StringFormat= {}Описание: {0:N0}}"
  110. FontFamily="Bahnschrift"
  111. TextWrapping="Wrap"
  112. FontSize="20"/>
  113. </Grid>
  114. <Button x:Name="DeleteButton" Grid.Column="2" Content="Удалить" Style="{DynamicResource ButtonStyleBase}" Click="DeleteButton_Click"/>
  115. </Grid>
  116. </Border>
  117. </DataTemplate>
  118. </ListView.ItemTemplate>
  119. </ListView>
  120. </Grid>
  121. </Page>