RecipeView.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <UserControl x:Class="Venus_MainPages.Views.RecipeView"
  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. mc:Ignorable="d"
  7. xmlns:prism="http://prismlibrary.com/"
  8. prism:ViewModelLocator.AutoWireViewModel="True"
  9. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  10. xmlns:customeControls="clr-namespace:Venus_Themes.CustomControls;assembly=Venus_Themes"
  11. xmlns:controls="clr-namespace:Aitex.Core.UI.View.Common;assembly=MECF.Framework.UI.Core"
  12. d:DesignHeight="450" d:DesignWidth="1200" Name="recipeView">
  13. <UserControl.Resources>
  14. <Style TargetType="{x:Type CheckBox}">
  15. <Setter Property="Background" Value="White" />
  16. <Setter Property="BorderBrush" Value="#FF262E34"/>
  17. <Setter Property="Foreground" Value="#FF262E34"/>
  18. <Setter Property="BorderThickness" Value="1"/>
  19. <Setter Property="Template">
  20. <Setter.Value>
  21. <ControlTemplate TargetType="{x:Type CheckBox}">
  22. <Border BorderThickness="0.8" BorderBrush="Gray" Background="White">
  23. <StackPanel Orientation="Horizontal" Name="mainStackPanel" HorizontalAlignment="Center" Background="White" VerticalAlignment="Center">
  24. <Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Width="15" Height="15" HorizontalAlignment="Center">
  25. <!-- your color here -->
  26. <Path Width="15" Height="10" Stroke="PaleVioletRed" StrokeThickness="3" Name="eliCheck" Data="M 2,4 C 2,4 3,5 5,13 C 5,13 5,3 12,0" Visibility="Collapsed"/>
  27. </Border>
  28. <TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}"></TextBlock>
  29. </StackPanel>
  30. </Border>
  31. <ControlTemplate.Triggers>
  32. <Trigger Property="IsMouseOver" Value="True">
  33. <Setter Property="Background" Value="LightGray" />
  34. </Trigger>
  35. <Trigger Property="IsPressed" Value="True">
  36. <Setter Property="Background" Value="#FF9C9E9F" />
  37. </Trigger>
  38. <Trigger Property="IsEnabled" Value="False">
  39. <Setter Property="Background" Value="LightGray" />
  40. <Setter Property="Foreground" Value="Gray" />
  41. <Setter Property="BorderBrush" Value="Gray"/>
  42. <Setter TargetName="eliCheck" Property="Opacity" Value="0.5" />
  43. <Setter TargetName="mainStackPanel" Property="Background" Value="#DDEBF9"/>
  44. </Trigger>
  45. <Trigger Property="IsChecked" Value="True">
  46. <Setter TargetName="eliCheck" Property="Visibility" Value="Visible"></Setter>
  47. </Trigger>
  48. </ControlTemplate.Triggers>
  49. </ControlTemplate>
  50. </Setter.Value>
  51. </Setter>
  52. </Style>
  53. <Style TargetType="{x:Type controls:TreeViewFileItem}">
  54. <Style.Triggers>
  55. <Trigger Property="IsSelected" Value="True">
  56. <Setter Property="BorderThickness" Value="1"/>
  57. <Setter Property="Opacity" Value="1"/>
  58. <!--<Setter Property="Foreground" Value="{DynamicResource TreeView_BG_Select}"/>-->
  59. <!--<Setter Property="Background" Value="{DynamicResource TreeView_BG_Select}"/>-->
  60. <Setter Property="BorderBrush" Value="#0078D7"/>
  61. </Trigger>
  62. <Trigger Property="IsMouseOver" Value="True">
  63. <Setter Property="Cursor" Value="Hand"/>
  64. <Setter Property="Background" Value="AliceBlue"/>
  65. </Trigger>
  66. <!--<Trigger Property="IsFocused" Value="True">
  67. <Setter Property="Background" Value="LightBlue"/>
  68. </Trigger>-->
  69. </Style.Triggers>
  70. </Style>
  71. </UserControl.Resources>
  72. <i:Interaction.Triggers>
  73. <i:EventTrigger EventName="Loaded">
  74. <i:InvokeCommandAction Command="{Binding LoadedCommand}" CommandParameter="{Binding ElementName=recipeView}"/>
  75. </i:EventTrigger>
  76. <i:EventTrigger EventName="Unloaded">
  77. <i:InvokeCommandAction Command="{Binding UnloadCommand}"/>
  78. </i:EventTrigger>
  79. </i:Interaction.Triggers>
  80. <Grid>
  81. <Grid.ColumnDefinitions>
  82. <ColumnDefinition Width="Auto" />
  83. <ColumnDefinition Width="6" />
  84. <ColumnDefinition Width="800*" />
  85. </Grid.ColumnDefinitions>
  86. <Grid Grid.Column="0">
  87. <Grid.RowDefinitions>
  88. <RowDefinition Height="40"/>
  89. <RowDefinition Height="*"/>
  90. </Grid.RowDefinitions>
  91. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
  92. <TextBlock Text="Recipe List" Margin="5" FontFamily="Arial" FontSize="20" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  93. </Border>
  94. <Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
  95. <TreeView Name="treeViewRcpList" Margin="0,6"
  96. FontSize="18" BorderThickness="1" BorderBrush="Black" Canvas.Top="140" Canvas.Left="4" Opacity="1" Background="LightSteelBlue" AllowDrop="True"
  97. >
  98. <i:Interaction.Triggers>
  99. <i:EventTrigger EventName="MouseRightButtonDown">
  100. <i:InvokeCommandAction Command="{Binding MouseRightButtonDownCommand}" CommandParameter="{Binding ElementName=treeViewRcpList}"/>
  101. </i:EventTrigger>
  102. </i:Interaction.Triggers>
  103. </TreeView>
  104. </Border>
  105. </Grid>
  106. <GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="Transparent" />
  107. <Grid x:Name="gridDisplay" Grid.Column="2">
  108. <Grid.RowDefinitions>
  109. <RowDefinition Height="40" />
  110. <RowDefinition Height="706*"/>
  111. </Grid.RowDefinitions>
  112. <StackPanel Grid.Row="0" Orientation="Horizontal">
  113. <!--<customeControls:PathButton PathData="{StaticResource Icon_Save}" Content="Save" DefaultFillBrush="White" Command="{Binding SaveRecipeCommand}" Margin="30,4,22,0" FontSize="16" Height="30" Width="130" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>-->
  114. <customeControls:SplitButton Content="Save" Style="{StaticResource SplitButtonStyle}" Command="{Binding SaveRecipeCommand}" Cursor="Hand" Foreground="White" Margin="30,0,22,0" FontSize="16" Height="30" Width="130" Background="#009ad6">
  115. <MenuItem Header="Save To PMA" Cursor="Hand" Command="{Binding SaveToRecipeCommand}" CommandParameter="0" Visibility="{Binding PMAIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
  116. <MenuItem Header="Save To PMB" Cursor="Hand" Command="{Binding SaveToRecipeCommand}" CommandParameter="1" Visibility="{Binding PMBIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
  117. <MenuItem Header="Save To PMC" Cursor="Hand" Command="{Binding SaveToRecipeCommand}" CommandParameter="2" Visibility="{Binding PMCIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
  118. <MenuItem Header="Save To PMD" Cursor="Hand" Command="{Binding SaveToRecipeCommand}" CommandParameter="3" Visibility="{Binding PMDIsInstalled,Converter={StaticResource bool2VisibilityConverter}}"/>
  119. <MenuItem Header="Save To All" Cursor="Hand" Command="{Binding SaveToRecipeCommand}" CommandParameter="4"/>
  120. </customeControls:SplitButton>
  121. <customeControls:PathButton PathData="{StaticResource Icon_Add}" Content="Add Step" DefaultFillBrush="White" Command="{Binding AddStepCommand}" Margin="30,4,22,0" FontSize="16" Height="30" Width="130" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>
  122. <customeControls:PathButton PathData="{StaticResource Icon_Delete}" Content="Del Step" DefaultFillBrush="White" Command="{Binding DeleteStepCommand}" Margin="30,4,22,0" FontSize="16" Height="30" Width="130" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>
  123. <customeControls:PathButton PathData="{StaticResource Icon_Refresh}" Content="Refresh" DefaultFillBrush="White" Command="{Binding RefreshCommand}" Margin="30,4,22,0" FontSize="16" Height="30" Width="130" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>
  124. <!--<customeControls:PathButton PathData="{StaticResource Icon_Tolerance}" Content="Tolerance" DefaultFillBrush="White" Command="{Binding ToleranceCommand}" Margin="30,4,22,0" FontSize="16" Height="30" Width="130" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>-->
  125. <RadioButton Content="Unfrozen" FontSize="15" Width="120" Height="30" Margin="30,0,10,0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsFrozen,Converter={StaticResource BoolToBool},Mode=TwoWay}"/>
  126. <RadioButton Content="Frozen" FontSize="15" Width="120" Height="30" Margin="0,0,30,0" Style="{StaticResource Button_RadioButton}" IsChecked="{Binding IsFrozen,Mode=TwoWay}"/>
  127. </StackPanel>
  128. <Grid x:Name="grid1" Grid.Row="1" >
  129. <Grid.ColumnDefinitions>
  130. <ColumnDefinition/>
  131. <!--<ColumnDefinition/>-->
  132. <ColumnDefinition Width="Auto"/>
  133. </Grid.ColumnDefinitions>
  134. <!--<Expander Grid.Column="1" Header="RecipeHead" FontSize="15" Margin="10,0,0,0">
  135. </Expander>-->
  136. <Grid Margin="0,-40,0,0" Grid.Column="1" Grid.Row="1" Background="#C6D2DE" Width="300" x:Name="expandGrid">
  137. <Grid.RowDefinitions>
  138. <RowDefinition Height="30"/>
  139. <RowDefinition Height="Auto"/>
  140. </Grid.RowDefinitions>
  141. <StackPanel Orientation="Horizontal">
  142. <customeControls:PathButton Width="25" Height="25" BorderThickness="0" PathData="{StaticResource Icon_Expand}" Background="Transparent" DefaultFillBrush="Black" Foreground="White" Cursor="Hand" Command="{Binding ExpandCommand}" Margin="5 5 0 0"/>
  143. <TextBlock Text="Recipe Head" FontSize="20" Margin="35 5 0 0"/>
  144. </StackPanel>
  145. <WrapPanel Grid.Row="1" x:Name="headWrapPanel" Orientation="Horizontal" Width="300" Margin="15 5 0 0" />
  146. </Grid>
  147. <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" FontSize="14">
  148. <StackPanel x:Name="bodyStackPanel" Orientation="Horizontal" Grid.Row="1" ScrollViewer.VerticalScrollBarVisibility="Visible" IsEnabled="{Binding IsFrozen,Converter={StaticResource BoolToBool}}"/>
  149. </ScrollViewer>
  150. </Grid>
  151. </Grid>
  152. </Grid>
  153. </UserControl>