Guest.xaml 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <Page x:Class="GGwp.Guest"
  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:GGwp"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="Guest">
  10. <Grid Background="LightGreen">
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="*"/>
  13. <RowDefinition Height="10*"/>
  14. <RowDefinition Height="*"/>
  15. </Grid.RowDefinitions>
  16. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  17. <Button BorderBrush="White" BorderThickness="2" Foreground="Green" Background="LightGreen" Width="100" Height="30" Click="CartGo" Name="ToCart" Content="Корзина" Visibility="Hidden"/>
  18. <ComboBox Foreground="Green" Background="LightGreen" SelectionChanged="SortFilterChanged" Name="SortByName" Height="30" Margin="10,0,0,0" Width="200"/>
  19. <ComboBox Foreground="Green" Background="LightGreen" SelectionChanged="SortFilterChanged" Name="FilterByPromo" Height="30" Margin="10,0,0,0" Width="200"/>
  20. <TextBox TextChanged="SearchChanged" Name="SearchByName" Height="30" TextAlignment="Center" Margin="10,0,0,0" Width="200"/>
  21. <TextBlock TextAlignment="Center" Margin="10,0,0,0" Name="AmountOfData"/>
  22. <Button BorderBrush="White" BorderThickness="2" Foreground="Green" Background="LightGreen" Width="100" Height="30" Click="BackToAuth" Content="Выйти"/>
  23. </StackPanel>
  24. <ListView Background="White" Grid.Row="1" Name="ProductList" d:ItemsSource="{d:SampleData ItemCount=5}">
  25. <ListView.ItemsPanel>
  26. <ItemsPanelTemplate>
  27. <WrapPanel Orientation="Vertical" HorizontalAlignment="Center"/>
  28. </ItemsPanelTemplate>
  29. </ListView.ItemsPanel>
  30. <ListView.ItemTemplate>
  31. <DataTemplate>
  32. <Border Width="800" Height="200" BorderThickness="1" BorderBrush="Black">
  33. <StackPanel>
  34. <StackPanel.ContextMenu>
  35. <ContextMenu>
  36. <MenuItem Header="Добавить в корзину" Uid="{Binding ProductArticleNumber}" Click="CartAdd"/>
  37. </ContextMenu>
  38. </StackPanel.ContextMenu>
  39. <Grid Width="795" Height="195" Loaded="BackgroundLoad" Uid="{Binding ProductArticleNumber}">
  40. <StackPanel Orientation="Horizontal">
  41. <Image Width="200" Height="195" Grid.Column="0" Uid="{Binding ProductArticleNumber}" Loaded="Photo"/>
  42. <StackPanel Margin="10,0,0,0" Width="300" HorizontalAlignment="Center" Grid.Column="1" Orientation="Vertical">
  43. <TextBlock Foreground="Green" Text="{Binding ProductName}"/>
  44. <TextBlock Foreground="Green" Text="{Binding ProductDescription}" TextWrapping="Wrap"/>
  45. <TextBlock Foreground="Green" Text="{Binding StringFormat=Произоводитель: {0},Path=Manufacturers.ManufacturerName}"/>
  46. <TextBlock Foreground="Green" Text="{Binding ProductCost}" Uid="{Binding ProductArticleNumber}" Loaded="StrikePrice"/>
  47. <TextBlock Foreground="Green" Text="{Binding ProductCost}" Uid="{Binding ProductArticleNumber}" Loaded="PromoPrice"/>
  48. </StackPanel>
  49. <TextBlock FontWeight="Bold" Foreground="Green" Margin="10,0,0,0" HorizontalAlignment="Center" Grid.Column="2" Text="{Binding StringFormat=Скидка: {0}%, Path=ProductMaxDiscountAmount}"/>
  50. </StackPanel>
  51. </Grid>
  52. </StackPanel>
  53. </Border>
  54. </DataTemplate>
  55. </ListView.ItemTemplate>
  56. </ListView>
  57. <StackPanel Name="ButtonsForAdmin" Visibility="Hidden" HorizontalAlignment="Center" Orientation="Horizontal" Grid.Row="2">
  58. <Button BorderBrush="White" BorderThickness="2" Foreground="Green" Background="LightGreen" Width="70" Height="30" Content="Добавить"/>
  59. <Button BorderBrush="White" BorderThickness="2" Foreground="Green" Background="LightGreen" Margin="10,0,0,0" Height="30" Width="90" Content="Редактировать"/>
  60. <Button BorderBrush="White" BorderThickness="2" Foreground="Green" Background="LightGreen" Margin="10,0,0,0" Height="30" Width="70" Content="Удалить"/>
  61. <Button BorderBrush="White" BorderThickness="2" Foreground="Green" Background="LightGreen" Margin="10,0,0,0" Name="ViewOrder" Width="130" Height="30" Click="ViewOrders" Content="Посмотреть заказы"/>
  62. </StackPanel>
  63. </Grid>
  64. </Page>