Fix bindings

This commit is contained in:
2021-12-04 14:54:21 +01:00
parent 5d761a5920
commit 321e67e400
4 changed files with 75 additions and 12 deletions

View File

@@ -1,16 +1,81 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace ExeLauncher.GUI
{
public record ApplicationModel
public record ApplicationModel : INotifyPropertyChanged
{
public int Number { get; set; } = 1;
public string Path { get; set; } = "";
public string Arguments { get; set; } = "";
public string WorkingDirectory { get; set; } = "";
private int _number = 1;
public int Number
{
get => _number;
set
{
if (_number != value)
{
_number = value;
NotifyPropertyChanged();
}
}
}
private string _path = "";
public string Path
{
get => _path;
set
{
if (_path != value)
{
_path = value;
NotifyPropertyChanged();
}
}
}
private string _arguments = "";
public string Arguments
{
get => _arguments;
set
{
if (_arguments != value)
{
_arguments = value;
NotifyPropertyChanged();
}
}
}
private string _workingDirectory = "";
public string WorkingDirectory
{
get => _workingDirectory;
set
{
if (_workingDirectory != value)
{
_workingDirectory = value;
NotifyPropertyChanged();
}
}
}
public event PropertyChangedEventHandler? PropertyChanged;
private void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
}