AiPromptbaustein SelectionView
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Threading;
|
||||
|
||||
@@ -16,6 +17,7 @@ using BS.Shared.DataContracts;
|
||||
using BS.Shared.DataContracts.Compact;
|
||||
using BS.Shared.Extensions;
|
||||
using BS.Shared.Services;
|
||||
using DevExpress.Mvvm;
|
||||
using Microsoft.VisualBasic;
|
||||
using Newtonsoft.Json;
|
||||
using DispatcherObject = System.Windows.Threading.DispatcherObject;
|
||||
@@ -92,6 +94,8 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
|
||||
//private static List<DarreichungsformDC> _AllDosageForms;
|
||||
|
||||
public ICommand OpenAiPromptSelectionCommand { get; set; }
|
||||
|
||||
public ServiceRecordListVM(
|
||||
Dictionary<ServiceCategoryDC, List<ServiceDescriptionDC>> pCategory2Services,
|
||||
IEnumerable<ValueListEntryDC> pAllGoalCategories,
|
||||
@@ -157,6 +161,10 @@ namespace BeWo.ViewModel.ListViewModel
|
||||
AllDocTypes.Sort((a, b) => a.ValueListEntryOid.Value.CompareTo(b.ValueListEntryOid.Value));
|
||||
}
|
||||
VMList.ListChanged += (s, e) => CheckCustomerAbsenceTimes();
|
||||
|
||||
OpenAiPromptSelectionCommand = new DelegateCommand(() => {
|
||||
BeWoApp.MainControl.WindowService.ShowAiPromptbausteinSelectionWindow(new View.AI.AiPromptbausteinSelectionViewModel());
|
||||
}, () => SelectedCustomerNode is object);
|
||||
}
|
||||
|
||||
//CB EINKOMMENTIEREN
|
||||
|
||||
@@ -7,6 +7,7 @@ using BeWo.SchulbegleitenderDienst.ViewModel;
|
||||
using BeWo.ServiceProxy;
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
using BeWo.ViewModel.View;
|
||||
using BeWo.ViewModel.View.AI;
|
||||
using BS.Shared;
|
||||
using BS.Shared.Core;
|
||||
using BS.Shared.DataContracts;
|
||||
|
||||
@@ -15,9 +15,9 @@ using DevExpress.Mvvm;
|
||||
using BeWo.ServiceProxy;
|
||||
using BS.Shared.Extensions;
|
||||
|
||||
namespace BeWo.ViewModel.View
|
||||
namespace BeWo.ViewModel.View.AI
|
||||
{
|
||||
public class AiConversationChatViewModel : AbstractBaseVM
|
||||
public class AiConversationChatViewModel : DialogViewModel
|
||||
{
|
||||
private bool _IsSettingsOpen;
|
||||
private bool _IsCloneOpen;
|
||||
45
BeWo/ViewModel/View/AI/AiPromptbausteinSelectionViewModel.cs
Normal file
45
BeWo/ViewModel/View/AI/AiPromptbausteinSelectionViewModel.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using BeWo.Services;
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
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 AiPromptbausteinTreeVM SelectedNode { get; set; }
|
||||
public AiPromptbausteinTreeListVM ListVM { get; set; }
|
||||
|
||||
public ICommand SendCommand { get; set; }
|
||||
|
||||
public void Send()
|
||||
{
|
||||
MessageBox.Show("Hi");
|
||||
|
||||
CloseDialogCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
using DevExpress.Mvvm;
|
||||
using DevExpress.Xpf.Docking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -9,7 +10,7 @@ using System.Windows.Input;
|
||||
|
||||
namespace BeWo.ViewModel.View.Administration
|
||||
{
|
||||
public class AiPromptbausteinDetailViewModel
|
||||
public class AiPromptbausteinDetailViewModel : DialogViewModel
|
||||
{
|
||||
private AiPromptbausteinDetailViewModel(AiPromptbausteinTreeViewModel viewModel, AiPromptbausteinTreeVM node, bool isAdd, AiPromptbausteinTreeListVM parent = null)
|
||||
{
|
||||
@@ -33,8 +34,6 @@ namespace BeWo.ViewModel.View.Administration
|
||||
public bool IsAdd { get; set; }
|
||||
public bool IsEditingMode { get; set; }
|
||||
|
||||
public Action CloseWindow { get; set; }
|
||||
|
||||
public bool IsKategorie => Node.IsKategorie;
|
||||
public string PromptLabelDescription => IsKategorie ? "Beschreibung:" : "Prompt:";
|
||||
|
||||
@@ -42,7 +41,7 @@ namespace BeWo.ViewModel.View.Administration
|
||||
public void Add()
|
||||
{
|
||||
Parent.AddNewVMToListAndSelect(false);
|
||||
CloseWindow();
|
||||
CloseDialogCommand?.Execute(null);
|
||||
}
|
||||
|
||||
public static AiPromptbausteinDetailViewModel CreateAdd(AiPromptbausteinTreeViewModel viewModel, AiPromptbausteinTreeVM node, AiPromptbausteinTreeListVM parent)
|
||||
|
||||
@@ -63,12 +63,12 @@ namespace BeWo.ViewModel.View.Administration
|
||||
parent.NewVM = null;
|
||||
parent.NewVM.IsKategorie = isKategorie;
|
||||
|
||||
WindowService.ShowAiPromptbausteinWindow(AiPromptbausteinDetailViewModel.CreateAdd(this, parent.NewVM, parent));
|
||||
WindowService.ShowAiPromptbausteinDetailWindow(AiPromptbausteinDetailViewModel.CreateAdd(this, parent.NewVM, parent));
|
||||
}
|
||||
|
||||
public void EditPromptbaustein()
|
||||
{
|
||||
WindowService.ShowAiPromptbausteinWindow(AiPromptbausteinDetailViewModel.CreateEdit(this, SelectedNode));
|
||||
WindowService.ShowAiPromptbausteinDetailWindow(AiPromptbausteinDetailViewModel.CreateEdit(this, SelectedNode));
|
||||
}
|
||||
|
||||
public void CopyPromptbaustein()
|
||||
|
||||
27
BeWo/ViewModel/View/DialogViewModel.cs
Normal file
27
BeWo/ViewModel/View/DialogViewModel.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using DevExpress.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace BeWo.ViewModel.View
|
||||
{
|
||||
public class DialogViewModel : WindowViewModel
|
||||
{
|
||||
public event EventHandler RequestClose;
|
||||
|
||||
public DialogViewModel() : base()
|
||||
{
|
||||
CloseDialogCommand = new DelegateCommand(Close);
|
||||
}
|
||||
|
||||
public ICommand CloseDialogCommand { get; set; }
|
||||
|
||||
private void Close()
|
||||
{
|
||||
RequestClose?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user