AddScrewFeeder.xaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <UserControl x:Class="TeamAAS_VP.Views.Setting.AddScrewFeeder"
  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:sys="clr-namespace:System;assembly=mscorlib"
  10. xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
  11. xmlns:convert="clr-namespace:TeamAAS_VP.ValueConverter"
  12. xmlns:valRules="clr-namespace:TeamAAS_VP.Identity"
  13. xmlns:validationRule="clr-namespace:TeamAAS_VP.ValidationRules"
  14. xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
  15. xmlns:lex="http://wpflocalizeextension.codeplex.com"
  16. xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Setting"
  17. lex:LocalizeDictionary.DesignCulture="zh-CN"
  18. lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
  19. lex:ResxLocalizationProvider.DefaultDictionary="Lang"
  20. mc:Ignorable="d"
  21. d:Background="White"
  22. d:DataContext="{d:DesignInstance Type=vm:AddScrewFeederViewModel}"
  23. prism:ViewModelLocator.AutoWireViewModel="True"
  24. FontFamily="{DynamicResource DefaultFont}">
  25. <prism:Dialog.WindowStyle>
  26. <Style TargetType="Window">
  27. <Setter Property="prism:Dialog.WindowStartupLocation"
  28. Value="CenterScreen" />
  29. <Setter Property="WindowStyle"
  30. Value="None" />
  31. <Setter Property="AllowDrop"
  32. Value="True" />
  33. <Setter Property="BorderThickness"
  34. Value="0" />
  35. <Setter Property="ShowInTaskbar"
  36. Value="False" />
  37. <Setter Property="SizeToContent"
  38. Value="WidthAndHeight" />
  39. <Setter Property="WindowState"
  40. Value="Normal" />
  41. <Setter Property="Topmost"
  42. Value="True" />
  43. </Style>
  44. </prism:Dialog.WindowStyle>
  45. <Grid HorizontalAlignment="Center">
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="*" />
  48. <RowDefinition Height="50" />
  49. </Grid.RowDefinitions>
  50. <!--参数详情-->
  51. <Grid Margin="20,20">
  52. <!-- 布局:两列,左侧标签固定宽度,右侧输入占满 -->
  53. <Grid.ColumnDefinitions>
  54. <ColumnDefinition Width="140" />
  55. <ColumnDefinition Width="*" MinWidth="150"/>
  56. </Grid.ColumnDefinitions>
  57. <Grid.RowDefinitions>
  58. <RowDefinition Height="36" /> <!-- 名称 -->
  59. </Grid.RowDefinitions>
  60. <!-- 名称 -->
  61. <TextBlock Grid.Row="0"
  62. Grid.Column="0"
  63. VerticalAlignment="Center"
  64. Foreground="{DynamicResource PrimaryHueMidBrush}"
  65. Text="{lex:Loc 名称}" />
  66. <TextBox x:Name="txt_Name"
  67. Grid.Row="0"
  68. Grid.Column="1"
  69. VerticalContentAlignment="Center"
  70. Margin="0,4,0,4"
  71. materialDesign:HintAssist.Hint="请填写名称"
  72. Text="{Binding SelectedScrewFeeder.Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" />
  73. </Grid>
  74. <StackPanel Grid.Row="1"
  75. Orientation="Horizontal"
  76. HorizontalAlignment="Right">
  77. <Button Height="30"
  78. materialDesign:ButtonAssist.CornerRadius="10"
  79. ToolTip="{lex:Loc 确定}"
  80. Command="{Binding ConfirmCommand}">
  81. <TextBlock Text="{lex:Loc 确定}" />
  82. <Button.Style>
  83. <Style TargetType="Button"
  84. BasedOn="{StaticResource MaterialDesignRaisedButton}">
  85. <Style.Triggers>
  86. <MultiDataTrigger>
  87. <MultiDataTrigger.Conditions>
  88. <!-- 当且仅当名称和端口无校验错误时,启用按钮 -->
  89. <Condition Binding="{Binding ElementName=txt_Name, Path=(Validation.HasError)}"
  90. Value="False" />
  91. <Condition Binding="{Binding ElementName=txt_Port, Path=(Validation.HasError)}"
  92. Value="False" />
  93. </MultiDataTrigger.Conditions>
  94. <Setter Property="IsEnabled"
  95. Value="True" />
  96. </MultiDataTrigger>
  97. </Style.Triggers>
  98. </Style>
  99. </Button.Style>
  100. </Button>
  101. <Button Height="30"
  102. Margin="20,0"
  103. materialDesign:ButtonAssist.CornerRadius="10"
  104. Style="{StaticResource MaterialDesignRaisedButton}"
  105. ToolTip="{lex:Loc 取消}"
  106. Command="{Binding CancelCommand}">
  107. <TextBlock Text="{lex:Loc 取消}" />
  108. </Button>
  109. </StackPanel>
  110. </Grid>
  111. </UserControl>