EditProductWindow.xaml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <Window x:Class="wpf_connection3.Windows.EditProductWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:wpf_connection3.Windows"
  7. mc:Ignorable="d"
  8. Title="EditProductWindow" Height="600" Width="800"
  9. Name="root">
  10. <Grid>
  11. <Grid.ColumnDefinitions>
  12. <ColumnDefinition Width="auto"/>
  13. <ColumnDefinition Width="*"/>
  14. <ColumnDefinition Width="auto"/>
  15. </Grid.ColumnDefinitions>
  16. <StackPanel>
  17. <Image
  18. Name="CurrentProductImage"
  19. Width="200"
  20. Height="200"
  21. Source="{Binding currentProduct.ImageBitmap}" />
  22. <ListView
  23. Name="ProductMaterialListView"
  24. ItemsSource="{Binding productMaterialList}">
  25. <ListView.ItemContainerStyle>
  26. <Style
  27. TargetType="ListViewItem">
  28. <Setter
  29. Property="HorizontalAlignment"
  30. Value="Stretch"/>
  31. </Style>
  32. </ListView.ItemContainerStyle>
  33. <ListView.ItemTemplate>
  34. <DataTemplate>
  35. <Grid>
  36. <Grid.ColumnDefinitions>
  37. <ColumnDefinition Width="150"/>
  38. <ColumnDefinition Width="auto"/>
  39. <ColumnDefinition Width="15"/>
  40. </Grid.ColumnDefinitions>
  41. <TextBlock
  42. Text="{Binding Title}"/>
  43. <TextBlock
  44. Grid.Column="1"
  45. Margin="15,0"
  46. HorizontalAlignment="Right"
  47. Text="{Binding Count}"/>
  48. <TextBlock
  49. x:Name="DeleteMaterialTextBox"
  50. Grid.Column="2"
  51. HorizontalAlignment="Right"
  52. Tag="{Binding Path=.}"
  53. Text="🗑"
  54. MouseDown="DeleteMaterialTextBox_MouseDown"
  55. />
  56. </Grid>
  57. </DataTemplate>
  58. </ListView.ItemTemplate>
  59. </ListView>
  60. <Button
  61. x:Name="AddMaterialButton"
  62. Content="✚"
  63. Height="50"
  64. Click="AddMaterialButton_Click"/>
  65. </StackPanel>
  66. <StackPanel
  67. Grid.Column="1"
  68. Margin="5">
  69. <Label Content="Артикул"/>
  70. <TextBox
  71. Name="ArticleNumberTextBox"
  72. Text="{Binding currentProduct.ArticleNumber}"/>
  73. <Label Content="Наименование продукта"/>
  74. <TextBox
  75. Name="TitleTextBox"
  76. Text="{Binding currentProduct.Title}"/>
  77. <Label Content="Тип продукта"/>
  78. <ComboBox
  79. Name="ProductTypeComboBox"
  80. ItemsSource="{Binding productTypeList}"
  81. SelectedIndex="{Binding selectedProductIndex}"/>
  82. <Label Content="Количество человек для производства"/>
  83. <TextBox
  84. Name="ProductionPersonCountTextBox"
  85. Text="{Binding currentProduct.ProductionPersonCount}"/>
  86. <Label Content="Номер производственного цеха"/>
  87. <TextBox
  88. Name="ProductionWorkshopNumberTextBox"
  89. Text="{Binding currentProduct.ProductionWorkshopNumber}"/>
  90. <Label Content="Минимальная стоимость для агента"/>
  91. <TextBox
  92. Name="MinCostForAgentTextBox"
  93. Text="{Binding currentProduct.MinCostForAgent}"/>
  94. <Label Content="Описание продукта"/>
  95. <TextBox
  96. Name="DescriptionTextBox"
  97. AcceptsReturn="True"
  98. Height="200"
  99. Text="{Binding currentProduct.Descrpition}"/>
  100. <Button
  101. Name="ChangeImageButton"
  102. Content="Изменить фото"
  103. Margin="5"
  104. Click="ChangeImageButton_Click"/>
  105. <Button
  106. Name="SaveButton"
  107. Content="Сохранить"
  108. Margin="5"
  109. Click="SaveButton_Click"/>
  110. <Button
  111. Name="deleteButton"
  112. Content="Удалить продукт"
  113. Margin="5"
  114. Click="deleteButton_Click"/>
  115. </StackPanel>
  116. </Grid>
  117. </Window>