mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using System.Windows;
|
|
using Flow.Launcher.Plugin.Program.ViewModels;
|
|
|
|
namespace Flow.Launcher.Plugin.Program
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for AddProgramSource.xaml
|
|
/// </summary>
|
|
public partial class AddProgramSource : Window
|
|
{
|
|
private readonly AddProgramSourceViewModel ViewModel;
|
|
|
|
public AddProgramSource(AddProgramSourceViewModel viewModel)
|
|
{
|
|
ViewModel = viewModel;
|
|
DataContext = viewModel;
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void BrowseButton_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
ViewModel.Browse();
|
|
}
|
|
|
|
private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void BtnAdd_OnClick(object sender, RoutedEventArgs e)
|
|
{
|
|
var status = ViewModel.AddOrUpdate();
|
|
bool modified = status.Item1;
|
|
string msg = status.Item2;
|
|
if (modified == false && msg != null)
|
|
{
|
|
MessageBox.Show(msg); // Invalid
|
|
return;
|
|
}
|
|
DialogResult = modified;
|
|
Close();
|
|
}
|
|
}
|
|
}
|