From 3906efee903be0725993b2978f42abb5d7a7d69a Mon Sep 17 00:00:00 2001 From: Rene Evertz Date: Mon, 6 Jul 2026 11:38:10 +0200 Subject: [PATCH] Schneller Workflow Buttons --- BeWo/BeWo.csproj | 1 + BeWo/BeWoApp.xaml | 1 + .../IsLastItemToBoolMultiConverter.cs | 39 ++++++ BeWo/Styles/Features/AIChatStyles.xaml | 121 +++++++++++++----- .../customFunctionPreSystemPrompt.txt | 2 +- .../SummaryParser/JsonContextSummaryParser.cs | 2 - 6 files changed, 134 insertions(+), 32 deletions(-) create mode 100644 BeWo/Converter/IsLastItemToBoolMultiConverter.cs diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index 9fd9e03c9..59731f77f 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -1317,6 +1317,7 @@ + diff --git a/BeWo/BeWoApp.xaml b/BeWo/BeWoApp.xaml index 43aa8902a..9ad1eff13 100644 --- a/BeWo/BeWoApp.xaml +++ b/BeWo/BeWoApp.xaml @@ -47,6 +47,7 @@ + diff --git a/BeWo/Converter/IsLastItemToBoolMultiConverter.cs b/BeWo/Converter/IsLastItemToBoolMultiConverter.cs new file mode 100644 index 000000000..eacf45aaa --- /dev/null +++ b/BeWo/Converter/IsLastItemToBoolMultiConverter.cs @@ -0,0 +1,39 @@ +using System; +using System.Globalization; +using System.Windows.Controls; +using System.Windows.Data; + +namespace BeWo.Converter +{ + /// + /// Erwartet: [0] = Item, [1] = ItemsControl, [2] = Items.Count (nur als Aktualisierungs-Trigger). + /// Liefert true, wenn das Item das letzte Element im ItemsControl ist. + /// + public class IsLastItemToBoolMultiConverter : IMultiValueConverter + { + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + try + { + if (values is null || values.Length < 2) + return false; + + if (!(values[1] is ItemsControl itemsControl)) + return false; + + var items = itemsControl.Items; + + return items.Count > 0 && ReferenceEquals(items[items.Count - 1], values[0]); + } + catch (Exception) + { + return false; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} diff --git a/BeWo/Styles/Features/AIChatStyles.xaml b/BeWo/Styles/Features/AIChatStyles.xaml index 267ec2e60..c19cf7b86 100644 --- a/BeWo/Styles/Features/AIChatStyles.xaml +++ b/BeWo/Styles/Features/AIChatStyles.xaml @@ -146,35 +146,85 @@ + + + + + + - - - - - - - - - - - - + Background="Transparent"> + + + + -