RecipeView.xaml 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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. d:DesignHeight="450" d:DesignWidth="800" Name="recipeView">
  12. <UserControl.Resources>
  13. <Style TargetType="{x:Type CheckBox}">
  14. <Setter Property="Background" Value="White" />
  15. <Setter Property="BorderBrush" Value="#FF262E34"/>
  16. <Setter Property="Foreground" Value="#FF262E34"/>
  17. <Setter Property="BorderThickness" Value="1"/>
  18. <Setter Property="Template">
  19. <Setter.Value>
  20. <ControlTemplate TargetType="{x:Type CheckBox}">
  21. <Border BorderThickness="0.8" BorderBrush="Gray" Background="White">
  22. <StackPanel Orientation="Horizontal" Name="mainStackPanel" HorizontalAlignment="Center" Background="White" VerticalAlignment="Center">
  23. <Border BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" Width="15" Height="15" HorizontalAlignment="Center">
  24. <!-- your color here -->
  25. <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"/>
  26. </Border>
  27. <TextBlock Margin="5,0,0,0" VerticalAlignment="Center" Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}"></TextBlock>
  28. </StackPanel>
  29. </Border>
  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. <Setter TargetName="mainStackPanel" Property="Background" Value="#DDEBF9"/>
  43. </Trigger>
  44. <Trigger Property="IsChecked" Value="True">
  45. <Setter TargetName="eliCheck" Property="Visibility" Value="Visible"></Setter>
  46. </Trigger>
  47. </ControlTemplate.Triggers>
  48. </ControlTemplate>
  49. </Setter.Value>
  50. </Setter>
  51. </Style>
  52. </UserControl.Resources>
  53. <i:Interaction.Triggers>
  54. <i:EventTrigger EventName="Loaded">
  55. <i:InvokeCommandAction Command="{Binding LoadedCommand}" CommandParameter="{Binding ElementName=recipeView}"/>
  56. </i:EventTrigger>
  57. </i:Interaction.Triggers>
  58. <Grid>
  59. <Grid.ColumnDefinitions>
  60. <ColumnDefinition Width="200" />
  61. <ColumnDefinition Width="6" />
  62. <ColumnDefinition Width="800*" />
  63. </Grid.ColumnDefinitions>
  64. <Grid Grid.Column="0">
  65. <Grid.RowDefinitions>
  66. <RowDefinition Height="40"/>
  67. <RowDefinition Height="*"/>
  68. </Grid.RowDefinitions>
  69. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1" Background="{DynamicResource Table_BG_Title}" Padding="5,1">
  70. <TextBlock Text="Recipe List" Margin="5" FontFamily="Arial" FontSize="20" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  71. </Border>
  72. <Border Grid.Row="1" BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,0,1,1" Background="{DynamicResource Table_BG_Content}" Padding="5,1">
  73. <TreeView Name="treeViewRcpList" Margin="0,6"
  74. FontSize="18" BorderThickness="1" BorderBrush="Black" Canvas.Top="140" Canvas.Left="4" Opacity="1" Background="LightSteelBlue" AllowDrop="True"
  75. >
  76. <i:Interaction.Triggers>
  77. <i:EventTrigger EventName="MouseRightButtonDown">
  78. <i:InvokeCommandAction Command="{Binding MouseRightButtonDownCommand}" CommandParameter="{Binding ElementName=treeViewRcpList}"/>
  79. </i:EventTrigger>
  80. </i:Interaction.Triggers>
  81. <!--<TreeView.ItemContainerStyle>
  82. <Style TargetType="{x:Type TreeViewItem}">
  83. <Style.Resources>
  84. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="DodgerBlue"/>
  85. <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="White"/>
  86. <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="DodgerBlue"/>
  87. <SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="White"/>
  88. </Style.Resources>
  89. </Style>
  90. </TreeView.ItemContainerStyle>-->
  91. </TreeView>
  92. </Border>
  93. </Grid>
  94. <GridSplitter Grid.Column="1" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="Transparent" />
  95. <Grid x:Name="gridDisplay" Grid.Column="2">
  96. <Grid.RowDefinitions>
  97. <RowDefinition Height="40" />
  98. <RowDefinition Height="706*" />
  99. </Grid.RowDefinitions>
  100. <StackPanel Grid.Row="0" Orientation="Horizontal">
  101. <customeControls:PathButton PathData="{StaticResource Icon_Save}" Content="Save" DefaultFillBrush="White" Command="{Binding SaveRecipeCommand}" Margin="30,4,22,0" FontSize="16" Height="30" Width="140" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>
  102. <customeControls:PathButton PathData="{StaticResource Icon_Add}" Content="Add Step" DefaultFillBrush="White" Command="{Binding AddStepCommand}" Margin="30,4,22,0" FontSize="16" Height="30" Width="140" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>
  103. <customeControls:PathButton PathData="{StaticResource Icon_Delete}" Content="Del Step" DefaultFillBrush="White" Command="{Binding DeleteStepCommand}" Margin="30,4,22,0" FontSize="16" Height="30" Width="140" VerticalContentAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Top"/>
  104. </StackPanel>
  105. <Grid x:Name="grid1" Grid.Row="1">
  106. <Grid.RowDefinitions>
  107. <RowDefinition Height="Auto"/>
  108. <RowDefinition />
  109. </Grid.RowDefinitions>
  110. <Grid Grid.Row="0">
  111. <Expander Header="RecipeHead" FontSize="15" Margin="10,0,0,0">
  112. <WrapPanel x:Name="headWrapPanel" Orientation="Horizontal"/>
  113. </Expander>
  114. </Grid>
  115. <ScrollViewer Grid.Row="1" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  116. <StackPanel x:Name="bodyStackPanel" Orientation="Horizontal" Grid.Row="1" ScrollViewer.VerticalScrollBarVisibility="Visible"/>
  117. </ScrollViewer>
  118. </Grid>
  119. </Grid>
  120. </Grid>
  121. </UserControl>