RecipeSkipWaitCommandView.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <UserControl x:Class="FurnaceUI.Views.Editors.RecipeSkipWaitCommandView"
  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. xmlns:local="clr-namespace:FurnaceUI.Views.Editors" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:cal="http://www.caliburn.org" xmlns:converter="clr-namespace:FurnaceUI.Converter"
  7. mc:Ignorable="d"
  8. Height="600" Width="740" FontFamily="Segoe">
  9. <UserControl.Resources>
  10. <converter:IsCheckShowStringConverter x:Key="isCheckShowStringConverter"/>
  11. <LinearGradientBrush x:Key="ToggleButton_BG_Color" EndPoint="0,0" StartPoint="0,1">
  12. <GradientStop Color="White" Offset="0"/>
  13. <GradientStop Color="White" Offset="0.9"/>
  14. <GradientStop Color="#FFD0D0D0" Offset="1"/>
  15. </LinearGradientBrush>
  16. <SolidColorBrush x:Key="ToggleButton_BD" Color="#FF284775"/>
  17. <SolidColorBrush x:Key="ToggleButton_BD_Shadow" Color="#FF284775"/>
  18. <SolidColorBrush x:Key="ToggleButton_BG_MouseOver" Color="#FF4FCBFF"/>
  19. <SolidColorBrush x:Key="ToggleButton_BG_Press" Color="#FF5A89D4"/>
  20. <SolidColorBrush x:Key="ToggleButton_BG_Unable" Color="#FFD2D2D2"/>
  21. <SolidColorBrush x:Key="ToggleButton_BD_Unable" Color="#FFF3F3F3"/>
  22. <SolidColorBrush x:Key="ToggleButton_BD_Shadow_Unable" Color="#FF9D9D9D"/>
  23. <SolidColorBrush x:Key="ToggleButton_BG_Checked" Color="#FFb8fff8"/>
  24. <SolidColorBrush x:Key="ToggleButton_BD_Checked" Color="#FFF3F3F3"/>
  25. <SolidColorBrush x:Key="ToggleButton_BD_Shadow_Checked" Color="#FF9D9D9D"/>
  26. <SolidColorBrush x:Key="TopFrame_BG" Color="Gray"/>
  27. <SolidColorBrush x:Key="TopFrame_BG2" Color="#FF688AB3"/>
  28. <Style TargetType="{x:Type ToggleButton}">
  29. <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
  30. <Setter Property="Background" Value="{StaticResource TopFrame_BG}"/>
  31. <Setter Property="BorderBrush" Value="Black"/>
  32. <Setter Property="BorderThickness" Value="2,2,0,0"/>
  33. <Setter Property="Foreground" Value="{DynamicResource FG_Black}"/>
  34. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  35. <Setter Property="VerticalContentAlignment" Value="Center"/>
  36. <Setter Property="Padding" Value="6,3"/>
  37. <Setter Property="MinWidth" Value="40"/>
  38. <Setter Property="MinHeight" Value="20"/>
  39. <Setter Property="SnapsToDevicePixels" Value="True"/>
  40. <Setter Property="Border.CornerRadius" Value="4"/>
  41. <Setter Property="Template">
  42. <Setter.Value>
  43. <ControlTemplate TargetType="{x:Type ToggleButton}">
  44. <Border x:Name="BG" BorderThickness="{TemplateBinding BorderThickness}"
  45. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  46. CornerRadius="{TemplateBinding Border.CornerRadius}"
  47. BorderBrush="{TemplateBinding BorderBrush}"
  48. Background="{TemplateBinding Background}" Cursor="Hand">
  49. <Border x:Name="Inner_BD"
  50. BorderBrush="WhiteSmoke"
  51. BorderThickness="0,0,2,2" Margin="0,0,-2,-2" CornerRadius="3" Padding="5,1">
  52. <ContentPresenter x:Name="contentpresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  53. Margin="{TemplateBinding Padding}" RecognizesAccessKey="True"
  54. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  55. VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Cursor="Hand">
  56. </ContentPresenter>
  57. </Border>
  58. </Border>
  59. <ControlTemplate.Triggers>
  60. <Trigger Property="IsMouseOver" Value="True">
  61. <Setter TargetName="BG" Property="Background" Value="{StaticResource ToggleButton_BG_MouseOver}"/>
  62. </Trigger>
  63. <Trigger Property="IsPressed" Value="True">
  64. <Setter TargetName="BG" Property="Background" Value="{StaticResource ToggleButton_BG_Press}"/>
  65. <Setter TargetName="BG" Property="Margin" Value="1"/>
  66. <Setter Property="FontSize" Value="13"/>
  67. </Trigger>
  68. <Trigger Property="IsEnabled" Value="False">
  69. <Setter TargetName="BG" Property="Background" Value="{StaticResource ToggleButton_BG_Unable}"/>
  70. <Setter TargetName="BG" Property="BorderBrush" Value="{StaticResource ToggleButton_BD_Unable}"/>
  71. <Setter TargetName="Inner_BD" Property="BorderBrush" Value="{StaticResource ToggleButton_BD_Shadow_Unable}"/>
  72. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  73. </Trigger>
  74. <Trigger Property="IsChecked" Value="True">
  75. <Setter TargetName="Inner_BD" Property="Background" Value="{StaticResource TopFrame_BG2}"/>
  76. <Setter TargetName="BG" Property="Background" Value="{StaticResource TopFrame_BG}"/>
  77. <Setter Property="FontSize" Value="16"/>
  78. <Setter Property="FontWeight" Value="Bold"/>
  79. <Setter TargetName="BG" Property="BorderBrush" Value="{StaticResource ToggleButton_BD}"/>
  80. <Setter TargetName="Inner_BD" Property="BorderBrush" Value="{StaticResource ToggleButton_BD_Unable}"/>
  81. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  82. </Trigger>
  83. <Trigger Property="IsChecked" Value="False">
  84. <Setter TargetName="Inner_BD" Property="Background" Value="{StaticResource TopFrame_BG}"/>
  85. <Setter TargetName="BG" Property="BorderBrush" Value="{StaticResource ToggleButton_BD}"/>
  86. <Setter Property="FontSize" Value="23"/>
  87. <Setter Property="FontWeight" Value="Normal"/>
  88. <Setter TargetName="Inner_BD" Property="BorderBrush" Value="{StaticResource ToggleButton_BD}"/>
  89. <Setter Property="TextBlock.Foreground" TargetName="contentpresenter" Value="Black"/>
  90. </Trigger>
  91. </ControlTemplate.Triggers>
  92. </ControlTemplate>
  93. </Setter.Value>
  94. </Setter>
  95. </Style>
  96. </UserControl.Resources>
  97. <Grid>
  98. <Grid.RowDefinitions>
  99. <RowDefinition Height="*"/>
  100. <RowDefinition Height="80"/>
  101. </Grid.RowDefinitions>
  102. <DockPanel>
  103. <Border BorderThickness="1" BorderBrush="Gray" Margin="10">
  104. <StackPanel Visibility="{Binding IsStepSkipVisibility}">
  105. <TextBlock Text="Step Skip Wait Check Time" FontSize="20" Margin="4,10,0,0"/>
  106. <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="4" >
  107. <ToggleButton Width="150" Height="35" Content="Step Skip" IsChecked="{Binding IsStepSkipIsChecked,UpdateSourceTrigger=Explicit}">
  108. <i:Interaction.Triggers>
  109. <i:EventTrigger EventName="Click">
  110. <cal:ActionMessage MethodName="StepClick">
  111. <cal:Parameter Value="Skip"/>
  112. </cal:ActionMessage>
  113. </i:EventTrigger>
  114. </i:Interaction.Triggers>
  115. </ToggleButton>
  116. <TextBlock Width="200" Text="Step Skip Check Time" VerticalAlignment="Center" Margin="10,0,0,0" Visibility="{Binding IsStepSkipIsChecked, Converter={StaticResource BoolVisibilityConverter}}"/>
  117. <TextBox Width="150" Text="{Binding StepSkipValue,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding IsStepSkipIsChecked, Converter={StaticResource BoolVisibilityConverter}}" Tag="Number"/>
  118. <TextBlock Text="sec" VerticalAlignment="Center" Visibility="{Binding IsStepSkipIsChecked, Converter={StaticResource BoolVisibilityConverter}}"/>
  119. </StackPanel>
  120. <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="4" Visibility="{Binding IsStepWaitVisibility}">
  121. <ToggleButton Width="150" Height="35" Content="Step Wait" IsChecked="{Binding IsStepWaitIsChecked,UpdateSourceTrigger=Explicit}">
  122. <i:Interaction.Triggers>
  123. <i:EventTrigger EventName="Click">
  124. <cal:ActionMessage MethodName="StepClick">
  125. <cal:Parameter Value="Wait"/>
  126. </cal:ActionMessage>
  127. </i:EventTrigger>
  128. </i:Interaction.Triggers>
  129. </ToggleButton>
  130. <TextBlock Width="200" Text="Step Wait Check Time" VerticalAlignment="Center" Margin="10,0,0,0" Visibility="{Binding IsStepWaitIsChecked, Converter={StaticResource BoolVisibilityConverter}}"/>
  131. <TextBox Width="150" Text="{Binding StepWaitValue,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding IsStepWaitIsChecked, Converter={StaticResource BoolVisibilityConverter}}" Tag="Number"/>
  132. <TextBlock Text="sec" VerticalAlignment="Center" Visibility="{Binding IsStepWaitIsChecked, Converter={StaticResource BoolVisibilityConverter}}"/>
  133. </StackPanel>
  134. </StackPanel>
  135. </Border>
  136. </DockPanel>
  137. <Border Grid.Row="2">
  138. <Grid>
  139. <Canvas>
  140. <Button Content="Save" Canvas.Left="406" Canvas.Top="19" Width="130" Height="45" Style="{StaticResource CommandButton}" IsEnabled="{Binding IsEnable}">
  141. <i:Interaction.Triggers>
  142. <i:EventTrigger EventName="Click">
  143. <cal:ActionMessage MethodName="TempSetSave">
  144. </cal:ActionMessage>
  145. </i:EventTrigger>
  146. </i:Interaction.Triggers>
  147. </Button>
  148. <Button Content="Close" Canvas.Left="556" Canvas.Top="19" Width="130" Height="45" Style="{StaticResource CommandButton}">
  149. <i:Interaction.Triggers>
  150. <i:EventTrigger EventName="Click">
  151. <cal:ActionMessage MethodName="TempSetCancel">
  152. </cal:ActionMessage>
  153. </i:EventTrigger>
  154. </i:Interaction.Triggers>
  155. </Button>
  156. </Canvas>
  157. </Grid>
  158. </Border>
  159. </Grid>
  160. </UserControl>