mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
@@ -1476,6 +1476,26 @@ namespace MaaWpfGui.ViewModels.UI
|
||||
return (from item in InfrastItemViewModels where item.IsChecked select item.OriginalName).ToList();
|
||||
}
|
||||
|
||||
// UI 绑定的方法
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public void InfrastItemSelectedAll()
|
||||
{
|
||||
foreach (var item in InfrastItemViewModels)
|
||||
{
|
||||
item.IsChecked = true;
|
||||
}
|
||||
}
|
||||
|
||||
// UI 绑定的方法
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public void InfrastItemUnselectedAll()
|
||||
{
|
||||
foreach (var item in InfrastItemViewModels)
|
||||
{
|
||||
item.IsChecked = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实时更新基建换班顺序
|
||||
/// </summary>
|
||||
|
||||
@@ -115,11 +115,37 @@
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<!--<maa:TextBlock Text="{Binding ID}" />
|
||||
<maa:TextBlock Text=". " />-->
|
||||
<CheckBox Content="{Binding Name}" IsChecked="{Binding IsChecked}" />
|
||||
<CheckBox Content="{Binding Name}" IsChecked="{Binding IsCheckedWithNull}" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.Resources>
|
||||
<Style BasedOn="{StaticResource {x:Type ListBox}}" TargetType="{x:Type ListBox}">
|
||||
<EventSetter Event="PreviewMouseWheel" Handler="ListBox_PreviewMouseWheel" />
|
||||
</Style>
|
||||
</ListBox.Resources>
|
||||
</ListBox>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Button
|
||||
Height="30"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Command="{s:Action InfrastItemSelectedAll}"
|
||||
Content="{DynamicResource SelectAll}"
|
||||
IsEnabled="{Binding Idle}" />
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
Height="30"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Command="{s:Action InfrastItemUnselectedAll}"
|
||||
Content="{DynamicResource Clear}"
|
||||
IsEnabled="{Binding Idle}" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- 开自定义基建计划时,放在常规设置的部分 -->
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
// but WITHOUT ANY WARRANTY
|
||||
// </copyright>
|
||||
|
||||
using System.Windows.Input;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace MaaWpfGui.Views.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
@@ -25,5 +29,21 @@ namespace MaaWpfGui.Views.UserControl
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ListBox_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
if (e.Handled)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
var eventArg = new MouseWheelEventArgs(e.MouseDevice, e.Timestamp, e.Delta)
|
||||
{
|
||||
RoutedEvent = UIElement.MouseWheelEvent
|
||||
};
|
||||
var parent = ((Control)sender).Parent as UIElement;
|
||||
parent?.RaiseEvent(eventArg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user