RecipeView.xaml 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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:core="clr-namespace:Aitex.UI.RecipeEditor;assembly=RecipeEditorControl"
  10. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  11. d:DesignHeight="450" d:DesignWidth="800" Name="recipeView">
  12. <UserControl.Resources>
  13. <Style TargetType="Button" x:Key="MiddleButton" BasedOn="{StaticResource {x:Type Button}}" />
  14. <Style TargetType="Button"></Style>
  15. <Style TargetType="{x:Type CheckBox}">
  16. <Setter Property="Background" Value="White" />
  17. <Setter Property="BorderBrush" Value="#FF262E34"/>
  18. <Setter Property="Foreground" Value="#FF262E34"/>
  19. <Setter Property="BorderThickness" Value="1"/>
  20. <Setter Property="Template">
  21. <Setter.Value>
  22. <ControlTemplate TargetType="{x:Type CheckBox}">
  23. <Border BorderThickness="1" BorderBrush="Gray">
  24. <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Background="White" Margin=".5">
  25. <Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Width="15" Height="15" Margin="1,0,0,0">
  26. <!-- your color here -->
  27. <Path Width="15" Height="10" Stroke="HotPink" StrokeThickness="3" Name="eliCheck" Data="M 2,4 C 2,4 3,5 5,13 C 5,13 5,3 12,0" Visibility="Collapsed"/>
  28. </Border>
  29. <TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}"></TextBlock>
  30. </StackPanel>
  31. </Border>
  32. <ControlTemplate.Triggers>
  33. <Trigger Property="IsMouseOver" Value="True">
  34. <Setter Property="Background" Value="LightGray" />
  35. </Trigger>
  36. <Trigger Property="IsPressed" Value="True">
  37. <Setter Property="Background" Value="#FF9C9E9F" />
  38. </Trigger>
  39. <Trigger Property="IsEnabled" Value="False">
  40. <Setter Property="Background" Value="LightGray" />
  41. <Setter Property="Foreground" Value="Gray" />
  42. <Setter Property="BorderBrush" Value="Gray"/>
  43. <Setter TargetName="eliCheck" Property="Opacity" Value="0.5" />
  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. </UserControl.Resources>
  54. <i:Interaction.Triggers>
  55. <i:EventTrigger EventName="Loaded">
  56. <i:InvokeCommandAction Command="{Binding LoadedCommand}" CommandParameter="{Binding ElementName=recipeView}"/>
  57. </i:EventTrigger>
  58. </i:Interaction.Triggers>
  59. <Grid>
  60. <Grid.ColumnDefinitions>
  61. <ColumnDefinition Width="200" />
  62. <ColumnDefinition Width="6" />
  63. <ColumnDefinition Width="800*" />
  64. </Grid.ColumnDefinitions>
  65. <Grid Grid.Column="0">
  66. <Grid.RowDefinitions>
  67. <RowDefinition Height="40"/>
  68. <RowDefinition Height="*"/>
  69. </Grid.RowDefinitions>
  70. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
  71. <StackPanel VerticalAlignment="Bottom">
  72. <StackPanel Orientation="Horizontal">
  73. <!--<Button Content="New" Width="85" Height="30" Style="{StaticResource MiddleButton}" Command="{Binding NewCommand}"/>
  74. <Button Content="Rename" Margin="10,0,0,0" Width="85" Height="30" Style="{StaticResource MiddleButton}" Command="{Binding ReNameCommand}"/>-->
  75. <!--<Button Content="Delete" Margin="10,0,0,0" Width="85" Height="30" Style="{StaticResource MiddleButton}" Command="{Binding DeleteCommand}"/>-->
  76. </StackPanel>
  77. <TextBlock Text="Recipe List" Margin="5" FontFamily="Arial" FontSize="20" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  78. </StackPanel>
  79. </Border>
  80. <Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
  81. <TreeView Name="treeViewRcpList" Margin="0,6"
  82. FontSize="18" BorderThickness="1" BorderBrush="Black" Canvas.Top="140" Canvas.Left="4" Opacity="1" Background="LightSteelBlue" AllowDrop="True"
  83. >
  84. <i:Interaction.Triggers>
  85. <i:EventTrigger EventName="MouseRightButtonDown">
  86. <i:InvokeCommandAction Command="{Binding MouseRightButtonDownCommand}" CommandParameter="{Binding ElementName=treeViewRcpList}"/>
  87. </i:EventTrigger>
  88. </i:Interaction.Triggers>
  89. <TreeView.ItemContainerStyle>
  90. <Style TargetType="{x:Type TreeViewItem}">
  91. <Style.Resources>
  92. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="DodgerBlue"/>
  93. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="White"/>
  94. <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="DodgerBlue"/>
  95. <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="White"/>
  96. </Style.Resources>
  97. </Style>
  98. </TreeView.ItemContainerStyle>
  99. </TreeView>
  100. </Border>
  101. </Grid>
  102. <GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="Transparent" />
  103. <Grid x:Name="gridDisplay" Grid.Column="2">
  104. <Grid.RowDefinitions>
  105. <RowDefinition Height="40" />
  106. <RowDefinition Height="706*" />
  107. </Grid.RowDefinitions>
  108. <StackPanel Grid.Row="0" Orientation="Horizontal">
  109. <!--<TextBlock Text="Type:" Margin="20,10,0,0" FontSize="15"/>
  110. <TextBlock Text="{Binding RecipeType}" Margin="0,10,0,0" FontSize="15"/>
  111. <TextBlock Text="Name:" Margin="20,10,0,0" FontSize="15"/>
  112. <TextBlock Text="{Binding CurrentRecipeName}" Margin="0,10,0,0" FontSize="15"/>-->
  113. <!--<Label Height="31" Margin="22,3,0,0" Name="labelSelectedRecipe" VerticalAlignment="Top" Content="{Binding RecipeType}" FontSize="15" HorizontalContentAlignment="Left" HorizontalAlignment="Left" FontWeight="Normal" />
  114. <Label Height="31" Margin="22,3,0,0" VerticalAlignment="Top" Content="{Binding CurrentRecipeName}" FontSize="15" HorizontalContentAlignment="Left" HorizontalAlignment="Left" FontWeight="Normal" />-->
  115. <!--<Button Style="{StaticResource MiddleButton}" Height="25" Name="buttonReloadTableRecipe" VerticalAlignment="Top" FontSize="16" Width="80" VerticalContentAlignment="Center" Command="{Binding ReLoadCommand}"
  116. Margin="50,4,0,0" HorizontalAlignment="Right" Content="{DynamicResource GlobalLableButtonReload}" FontWeight="Normal"></Button>-->
  117. <!--<Button Style="{StaticResource MiddleButton}" Height="25" FontSize="16" Width="80"
  118. VerticalContentAlignment="Center" Margin="30,4,22,0" HorizontalAlignment="Right" VerticalAlignment="Top" Content="{DynamicResource GlobalLableButtonSave}" FontWeight="Normal" Command="{Binding SaveRecipeCommand}"/>-->
  119. <Button Style="{StaticResource MiddleButton}" Height="25" Name="buttonSaveTableRecipe" FontSize="16" Width="80"
  120. VerticalContentAlignment="Center" Margin="30,4,22,0" HorizontalAlignment="Right" VerticalAlignment="Top" Content="{DynamicResource GlobalLableButtonSave}" FontWeight="Normal" Command="{Binding SaveRecipeCommand}"/>
  121. <Button Content="Add Step" Command="{Binding AddStepCommand}" Margin="30,4,22,0" Style="{StaticResource MiddleButton}" FontSize="16" Height="25" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>
  122. <Button Content="Delete Step" Command="{Binding DeleteStepCommand}" Margin="30,4,22,0" Style="{StaticResource MiddleButton}" FontSize="16" Height="25" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>
  123. </StackPanel>
  124. <Grid Grid.Row="1">
  125. <core:RecipeEditorControl x:Name="tableRecipeGrid" FontSize="12" BorderThickness="1" BorderBrush="Black" Margin="0,0,0,6" />
  126. </Grid>
  127. </Grid>
  128. </Grid>
  129. </UserControl>