Add button interactions

This commit is contained in:
2021-12-04 13:31:20 +01:00
parent 0d2f2a6653
commit 5d761a5920
4 changed files with 61 additions and 15 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -11,7 +12,7 @@ using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Win32;
namespace ExeLauncher.GUI
{
@@ -59,12 +60,20 @@ namespace ExeLauncher.GUI
private void Button_Path(object sender, RoutedEventArgs e)
{
var dialog = new OpenFileDialog()
{
AddExtension = true,
DefaultExt = ".exe",
FileName = "Run.exe",
Filter = "Executable|*.exe"
};
}
private void Button_WorkingDirectory(object sender, RoutedEventArgs e)
{
if (dialog.ShowDialog() == true)
{
ApplicationPath = dialog.FileName;
ApplicationWorkingDirectory = Path.GetDirectoryName(ApplicationPath) ?? "";
}
}
}
}