ProductsPage.xaml 6.3 KB

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