OtherSettings.xaml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <UserControl x:Class="HistoryView.Views.Regions.SettingSubs.OtherSettings"
  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:local="clr-namespace:HistoryView.Views.Regions.SettingSubs"
  7. xmlns:prism="http://prismlibrary.com/"
  8. prism:ViewModelLocator.AutoWireViewModel="True"
  9. xmlns:Inputs="clr-namespace:HistoryView.Controls.Input"
  10. xmlns:conterter="clr-namespace:HistoryView.Converters"
  11. mc:Ignorable="d"
  12. d:DesignHeight="450" d:DesignWidth="800">
  13. <UserControl.Resources>
  14. <conterter:RunningModeToBool x:Key="StateConvert"/>
  15. <conterter:SizeConvert x:Key="Size"/>
  16. <conterter:AuthorityToVis x:Key="Authority"/>
  17. </UserControl.Resources>
  18. <Grid>
  19. <Grid.RowDefinitions>
  20. <RowDefinition Height="auto"/>
  21. <RowDefinition Height="0"/>
  22. <RowDefinition Height="auto"/>
  23. <RowDefinition Height="0"/>
  24. <RowDefinition Height="auto"/>
  25. <RowDefinition Height="32"/>
  26. </Grid.RowDefinitions>
  27. <GroupBox Visibility="{Binding UserInfo.Authority, Converter={StaticResource Authority}, ConverterParameter=Operator}" Margin="0,0,0,32">
  28. <GroupBox.Header>
  29. <TextBlock FontSize="14" FontWeight="Bold" Text="重置全部链接"/>
  30. </GroupBox.Header>
  31. <Button Style="{StaticResource FunctionButton}" Command="{Binding SwitchDataBaseCommand}" CommandParameter="Reset" Margin="16" HorizontalAlignment="Left" Height="32" Content="重置" Width="120"/>
  32. </GroupBox>
  33. <GroupBox Grid.Row="2" Margin="0,0,0,32">
  34. <GroupBox.Header>
  35. <TextBlock FontSize="14" FontWeight="Bold" Text="数据库"/>
  36. </GroupBox.Header>
  37. <Grid Margin="16">
  38. <Grid.ColumnDefinitions>
  39. <ColumnDefinition Width="auto"/>
  40. <ColumnDefinition Width="32"/>
  41. <ColumnDefinition Width="auto"/>
  42. <ColumnDefinition Width="64"/>
  43. <ColumnDefinition Width="auto"/>
  44. <ColumnDefinition/>
  45. </Grid.ColumnDefinitions>
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="auto"/>
  48. <RowDefinition Height="16"/>
  49. <RowDefinition Height="auto"/>
  50. <RowDefinition Height="16"/>
  51. <RowDefinition Height="auto"/>
  52. </Grid.RowDefinitions>
  53. <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center">历史保留时间:</TextBlock>
  54. <StackPanel Grid.Row="0" Grid.Column="2" Orientation="Horizontal">
  55. <Inputs:NumberKeyboard Text="{Binding DatabaseCleaner.KeepRange, Mode=TwoWay}">
  56. <Inputs:NumberKeyboard.DisplayContent>
  57. <TextBox MinWidth="100" Background="#f8f8f8" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" BorderThickness="0" Height="24"
  58. Text="{Binding DatabaseCleaner.KeepRange, Mode=TwoWay}"/>
  59. </Inputs:NumberKeyboard.DisplayContent>
  60. </Inputs:NumberKeyboard>
  61. <TextBlock Margin="4,0" VerticalAlignment="Center" HorizontalAlignment="Center">天</TextBlock>
  62. </StackPanel>
  63. <Button Grid.Row="0" Grid.Column="4" Height="32" Width="120"
  64. Style="{StaticResource FunctionButton}"
  65. Command="{Binding SwitchDataBaseCommand}" CommandParameter="Range" Content="{DynamicResource Save}"/>
  66. <TextBlock Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left">上次检查时间:</TextBlock>
  67. <TextBlock Grid.Row="2" Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Left" Text="{Binding DatabaseCleaner.LastCheckDate, StringFormat=yyyy/MM/dd HH:mm:ss}"/>
  68. <Button Grid.Row="2" Grid.Column="4" Height="32" Width="120"
  69. Style="{StaticResource FunctionButton}"
  70. Command="{Binding SwitchDataBaseCommand}" CommandParameter="Delete" Content="手动检查"/>
  71. <Button Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4" VerticalAlignment="Center" HorizontalAlignment="Left" Height="32" Width="120"
  72. Style="{StaticResource FunctionButton}"
  73. Background="{StaticResource WarningColor}"
  74. Visibility="{Binding UserInfo.Authority, Converter={StaticResource Authority}, ConverterParameter=Engineer}"
  75. Command="{Binding SwitchDataBaseCommand}" CommandParameter="SwitchDataBase" Content="切换至新数据库"/>
  76. </Grid>
  77. </GroupBox>
  78. <GroupBox Grid.Row="4" Margin="0,0,0,32">
  79. <GroupBox.Header>
  80. <TextBlock FontSize="14" FontWeight="Bold" Text="{DynamicResource MonitorSelection}"/>
  81. </GroupBox.Header>
  82. <ItemsControl ItemsSource="{Binding Monitor.Monitors}">
  83. <ItemsControl.ItemTemplate>
  84. <DataTemplate>
  85. <RadioButton GroupName="1" Style="{StaticResource ThemeRadioButton}" Margin="8" VerticalAlignment="Top" HorizontalAlignment="Center"
  86. Command="{Binding RelativeSource={RelativeSource AncestorType=local:OtherSettings, Mode=FindAncestor}, Path=DataContext.DisplaySelectCommand}"
  87. CommandParameter="{Binding Key}" >
  88. <Grid Width="{Binding Value.ResolutionHorizontal, Mode=OneWay, Converter={StaticResource Size}, ConverterParameter=16}" Height="{Binding Value.ResolutionVertical, Mode=OneWay, Converter={StaticResource Size}, ConverterParameter=16}">
  89. <TextBlock Text="{Binding Value.ResolutionHorizontal, Mode=OneWay}" VerticalAlignment="Top" HorizontalAlignment="Center" Foreground="{StaticResource TextColor}"/>
  90. <TextBlock Text="{Binding Value.ResolutionVertical, Mode=OneWay}" VerticalAlignment="Center" HorizontalAlignment="Left" Foreground="{StaticResource TextColor}">
  91. <TextBlock.LayoutTransform>
  92. <RotateTransform Angle="270"></RotateTransform>
  93. </TextBlock.LayoutTransform>
  94. </TextBlock>
  95. <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" FontSize="16" Foreground="{StaticResource TextColor}">
  96. <!--<Run>Display</Run>-->
  97. <Run Text="{Binding Key, Mode=OneWay}"/>
  98. </TextBlock>
  99. </Grid>
  100. </RadioButton>
  101. </DataTemplate>
  102. </ItemsControl.ItemTemplate>
  103. <ItemsControl.ItemsPanel>
  104. <ItemsPanelTemplate>
  105. <StackPanel Orientation="Horizontal"/>
  106. </ItemsPanelTemplate>
  107. </ItemsControl.ItemsPanel>
  108. </ItemsControl>
  109. </GroupBox>
  110. </Grid>
  111. </UserControl>