CalibTool.xaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <UserControl x:Class="TeamAAS_VP.Views.Calibration.CalibTool"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:prism="http://prismlibrary.com/"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  7. xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
  8. xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
  9. xmlns:wf="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
  10. xmlns:vp="clr-namespace:Cognex.VisionPro;assembly=Cognex.VisionPro.Controls"
  11. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Calibration"
  12. xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
  13. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  14. lex:LocalizeDictionary.DesignCulture="zh-CN"
  15. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  16. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  17. prism:ViewModelLocator.AutoWireViewModel="True"
  18. mc:Ignorable="d"
  19. d:DataContext="{d:DesignInstance Type=vm:CalibToolViewModel}"
  20. d:Height="600"
  21. d:Width="1024"
  22. d:Background="White"
  23. MinHeight="700"
  24. MinWidth="700"
  25. FontFamily="{DynamicResource DefaultFont}">
  26. <prism:Dialog.WindowStyle>
  27. <Style TargetType="Window">
  28. <Setter Property="prism:Dialog.WindowStartupLocation"
  29. Value="CenterScreen" />
  30. <Setter Property="AllowDrop"
  31. Value="True" />
  32. <Setter Property="ShowInTaskbar"
  33. Value="True" />
  34. <!--<Setter Property="SizeToContent"
  35. Value="WidthAndHeight" />-->
  36. <!--<Setter Property="WindowState"
  37. Value="Maximized" />-->
  38. <Setter Property="Topmost"
  39. Value="True" />
  40. </Style>
  41. </prism:Dialog.WindowStyle>
  42. <materialDesign:DialogHost DialogTheme="Inherit"
  43. Identifier="CalibToolDialog">
  44. <Grid>
  45. <Grid.RowDefinitions>
  46. <RowDefinition Height="*" />
  47. <RowDefinition Height="auto" />
  48. <RowDefinition Height="auto" />
  49. <RowDefinition Height="auto" />
  50. </Grid.RowDefinitions>
  51. <wf:WindowsFormsHost Grid.Column="0">
  52. <vp:CogRecordDisplay x:Name="display" />
  53. </wf:WindowsFormsHost>
  54. <StackPanel Grid.Row="1"
  55. Orientation="Horizontal"
  56. HorizontalAlignment="Center"
  57. Margin="0,10">
  58. <TextBlock Text="{lex:Loc 机器人旋转角度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  59. VerticalAlignment="Center" />
  60. <mah:NumericUpDown x:Name="MotorAmplitudeNumeric1"
  61. Style="{StaticResource MahApps.Styles.NumericUpDown.DataGrid.Editing}"
  62. BorderThickness="0,0,0,1"
  63. StringFormat="{}{0:N1} °"
  64. MinWidth="100"
  65. Value="{Binding Angle,Mode=TwoWay}"
  66. Margin="10,0" />
  67. </StackPanel>
  68. <Button Grid.Row="2"
  69. MinWidth="150"
  70. MaxWidth="250"
  71. Margin="10,10"
  72. HorizontalAlignment="Center"
  73. VerticalAlignment="Center"
  74. materialDesign:ButtonAssist.CornerRadius="10"
  75. Style="{StaticResource MaterialDesignRaisedButton}"
  76. Command="{Binding StartCalibCommand}">
  77. <StackPanel Orientation="Horizontal">
  78. <materialDesign:PackIcon Kind="CrosshairsGps" />
  79. <TextBlock Text="{lex:Loc 开始校准Tool}"
  80. Margin="5,0" />
  81. </StackPanel>
  82. </Button>
  83. <StackPanel Grid.Row="3"
  84. Orientation="Horizontal"
  85. VerticalAlignment="Center"
  86. HorizontalAlignment="Right">
  87. <Button Height="30"
  88. Content="{lex:Loc 确定}"
  89. materialDesign:ButtonAssist.CornerRadius="10"
  90. ToolTip="{lex:Loc 确定}"
  91. Command="{Binding ConfirmCommand}">
  92. </Button>
  93. <Button Height="30"
  94. Margin="20,0"
  95. materialDesign:ButtonAssist.CornerRadius="10"
  96. Style="{StaticResource MaterialDesignRaisedButton}"
  97. ToolTip="{lex:Loc 取消}"
  98. Command="{Binding CancelCommand}">
  99. <TextBlock Text="{lex:Loc 取消}" />
  100. </Button>
  101. </StackPanel>
  102. </Grid>
  103. </materialDesign:DialogHost>
  104. </UserControl>