终端一体化运控平台
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

149 linhas
8.4 KiB

  1. <Window x:Class="BPASmartClient.RecipeManagement.View.RecipesConfigure"
  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:BPASmartClient.RecipeManagement.View"
  7. xmlns:vm="clr-namespace:BPASmart.RecipeManagement.ViewModel"
  8. mc:Ignorable="d"
  9. Title="RecipesConfigure" Height="600" Width="600" WindowStartupLocation="CenterScreen" WindowStyle="None" Background="#01003B" MouseLeftButtonDown="Window_MouseLeftButtonDown"
  10. AllowsTransparency="True" Foreground="#FF2AB2E7">
  11. <Window.DataContext>
  12. <vm:RecipesConfigureViewModel/>
  13. </Window.DataContext>
  14. <Window.Resources>
  15. </Window.Resources>
  16. <Border >
  17. <Border.Background>
  18. <ImageBrush ImageSource="../Image/边框元素.png" Stretch="Fill"/>
  19. </Border.Background>
  20. <Grid Background="Transparent" Margin="40,10">
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="40"/>
  23. <RowDefinition Height="50"/>
  24. <RowDefinition />
  25. <RowDefinition Height="30"/>
  26. <RowDefinition Height="60"/>
  27. <RowDefinition Height="26"/>
  28. </Grid.RowDefinitions>
  29. <Grid.ColumnDefinitions>
  30. <ColumnDefinition Width="103*" />
  31. <ColumnDefinition Width="147*" />
  32. <ColumnDefinition Width="100*" />
  33. </Grid.ColumnDefinitions>
  34. <StackPanel Grid.Row="1" Orientation="Horizontal" Grid.ColumnSpan="3 " HorizontalAlignment="Center">
  35. <TextBlock Text="配方名称:" FontSize="16"
  36. HorizontalAlignment="Right" VerticalAlignment="Center" Margin="50,0,10,0"/>
  37. <TextBox Text="{Binding RecipeName}" FontSize="16" Grid.Column="1" Width="160" Background="Transparent" Foreground="Orange"
  38. BorderBrush="#FF2AB2E7"
  39. VerticalAlignment="Center" HorizontalAlignment="Left" Margin="10"
  40. VerticalContentAlignment="Center"/>
  41. <Button Grid.Column="2"
  42. Content="添加原料"
  43. FontSize="16" Width="90" Height="22" Margin="10" Style="{DynamicResource CommonButton}"
  44. Command="{Binding AddMaterailsCommand}"/>
  45. </StackPanel>
  46. <ScrollViewer Grid.ColumnSpan="3"
  47. Grid.Row="2"
  48. Margin="30,10"
  49. HorizontalScrollBarVisibility="Hidden"
  50. VerticalScrollBarVisibility="Auto">
  51. <ItemsControl ItemsSource="{Binding recipeMaterials}" >
  52. <ItemsControl.ItemTemplate>
  53. <DataTemplate>
  54. <RadioButton GroupName="all">
  55. <RadioButton.Template>
  56. <ControlTemplate TargetType="RadioButton">
  57. <Grid Name="gr" Height="40">
  58. <Grid.ColumnDefinitions>
  59. <ColumnDefinition Width="2*"/>
  60. <ColumnDefinition Width="2*" />
  61. <ColumnDefinition Width="2*" />
  62. </Grid.ColumnDefinitions>
  63. <ComboBox
  64. Name="cb"
  65. Grid.Column="0"
  66. Margin="3,1"
  67. Foreground="#FF2AB2E7"
  68. VerticalAlignment="Center"
  69. HorizontalAlignment="Right"
  70. Width="200"
  71. FontFamily="楷体"
  72. FontSize="20"
  73. IsEditable="False"
  74. SelectedValuePath="Key" DisplayMemberPath="Value"
  75. ItemsSource="{Binding DataContext.materialsName, RelativeSource={RelativeSource AncestorType=ItemsControl, Mode=FindAncestor}}"
  76. SelectedValue="{Binding ID}"
  77. />
  78. <StackPanel
  79. Grid.Column="1"
  80. VerticalAlignment="Center" HorizontalAlignment="Right"
  81. Orientation="Horizontal">
  82. <TextBox
  83. Name="tb"
  84. Grid.Column="1"
  85. Width="50"
  86. Height="29"
  87. Margin="10,1"
  88. VerticalAlignment="Center"
  89. Style="{DynamicResource CommonTextBox}"
  90. FontSize="20"
  91. Text="{Binding MaterialWeight}" />
  92. <TextBlock
  93. Grid.Column="1"
  94. Margin="0,0,5,4"
  95. HorizontalAlignment="Right"
  96. VerticalAlignment="Center"
  97. FontSize="20"
  98. Foreground="#FF2AB2E7"
  99. Text="g" />
  100. </StackPanel>
  101. <Button
  102. Grid.Column="2"
  103. Width="70"
  104. Height="25"
  105. Margin="15,0,0,0"
  106. FontSize="16"
  107. BorderBrush="#FF2AB2E7"
  108. BorderThickness="1"
  109. HorizontalAlignment="Left"
  110. Style="{DynamicResource DeleteButton}"
  111. Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
  112. CommandParameter="{Binding ID}"
  113. Content="删 除" />
  114. </Grid>
  115. </ControlTemplate>
  116. </RadioButton.Template>
  117. </RadioButton>
  118. </DataTemplate>
  119. </ItemsControl.ItemTemplate>
  120. </ItemsControl>
  121. </ScrollViewer>
  122. <TextBlock Text="{Binding ErrorMessage}" Grid.Row="2" Grid.ColumnSpan="3"
  123. Foreground="Red" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  124. <StackPanel Grid.Row="4" Grid.ColumnSpan="3" Orientation="Horizontal"
  125. HorizontalAlignment="Center" VerticalAlignment="Center">
  126. <Button Content="保存" FontSize="18" Width="120" Height="24" Margin="10" Style="{DynamicResource ButtonStyle}"
  127. Command="{Binding SaveCommand}"/>
  128. <Button Content="取消" FontSize="18" Width="120" Height="24" Margin="10" Style="{DynamicResource ButtonStyle}"
  129. Click="Button_Click"/>
  130. </StackPanel>
  131. </Grid>
  132. </Border>
  133. </Window>