ProductList.xaml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <Page x:Class="Exxxam.ProductList"
  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:Exxxam"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="ProductList">
  10. <Page.Resources>
  11. <BitmapImage x:Key="defaultImage" UriSource="/Resources/nolog.png"></BitmapImage>
  12. </Page.Resources>
  13. <Grid>
  14. <Grid.RowDefinitions>
  15. <RowDefinition Height="50"/>
  16. <RowDefinition/>
  17. </Grid.RowDefinitions>
  18. <TextBlock Text="Список товаров" VerticalAlignment="Center" Margin="10" FontSize="18" FontWeight="SemiBold"></TextBlock>
  19. <Button Name="openShoppingCart" Content="Корзина" Width="100" Height="30" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"></Button>
  20. <ListView Name="productList" Grid.Row="1" Background="Transparent" HorizontalContentAlignment="Stretch">
  21. <ListView.ContextMenu>
  22. <ContextMenu>
  23. <MenuItem Name="addToShoppingCart" Header="Добавить в корзину" Click="addToShoppingCart_Click"></MenuItem>
  24. </ContextMenu>
  25. </ListView.ContextMenu>
  26. <ListView.ItemsPanel>
  27. <ItemsPanelTemplate>
  28. <StackPanel></StackPanel>
  29. </ItemsPanelTemplate>
  30. </ListView.ItemsPanel>
  31. <ListView.ItemTemplate>
  32. <DataTemplate>
  33. <DockPanel>
  34. <Image Source="{Binding Photo_Prodiuct, TargetNullValue={StaticResource defaultImage}, FallbackValue={StaticResource defaultImage}}" Width="80" DockPanel.Dock="Left" Margin="5"></Image>
  35. <StackPanel Margin="5">
  36. <TextBlock Text="{Binding Name_Product}"></TextBlock>
  37. <TextBlock Text="{Binding Description_Product}"></TextBlock>
  38. <WrapPanel>
  39. <TextBlock Text="Производитель:" Margin="0,0,5,0"></TextBlock>
  40. <TextBlock Text="{Binding Manufacturer.Name_Manufacturer}"></TextBlock>
  41. </WrapPanel>
  42. <WrapPanel>
  43. <TextBlock Text="Цена:" Margin="0,0,5,0"></TextBlock>
  44. <TextBlock Uid="{Binding Code_Product}" Name="oldPrice" Text="{Binding Price_Product}" TextDecorations="Strikethrough" Visibility="Collapsed" Margin="0,0,5,0" Loaded="oldPrice_Loaded"></TextBlock>
  45. <TextBlock Uid="{Binding Code_Product}" Name="mainPrice" Text="{Binding Price_Product}" Loaded="mainPrice_Loaded"></TextBlock>
  46. </WrapPanel>
  47. </StackPanel>
  48. <TextBlock Uid="{Binding Code_Product}" Name="currentDiscount" Loaded="currentDiscount_Loaded" Visibility="Collapsed" VerticalAlignment="Center" HorizontalAlignment="Right"></TextBlock>
  49. </DockPanel>
  50. </DataTemplate>
  51. </ListView.ItemTemplate>
  52. </ListView>
  53. </Grid>
  54. </Page>