OF-DL/OF DL.Gui/ViewModels/CreatorConfigRowViewModel.cs
2026-02-14 01:34:57 -06:00

29 lines
860 B
C#

using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using OF_DL.Models.Config;
namespace OF_DL.Gui.ViewModels;
public partial class CreatorConfigRowViewModel : ViewModelBase
{
private readonly Action<CreatorConfigRowViewModel> _onDelete;
private readonly Action<CreatorConfigRowViewModel> _onEdit;
[ObservableProperty] private string _username;
[ObservableProperty] private CreatorConfig _config;
public CreatorConfigRowViewModel(string username, CreatorConfig config, Action<CreatorConfigRowViewModel> onDelete, Action<CreatorConfigRowViewModel> onEdit)
{
_username = username;
_config = config;
_onDelete = onDelete;
_onEdit = onEdit;
}
[RelayCommand]
private void Delete() => _onDelete(this);
[RelayCommand]
private void Edit() => _onEdit(this);
}