Files
EngineeringSync/EngineeringSync.TrayApp/Views/ProjectManagementWindow.xaml.cs

53 lines
1.5 KiB
C#
Raw Normal View History

using System.Windows;
using EngineeringSync.TrayApp.ViewModels;
using Microsoft.Win32;
namespace EngineeringSync.TrayApp.Views;
public partial class ProjectManagementWindow : Window
{
private readonly ProjectManagementViewModel _vm;
public ProjectManagementWindow(ProjectManagementViewModel vm)
{
InitializeComponent();
_vm = vm;
DataContext = vm;
}
private void BrowseEngineering_Click(object sender, RoutedEventArgs e)
{
var dialog = new OpenFolderDialog
{
Title = "Engineering-Quellpfad wählen",
InitialDirectory = _vm.EditEngineeringPath
};
if (dialog.ShowDialog() == true)
_vm.EditEngineeringPath = dialog.FolderName;
}
private void BrowseSimulation_Click(object sender, RoutedEventArgs e)
{
var dialog = new OpenFolderDialog
{
Title = "Simulations-Zielpfad wählen",
InitialDirectory = _vm.EditSimulationPath
};
if (dialog.ShowDialog() == true)
_vm.EditSimulationPath = dialog.FolderName;
}
private void BrowseBackup_Click(object sender, RoutedEventArgs e)
{
var dlg = new OpenFolderDialog
{
Title = "Backup-Verzeichnis wählen",
InitialDirectory = string.IsNullOrEmpty(_vm.EditBackupCustomPath)
? null
: _vm.EditBackupCustomPath
};
if (dlg.ShowDialog() == true)
_vm.EditBackupCustomPath = dlg.FolderName;
}
}