mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-04-01 10:39:50 +08:00
47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using MicaSetup.Helper;
|
|
using System;
|
|
using System.IO;
|
|
using System.Windows;
|
|
|
|
namespace MicaSetup.ViewModels;
|
|
|
|
public partial class FinishViewModel : ObservableObject
|
|
{
|
|
public FinishViewModel()
|
|
{
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void Close()
|
|
{
|
|
if (UIDispatcherHelper.MainWindow is Window window)
|
|
{
|
|
SystemCommands.CloseWindow(window);
|
|
}
|
|
}
|
|
|
|
[RelayCommand]
|
|
public void Open()
|
|
{
|
|
if (UIDispatcherHelper.MainWindow is Window window)
|
|
{
|
|
try
|
|
{
|
|
FluentProcess.Create()
|
|
.FileName(Path.Combine(Option.Current.InstallLocation, Option.Current.ExeName))
|
|
.WorkingDirectory(Option.Current.InstallLocation)
|
|
.UseShellExecute()
|
|
.Start()
|
|
.Forget();
|
|
}
|
|
catch (Exception e)
|
|
{
|
|
Logger.Error(e);
|
|
}
|
|
SystemCommands.CloseWindow(window);
|
|
}
|
|
}
|
|
}
|