96 lines
2.4 KiB
C#
96 lines
2.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
|
|
namespace ExeLauncher.GUI
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : Window, INotifyPropertyChanged
|
|
{
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
private string _appName = "";
|
|
|
|
public string ApplicationName
|
|
{
|
|
get => _appName;
|
|
set
|
|
{
|
|
if (_appName != value)
|
|
{
|
|
_appName = value;
|
|
|
|
NotifyPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
private string _applicationIconPath = "";
|
|
|
|
public string ApplicationIconPath
|
|
{
|
|
get => _applicationIconPath;
|
|
set
|
|
{
|
|
if (_applicationIconPath != value)
|
|
{
|
|
_applicationIconPath = value;
|
|
|
|
NotifyPropertyChanged();
|
|
}
|
|
}
|
|
}
|
|
|
|
public ObservableCollection<ApplicationModel> Applications { get; set; }
|
|
|
|
public MainWindow()
|
|
{
|
|
Applications = new()
|
|
{
|
|
new ApplicationModel()
|
|
};
|
|
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Button_Icon(object sender, RoutedEventArgs e)
|
|
{
|
|
ApplicationIconPath = Program.GetIcon();
|
|
}
|
|
|
|
private void Button_Add(object sender, RoutedEventArgs e)
|
|
{
|
|
Applications.Add(new ApplicationModel() { Number = Applications.Count + 1 });
|
|
}
|
|
|
|
private void Button_Remove(object sender, RoutedEventArgs e)
|
|
{
|
|
if (Applications.Count > 1)
|
|
{
|
|
Applications.RemoveAt(Applications.Count - 1);
|
|
}
|
|
}
|
|
|
|
private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|
|
}
|