MainPage.xaml 6.7 KB

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