34 lines
813 B
C#
34 lines
813 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BeWo.ViewModel.View.Administration
|
|
{
|
|
public class AiPromptbausteinPromptViewModel : AcceptCancelDialogViewModel
|
|
{
|
|
private readonly bool _IsNew;
|
|
|
|
public AiPromptbausteinPromptViewModel(AiPromptbausteinPromptVM viewModel, bool isNew) : base()
|
|
{
|
|
ViewModel = viewModel;
|
|
_IsNew = isNew;
|
|
|
|
ViewModel.PropertyChanged += (s, e) =>
|
|
{
|
|
AcceptCommand.RaiseCanExecuteChanged();
|
|
};
|
|
}
|
|
|
|
public AiPromptbausteinPromptVM ViewModel { get; private set; }
|
|
|
|
public string AcceptButtonText => _IsNew ? "Hinzufügen" : "Speichern";
|
|
|
|
protected override bool canAccept()
|
|
{
|
|
return (_IsNew || ViewModel.IsDirty) && !string.IsNullOrWhiteSpace(ViewModel.Title);
|
|
}
|
|
}
|
|
}
|