57 lines
1.3 KiB
C#
57 lines
1.3 KiB
C#
using BeWo.ServiceProxy;
|
|
using BeWo.Services;
|
|
using BeWo.ViewModel.ListViewModel;
|
|
using BeWo.ViewModel.View.Dialogs;
|
|
using DevExpress.Mvvm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using System.Windows.Input;
|
|
|
|
namespace BeWo.ViewModel.View.AI
|
|
{
|
|
public class AiPromptbausteinSelectionViewModel : DialogViewModel
|
|
{
|
|
|
|
public AiPromptbausteinSelectionViewModel()
|
|
{
|
|
Func<bool> isPrompt = () => SelectedNode is object && !SelectedNode.IsKategorie;
|
|
|
|
SendCommand = new DelegateCommand(Send, isPrompt);
|
|
|
|
if (BeWoApp.IsInDesignMode)
|
|
{
|
|
ListVM = new AiPromptbausteinTreeListVM();
|
|
}
|
|
}
|
|
|
|
public AiPromptbausteinSelectionViewModel(AiPromptbausteinTreeListVM viewModel) : this()
|
|
{
|
|
ListVM = viewModel;
|
|
}
|
|
|
|
public event EventHandler<AiPromptbausteinTreeVM> PromptAccepted;
|
|
|
|
public AiPromptbausteinTreeVM SelectedNode { get; set; }
|
|
public AiPromptbausteinTreeListVM ListVM { get; private set; }
|
|
|
|
public ICommand SendCommand { get; set; }
|
|
|
|
public void Send()
|
|
{
|
|
PromptAccepted?.Invoke(this, SelectedNode);
|
|
|
|
CloseDialogCommand.Execute(null);
|
|
}
|
|
|
|
public void UpdateVMList(AiPromptbausteinTreeListVM new_list)
|
|
{
|
|
ListVM = new_list;
|
|
FirePropertyChanged(nameof(ListVM));
|
|
}
|
|
}
|
|
}
|