mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-05-17 09:26:50 +08:00
add switch inference device UI
This commit is contained in:
@@ -187,6 +187,33 @@
|
||||
IsChecked="{Binding Config.WgcUseBitmapCache, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Separator Margin="-18,0" BorderThickness="0,1,0,0" />
|
||||
<Grid Margin="16">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:TextBlock Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
FontTypography="Body"
|
||||
Text="切换AI推理设备"
|
||||
TextWrapping="Wrap" />
|
||||
<ui:TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Foreground="{ui:ThemeResource TextFillColorTertiaryBrush}"
|
||||
Text="GPU推理需要安装CUDA,切换后需要重启程序"
|
||||
TextWrapping="Wrap" />
|
||||
<ComboBox Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="1"
|
||||
Margin="0,0,36,0"
|
||||
ItemsSource="{Binding InferenceDevices}"
|
||||
SelectedItem="{Binding Config.InferenceDevice, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
<Separator Margin="-18,0" BorderThickness="0,1,0,0" />
|
||||
<Grid Margin="16">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
||||
@@ -44,6 +44,8 @@ public partial class HomePageViewModel : ObservableObject, INavigationAware, IVi
|
||||
private readonly TaskTriggerDispatcher _taskDispatcher;
|
||||
private readonly MouseKeyMonitor _mouseKeyMonitor = new();
|
||||
|
||||
[ObservableProperty] private string[] _inferenceDevices = ["CPU", "GPU"];
|
||||
|
||||
public HomePageViewModel(IConfigService configService, TaskTriggerDispatcher taskTriggerDispatcher)
|
||||
{
|
||||
_taskDispatcher = taskTriggerDispatcher;
|
||||
|
||||
Reference in New Issue
Block a user