RecipeView.xaml 9.7 KB

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