终端一体化运控平台
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 

150 řádky
8.6 KiB

  1. <UserControl x:Class="BPASmart.RecipeManagement.View.MaterialManager"
  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:BPASmart.RecipeManagement.View"
  7. xmlns:vm="clr-namespace:BPASmart.RecipeManagement.ViewModel"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800" Foreground="#FF2AB2E7" >
  10. <UserControl.DataContext>
  11. <vm:MaterialManagerViewModel/>
  12. </UserControl.DataContext>
  13. <UserControl.Resources>
  14. <Style TargetType="ListViewItem" >
  15. <Setter Property="Margin" Value="60,20"/>
  16. <Setter Property="Template">
  17. <Setter.Value>
  18. <ControlTemplate TargetType="ListViewItem">
  19. <Border Padding="4" Opacity="0.7" x:Name="mborder" BorderBrush="Transparent" BorderThickness="1">
  20. <Border >
  21. <Border.Background>
  22. <ImageBrush ImageSource="../image/蓝边框.png"/>
  23. </Border.Background>
  24. <Grid Width="100" >
  25. <Grid.RowDefinitions>
  26. <RowDefinition Height="60"/>
  27. <RowDefinition Height="25"/>
  28. <RowDefinition Height="5"/>
  29. </Grid.RowDefinitions>
  30. <Grid.ColumnDefinitions>
  31. <ColumnDefinition Width="*"/>
  32. <ColumnDefinition Width="*"/>
  33. </Grid.ColumnDefinitions>
  34. <TextBlock Text="{Binding MaterialPosion}" Foreground="White" Height="20" Width="20" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="10,0"/>
  35. <TextBlock Text="{Binding Name}" Grid.ColumnSpan="2" Foreground="Orange"
  36. FontSize="24"
  37. HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
  38. <TextBlock Grid.Row="1" Text="种类:" Foreground="#FF2AB2E7" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Right"/>
  39. <TextBlock Grid.Row="1" Grid.Column="1" FontSize="16"
  40. VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="#FF2AB2E7"
  41. Text="{Binding MaterialType}" TextAlignment="Center"></TextBlock>
  42. </Grid>
  43. </Border>
  44. </Border>
  45. <ControlTemplate.Triggers>
  46. <Trigger Property="IsMouseOver" Value="True">
  47. <Setter Property="BorderBrush" Value="#4169E1" TargetName="mborder"/>
  48. <Setter Property="Opacity" Value="1" TargetName="mborder"/>
  49. </Trigger>
  50. <Trigger Property="IsFocused" Value="True">
  51. </Trigger>
  52. </ControlTemplate.Triggers>
  53. </ControlTemplate>
  54. </Setter.Value>
  55. </Setter>
  56. </Style>
  57. </UserControl.Resources>
  58. <Border>
  59. <Border.Background>
  60. <ImageBrush ImageSource="../image/中间.png"/>
  61. </Border.Background>
  62. <Grid Background="Transparent">
  63. <Grid.ColumnDefinitions>
  64. <ColumnDefinition />
  65. </Grid.ColumnDefinitions>
  66. <Grid.RowDefinitions>
  67. <RowDefinition Height="*"/>
  68. <RowDefinition Height="20*"/>
  69. <RowDefinition Height="20*"/>
  70. </Grid.RowDefinitions>
  71. <Grid Grid.RowSpan="2" Grid.Row="1">
  72. <Grid.RowDefinitions>
  73. <RowDefinition Height="40"/>
  74. <RowDefinition Height="30"/>
  75. <RowDefinition Height="*"/>
  76. </Grid.RowDefinitions>
  77. <TextBlock Text="原料清单" FontSize="28" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  78. <Button Grid.Row="1" x:Name="MateraisProperty" Style="{DynamicResource CommonButton}" Content="原料扩展属性"
  79. VerticalAlignment="Center" HorizontalAlignment="Right"
  80. FontSize="14" Margin="0,0,20,0" Height="26" Width="120"
  81. Click="MateraisProperty_Click"/>
  82. <ListView x:Name="mylistview" Grid.Row="2"
  83. ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsSource="{Binding MaterialList}" Margin=" 0" Background="Transparent"
  84. BorderBrush="Transparent">
  85. <ListView.ContextMenu>
  86. <ContextMenu FontSize="16" Foreground="White">
  87. <MenuItem Name="MenuAdd" Command="{Binding CreateMaterailCommand}">
  88. <MenuItem.Header>
  89. <Grid>
  90. <Grid.ColumnDefinitions>
  91. <ColumnDefinition Width="auto"/>
  92. <ColumnDefinition Width="*"/>
  93. </Grid.ColumnDefinitions>
  94. <TextBlock Style="{DynamicResource menuText}" Text="&#xe64d;"/>
  95. <TextBlock Grid.Column="1" Text="新建原料" Style="{DynamicResource menuText}" FontFamily="楷体"/>
  96. </Grid>
  97. </MenuItem.Header>
  98. </MenuItem>
  99. <MenuItem Command="{Binding EditMaterailCommand }"
  100. CommandParameter="{Binding PlacementTarget.SelectedIndex,RelativeSource={RelativeSource AncestorType=ContextMenu}}">
  101. <MenuItem.Header>
  102. <Grid>
  103. <Grid.ColumnDefinitions>
  104. <ColumnDefinition Width="auto"/>
  105. <ColumnDefinition Width="*"/>
  106. </Grid.ColumnDefinitions>
  107. <TextBlock Style="{DynamicResource menuText}" Text="&#xf0213;"/>
  108. <TextBlock Grid.Column="1" Text="编辑原料" Style="{DynamicResource menuText}" FontFamily="楷体" />
  109. </Grid>
  110. </MenuItem.Header>
  111. </MenuItem>
  112. <MenuItem Name="MenuDelete"
  113. Command="{Binding DeleteMaterailCommand}"
  114. CommandParameter="{Binding PlacementTarget.SelectedIndex,RelativeSource={RelativeSource AncestorType=ContextMenu}}">
  115. <MenuItem.Header>
  116. <Grid>
  117. <Grid.ColumnDefinitions>
  118. <ColumnDefinition Width="auto"/>
  119. <ColumnDefinition Width="*"/>
  120. </Grid.ColumnDefinitions>
  121. <TextBlock Style="{DynamicResource menuText}" Text="&#xe8c1;"/>
  122. <TextBlock Grid.Column="1" Text="删除原料" Style="{DynamicResource menuText}" FontFamily="楷体" />
  123. </Grid>
  124. </MenuItem.Header>
  125. </MenuItem>
  126. </ContextMenu>
  127. </ListView.ContextMenu>
  128. <ListBox.ItemsPanel>
  129. <ItemsPanelTemplate>
  130. <WrapPanel Margin="10"/>
  131. </ItemsPanelTemplate>
  132. </ListBox.ItemsPanel>
  133. </ListView>
  134. </Grid>
  135. </Grid>
  136. </Border>
  137. </UserControl>