CalibTool.xaml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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:Background="White"
  21. Width="1024"
  22. Height="768"
  23. FontFamily="{DynamicResource DefaultFont}">
  24. <prism:Dialog.WindowStyle>
  25. <Style TargetType="Window">
  26. <Setter Property="prism:Dialog.WindowStartupLocation"
  27. Value="CenterScreen" />
  28. <Setter Property="AllowDrop"
  29. Value="True" />
  30. <Setter Property="ShowInTaskbar"
  31. Value="True" />
  32. <Setter Property="Width"
  33. Value="1024" />
  34. <Setter Property="Height"
  35. Value="768" />
  36. <!--<Setter Property="SizeToContent"
  37. Value="WidthAndHeight" />-->
  38. <!--<Setter Property="WindowState"
  39. Value="Maximized" />-->
  40. <Setter Property="Topmost"
  41. Value="True" />
  42. </Style>
  43. </prism:Dialog.WindowStyle>
  44. <materialDesign:DialogHost DialogTheme="Inherit"
  45. Identifier="CalibToolDialog">
  46. <Grid>
  47. <Grid.RowDefinitions>
  48. <RowDefinition Height="*" />
  49. <RowDefinition Height="auto" />
  50. <RowDefinition Height="auto" />
  51. <RowDefinition Height="auto" />
  52. </Grid.RowDefinitions>
  53. <wf:WindowsFormsHost>
  54. <vp:CogRecordDisplay x:Name="display" />
  55. </wf:WindowsFormsHost>
  56. <StackPanel Grid.Row="1"
  57. Orientation="Horizontal"
  58. HorizontalAlignment="Center"
  59. Margin="0,10">
  60. <TextBlock Text="{lex:Loc 机器人旋转角度,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
  61. VerticalAlignment="Center" />
  62. <mah:NumericUpDown x:Name="MotorAmplitudeNumeric1"
  63. Style="{StaticResource MahApps.Styles.NumericUpDown.DataGrid.Editing}"
  64. BorderThickness="0,0,0,1"
  65. StringFormat="{}{0:N1} °"
  66. MinWidth="100"
  67. Value="{Binding Angle,Mode=TwoWay}"
  68. Margin="10,0" />
  69. </StackPanel>
  70. <Button Grid.Row="2"
  71. MinWidth="150"
  72. MaxWidth="250"
  73. Margin="10,10"
  74. HorizontalAlignment="Center"
  75. VerticalAlignment="Center"
  76. materialDesign:ButtonAssist.CornerRadius="10"
  77. Style="{StaticResource MaterialDesignRaisedButton}"
  78. Command="{Binding StartCalibCommand}">
  79. <StackPanel Orientation="Horizontal">
  80. <materialDesign:PackIcon Kind="CrosshairsGps" />
  81. <TextBlock Text="{lex:Loc 开始校准Tool}"
  82. Margin="5,0" />
  83. </StackPanel>
  84. </Button>
  85. <StackPanel Grid.Row="3"
  86. Orientation="Horizontal"
  87. VerticalAlignment="Center"
  88. HorizontalAlignment="Right">
  89. <Button Height="30"
  90. Content="{lex:Loc 确定}"
  91. materialDesign:ButtonAssist.CornerRadius="10"
  92. ToolTip="{lex:Loc 确定}"
  93. Command="{Binding ConfirmCommand}">
  94. </Button>
  95. <Button Height="30"
  96. Margin="20,0"
  97. materialDesign:ButtonAssist.CornerRadius="10"
  98. Style="{StaticResource MaterialDesignRaisedButton}"
  99. ToolTip="{lex:Loc 取消}"
  100. Command="{Binding CancelCommand}">
  101. <TextBlock Text="{lex:Loc 取消}" />
  102. </Button>
  103. </StackPanel>
  104. </Grid>
  105. </materialDesign:DialogHost>
  106. </UserControl>