mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-19 18:47:55 +08:00
443 lines
21 KiB
XML
443 lines
21 KiB
XML
<UserControl
|
|
x:Class="MaaWpfGui.Views.UserControl.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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:s="https://github.com/canton7/Stylet"
|
|
xmlns:styles="clr-namespace:MaaWpfGui.Styles"
|
|
xmlns:ui="clr-namespace:MaaWpfGui.ViewModels.UI"
|
|
xmlns:viewModels="clr-namespace:MaaWpfGui.ViewModels"
|
|
xmlns:vm="clr-namespace:MaaWpfGui"
|
|
d:DataContext="{d:DesignInstance {x:Type ui:SettingsViewModel}}"
|
|
d:DesignHeight="450"
|
|
d:DesignWidth="800"
|
|
mc:Ignorable="d">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
<controls:TextBlock
|
|
Grid.Row="0"
|
|
HorizontalAlignment="Center"
|
|
FontWeight="Bold"
|
|
Text="{DynamicResource TimerTip}"
|
|
TextAlignment="Center" />
|
|
<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>
|
|
|
|
<Grid Grid.Row="2">
|
|
<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" IsChecked="{Binding TimerModels.Timers[0].IsOn}">
|
|
<CheckBox.Content>
|
|
<controls:TextBlock>
|
|
<controls:TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} 1">
|
|
<Binding Source="{StaticResource Timer}" />
|
|
</MultiBinding>
|
|
</controls:TextBlock.Text>
|
|
</controls:TextBlock>
|
|
</CheckBox.Content>
|
|
</CheckBox>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[0].IsOn}"
|
|
Text="{Binding TimerModels.Timers[0].Hour, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
<controls:TextBlock Text=":" />
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[0].IsOn}"
|
|
Text="{Binding TimerModels.Timers[0].Min, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
IsEditable="True"
|
|
IsHitTestVisible="{Binding Idle}"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ConfigurationList}"
|
|
SelectedValue="{Binding TimerModels.Timers[0].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="1" Grid.Column="0">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[1].IsOn}">
|
|
<CheckBox.Content>
|
|
<controls:TextBlock>
|
|
<controls:TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} 2">
|
|
<Binding Source="{StaticResource Timer}" />
|
|
</MultiBinding>
|
|
</controls:TextBlock.Text>
|
|
</controls:TextBlock>
|
|
</CheckBox.Content>
|
|
</CheckBox>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[1].IsOn}"
|
|
Text="{Binding TimerModels.Timers[1].Hour, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
<controls:TextBlock Text=":" />
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[1].IsOn}"
|
|
Text="{Binding TimerModels.Timers[1].Min, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
IsEditable="True"
|
|
IsHitTestVisible="{Binding Idle}"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ConfigurationList}"
|
|
SelectedValue="{Binding TimerModels.Timers[1].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="2" Grid.Column="0">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[2].IsOn}">
|
|
<CheckBox.Content>
|
|
<controls:TextBlock>
|
|
<controls:TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} 3">
|
|
<Binding Source="{StaticResource Timer}" />
|
|
</MultiBinding>
|
|
</controls:TextBlock.Text>
|
|
</controls:TextBlock>
|
|
</CheckBox.Content>
|
|
</CheckBox>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[2].IsOn}"
|
|
Text="{Binding TimerModels.Timers[2].Hour, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
<controls:TextBlock Text=":" />
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[2].IsOn}"
|
|
Text="{Binding TimerModels.Timers[2].Min, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
IsEditable="True"
|
|
IsHitTestVisible="{Binding Idle}"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ConfigurationList}"
|
|
SelectedValue="{Binding TimerModels.Timers[2].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="3" Grid.Column="0">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[3].IsOn}">
|
|
<CheckBox.Content>
|
|
<controls:TextBlock>
|
|
<controls:TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} 4">
|
|
<Binding Source="{StaticResource Timer}" />
|
|
</MultiBinding>
|
|
</controls:TextBlock.Text>
|
|
</controls:TextBlock>
|
|
</CheckBox.Content>
|
|
</CheckBox>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[3].IsOn}"
|
|
Text="{Binding TimerModels.Timers[3].Hour, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
<controls:TextBlock Text=":" />
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[3].IsOn}"
|
|
Text="{Binding TimerModels.Timers[3].Min, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
IsEditable="True"
|
|
IsHitTestVisible="{Binding Idle}"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ConfigurationList}"
|
|
SelectedValue="{Binding TimerModels.Timers[3].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="0" Grid.Column="1">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[4].IsOn}">
|
|
<CheckBox.Content>
|
|
<controls:TextBlock>
|
|
<controls:TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} 5">
|
|
<Binding Source="{StaticResource Timer}" />
|
|
</MultiBinding>
|
|
</controls:TextBlock.Text>
|
|
</controls:TextBlock>
|
|
</CheckBox.Content>
|
|
</CheckBox>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[4].IsOn}"
|
|
Text="{Binding TimerModels.Timers[4].Hour, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
<controls:TextBlock Text=":" />
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[4].IsOn}"
|
|
Text="{Binding TimerModels.Timers[4].Min, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
IsEditable="True"
|
|
IsHitTestVisible="{Binding Idle}"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ConfigurationList}"
|
|
SelectedValue="{Binding TimerModels.Timers[4].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="1" Grid.Column="1">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[5].IsOn}">
|
|
<CheckBox.Content>
|
|
<controls:TextBlock>
|
|
<controls:TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} 6">
|
|
<Binding Source="{StaticResource Timer}" />
|
|
</MultiBinding>
|
|
</controls:TextBlock.Text>
|
|
</controls:TextBlock>
|
|
</CheckBox.Content>
|
|
</CheckBox>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[5].IsOn}"
|
|
Text="{Binding TimerModels.Timers[5].Hour, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
<controls:TextBlock Text=":" />
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[5].IsOn}"
|
|
Text="{Binding TimerModels.Timers[5].Min, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
IsEditable="True"
|
|
IsHitTestVisible="{Binding Idle}"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ConfigurationList}"
|
|
SelectedValue="{Binding TimerModels.Timers[5].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="2" Grid.Column="1">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[6].IsOn}">
|
|
<CheckBox.Content>
|
|
<controls:TextBlock>
|
|
<controls:TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} 7">
|
|
<Binding Source="{StaticResource Timer}" />
|
|
</MultiBinding>
|
|
</controls:TextBlock.Text>
|
|
</controls:TextBlock>
|
|
</CheckBox.Content>
|
|
</CheckBox>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[6].IsOn}"
|
|
Text="{Binding TimerModels.Timers[6].Hour, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
<controls:TextBlock Text=":" />
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[6].IsOn}"
|
|
Text="{Binding TimerModels.Timers[6].Min, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
IsEditable="True"
|
|
IsHitTestVisible="{Binding Idle}"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ConfigurationList}"
|
|
SelectedValue="{Binding TimerModels.Timers[6].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Row="3" Grid.Column="1">
|
|
<StackPanel
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
Orientation="Horizontal">
|
|
<CheckBox Margin="10" IsChecked="{Binding TimerModels.Timers[7].IsOn}">
|
|
<CheckBox.Content>
|
|
<controls:TextBlock>
|
|
<controls:TextBlock.Text>
|
|
<MultiBinding StringFormat="{}{0} 8">
|
|
<Binding Source="{StaticResource Timer}" />
|
|
</MultiBinding>
|
|
</controls:TextBlock.Text>
|
|
</controls:TextBlock>
|
|
</CheckBox.Content>
|
|
</CheckBox>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[7].IsOn}"
|
|
Text="{Binding TimerModels.Timers[7].Hour, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
<controls:TextBlock Text=":" />
|
|
<TextBox
|
|
Width="35"
|
|
Margin="10"
|
|
InputMethod.IsInputMethodEnabled="False"
|
|
IsReadOnly="{c:Binding !TimerModels.Timers[7].IsOn}"
|
|
Text="{Binding TimerModels.Timers[7].Min, StringFormat=D2}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</StackPanel>
|
|
<ComboBox
|
|
Width="150"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
IsEditable="True"
|
|
IsHitTestVisible="{Binding Idle}"
|
|
IsReadOnly="True"
|
|
ItemsSource="{Binding ConfigurationList}"
|
|
SelectedValue="{Binding TimerModels.Timers[7].TimerConfig}"
|
|
SelectedValuePath="Value"
|
|
Visibility="{c:Binding CustomConfig}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Grid>
|
|
</UserControl>
|