Guest.xaml 4.1 KB

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