TVSettingDialogView.xaml 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <UserControl x:Class="MECF.Framework.UI.Client.Ctrlib.UnitControls.TVSettingDialogView"
  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:unitControls="clr-namespace:MECF.Framework.UI.Client.Ctrlib.UnitControls"
  7. xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
  8. xmlns:micro="clr-namespace:Caliburn.Micro"
  9. xmlns:controls="clr-namespace:OpenSEMI.Ctrlib.Controls"
  10. xmlns:converters="clr-namespace:Aitex.Core.UI.Converters;assembly=MECF.Framework.UI.Core"
  11. mc:Ignorable="d"
  12. KeyDown="OnEnterKeyIsHit"
  13. d:DesignHeight="450" d:DesignWidth="600">
  14. <UserControl.Resources>
  15. <Style x:Key="textBoxInError" TargetType="{x:Type TextBox}">
  16. <Style.Triggers>
  17. <Trigger Property="Validation.HasError" Value="true">
  18. <Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}"/>
  19. </Trigger>
  20. </Style.Triggers>
  21. </Style>
  22. <unitControls:DoubleConverter x:Key="doubleConverter"/>
  23. <converters:BoolToValueConverter x:Key="BoolToValueConverter"/>
  24. </UserControl.Resources>
  25. <Border Height="300" Width="400" Background="{DynamicResource Color_BG_Dialog_Inner}" BorderThickness="1" BorderBrush="SteelBlue" >
  26. <Grid>
  27. <Grid.Resources>
  28. <Style TargetType="RadioButton"/>
  29. </Grid.Resources>
  30. <Grid.RowDefinitions>
  31. <RowDefinition/>
  32. <RowDefinition/>
  33. <RowDefinition/>
  34. <RowDefinition/>
  35. <RowDefinition/>
  36. <RowDefinition/>
  37. <RowDefinition Height="70"/>
  38. </Grid.RowDefinitions>
  39. <Grid.ColumnDefinitions>
  40. <ColumnDefinition Width="1*"/>
  41. <ColumnDefinition Width="130"/>
  42. <ColumnDefinition Width="150"/>
  43. <ColumnDefinition Width="1*"/>
  44. </Grid.ColumnDefinitions>
  45. <Label Grid.Row="0" Grid.Column="1" Content="Device Name:" />
  46. <Label Grid.Row="1" Grid.Column="1" Content="Work Mode:" />
  47. <Label Grid.Row="2" Grid.Column="1" Content="Max:" />
  48. <Label Grid.Row="3" Grid.Column="1" Content="Unit:" />
  49. <Label Grid.Row="4" Grid.Column="1" Content="Feedback:" />
  50. <Label Grid.Row="5" Grid.Column="1" Content="Set Point:" />
  51. <Label Grid.Row="0" Grid.Column="2" Content="{Binding Path=DeviceData.DisplayName}" Width="150" Height="28" HorizontalAlignment="Left" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" VerticalContentAlignment="Center" />
  52. <Label Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Left" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="12" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center" >
  53. <StackPanel Orientation="Horizontal">
  54. <CheckBox x:Name="ckPosition" Content="Position" IsChecked="{Binding IsPositionMode}" VerticalContentAlignment="Center">
  55. <i:Interaction.Triggers>
  56. <i:EventTrigger EventName="Click">
  57. <micro:ActionMessage MethodName="SetPosition">
  58. </micro:ActionMessage>
  59. </i:EventTrigger>
  60. </i:Interaction.Triggers>
  61. </CheckBox>
  62. <CheckBox x:Name="ckPressure" Content="Pressure" IsChecked="{Binding IsPressureMode}" Margin="10,0,0,0" VerticalContentAlignment="Center">
  63. <i:Interaction.Triggers>
  64. <i:EventTrigger EventName="Click">
  65. <micro:ActionMessage MethodName="SetPressure">
  66. </micro:ActionMessage>
  67. </i:EventTrigger>
  68. </i:Interaction.Triggers>
  69. </CheckBox>
  70. </StackPanel>
  71. </Label>
  72. <Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=DeviceData.MaxValuePosition}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  73. Visibility="{Binding ElementName=ckPosition, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  74. <Label Grid.Row="2" Grid.Column="2" Content="{Binding Path=DeviceData.MaxValuePressure}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  75. Visibility="{Binding ElementName=ckPressure, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  76. <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=DeviceData.UnitPosition}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  77. Visibility="{Binding ElementName=ckPosition, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  78. <Label Grid.Row="3" Grid.Column="2" Content="{Binding Path=DeviceData.UnitPressure}" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  79. Visibility="{Binding ElementName=ckPressure, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  80. <Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=DeviceData.PositionFeedback}" ContentStringFormat="F1" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  81. Visibility="{Binding ElementName=ckPosition, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  82. <Label Grid.Row="4" Grid.Column="2" Content="{Binding Path=DeviceData.PressureFeedback}" ContentStringFormat="F1" Width="150" BorderThickness="0,0,0,1" BorderBrush="Black" FontSize="13" FontFamily="Arial,SimSun" Height="28" VerticalContentAlignment="Center"
  83. Visibility="{Binding ElementName=ckPressure, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  84. <controls:TextBoxEx Grid.Row="5" Grid.Column="2" x:Name="inputBoxPosition"
  85. AllowBackgroundChange="False" BorderBrush="Green" BorderThickness="0,0,0,1"
  86. TextChanged="InputTextBoxPosition_TextChanged" Width="150" HorizontalAlignment="Stretch"
  87. VerticalContentAlignment="Center"
  88. Text="{Binding Path=InputSetPointPosition, UpdateSourceTrigger=PropertyChanged}"
  89. Visibility="{Binding ElementName=ckPosition, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  90. <controls:TextBoxEx Grid.Row="5" Grid.Column="2" x:Name="inputBoxPressure"
  91. AllowBackgroundChange="False" BorderBrush="Green" BorderThickness="0,0,0,1"
  92. TextChanged="InputTextBoxPressure_TextChanged" Width="150" HorizontalAlignment="Stretch"
  93. Height="30" VerticalContentAlignment="Center"
  94. Text="{Binding Path=InputSetPointPressure, UpdateSourceTrigger=PropertyChanged}"
  95. Visibility="{Binding ElementName=ckPressure, Path=IsChecked, Converter={StaticResource BoolToValueConverter}, ConverterParameter=Visible, FallbackValue=Collapsed}"/>
  96. <StackPanel Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" Margin="0,10,0,0"
  97. VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Center">
  98. <Button IsEnabled="{Binding IsEnableSet}" x:Name="buttonSet" Content="Set" Width="90" Height="30">
  99. <i:Interaction.Triggers>
  100. <i:EventTrigger EventName="Click">
  101. <micro:ActionMessage MethodName="Set">
  102. </micro:ActionMessage>
  103. </i:EventTrigger>
  104. </i:Interaction.Triggers>
  105. </Button>
  106. <Button Content="Cancel" Margin="30,0,0,0" Width="90" Height="30">
  107. <i:Interaction.Triggers>
  108. <i:EventTrigger EventName="Click">
  109. <micro:ActionMessage MethodName="Cancel">
  110. </micro:ActionMessage>
  111. </i:EventTrigger>
  112. </i:Interaction.Triggers>
  113. </Button>
  114. <!--<CheckBox Margin="20,0,0,0" Content="Stick" IsChecked="{Binding IsSticked}" VerticalAlignment="Center" ></CheckBox>-->
  115. </StackPanel>
  116. </Grid>
  117. </Border>
  118. </UserControl>