|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <UserControl
- x:Class="FryPot_DosingSystem.View.RecipeSetView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:FryPot_DosingSystem.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:vm="clr-namespace:FryPot_DosingSystem.ViewModel"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
- <UserControl.DataContext>
- <vm:RecipeSetViewModel />
- </UserControl.DataContext>
- <UserControl.Resources>
- <SolidColorBrush x:Key="BorderSolid" Color="#5523CACA" />
- <SolidColorBrush x:Key="FontColor" Color="#FF2AB2E7" />
- <SolidColorBrush x:Key="TitleFontColor" Color="#ddd" />
- <SolidColorBrush x:Key="CursorColor" Color="Aqua" />
- <SolidColorBrush x:Key="TitleBorderColor" Color="#FF2AB2E7" />
- <SolidColorBrush x:Key="TextBlockForeground" Color="#9934F7F7" />
-
- <Style x:Key="TextBlockStyle" TargetType="TextBlock">
- <Setter Property="FontFamily" Value="楷体" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="Background" Value="Transparent" />
- <!--<Setter Property="Foreground" Value="{StaticResource FontColor}" />-->
- <Setter Property="VerticalAlignment" Value="Center" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- </Style>
-
- <Style x:Key="buttonStyle" TargetType="Button">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="FontSize" Value="16" />
- <Setter Property="Foreground" Value="Aqua" />
- <Setter Property="HorizontalAlignment" Value="Center" />
- <Setter Property="BorderThickness" Value="0" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Cursor" Value="Hand" />
- </Trigger>
- </Style.Triggers>
- </Style>
-
- </UserControl.Resources>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="55" />
- <RowDefinition Height="30" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <UniformGrid Columns="2">
- <Image HorizontalAlignment="Left" Source="../hbl.ico" />
- <StackPanel
- Grid.Column="2"
- HorizontalAlignment="Right"
- Orientation="Horizontal">
- <pry:IcoButton
- Width="150"
- Margin="80,15,10,0"
- Command="{Binding NewRecipe}"
- Content="新建配方"
- Cursor="Hand"
- FontSize="16"
- Foreground="Aqua"
- IcoText=""
- Style="{StaticResource IcoButtonStyle}" />
- <pry:IcoButton
- Width="150"
- Margin="5,15,10,0"
- Command="{Binding SaveRecipe}"
- Content="保存配方"
- Cursor="Hand"
- FontSize="16"
- Foreground="Aqua"
- IcoText=""
- Style="{StaticResource IcoButtonStyle}" />
-
- </StackPanel>
- </UniformGrid>
- <!--<TextBlock Grid.Row="1" Text="配方信息" Foreground="Aquamarine" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="18" Margin="0,5" ></TextBlock>-->
- <!--<Line Grid.Row="1" X1="0" Y1="5" X2="1920" Y2="10" Stroke="Aqua" VerticalAlignment="Center"></Line>-->
- <Grid
- Grid.Row="1"
- Margin="0,5,0,0"
- Background="Cyan">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <ColumnDefinition Width="0.3*" />
- <!--<ColumnDefinition/>-->
- </Grid.ColumnDefinitions>
- <!--<TextBlock Text="编号" FontSize="16" Foreground="Tomato" HorizontalAlignment="Center" VerticalAlignment="Center"/>-->
- <TextBlock
- Grid.Column="0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="Tomato"
- Text="配方名称" />
- <GridSplitter BorderBrush="CadetBlue" BorderThickness="0.5" />
- <TextBlock
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="Tomato"
- Text="编辑配方" />
- <GridSplitter
- Grid.Column="1"
- BorderBrush="CadetBlue"
- BorderThickness="0.5" />
- <TextBlock
- Grid.Column="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="Tomato"
- Text="删除配方" />
- </Grid>
- <ScrollViewer
- Grid.Row="2"
- Padding="0,5,0,0"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Hidden">
- <ItemsControl ItemsSource="{Binding recipeModels}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <StackPanel />
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <RadioButton>
- <RadioButton.Template>
- <ControlTemplate>
- <Grid x:Name="gr">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="0.25*" />
- <ColumnDefinition Width="0.25*" />
- <ColumnDefinition Width="0.25*" />
- <!--<ColumnDefinition Width="0.25*"></ColumnDefinition>-->
-
- </Grid.ColumnDefinitions>
- <!--<TextBlock Text="{Binding RecipeId}" Grid.Column="0" FontSize="16" HorizontalAlignment="Left" VerticalAlignment="Center"
- Foreground="Aqua"
- Margin="5,0,0,5"></TextBlock>-->
- <TextBlock
- Grid.Column="0"
- Margin="5,0,0,5"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="16"
- Foreground="Aqua"
- Text="{Binding RecipeName}" />
-
- <Button
- Grid.Column="1"
- Margin="5,0,0,5"
- Command="{Binding DataContext.EditRecipeCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
- CommandParameter="{Binding RecipeId}"
- Content="编辑"
- FontSize="16"
- Style="{StaticResource buttonStyle}" />
-
-
- <Button
- Grid.Column="2"
- Margin="5,0,0,5"
- Command="{Binding DataContext.DeleteRecipeCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
- CommandParameter="{Binding RecipeId}"
- Content="删除"
- FontSize="16"
- Style="{StaticResource buttonStyle}" />
-
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="gr" Property="Background" Value="#3300ccff" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </RadioButton.Template>
- </RadioButton>
-
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </ScrollViewer>
- </Grid>
- </UserControl>
|