This commit is contained in:
Mossimo
2021-05-15 23:41:24 +08:00
parent 41ad3c1831
commit f74fe9abea
2 changed files with 24 additions and 2 deletions
@@ -95,13 +95,25 @@
Cursor="Hand"
VerticalAlignment="Center"
HorizontalAlignment="Center"
IsVisible="{Binding Process,Converter={StaticResource IsNullConverter}}"
ToolTip.Tip="{ReflectionBinding Path=Res.UserChange_DeleteUser,Mode=OneWay,Source={x:Static resx:R.Current}}"
Command="{ReflectionBinding #u.DataContext.DeleteUserButton_Click}"
CommandParameter="{Binding}">
<PathIcon Width="48" Height="48" Data="{DynamicResource PauseCircleDrawing}">
</PathIcon>
</Button>
<Button Classes="flatbutton plain" x:Name="runstop_btn"
Background="Transparent"
Cursor="Hand"
VerticalAlignment="Center"
HorizontalAlignment="Center"
IsVisible="{Binding !Process,Converter={StaticResource IsNullConverter}}"
ToolTip.Tip="{ReflectionBinding Path=Res.UserChange_DeleteUser,Mode=OneWay,Source={x:Static resx:R.Current}}"
Command="{ReflectionBinding #u.DataContext.DeleteUserButton_Click}"
CommandParameter="{Binding}">
<PathIcon Width="48" Height="48" Data="{DynamicResource PlayCircleDrawing}">
</PathIcon>
</Button>
<Button Classes="flatbutton" x:Name="delete_btn"
Background="Transparent"
Cursor="Hand" HorizontalAlignment="Right"
@@ -38,6 +38,9 @@ namespace System.Application.UI.ViewModels
SteamConnectService.Current.RuningSteamApps.FirstOrDefault(x => x.AppId == item.AppId);
}
public void onExited(object? sender, EventArgs e) {
}
public void Refresh_Click()
{
@@ -46,8 +49,15 @@ namespace System.Application.UI.ViewModels
foreach (var item in GameLibrarySettings.AFKAppList.Value)
{
var appInfo =SteamConnectService.Current.SteamApps.Items.FirstOrDefault(x => x.AppId == item.Key);
if (appInfo != null)
if (appInfo != null) {
var runState = SteamConnectService.Current.RuningSteamApps.FirstOrDefault(x => x.AppId == item.Key);
if (runState != null && runState.Process != null) {
appInfo.Process = runState.Process;
appInfo.Process.Exited += new EventHandler(onExited);
}
list.Add(appInfo);
}
}
IdleGameList = new ObservableCollection<SteamApp>(list);
//if (SteamApps.Items.Any_Nullable() && GameLibrarySettings.AFKAppList.Value?.Count > 0)