67 lines
1.8 KiB
C#
67 lines
1.8 KiB
C#
using BeWo.ViewModel.View.AI;
|
|
using DevExpress.Mvvm;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BeWo.ViewModel.Controls.AI
|
|
{
|
|
public class AiChatButtonViewModel : AbstractBaseVM
|
|
{
|
|
private bool canExecute;
|
|
|
|
public bool IsFavoritenOpen { get; set; }
|
|
public List<AiMenuItemTemplate> AssistentCommands { get; protected set; }
|
|
|
|
public virtual bool IsHistoryEnabled => false;
|
|
|
|
public bool CanExecute
|
|
{
|
|
get => canExecute;
|
|
set => SetProperty(ref canExecute, value, nameof(CanExecute));
|
|
}
|
|
|
|
public Func<AiConversationChatViewModel> GetAiConversationChatViewModel { get; set; }
|
|
|
|
public AiPromptbausteinSelectionComplexViewModel AllPromptsViewModel { get; set; }
|
|
|
|
public DelegateCommand OpenConversationPopupCommand { get; protected set; }
|
|
public DelegateCommand OpenAllPromptsPopupCommand { get; protected set; }
|
|
public DelegateCommand OpenFavoritePromptsPopupCommand { get; protected set; }
|
|
|
|
public AiChatButtonViewModel()
|
|
{
|
|
canExecute = true;
|
|
|
|
OpenConversationPopupCommand = new DelegateCommand(OpenConversationPopup);
|
|
OpenAllPromptsPopupCommand = new DelegateCommand(OpenAllPromptsPopup);
|
|
OpenFavoritePromptsPopupCommand = new DelegateCommand(OpenFavoritePromptsPopup);
|
|
}
|
|
|
|
public void OpenConversationPopup()
|
|
{
|
|
BeWoApp.MainControl.WindowService.ShowAiConversationWindow(GetAiConversationChatViewModel());
|
|
}
|
|
|
|
public void OpenAllPromptsPopup()
|
|
{
|
|
BeWoApp.MainControl.WindowService.Show(AllPromptsViewModel);
|
|
}
|
|
|
|
public void OpenFavoritePromptsPopup()
|
|
{
|
|
IsFavoritenOpen = true;
|
|
FirePropertyChanged(nameof(IsFavoritenOpen));
|
|
}
|
|
}
|
|
|
|
public class AiMenuItemTemplate
|
|
{
|
|
public string Icon { get; set; }
|
|
public string Name { get; set; }
|
|
public DelegateCommand<AiConversationMessageVM> Command { get; set; }
|
|
}
|
|
}
|