39 lines
991 B
C#
39 lines
991 B
C#
using DevExpress.DataProcessing.InMemoryDataProcessor;
|
|
using DevExpress.Mvvm;
|
|
using DevExpress.Mvvm.POCO;
|
|
using DevExpress.XtraBars.Docking2010.Views.WindowsUI;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Input;
|
|
|
|
namespace BeWo.ViewModel.View.Administration
|
|
{
|
|
public class AiPromptbausteinFolderViewModel : AcceptCancelDialogViewModel
|
|
{
|
|
private readonly bool _IsNew;
|
|
|
|
public AiPromptbausteinFolderViewModel(AiPromptbausteinFolderVM viewModel, bool isNew) : base()
|
|
{
|
|
ViewModel = viewModel;
|
|
_IsNew = isNew;
|
|
|
|
ViewModel.PropertyChanged += (s, e) =>
|
|
{
|
|
AcceptCommand.RaiseCanExecuteChanged();
|
|
};
|
|
}
|
|
|
|
public AiPromptbausteinFolderVM ViewModel { get; set; }
|
|
|
|
public string AcceptButtonText => _IsNew ? "Hinzufügen" : "Speichern";
|
|
|
|
protected override bool canAccept()
|
|
{
|
|
return (_IsNew || ViewModel.IsDirty) && !string.IsNullOrWhiteSpace(ViewModel.Title);
|
|
}
|
|
}
|
|
}
|