mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 02:23:01 +08:00
476 lines
24 KiB
XML
476 lines
24 KiB
XML
<UserControl
|
|
x:Class="MaaWpfGui.Views.UserControl.Settings.TimerSettingsUserControl"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
|
|
xmlns:controls="clr-namespace:MaaWpfGui.Styles.Controls"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:dd="urn:gong-wpf-dragdrop"
|
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
|
xmlns:helper="clr-namespace:MaaWpfGui.Helper"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:s="https://github.com/canton7/Stylet"
|
|
xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels.UserControl.Settings"
|
|
d:Background="White"
|
|
d:DataContext="{d:DesignInstance {x:Type viewModels:TimerSettingsUserControlModel}}"
|
|
d:DesignHeight="450"
|
|
s:View.ActionTarget="{Binding}"
|
|
mc:Ignorable="d">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<controls:TextBlock
|
|
Grid.Row="0"
|
|
HorizontalAlignment="Center"
|
|
FontWeight="Bold"
|
|
Text="{DynamicResource GlobalConfigTip}"
|
|
TextAlignment="Center"
|
|
Visibility="{c:Binding 'ConfigurationList.Count > 1',
|
|
Source={x:Static helper:Instances.SettingsViewModel}}" />
|
|
<StackPanel
|
|
Grid.Row="1"
|
|
HorizontalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Height="30"
|
|
Margin="5,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Content="{DynamicResource ForceScheduledStart}"
|
|
IsChecked="{Binding ForceScheduledStart}"
|
|
ToolTip="{DynamicResource ForceScheduledStartTip}" />
|
|
<CheckBox
|
|
Height="30"
|
|
Margin="5,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Content="{DynamicResource TimerCustomConfig}"
|
|
IsChecked="{Binding CustomConfig}"
|
|
ToolTip="{DynamicResource TimerCustomConfigTip}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel
|
|
Grid.Row="2"
|
|
HorizontalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Height="30"
|
|
Margin="5,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalContentAlignment="Center"
|
|
Content="{DynamicResource ShowWindowBeforeForceScheduledStart}"
|
|
IsChecked="{Binding ShowWindowBeforeForceScheduledStart}"
|
|
Visibility="{c:Binding ForceScheduledStart}" />
|
|
</StackPanel>
|
|
|
|
<Grid Grid.Row="3">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
<RowDefinition />
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
|
|
<StackPanel Grid.Row="0" Grid.Column="0">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Margin="10"
|
|
Content="{Binding TimerModels.Timers[0].TimerName}"
|
|
IsChecked="{Binding TimerModels.Timers[0].IsOn}"
|
|
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
|
|
Target={x:Type helper:CheckBoxHelper}}"
|
|
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="0"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[0].IsOn}"
|
|
Maximum="23"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[0].Hour}" />
|
|
<controls:TextBlock Text=":" />
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="0"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[0].IsOn}"
|
|
Maximum="59"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[0].Min}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Focusable="False"
|
|
IsEnabled="{Binding Idle, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
ItemsSource="{Binding ConfigurationList, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
SelectedValue="{Binding TimerModels.Timers[0].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
ToolTip="{Binding TimerModels.Timers[0].TimerConfig}"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="1" Grid.Column="0">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Margin="10"
|
|
Content="{Binding TimerModels.Timers[1].TimerName}"
|
|
IsChecked="{Binding TimerModels.Timers[1].IsOn}"
|
|
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
|
|
Target={x:Type helper:CheckBoxHelper}}"
|
|
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="3"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[1].IsOn}"
|
|
Maximum="23"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[1].Hour}" />
|
|
<controls:TextBlock Text=":" />
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="5"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[1].IsOn}"
|
|
Maximum="59"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[1].Min}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Focusable="False"
|
|
IsEnabled="{Binding Idle, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
ItemsSource="{Binding ConfigurationList, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
SelectedValue="{Binding TimerModels.Timers[1].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
ToolTip="{Binding TimerModels.Timers[1].TimerConfig}"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="2" Grid.Column="0">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Margin="10"
|
|
Content="{Binding TimerModels.Timers[2].TimerName}"
|
|
IsChecked="{Binding TimerModels.Timers[2].IsOn}"
|
|
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
|
|
Target={x:Type helper:CheckBoxHelper}}"
|
|
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="6"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[2].IsOn}"
|
|
Maximum="23"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[2].Hour}" />
|
|
<controls:TextBlock Text=":" />
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[2].IsOn}"
|
|
Maximum="59"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[2].Min}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Focusable="False"
|
|
IsEnabled="{Binding Idle, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
ItemsSource="{Binding ConfigurationList, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
SelectedValue="{Binding TimerModels.Timers[2].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
ToolTip="{Binding TimerModels.Timers[2].TimerConfig}"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="3" Grid.Column="0">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Margin="10"
|
|
Content="{Binding TimerModels.Timers[3].TimerName}"
|
|
IsChecked="{Binding TimerModels.Timers[3].IsOn}"
|
|
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
|
|
Target={x:Type helper:CheckBoxHelper}}"
|
|
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="9"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[3].IsOn}"
|
|
Maximum="23"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[3].Hour}" />
|
|
<controls:TextBlock Text=":" />
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="15"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[3].IsOn}"
|
|
Maximum="59"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[3].Min}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Focusable="False"
|
|
IsEnabled="{Binding Idle, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
ItemsSource="{Binding ConfigurationList, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
SelectedValue="{Binding TimerModels.Timers[3].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
ToolTip="{Binding TimerModels.Timers[3].TimerConfig}"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="0" Grid.Column="1">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Margin="10"
|
|
Content="{Binding TimerModels.Timers[4].TimerName}"
|
|
IsChecked="{Binding TimerModels.Timers[4].IsOn}"
|
|
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
|
|
Target={x:Type helper:CheckBoxHelper}}"
|
|
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="12"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[4].IsOn}"
|
|
Maximum="23"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[4].Hour}" />
|
|
<controls:TextBlock Text=":" />
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="20"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[4].IsOn}"
|
|
Maximum="59"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[4].Min}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Focusable="False"
|
|
IsEnabled="{Binding Idle, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
ItemsSource="{Binding ConfigurationList, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
SelectedValue="{Binding TimerModels.Timers[4].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
ToolTip="{Binding TimerModels.Timers[4].TimerConfig}"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="1" Grid.Column="1">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Margin="10"
|
|
Content="{Binding TimerModels.Timers[5].TimerName}"
|
|
IsChecked="{Binding TimerModels.Timers[5].IsOn}"
|
|
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
|
|
Target={x:Type helper:CheckBoxHelper}}"
|
|
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="15"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[5].IsOn}"
|
|
Maximum="23"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[5].Hour}" />
|
|
<controls:TextBlock Text=":" />
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="30"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[5].IsOn}"
|
|
Maximum="59"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[5].Min}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Focusable="False"
|
|
IsEnabled="{Binding Idle, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
ItemsSource="{Binding ConfigurationList, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
SelectedValue="{Binding TimerModels.Timers[5].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
ToolTip="{Binding TimerModels.Timers[5].TimerConfig}"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="2" Grid.Column="1">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Margin="10"
|
|
Content="{Binding TimerModels.Timers[6].TimerName}"
|
|
IsChecked="{Binding TimerModels.Timers[6].IsOn}"
|
|
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
|
|
Target={x:Type helper:CheckBoxHelper}}"
|
|
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="18"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[6].IsOn}"
|
|
Maximum="23"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[6].Hour}" />
|
|
<controls:TextBlock Text=":" />
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="40"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[6].IsOn}"
|
|
Maximum="59"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[6].Min}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Focusable="False"
|
|
IsEnabled="{Binding Idle, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
ItemsSource="{Binding ConfigurationList, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
SelectedValue="{Binding TimerModels.Timers[6].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
ToolTip="{Binding TimerModels.Timers[6].TimerConfig}"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="3" Grid.Column="1">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox
|
|
Margin="10"
|
|
Content="{Binding TimerModels.Timers[7].TimerName}"
|
|
IsChecked="{Binding TimerModels.Timers[7].IsOn}"
|
|
MouseRightButtonUp="{s:Action ToggleCheckBoxNullOnRightClick,
|
|
Target={x:Type helper:CheckBoxHelper}}"
|
|
ToolTip="{DynamicResource CheckBoxesNotSaved}" />
|
|
<StackPanel Orientation="Horizontal">
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="21"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[7].IsOn}"
|
|
Maximum="23"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[7].Hour}" />
|
|
<controls:TextBlock Text=":" />
|
|
<hc:NumericUpDown
|
|
Width="55"
|
|
Margin="10"
|
|
d:Value="50"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsEnabled="{c:Binding TimerModels.Timers[7].IsOn}"
|
|
Maximum="59"
|
|
Minimum="0"
|
|
ValueFormat="00"
|
|
Value="{Binding TimerModels.Timers[7].Min}" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Focusable="False"
|
|
IsEnabled="{Binding Idle, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
ItemsSource="{Binding ConfigurationList, Source={x:Static helper:Instances.SettingsViewModel}}"
|
|
SelectedValue="{Binding TimerModels.Timers[7].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
ToolTip="{Binding TimerModels.Timers[7].TimerConfig}"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|