restore start genshin code

This commit is contained in:
huiyadanli
2023-12-05 23:52:26 +08:00
parent fbf00105c1
commit df1174fd9b
2 changed files with 6 additions and 6 deletions

View File

@@ -103,7 +103,7 @@
</Grid>
</ui:CardExpander.Header>
<StackPanel>
<!--<Grid Margin="16">
<Grid Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
@@ -131,7 +131,7 @@
Margin="0,0,36,0"
Command="{Binding SelectInstallPathCommand}"
Content="浏览" />
</Grid>-->
</Grid>
<Separator Margin="-18,0" BorderThickness="0,1,0,0" />
<Grid Margin="16">
<Grid.RowDefinitions>

View File

@@ -147,10 +147,10 @@ public partial class HomePageViewModel : ObservableObject, INavigationAware
var hWnd = SystemControl.FindGenshinImpactHandle();
if (hWnd == IntPtr.Zero)
{
//if (!string.IsNullOrEmpty(Config.InstallPath))
//{
// hWnd = await SystemControl.StartFromLocalAsync(Config.InstallPath);
//}
if (!string.IsNullOrEmpty(Config.InstallPath))
{
hWnd = await SystemControl.StartFromLocalAsync(Config.InstallPath);
}
if (hWnd == IntPtr.Zero)
{
System.Windows.MessageBox.Show("未找到原神窗口,请先启动原神!");