CalibrationTableView.xaml 8.3 KB

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