CalibrationTableView.xaml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <UserControl x:Class="VirgoUI.Client.Models.PMs.CalibrationTableView"
  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:i="http://schemas.microsoft.com/expression/2010/interactivity"
  7. xmlns:micro="http://www.caliburn.org"
  8. xmlns:local="clr-namespace:VirgoUI.Client.Models.PMs"
  9. xmlns:controls="http://OpenSEMI.Ctrlib.com/presentation"
  10. mc:Ignorable="d"
  11. d:DesignHeight="450" d:DesignWidth="800">
  12. <Grid>
  13. <Grid.ColumnDefinitions>
  14. <ColumnDefinition Width="300"/>
  15. <ColumnDefinition Width="*"/>
  16. </Grid.ColumnDefinitions>
  17. <DataGrid Grid.Column="0" HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"
  18. VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
  19. SelectedItem="{Binding CurrentSelection}"
  20. ItemsSource="{Binding CalibrationItems}" Margin="0,5,0,0" >
  21. <DataGrid.Columns>
  22. <DataGridTemplateColumn Header="Name" Width="280">
  23. <DataGridTemplateColumn.CellTemplate>
  24. <DataTemplate>
  25. <TextBlock Text="{Binding DisplayName}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
  26. </TextBlock>
  27. </DataTemplate>
  28. </DataGridTemplateColumn.CellTemplate>
  29. </DataGridTemplateColumn>
  30. </DataGrid.Columns>
  31. </DataGrid>
  32. <Grid Grid.Column="1">
  33. <Grid.RowDefinitions>
  34. <RowDefinition Height="50"/>
  35. <RowDefinition Height="30"/>
  36. <RowDefinition Height="50"/>
  37. <RowDefinition Height="*"/>
  38. </Grid.RowDefinitions>
  39. <Canvas Grid.Row="0">
  40. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="1,1,1,1" Background="{DynamicResource Table_BG_Title}" Grid.Row="1" Padding="5,1" Height="40" Width="120">
  41. <TextBlock Text="Calibration Item" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
  42. </Border>
  43. <Border BorderBrush="{DynamicResource Table_BD}" BorderThickness="0,1,1,1" Background="{DynamicResource Table_BG_Content}" Grid.Row="1" Grid.Column="1" Padding="5,1" Canvas.Left="120" Height="40" Width="250">
  44. <TextBlock Text="{Binding CurrentSelection.DisplayName}" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center"/>
  45. </Border>
  46. <Button Content="Save" Grid.Column="1" Width="70" Height="30" Margin="0" Padding="0" Canvas.Left="385" Canvas.Top="4" >
  47. <i:Interaction.Triggers>
  48. <i:EventTrigger EventName="Click">
  49. <micro:ActionMessage MethodName="Save">
  50. </micro:ActionMessage>
  51. </i:EventTrigger>
  52. </i:Interaction.Triggers>
  53. </Button>
  54. <Button Content="Cancel" Grid.Column="1" Width="70" Height="30" Margin="0" Padding="0" Canvas.Left="473" Canvas.Top="4" >
  55. <i:Interaction.Triggers>
  56. <i:EventTrigger EventName="Click">
  57. <micro:ActionMessage MethodName="Cancel">
  58. </micro:ActionMessage>
  59. </i:EventTrigger>
  60. </i:Interaction.Triggers>
  61. </Button>
  62. </Canvas>
  63. <Canvas Grid.Row="1" VerticalAlignment="Bottom">
  64. <TextBlock Text="Setpoint Value:" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center" Canvas.Left="1" Canvas.Top="-21" />
  65. <TextBlock Text="Calibration Value:" TextWrapping="Wrap" Foreground="{DynamicResource FG_Black}" FontSize="12" FontFamily="Arial" VerticalAlignment="Center" Canvas.Left="210" Canvas.Top="-21" />
  66. </Canvas>
  67. <Canvas Grid.Row="2">
  68. <controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding Path=FeedbackValue, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch" RenderTransformOrigin="3.857,1.5" Height="40" Width="160" Canvas.Left="1" />
  69. <controls:TextBoxEx AllowBackgroundChange="False" Text="{Binding Path=CalibrationValue, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Stretch" RenderTransformOrigin="3.857,1.5" Canvas.Left="208" Height="40" Width="160" />
  70. <Button Content="Add" Grid.Column="1" Width="70" Height="30" Margin="0" Padding="0" Canvas.Left="389" Canvas.Top="5" >
  71. <i:Interaction.Triggers>
  72. <i:EventTrigger EventName="Click">
  73. <micro:ActionMessage MethodName="Add">
  74. </micro:ActionMessage>
  75. </i:EventTrigger>
  76. </i:Interaction.Triggers>
  77. </Button>
  78. </Canvas>
  79. <DataGrid Grid.Row="3" HorizontalAlignment="Left" CanUserAddRows="False" AutoGenerateColumns="False" RowHeaderWidth="0"
  80. VirtualizingPanel.IsVirtualizing="True" VirtualizingPanel.VirtualizationMode="Recycling"
  81. ItemsSource="{Binding TableData}" Margin="0,5,0,0" >
  82. <DataGrid.Columns>
  83. <DataGridTemplateColumn Header="Setpoint Value" Width="280">
  84. <DataGridTemplateColumn.CellTemplate>
  85. <DataTemplate>
  86. <TextBlock Text="{Binding FeedbackValue}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
  87. </TextBlock>
  88. </DataTemplate>
  89. </DataGridTemplateColumn.CellTemplate>
  90. </DataGridTemplateColumn>
  91. <DataGridTemplateColumn Header="Calibration Value" Width="280">
  92. <DataGridTemplateColumn.CellTemplate>
  93. <DataTemplate>
  94. <TextBlock Text="{Binding CalibrationValue}" Margin="5,0" FontFamily="Arial" FontSize="14" Foreground="{DynamicResource FG_Black}" HorizontalAlignment="Left" VerticalAlignment="Center" >
  95. </TextBlock>
  96. </DataTemplate>
  97. </DataGridTemplateColumn.CellTemplate>
  98. </DataGridTemplateColumn>
  99. <DataGridTemplateColumn Header=" " Width="280">
  100. <DataGridTemplateColumn.CellTemplate>
  101. <DataTemplate>
  102. <Button Content="Delete" Width="100" Height="25" FontSize="14">
  103. <i:Interaction.Triggers>
  104. <i:EventTrigger EventName="Click">
  105. <micro:ActionMessage MethodName="DeleteItem">
  106. <micro:Parameter Value="{Binding }" />
  107. </micro:ActionMessage>
  108. </i:EventTrigger>
  109. </i:Interaction.Triggers>
  110. </Button>
  111. </DataTemplate>
  112. </DataGridTemplateColumn.CellTemplate>
  113. </DataGridTemplateColumn>
  114. </DataGrid.Columns>
  115. </DataGrid>
  116. </Grid>
  117. </Grid>
  118. </UserControl>