Files
BeWoPlaner/BeWo/View/Detail/AI/AiPromptbausteinRoutineView.xaml
2026-06-05 15:46:56 +02:00

225 lines
9.6 KiB
XML

<view:BeWoView
x:Class="BeWo.View.Detail.AI.AiPromptbausteinRoutineView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:comboboxes="clr-namespace:BeWo.View.Controls.ComboBoxes"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:local="clr-namespace:BeWo.View.Detail.AI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:shared="clr-namespace:BS.Shared;assembly=BS.Shared"
xmlns:view="clr-namespace:BeWo.View"
xmlns:viewmodel="clr-namespace:BeWo.ViewModel.View.Administration"
d:DataContext="{d:DesignInstance Type=viewmodel:AiPromptbausteinRoutineViewModel}"
d:DesignHeight="450"
d:DesignWidth="800"
Background="{StaticResource ObjectEditBackgroundBrush}"
Focusable="True"
mc:Ignorable="d">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="..\..\..\Styles\ModernOrangeBlack.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource PopupBlackLabel2}" TargetType="Label" />
<Style BasedOn="{StaticResource PopupBlackRadioButton}" TargetType="RadioButton" />
</ResourceDictionary>
</UserControl.Resources>
<Grid HorizontalAlignment="Stretch">
<Grid Margin="8,4,8,4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" MinWidth="80" />
<ColumnDefinition Width="0" />
<ColumnDefinition Width="3*" MinWidth="100" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="*" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0">Name</Label>
<TextBox
Grid.Row="0"
Grid.Column="2"
Text="{Binding ViewModel.Title, UpdateSourceTrigger=PropertyChanged}" />
<Label
Grid.Row="1"
Grid.Column="0"
HorizontalAlignment="Right"
Content="Beschreibung" />
<TextBox
Grid.Row="1"
Grid.Column="2"
MaxHeight="100"
Margin="3,6,3,3"
MaxLength="1024"
Style="{StaticResource TextBoxNotice}"
Text="{Binding ViewModel.Description, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
<Label
Grid.Row="2"
Grid.Column="0"
Content="Kontext-Eingabe-Typ" />
<StackPanel
Grid.Row="2"
Grid.Column="2"
Margin="3,3"
Orientation="Horizontal">
<RadioButton IsChecked="{Binding ViewModel.RoutineType, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static shared:AiRoutineType.Chain}}">Kette</RadioButton>
<RadioButton IsChecked="{Binding ViewModel.RoutineType, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static shared:AiRoutineType.Stack}}">Stapel</RadioButton>
</StackPanel>
<Label
Grid.Row="3"
Grid.Column="0"
Content="Promptbausteine" />
<ListBox
x:Name="steps"
Grid.Row="3"
Grid.Column="2"
Margin="3"
HorizontalContentAlignment="Center"
ItemsSource="{Binding ViewModel.Steps.VMList}"
SelectedItem="{Binding SelectedStep}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Margin="3" Orientation="Horizontal">
<!--<TextBlock
x:Name="arrow"
Margin="3"
VerticalAlignment="Center"
Text="&#x2794;" />-->
<Border
x:Name="border1"
Height="19"
Margin="0"
Padding="3"
HorizontalAlignment="Left"
Background="DarkGray"
CornerRadius="7">
<TextBlock
Margin="3,0,3,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="10"
Text="{Binding PromptReference.Title, StringFormat={}✦ {0}}"
TextWrapping="Wrap" />
</Border>
</StackPanel>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding IsValid}" Value="false">
<Setter TargetName="border1" Property="Background" Value="LightCoral" />
</DataTrigger>
</DataTemplate.Triggers>
<!--<DataTemplate.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}" Value="{x:Null}">
<Setter TargetName="arrow" Property="Visibility" Value="Collapsed" />
</DataTrigger>
</DataTemplate.Triggers>-->
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<StackPanel
Grid.Row="4"
Grid.Column="2"
Margin="0,0,0,3"
HorizontalAlignment="Center"
Orientation="Horizontal">
<StackPanel.Resources>
<ResourceDictionary>
<Style BasedOn="{StaticResource PrimaryButton}" TargetType="Button">
<Setter Property="Width" Value="24" />
</Style>
</ResourceDictionary>
</StackPanel.Resources>
<Button Click="Button_Plus_Click">+</Button>
<Button Command="{Binding DeleteStepCommand}" CommandParameter="{Binding SelectedStep}">
-
</Button>
<Button
Margin="9,3,3,3"
Command="{Binding MoveStepUpCommand}"
CommandParameter="{Binding SelectedStep}">
<Path
Width="8"
Data="{StaticResource Lucide.ChevronUp}"
Fill="White"
Stretch="Uniform" />
</Button>
<Button Command="{Binding MoveStepDownCommand}" CommandParameter="{Binding SelectedStep}">
<Path
Width="8"
Data="{StaticResource Lucide.ChevronDown}"
Fill="White"
Stretch="Uniform" />
</Button>
<Popup
x:Name="myPopup"
Width="600"
Height="400"
Placement="Top"
PlacementTarget="{Binding ElementName=myButton}"
StaysOpen="False">
<Border
x:Name="myPopupBorder"
BorderBrush="Black"
BorderThickness="1">
<TextBlock Text="Ich bin ein Popup!" />
</Border>
</Popup>
</StackPanel>
<Label
Grid.Row="5"
Grid.Column="0"
Content="Ersteller" />
<comboboxes:ComboBoxEmployeeSearch
Grid.Row="5"
Grid.Column="2"
Margin="3"
IsEnabled="False"
SelectedCompactEmployeeDC="{Binding ViewModel.Creator}" />
<!--<Label Grid.Row="4" Grid.Column="0">Öffentlich</Label>
<dxe:CheckEdit
Grid.Row="4"
Grid.Column="2"
Margin="3"
IsChecked="{Binding ViewModel.IsPublic}"
IsEnabled="{Binding ViewModel.CanShareEdit, UpdateSourceTrigger=PropertyChanged}" />-->
<Label Grid.Row="6" Grid.Column="0">Favorit</Label>
<dxe:CheckEdit
Grid.Row="6"
Grid.Column="2"
Margin="3"
IsChecked="{Binding ViewModel.IsFavorite}"
IsEnabled="true" />
<StackPanel
Grid.Row="7"
Grid.ColumnSpan="3"
Margin="0,19,0,0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<Button Width="100" Command="ApplicationCommands.Close">
Abbrechen
</Button>
<Button
Width="100"
Command="{Binding SaveCommand}"
Content="{Binding AcceptButtonText}"
Visibility="Visible" />
</StackPanel>
</Grid>
</Grid>
</view:BeWoView>