终端一体化运控平台
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

136 lignes
8.2 KiB

  1. <Window x:Class="BPASmartClient.MilkWithTea.View.RecipeConfige"
  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.MilkWithTea.View"
  7. xmlns:vm="clr-namespace:BPASmartClient.MilkWithTea.ViewModel"
  8. mc:Ignorable="d"
  9. Title="RecipeConfige"
  10. Height="800" Width="800" WindowStartupLocation="CenterScreen" WindowStyle="None" AllowsTransparency="True"
  11. >
  12. <Window.DataContext>
  13. <vm:RecipeConfigeViewModel/>
  14. </Window.DataContext>
  15. <Window.Resources>
  16. </Window.Resources>
  17. <Grid>
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="60"/>
  20. <RowDefinition Height="*"/>
  21. <RowDefinition Height="*"/>
  22. </Grid.RowDefinitions>
  23. <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
  24. <TextBlock Text="奶茶名称" Margin="10,0" />
  25. <TextBox Text="{Binding Name}" Width="120" Foreground="DarkSlateGray" Margin="10,0"/>
  26. <Button Content="添加配料" Margin="10,0" Width="100" Command="{Binding AddMaterialCommand}"/>
  27. <Button Content="保存" Margin="10,0" Width="100" Command="{Binding SaveCommand}"/>
  28. <Button Content="取消" Margin="10,0" Width="100" Click="Button_Click"/>
  29. </StackPanel>
  30. <Grid Grid.Row="1">
  31. <ScrollViewer
  32. HorizontalScrollBarVisibility="Hidden"
  33. VerticalScrollBarVisibility="Auto">
  34. <ItemsControl ItemsSource="{Binding Materails}" >
  35. <ItemsControl.ItemTemplate>
  36. <DataTemplate>
  37. <RadioButton GroupName="all">
  38. <RadioButton.Template>
  39. <ControlTemplate TargetType="RadioButton">
  40. <Grid Name="gr" Height="40" Margin="20,0">
  41. <Grid.ColumnDefinitions>
  42. <ColumnDefinition Width="2*"/>
  43. <ColumnDefinition Width="2*"/>
  44. <ColumnDefinition Width="2*" />
  45. </Grid.ColumnDefinitions>
  46. <ComboBox Name="cb" Width="120" Height="30"
  47. ItemsSource="{Binding DataContext.materialNames, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
  48. SelectedValue="{Binding MaterialID}"
  49. SelectedValuePath="Key" DisplayMemberPath="Value"/>
  50. <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  51. <TextBox Text="{Binding MaterialWeight}" Width="120" Margin="10,0"/>
  52. <TextBlock Text="g" />
  53. </StackPanel>
  54. <Button Grid.Column="2"
  55. Width="70"
  56. Height="25"
  57. Margin="15,0,0,0"
  58. FontSize="16"
  59. BorderBrush="#FF2AB2E7"
  60. BorderThickness="1"
  61. HorizontalAlignment="Left"
  62. Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
  63. CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}"
  64. Content="删 除" />
  65. </Grid>
  66. </ControlTemplate>
  67. </RadioButton.Template>
  68. </RadioButton>
  69. </DataTemplate>
  70. </ItemsControl.ItemTemplate>
  71. </ItemsControl>
  72. </ScrollViewer>
  73. </Grid>
  74. <Grid Grid.Row="2">
  75. <ListBox x:Name="listview1" AllowDrop="True" SelectionMode="Extended" MouseMove="listview1_MouseMove"
  76. ItemsSource="{Binding Materails}" PreviewMouseLeftButtonUp="listview1_MouseLeftButtonUp">
  77. <ListBox.ItemTemplate>
  78. <DataTemplate>
  79. <Border PreviewMouseLeftButtonDown="listview1_MouseLeftButtonDown" Width="800" BorderBrush="Black" BorderThickness="1" Background="White"
  80. >
  81. <RadioButton GroupName="all" >
  82. <RadioButton.Template>
  83. <ControlTemplate TargetType="RadioButton">
  84. <Grid Name="gr" Height="40" Margin="20,0">
  85. <Grid.ColumnDefinitions>
  86. <ColumnDefinition Width="2*"/>
  87. <ColumnDefinition Width="2*"/>
  88. <ColumnDefinition Width="2*" />
  89. </Grid.ColumnDefinitions>
  90. <ComboBox Name="cb" Width="120" Height="30"
  91. ItemsSource="{Binding DataContext.materialNames, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
  92. SelectedValue="{Binding MaterialID }"
  93. SelectedValuePath="Key" DisplayMemberPath="Value"/>
  94. <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  95. <TextBox Text="{Binding MaterialWeight}" Width="120" Margin="10,0"/>
  96. <TextBlock Text="g" />
  97. </StackPanel>
  98. <Button Grid.Column="2"
  99. Width="70"
  100. Height="25"
  101. Margin="15,0,0,0"
  102. FontSize="16"
  103. BorderBrush="#FF2AB2E7"
  104. BorderThickness="1"
  105. HorizontalAlignment="Left"
  106. Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource AncestorType=Window, Mode=FindAncestor}}"
  107. CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}"
  108. Content="删 除" />
  109. </Grid>
  110. </ControlTemplate>
  111. </RadioButton.Template>
  112. </RadioButton>
  113. </Border>
  114. </DataTemplate>
  115. </ListBox.ItemTemplate>
  116. </ListBox>
  117. </Grid>
  118. </Grid>
  119. </Window>