终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

133 lines
7.0 KiB

  1. <UserControl
  2. x:Class="BPASmartClient.DosingSystem.View.ConveyerBeltManualView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.DosingSystem.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
  9. xmlns:vm="clr-namespace:BPASmartClient.DosingSystem.ViewModel"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. mc:Ignorable="d">
  13. <UserControl.Resources>
  14. <Style x:Key="radioButtonStyle" TargetType="RadioButton">
  15. <Setter Property="Template">
  16. <Setter.Value>
  17. <ControlTemplate TargetType="RadioButton">
  18. <Grid Name="gr" Opacity="0.8">
  19. <ContentControl
  20. Margin="{TemplateBinding Margin}"
  21. HorizontalAlignment="Center"
  22. VerticalAlignment="Center"
  23. HorizontalContentAlignment="Center"
  24. VerticalContentAlignment="Center"
  25. Content="{TemplateBinding Content}"
  26. FontSize="{TemplateBinding FontSize}"
  27. Foreground="{TemplateBinding Foreground}" />
  28. <Image
  29. Name="image"
  30. Source="/BPASmartClient.CustomResource;component/Image/边框线.png"
  31. Stretch="Fill" />
  32. </Grid>
  33. <ControlTemplate.Triggers>
  34. <Trigger Property="IsChecked" Value="False">
  35. <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/边框线.png" />
  36. </Trigger>
  37. <Trigger Property="IsChecked" Value="True">
  38. <Setter TargetName="image" Property="Source" Value="/BPASmartClient.CustomResource;component/Image/透明背景.png" />
  39. </Trigger>
  40. <Trigger Property="IsMouseOver" Value="True">
  41. <Setter TargetName="gr" Property="Opacity" Value="1" />
  42. </Trigger>
  43. </ControlTemplate.Triggers>
  44. </ControlTemplate>
  45. </Setter.Value>
  46. </Setter>
  47. </Style>
  48. </UserControl.Resources>
  49. <UserControl.DataContext>
  50. <vm:ConveyerBeltManualViewModel />
  51. </UserControl.DataContext>
  52. <ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden">
  53. <ItemsControl ItemsSource="{Binding ConveyerBeltModels}">
  54. <ItemsControl.ItemTemplate>
  55. <DataTemplate>
  56. <Grid Margin="8">
  57. <Grid
  58. Name="cy"
  59. Grid.Row="0"
  60. Margin="5">
  61. <pry:ImageBorder
  62. Grid.RowSpan="2"
  63. Width="{Binding ElementName=cy, Path=ActualWidth}"
  64. Height="{Binding ElementName=cy, Path=ActualHeight}" />
  65. <StackPanel Background="Transparent">
  66. <Grid Height="40">
  67. <Image
  68. Margin="2,3,0,0"
  69. HorizontalAlignment="Left"
  70. VerticalAlignment="Top"
  71. Source="/BPASmartClient.CustomResource;component/Image/标签.png" />
  72. <TextBlock
  73. Margin="10,10,0,0"
  74. VerticalAlignment="Top"
  75. FontSize="16"
  76. Foreground="Aqua"
  77. Text="{Binding Name}" />
  78. <StackPanel
  79. Margin="0,0,20,0"
  80. HorizontalAlignment="Right"
  81. Orientation="Horizontal">
  82. <TextBlock
  83. Margin="0,0,2,0"
  84. Style="{StaticResource TextBlockStyle}"
  85. Text="输送带速度:" />
  86. <TextBox
  87. Width="170"
  88. Height="35"
  89. HorizontalAlignment="Right"
  90. FontSize="20"
  91. Style="{StaticResource TextBoxStyle}"
  92. Text="{Binding Speed, UpdateSourceTrigger=PropertyChanged}" />
  93. <TextBlock
  94. Margin="20,0,5,0"
  95. VerticalAlignment="Center"
  96. FontSize="20"
  97. Foreground="#00c2f4"
  98. Text="输送带控制" />
  99. <ToggleButton
  100. Width="80"
  101. Height="30"
  102. Margin="5,0,5,0"
  103. Background="Transparent"
  104. FontSize="20"
  105. IsChecked="{Binding ConveyerBeltWork}"
  106. Style="{StaticResource SwitchToggleButtonStyle}" />
  107. </StackPanel>
  108. </Grid>
  109. <Grid Name="gr" Height="200">
  110. <pry:ConveyBelt2
  111. Grid.RowSpan="4"
  112. Margin="-12,0,10,0"
  113. BeltDashThickess="50"
  114. BeltHeight="{Binding ElementName=gr, Path=ActualHeight}"
  115. BeltWidth="{Binding ElementName=gr, Path=ActualWidth}"
  116. IsRun="{Binding ConveyerBeltWork}" />
  117. </Grid>
  118. </StackPanel>
  119. </Grid>
  120. </Grid>
  121. </DataTemplate>
  122. </ItemsControl.ItemTemplate>
  123. </ItemsControl>
  124. </ScrollViewer>
  125. </UserControl>