ProductsPage.xaml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <Page x:Class="Sessioa.Pages.ProductsPage"
  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:Sessioa.Pages"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Title="ProductsPage">
  10. <Page.Resources>
  11. <BitmapImage x:Key="defaultImage" UriSource="/Resources/picture.png"/>
  12. </Page.Resources>
  13. <Grid>
  14. <Grid.RowDefinitions>
  15. <RowDefinition Height="0.07*"/>
  16. <RowDefinition Height="0.1*"/>
  17. <RowDefinition/>
  18. <RowDefinition Height="0.07*"/>
  19. </Grid.RowDefinitions>
  20. <ListBox Name="LB_Product" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Grid.Row="2">
  21. <ListBox.ItemTemplate>
  22. <DataTemplate>
  23. <Border BorderBrush="#498C51" BorderThickness="3" CornerRadius="5" Uid="{Binding ProductArticleNumber}" Loaded="Border_Loaded">
  24. <Grid>
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="0.3*"/>
  27. <ColumnDefinition Width="2*"/>
  28. <ColumnDefinition Width="0.5*"/>
  29. <ColumnDefinition Width="0.2*"/>
  30. </Grid.ColumnDefinitions>
  31. <Image Source="{Binding ProductPhoto, TargetNullValue={StaticResource defaultImage}}" Margin="5" MaxWidth="80"/>
  32. <StackPanel Grid.Column="1">
  33. <TextBlock Text="{Binding ProductName}" Style="{StaticResource TextBlockBold}"/>
  34. <TextBlock Text="{Binding ProductDescription}" Style="{StaticResource TextBlock}"/>
  35. <StackPanel Orientation="Horizontal">
  36. <TextBlock Text="Производитель:" Style="{StaticResource TextBlock}" Margin="0,0,5,0"/>
  37. <TextBlock Text="{Binding Manufacturer.Manufacturer1}" Style="{StaticResource TextBlock}"/>
  38. </StackPanel>
  39. <StackPanel Orientation="Horizontal">
  40. <TextBlock Text="Цена: " Style="{StaticResource TextBlock}" Margin="0,0,5,0"/>
  41. <TextBlock Name="countPr" Text="{Binding ProductCost, StringFormat={}{0:C}}" Language="ru-Ru" Style="{StaticResource TextBlock}" Uid="{Binding ProductArticleNumber}" Loaded="countPr_Loaded"/>
  42. <TextBlock Name="countDPr" Style="{StaticResource TextBlock}" Uid="{Binding ProductArticleNumber}" Visibility="Collapsed" Loaded="countPr_Loaded_1" Margin="5,0,0,0"/>
  43. </StackPanel>
  44. </StackPanel>
  45. <TextBlock Name="Discount" Loaded="Discount_Loaded" Uid="{Binding ProductArticleNumber}" Style="{StaticResource TextBlock}" Grid.Column="2" VerticalAlignment="Center"/>
  46. </Grid>
  47. </Border>
  48. </DataTemplate>
  49. </ListBox.ItemTemplate>
  50. <ListBox.ContextMenu>
  51. <ContextMenu Loaded="ContextMenu_Loaded">
  52. <MenuItem Name="AddOrder" Header="Добавить к заказу" Click="AddOrder_Click"/>
  53. <MenuItem Name="EditProduct" Header="Редактировать" Loaded="EditProduct_Loaded" Click="EditProduct_Click"/>
  54. <MenuItem Name="DeleteProduct" Header="Удалить" Loaded="DeleteProduct_Loaded" Click="DeleteProduct_Click"/>
  55. </ContextMenu>
  56. </ListBox.ContextMenu>
  57. </ListBox>
  58. <Grid Grid.Row="1">
  59. <Grid.ColumnDefinitions>
  60. <ColumnDefinition Width="7*"/>
  61. <ColumnDefinition/>
  62. <ColumnDefinition/>
  63. </Grid.ColumnDefinitions>
  64. <TextBox Name="SearchTB" TextChanged="SearchTB_TextChanged" Style="{StaticResource TextBox}" MaxHeight="60" Margin="6" DataContext="Поиск"/>
  65. <ComboBox Name="CB_Sort" SelectionChanged="CB_Sort_SelectionChanged" MaxHeight="60" Margin="6" Grid.Column="1" FontFamily="Comic Sans MS" FontSize="16" VerticalContentAlignment="Center" FontWeight="Light"/>
  66. <ComboBox Name="CB_Filtr" SelectionChanged="CB_Filtr_SelectionChanged" MaxHeight="60" Margin="6" Grid.Column="2" FontFamily="Comic Sans MS" FontSize="16" VerticalContentAlignment="Center" FontWeight="Light"/>
  67. </Grid>
  68. <StackPanel Grid.Row="3" HorizontalAlignment="Center" Orientation="Horizontal" VerticalAlignment="Center">
  69. <TextBlock Name="TB_CountActual" Style="{StaticResource TextBlock}"/>
  70. <TextBlock Text=" из " Style="{StaticResource TextBlock}"/>
  71. <TextBlock Name="TB_CountAll" Style="{StaticResource TextBlock}"/>
  72. </StackPanel>
  73. <TextBlock Name="UserSign" HorizontalAlignment="Right" Style="{StaticResource TextBlock}" Margin="30,0"/>
  74. <StackPanel Orientation="Horizontal">
  75. <Button Name="SignOf" Content="Выйти" Style="{StaticResource ButtonAct}" Margin="10,0" MaxHeight="50" MinWidth="90" MaxWidth="150" Click="SignOf_Click" HorizontalAlignment="Left"/>
  76. <Button Name="NewProduct" Content="Добавить продукт" Style="{StaticResource ButtonSt}" Margin="10,0" MaxHeight="50" MinWidth="90" MaxWidth="150" Click="NewProduct_Click" HorizontalAlignment="Left" Visibility="Collapsed" Loaded="NewProduct_Loaded"/>
  77. <Button Name="OrdersUser" Content="Заказы" Style="{StaticResource ButtonSt}" Margin="10,0" MaxHeight="50" MinWidth="90" MaxWidth="150" Click="OrdersUser_Click" HorizontalAlignment="Left" Visibility="Collapsed" Loaded="OrdersUser_Loaded"/>
  78. <Button Name="OrderActUser" Content="Корзина" Style="{StaticResource ButtonSt}" Margin="10,0" MaxHeight="50" MinWidth="90" MaxWidth="150" Click="OrderActUser_Click" HorizontalAlignment="Left" Visibility="Collapsed"/>
  79. </StackPanel>
  80. </Grid>
  81. </Page>