终端一体化运控平台
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ů.
 
 
 

129 řádky
7.4 KiB

  1. <UserControl x:Class="FryPot_DosingSystem.View.RecipeSetView"
  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:FryPot_DosingSystem.View"
  7. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  8. xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
  9. mc:Ignorable="d"
  10. d:DesignHeight="450" d:DesignWidth="800">
  11. <UserControl.DataContext>
  12. <vm:RecipeSetViewModel></vm:RecipeSetViewModel>
  13. </UserControl.DataContext>
  14. <UserControl.Resources>
  15. <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
  16. <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
  17. <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
  18. <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
  19. <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
  20. <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />
  21. <Style x:Key="TextBlockStyle" TargetType="TextBlock">
  22. <Setter Property="FontFamily" Value="楷体" />
  23. <Setter Property="FontSize" Value="16" />
  24. <Setter Property="Background" Value="Transparent" />
  25. <!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
  26. <Setter Property="VerticalAlignment" Value="Center" />
  27. <Setter Property="HorizontalAlignment" Value="Center" />
  28. </Style>
  29. <Style x:Key="buttonStyle" TargetType="Button">
  30. <Setter Property="Background" Value="Transparent" />
  31. <Setter Property="FontSize" Value="16" />
  32. <Setter Property="Foreground" Value="Aqua" />
  33. <Setter Property="HorizontalAlignment" Value="Center" />
  34. <Setter Property="BorderThickness" Value="0" />
  35. <Style.Triggers>
  36. <Trigger Property="IsMouseOver" Value="True">
  37. <Setter Property="Cursor" Value="Hand"></Setter>
  38. </Trigger>
  39. </Style.Triggers>
  40. </Style>
  41. </UserControl.Resources>
  42. <Grid>
  43. <Grid.RowDefinitions>
  44. <RowDefinition Height="50"></RowDefinition>
  45. <RowDefinition Height="20"></RowDefinition>
  46. <RowDefinition></RowDefinition>
  47. </Grid.RowDefinitions>
  48. <UniformGrid Columns="2">
  49. <Image Source="../hbl.ico" HorizontalAlignment="Left"></Image>
  50. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Column="2">
  51. <pry:IcoButton Content="新建配方"
  52. Margin="80,5,15,5"
  53. Width="150"
  54. FontSize="16"
  55. Foreground="Aqua"
  56. IcoText="&#xe626;"
  57. Cursor="Hand"
  58. Style="{StaticResource NewButtonStyle}"
  59. Command="{Binding NewRecipe}">
  60. </pry:IcoButton>
  61. <pry:IcoButton
  62. Content="保存配方" Margin="5,5"
  63. Width="150"
  64. FontSize="16"
  65. Foreground="Aqua"
  66. IcoText="&#xe626;"
  67. Cursor="Hand"
  68. Style="{StaticResource NewButtonStyle}"
  69. Command="{Binding SaveRecipe}">
  70. </pry:IcoButton>
  71. </StackPanel>
  72. </UniformGrid>
  73. <!--<TextBlock Grid.Row="1" Text="配方信息" Foreground="Aquamarine" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="0,5" ></TextBlock>-->
  74. <Line Grid.Row="1" X1="0" Y1="10" X2="1000" Y2="10" Stroke="Aqua"></Line>
  75. <ScrollViewer Grid.Row="2" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
  76. <ItemsControl ItemsSource="{Binding recipeModels}">
  77. <ItemsControl.ItemsPanel>
  78. <ItemsPanelTemplate>
  79. <StackPanel></StackPanel>
  80. </ItemsPanelTemplate>
  81. </ItemsControl.ItemsPanel>
  82. <ItemsControl.ItemTemplate>
  83. <DataTemplate>
  84. <RadioButton>
  85. <RadioButton.Template>
  86. <ControlTemplate>
  87. <Grid x:Name="gr">
  88. <Grid.ColumnDefinitions>
  89. <ColumnDefinition></ColumnDefinition>
  90. <ColumnDefinition></ColumnDefinition>
  91. <ColumnDefinition></ColumnDefinition>
  92. <ColumnDefinition></ColumnDefinition>
  93. <ColumnDefinition></ColumnDefinition>
  94. </Grid.ColumnDefinitions>
  95. <TextBlock Text="{Binding RecipeId}" Grid.Column="0" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center"
  96. Foreground="Aqua"
  97. Margin="5,0,0,5"></TextBlock>
  98. <TextBlock Text="{Binding RecipeName}" Grid.Column="1" Margin="5,0,0,5"
  99. HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="Aqua" FontSize="16"></TextBlock>
  100. <Grid Grid.Column="3">
  101. <Button FontSize="16"
  102. Margin="5,0,0,5" Content="编辑配方" Style="{StaticResource buttonStyle}" Command="{Binding DataContext.EditRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}"
  103. CommandParameter="{Binding RecipeId}"></Button>
  104. </Grid>
  105. <Grid Grid.Column="4">
  106. <Button Margin="5,0,0,5" FontSize="16" Content="删除配方" Style="{StaticResource buttonStyle}" Command="{Binding DataContext.DeleteRecipeCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ItemsControl}}" CommandParameter="{Binding RecipeId}">
  107. </Button>
  108. </Grid>
  109. </Grid>
  110. <ControlTemplate.Triggers>
  111. <Trigger Property="IsMouseOver" Value="true">
  112. <Setter TargetName="gr" Property="Background" Value="#3300ccff" />
  113. </Trigger>
  114. </ControlTemplate.Triggers>
  115. </ControlTemplate>
  116. </RadioButton.Template>
  117. </RadioButton>
  118. </DataTemplate>
  119. </ItemsControl.ItemTemplate>
  120. </ItemsControl>
  121. </ScrollViewer>
  122. </Grid>
  123. </UserControl>