SystemPageView.xaml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <UserControl
  2. x:Class="ShakerManger.View.SystemPageView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:hc="https://handyorg.github.io/handycontrol"
  7. xmlns:local="clr-namespace:ShakerManger.View"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:model="clr-namespace:Shaker.Model;assembly=Shaker"
  10. xmlns:vm="clr-namespace:ShakerManger.ViewModel"
  11. d:DataContext="{d:DesignInstance {x:Type vm:SystemPageViewModel}}"
  12. d:DesignHeight="450"
  13. d:DesignWidth="800"
  14. DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data.SystemConfig.SystemPage}"
  15. IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
  16. mc:Ignorable="d">
  17. <UserControl.Style>
  18. <Style TargetType="UserControl">
  19. <Style.Triggers>
  20. <DataTrigger Binding="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=UserType}" Value="{x:Static model:UserType.SystemAdministrator}">
  21. <Setter Property="IsEnabled" Value="True" />
  22. </DataTrigger>
  23. <DataTrigger Binding="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=UserType}" Value="{x:Static model:UserType.ClientUser}">
  24. <Setter Property="IsEnabled" Value="False" />
  25. </DataTrigger>
  26. <DataTrigger Binding="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=UserType}" Value="{x:Static model:UserType.SystemUser}">
  27. <Setter Property="IsEnabled" Value="False" />
  28. </DataTrigger>
  29. </Style.Triggers>
  30. </Style>
  31. </UserControl.Style>
  32. <UniformGrid
  33. Margin="10"
  34. HorizontalAlignment="Center"
  35. VerticalAlignment="Top"
  36. Columns="1">
  37. <StackPanel Height="66" Orientation="Horizontal">
  38. <TextBlock
  39. HorizontalAlignment="Center"
  40. VerticalAlignment="Center"
  41. FontSize="14"
  42. Text="采集间隔时间:" />
  43. <hc:NumericUpDown
  44. Width="120"
  45. Height="32"
  46. Margin="4,0,0,0"
  47. Background="Transparent"
  48. CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
  49. FontSize="14"
  50. Minimum="10"
  51. Value="{Binding LoopTime}" />
  52. <TextBlock
  53. HorizontalAlignment="Center"
  54. VerticalAlignment="Center"
  55. FontSize="14"
  56. Text="ms" />
  57. </StackPanel>
  58. <StackPanel Margin="0,0,0,0" Orientation="Horizontal">
  59. <TextBlock
  60. HorizontalAlignment="Center"
  61. VerticalAlignment="Center"
  62. FontSize="14"
  63. Text="权限申请超时时间:" />
  64. <hc:NumericUpDown
  65. Width="120"
  66. Height="32"
  67. Margin="4,0,0,0"
  68. Background="Transparent"
  69. CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
  70. FontSize="14"
  71. Minimum="1000"
  72. Value="{Binding RequestPermissionsTimeout, Mode=TwoWay}" />
  73. <TextBlock
  74. HorizontalAlignment="Center"
  75. VerticalAlignment="Center"
  76. FontSize="14"
  77. Text="ms" />
  78. </StackPanel>
  79. <StackPanel Margin="0,0,0,0" Orientation="Horizontal">
  80. <TextBlock
  81. HorizontalAlignment="Center"
  82. VerticalAlignment="Center"
  83. FontSize="14"
  84. Text="振动台启动超时时间:" />
  85. <hc:NumericUpDown
  86. Width="120"
  87. Height="32"
  88. Margin="4,0,0,0"
  89. Background="Transparent"
  90. CaretBrush="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Foreground}"
  91. FontSize="14"
  92. Maximum="12000"
  93. Minimum="10"
  94. Value="{Binding StartShakerTimeOut, Mode=TwoWay}" />
  95. <TextBlock
  96. HorizontalAlignment="Center"
  97. VerticalAlignment="Center"
  98. FontSize="14"
  99. Foreground="White"
  100. Text="s" />
  101. </StackPanel>
  102. <Button
  103. Height="42"
  104. hc:IconElement.Geometry="{StaticResource SaveGeometry}"
  105. hc:IconElement.Height="20"
  106. hc:IconElement.Width="20"
  107. Command="{Binding SaveCommand}"
  108. Content="保存"
  109. FontSize="16"
  110. Style="{StaticResource HasIconButton}" />
  111. </UniformGrid>
  112. </UserControl>