Favoriten Order
+ Routine.!IsValid bearbeitbar
This commit is contained in:
@@ -186,8 +186,8 @@
|
||||
<DataTrigger Binding="{Binding IsValid}" Value="False">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderBrush" Value="Red" />
|
||||
<Setter Property="IsEnabled" Value="False" />
|
||||
<Setter Property="IsHitTestVisible" Value="False" />
|
||||
<Setter Property="IsEnabled" Value="True" />
|
||||
<Setter Property="IsHitTestVisible" Value="True" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
@@ -238,25 +238,26 @@
|
||||
Background="Transparent"
|
||||
ContextMenuOpening="ListBox_ContextMenuOpening"
|
||||
PreviewMouseDown="Grid_PreviewMouseDown_2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="9" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Rectangle
|
||||
<Grid IsEnabled="{Binding IsValid}">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="9" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Rectangle
|
||||
Grid.RowSpan="2"
|
||||
Width="24"
|
||||
Height="24"
|
||||
Fill="White" />
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<TextBox
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<TextBox
|
||||
Height="21"
|
||||
Margin="0,0,0,0"
|
||||
Padding="0"
|
||||
@@ -269,10 +270,10 @@
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Path=Title, UpdateSourceTrigger=PropertyChanged, Mode=OneWay}"
|
||||
ToolTipService.ShowDuration="100000">
|
||||
<TextBox.ToolTip>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Content="{Binding Path=Title, Mode=OneWay}" FontWeight="Bold" />
|
||||
<TextBox
|
||||
<TextBox.ToolTip>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<Label Content="{Binding Path=Title, Mode=OneWay}" FontWeight="Bold" />
|
||||
<TextBox
|
||||
MaxWidth="500"
|
||||
Padding="3,1,0,0"
|
||||
VerticalAlignment="Center"
|
||||
@@ -282,16 +283,16 @@
|
||||
IsReadOnly="True"
|
||||
Text="{Binding Path=Description}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</TextBox.ToolTip>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
</StackPanel>
|
||||
</TextBox.ToolTip>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Margin="0,-1,0,0"
|
||||
Orientation="Horizontal">
|
||||
<Border
|
||||
<Border
|
||||
x:Name="border1"
|
||||
Width="46"
|
||||
Margin="0,0,3,0"
|
||||
@@ -299,27 +300,27 @@
|
||||
HorizontalAlignment="Left"
|
||||
Background="#E1F5EE"
|
||||
CornerRadius="7">
|
||||
<TextBlock
|
||||
<TextBlock
|
||||
Margin="1,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10"
|
||||
Text="Routine"
|
||||
TextWrapping="Wrap" />
|
||||
</Border>
|
||||
<TextBlock
|
||||
</Border>
|
||||
<TextBlock
|
||||
Margin="3,0,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="10">
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} Schritte">
|
||||
<Binding Path="Steps.Count" />
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<ListBox
|
||||
<TextBlock.Text>
|
||||
<MultiBinding StringFormat="{}{0} Schritte">
|
||||
<Binding Path="Steps.Count" />
|
||||
</MultiBinding>
|
||||
</TextBlock.Text>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<ListBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="2"
|
||||
Margin="3,9,3,3"
|
||||
@@ -330,20 +331,20 @@
|
||||
IsHitTestVisible="False"
|
||||
ItemsSource="{Binding Steps.VMList}"
|
||||
Visibility="{Binding Steps.VMList.Count, Converter={StaticResource CollectionCountToVisibilityConverter}}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Padding" Value="0" />
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style TargetType="ListBoxItem">
|
||||
<Setter Property="Padding" Value="0" />
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock
|
||||
x:Name="arrow"
|
||||
Margin="3"
|
||||
VerticalAlignment="Center"
|
||||
Text="➔" />
|
||||
<Border
|
||||
<Border
|
||||
x:Name="border1"
|
||||
Height="19"
|
||||
Margin="0"
|
||||
@@ -351,48 +352,49 @@
|
||||
HorizontalAlignment="Left"
|
||||
Background="DarkGray"
|
||||
CornerRadius="7">
|
||||
<TextBlock
|
||||
<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 RelativeSource={RelativeSource PreviousData}}" Value="{x:Null}">
|
||||
<Setter TargetName="arrow" Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsValid}" Value="false">
|
||||
<Setter TargetName="border1" Property="Background" Value="LightCoral" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
</ListBox>
|
||||
<StackPanel
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<DataTemplate.Triggers>
|
||||
<DataTrigger Binding="{Binding RelativeSource={RelativeSource PreviousData}}" Value="{x:Null}">
|
||||
<Setter TargetName="arrow" Property="Visibility" Value="Collapsed" />
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding IsValid}" Value="false">
|
||||
<Setter TargetName="border1" Property="Background" Value="LightCoral" />
|
||||
</DataTrigger>
|
||||
</DataTemplate.Triggers>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
</ListBox>
|
||||
<StackPanel
|
||||
Grid.Row="3"
|
||||
Grid.Column="2"
|
||||
Orientation="Horizontal"
|
||||
Visibility="{Binding IsValid, Converter={StaticResource BoolVisibilityConverter}, ConverterParameter=reverse}">
|
||||
|
||||
<Image
|
||||
<Image
|
||||
x:Name="imgWarning"
|
||||
Grid.Column="2"
|
||||
Height="20"
|
||||
Margin="6,0"
|
||||
Source="{Binding Source={x:Static draw:SystemIcons.Warning}, Converter={StaticResource IconToImageSourceConverter}, Mode=OneWay}" />
|
||||
<!-- Visibility="{Binding ElementName=btnOpenAi4, Path=Visibility}" -->
|
||||
<Label Foreground="Red">
|
||||
Ungültig
|
||||
</Label>
|
||||
</StackPanel>
|
||||
<!-- Visibility="{Binding ElementName=btnOpenAi4, Path=Visibility}" -->
|
||||
<Label Foreground="Red">
|
||||
Ungültig
|
||||
</Label>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
@@ -417,13 +419,13 @@
|
||||
<TreeView
|
||||
x:Name="treeView"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Grid.Column="0"
|
||||
MinHeight="100"
|
||||
Padding="4,16,4,16"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
AllowDrop="True"
|
||||
BorderThickness="1,0,0,1"
|
||||
BorderThickness="1,1,0,1"
|
||||
ContextMenuOpening="treeView_ContextMenuOpening"
|
||||
Focusable="True"
|
||||
ItemContainerStyle="{DynamicResource igoal_treeitemstyle}"
|
||||
|
||||
@@ -970,13 +970,15 @@ namespace BeWo.ViewModel
|
||||
Oid = -5,
|
||||
Title = "Favoriten",
|
||||
Description = "Eigene Favoriten",
|
||||
SubPrompts = new List<AiPromptbausteinPromptDC>()
|
||||
SubPrompts = new List<AiPromptbausteinPromptDC>(),
|
||||
SubRoutines = new List<AiPromptbausteinRoutineDC>()
|
||||
};
|
||||
var fav_vm = new AiPromptbausteinFolderVM(favoriten);
|
||||
|
||||
fav_vm.SubPrompts.VMList.Clear();
|
||||
fav_vm.SubRoutines.VMList.Clear();
|
||||
|
||||
folders.VMList[0].SubFolders.VMList.Insert(0, fav_vm);
|
||||
folders.VMList.Insert(0, fav_vm);
|
||||
|
||||
findFavoriten(folders, fav_vm);
|
||||
}
|
||||
|
||||
@@ -156,8 +156,8 @@ namespace BeWo.ViewModel.View.AI
|
||||
public AiPromptbausteinFolderListVM Folders { get; private set; }
|
||||
public AiActionType LoadedActionType { get; set; }
|
||||
|
||||
public AiPromptbausteinFolderVM RootFolders => Folders.VMList[0];
|
||||
public AiPromptbausteinFolderVM FavoritenFolder => RootFolders.SubFolders.VMList[0];
|
||||
public AiPromptbausteinFolderVM FavoritenFolder => Folders.VMList[0];
|
||||
public AiPromptbausteinFolderVM RootFolders => Folders.VMList[1];
|
||||
|
||||
public bool HasFavoriten
|
||||
{
|
||||
@@ -168,7 +168,7 @@ namespace BeWo.ViewModel.View.AI
|
||||
return true;
|
||||
#endif
|
||||
|
||||
return RootFolders.SubFolders.Count > 3 && (FavoritenFolder.Prompts.Count > 0 || FavoritenFolder.Routines.Count > 0);
|
||||
return Folders.Count > 1 && (FavoritenFolder.Prompts.Count > 0 || FavoritenFolder.Routines.Count > 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -180,10 +180,8 @@ namespace BeWo.ViewModel.View.AI
|
||||
|
||||
SelectedFolder = null;
|
||||
|
||||
// Favoriten-Popup: Favoriten (VMList[0]), sonst "Eigene" (VMList[1]) vorauswählen.
|
||||
var target = IsFavorite
|
||||
? (RootFolders.SubFolders.Count > 0 ? RootFolders.SubFolders.VMList[0] : null)
|
||||
: (RootFolders.SubFolders.Count > 1 ? RootFolders.SubFolders.VMList[1] : null);
|
||||
// Favoriten-Popup:
|
||||
var target = IsFavorite ? FavoritenFolder : RootFolders;
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
@@ -216,7 +214,7 @@ namespace BeWo.ViewModel.View.AI
|
||||
{
|
||||
VMFactory.CreateAiPromptbausteinFolderListVMAsync(AiActionType, UpdateVMList);
|
||||
|
||||
if(notify)
|
||||
if (notify)
|
||||
VMListReloaded?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
private void UpdateVMList(AiPromptbausteinFolderListVM new_list)
|
||||
|
||||
@@ -29,7 +29,8 @@ namespace BeWo.ViewModel.View.Administration
|
||||
private AiActionType AiActionType { get; set; }
|
||||
|
||||
public AiPromptbausteinFolderListVM Folders { get; set; }
|
||||
public AiPromptbausteinFolderVM Favoriten { get; set; }
|
||||
public AiPromptbausteinFolderVM Favoriten => Folders.VMList[0];
|
||||
public AiPromptbausteinFolderVM RootFolders => Folders.VMList[1];
|
||||
|
||||
public AiPromptbausteinFolderVM CopiedFolder { get; set; }
|
||||
public AiPromptbausteinPromptVM CopiedPrompt { get; set; }
|
||||
@@ -186,19 +187,11 @@ namespace BeWo.ViewModel.View.Administration
|
||||
listvm =>
|
||||
{
|
||||
Folders = listvm;
|
||||
if (Folders.VMList.Count > 0
|
||||
&& Folders.VMList[0].DataContract.Oid == -51
|
||||
&& Folders.VMList[0].SubFolders.Count > 0
|
||||
&& Folders.VMList[0].SubFolders.VMList[0].DataContract.Oid == -5)
|
||||
{
|
||||
Favoriten = Folders.VMList[0].SubFolders.VMList[0];
|
||||
}
|
||||
|
||||
if (Folders.VMList.Count > 0
|
||||
&& Folders.VMList[0].DataContract.Oid == -51
|
||||
&& Folders.VMList[0].SubFolders.Count > 1
|
||||
&& Folders.VMList[0].SubFolders.VMList[1].DataContract.Oid == -1)
|
||||
Folders.VMList[0].SubFolders.VMList[1].IsSelected = true;
|
||||
if (RootFolders.SubFolders.VMList[0].DataContract.Oid == -1)
|
||||
{
|
||||
RootFolders.SubFolders.VMList[0].IsSelected = true;
|
||||
}
|
||||
|
||||
FirePropertyChanged(nameof(Folders));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user