This commit is contained in:
2026-07-29 13:25:13 +02:00
parent a618ba97ad
commit 388315c071
4 changed files with 59 additions and 15 deletions

View File

@@ -9,4 +9,5 @@
<PathGeometry x:Key="Phosphor.FloppyDisk">M219.31,72,184,36.69A15.86,15.86,0,0,0,172.69,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V83.31A15.86,15.86,0,0,0,219.31,72ZM168,208H88V152h80Zm40,0H184V152a16,16,0,0,0-16-16H88a16,16,0,0,0-16,16v56H48V48H172.69L208,83.31ZM160,72a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h56A8,8,0,0,1,160,72Z</PathGeometry>
<PathGeometry x:Key="Phosphor.RowsPlusTop">M208,160H48a16,16,0,0,0-16,16v24a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V176A16,16,0,0,0,208,160Zm0,40H48V176H208v24Zm0-112H48a16,16,0,0,0-16,16v24a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104A16,16,0,0,0,208,88Zm0,40H48V104H208v24ZM96,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H136V64a8,8,0,0,1-16,0V48H104A8,8,0,0,1,96,40Z</PathGeometry>
<PathGeometry x:Key="Phosphor.Swap">M224,48V152a16,16,0,0,1-16,16H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,152H208V48H96v8a8,8,0,0,1-16,0V48A16,16,0,0,1,96,32H208A16,16,0,0,1,224,48ZM168,192a8,8,0,0,0-8,8v8H48V104H156.69l-10.35,10.34a8,8,0,0,0,11.32,11.32l24-24a8,8,0,0,0,0-11.32l-24-24a8,8,0,0,0-11.32,11.32L156.69,88H48a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16H160a16,16,0,0,0,16-16v-8A8,8,0,0,0,168,192Z</PathGeometry>
<PathGeometry x:Key="Phosphor.Copy">M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z</PathGeometry>
</ResourceDictionary>

View File

@@ -351,8 +351,8 @@
Style="{StaticResource AssistentCommandButtonStyle}"
ToolTip="{Binding Name}">
<Path
Width="16"
Height="16"
Width="12"
Height="12"
Data="{Binding Icon}"
Fill="Black"
Stretch="Fill" />
@@ -503,21 +503,35 @@
</StackPanel>
</Grid>
</Border>
<Button
<StackPanel
Grid.Row="1"
Margin="0,4,0,0"
HorizontalAlignment="Right"
Command="{Binding DataContext.SavePromptCommand, RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"
CommandParameter="{Binding}"
Style="{StaticResource UserMessageSaveButtonStyle}"
ToolTip="Speichern">
<Path
Width="16"
Height="16"
Data="{StaticResource Phosphor.FloppyDisk}"
Fill="Black"
Stretch="Fill" />
</Button>
HorizontalAlignment="Right" Orientation="Horizontal">
<Button
Command="{Binding DataContext.CopyPromptCommand, RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"
CommandParameter="{Binding}"
Style="{StaticResource UserMessageSaveButtonStyle}"
ToolTip="Kopieren">
<Path
Width="12"
Height="12"
Data="{StaticResource Phosphor.Copy}"
Fill="Black"
Stretch="Fill" />
</Button>
<Button
Command="{Binding DataContext.SavePromptCommand, RelativeSource={RelativeSource AncestorType={x:Type ListView}}}"
CommandParameter="{Binding}"
Style="{StaticResource UserMessageSaveButtonStyle}"
ToolTip="Speichern">
<Path
Width="12"
Height="12"
Data="{StaticResource Phosphor.FloppyDisk}"
Fill="Black"
Stretch="Fill" />
</Button>
</StackPanel>
</Grid>
</DataTemplate>

View File

@@ -918,6 +918,8 @@ namespace BeWo.ViewModel
vm.ViewContext = view_context;
vm.CanSendNewMessage = canSendNewMessage;
vm.ImportAssistentCommandCopy();
if (assistentCommands is object)
{
foreach (var command in assistentCommands)

View File

@@ -19,6 +19,7 @@ using static DevExpress.Utils.Drawing.Helpers.NativeMethods;
using System.Security.Cryptography;
using BeWo.ViewModel.Controls.AI;
using DevExpress.Charts.Native;
using System.Windows.Media;
namespace BeWo.ViewModel.View.AI
{
@@ -58,6 +59,8 @@ namespace BeWo.ViewModel.View.AI
AcceptSavePromptCommand = new DelegateCommand(AcceptSavePrompt, () => !string.IsNullOrWhiteSpace(SavePromptVM?.Title));
CancelSavePromptCommand = new DelegateCommand(CancelSavePrompt);
CopyPromptCommand = new DelegateCommand<AiConversationMessageVM>(CopyPrompt);
ListVM = new AiConversationListVM();
ListVM.SelectedVMChanged += (s, e) => FirePropertyChanged(nameof(IsNewConversationVisible));
@@ -83,6 +86,8 @@ namespace BeWo.ViewModel.View.AI
public ICommand AcceptSavePromptCommand { get; set; }
public ICommand CancelSavePromptCommand { get; set; }
public ICommand CopyPromptCommand { get; set; }
public AiActionType ActionType { get; set; }
public AiViewContextDC ViewContext { get; set; }
@@ -479,6 +484,28 @@ namespace BeWo.ViewModel.View.AI
SavePromptVM = null;
}
public void CopyPrompt(AiConversationMessageVM message)
{
Clipboard.SetText(message.Message);
}
public void ImportAssistentCommandCopy()
{
var new_command = new DelegateCommand<AiConversationMessageVM>(x =>
{
CopyPromptCommand.Execute(x);
});
var imported_menu_item = new AiMenuItemTemplate()
{
Command = new_command,
Icon = Application.Current.FindResource("Phosphor.Copy") as Geometry,
Name = "Kopieren"
};
AssistentCommands.Add(imported_menu_item);
}
public void ImportAssistentCommand(AiMenuItemTemplate origin)
{
var origin_command = origin.Command;