ProductListUser.xaml 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <Page x:Class="UP_Venediktov.Pages.ProductListUser"
  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:UP_Venediktov.Pages"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="ProductListUser">
  10. <Grid>
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="70"></RowDefinition>
  13. <RowDefinition></RowDefinition>
  14. <RowDefinition Height="70"></RowDefinition>
  15. </Grid.RowDefinitions>
  16. <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="15,0,0,0">
  17. <Button Name="BackBtn" Content="←" Height="20" Width="20" VerticalAlignment="Center"></Button>
  18. <GroupBox Height="60" Header="Введите текст для поиска" BorderThickness="2" BorderBrush="#76E383" Margin="10,0,0,0">
  19. <TextBox Name="TB_Search" Width="300" Height="30"/>
  20. </GroupBox>
  21. <ComboBox Name="CB_Sort" Width="200" Height="30" Margin="10,10,0,0"></ComboBox>
  22. <ComboBox Name="CB_Filter" Width="200" Height="30" Margin="20,10,0,0"></ComboBox>
  23. <Button Name="GoToCard" Click="CartGo" Content="Корзина" Visibility="Hidden"/>
  24. </StackPanel>
  25. <ListView Grid.Row="1" Name="ProductList" d:ItemsSource="{d:SampleData ItemCount=5}" BorderBrush="#498C51" >
  26. <ListView.ItemsPanel>
  27. <ItemsPanelTemplate>
  28. <WrapPanel Orientation="Vertical" HorizontalAlignment="Center"/>
  29. </ItemsPanelTemplate>
  30. </ListView.ItemsPanel>
  31. <ListView.ItemTemplate>
  32. <DataTemplate>
  33. <Border Width="800" Height="200" BorderThickness="1" BorderBrush="#498C51">
  34. <StackPanel>
  35. <StackPanel.ContextMenu>
  36. <ContextMenu>
  37. <MenuItem Header="Добавить в корзину" Uid="{Binding ProductArticleNumber}" Click="CartAdd"/>
  38. </ContextMenu>
  39. </StackPanel.ContextMenu>
  40. <Grid Width="795" Height="195" Loaded="BackgroundLoad" Uid="{Binding ProductArticleNumber}">
  41. <StackPanel Orientation="Horizontal">
  42. <Image Width="200" Height="195" Uid="{Binding ProductArticleNumber}" Loaded="Photo"/>
  43. <StackPanel Margin="10,0,0,0" Width="300" HorizontalAlignment="Center" Grid.Column="1" Orientation="Vertical">
  44. <TextBlock Text="{Binding ProductName}"/>
  45. <TextBlock Text="{Binding ProductDescription}" TextWrapping="Wrap"/>
  46. <TextBlock Text="{Binding StringFormat=Произоводитель: {0},Path=Manufacturers.ManufacturerName}"/>
  47. <TextBlock Text="{Binding ProductCost}" Uid="{Binding ProductArticleNumber}" Loaded="StrikePrice"/>
  48. <TextBlock Text="{Binding ProductCost}" Uid="{Binding ProductArticleNumber}" Loaded="PromoPrice"/>
  49. </StackPanel>
  50. <TextBlock Margin="10,0,0,0" HorizontalAlignment="Center" Grid.Column="2" Text="{Binding StringFormat=Скидка: {0}%, Path=ProductMaxDiscountAmount}"/>
  51. </StackPanel>
  52. </Grid>
  53. </StackPanel>
  54. </Border>
  55. </DataTemplate>
  56. </ListView.ItemTemplate>
  57. </ListView>
  58. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Grid.Row="2">
  59. <StackPanel Name="ButtonsForAdmin" Visibility="Hidden" HorizontalAlignment="Center" Orientation="Horizontal" Grid.Row="2">
  60. <Button Width="70" Height="30" Content="Добавить"/>
  61. <Button Margin="10,0,0,0" Height="30" Width="90" Content="Редактировать"/>
  62. <Button Margin="10,0,0,0" Height="30" Width="70" Content="Удалить"/>
  63. </StackPanel>
  64. <StackPanel Margin="10,0,0,0" Name="ViewOrder" Visibility="Hidden" HorizontalAlignment="Center" Orientation="Horizontal" Grid.Row="2">
  65. <Button Width="150" Height="30" Click="ViewOrders" Content="Посмотреть заказы"/>
  66. </StackPanel>
  67. </StackPanel>
  68. </Grid>
  69. </Page>