Merge branch 'feature_rene_18_ai'
This commit is contained in:
@@ -237,7 +237,8 @@ namespace BeWo.Services
|
||||
|
||||
if (windowViewModel is DialogViewModel dialogViewModel)
|
||||
{
|
||||
dialogViewModel.RequestCloseFinal += (s, e) => window.Close();
|
||||
dialogViewModel.Closing += (s, e) => window.Close();
|
||||
window.Closed += (s, e) => dialogViewModel.CloseFinalCommand.Execute(null);
|
||||
}
|
||||
|
||||
if (options.ShowAsDialog)
|
||||
|
||||
@@ -52,4 +52,129 @@
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PopUpWindowStyle2" TargetType="{x:Type GroupBox}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type GroupBox}">
|
||||
<Grid SnapsToDevicePixels="True">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="10" />
|
||||
<RowDefinition Height="20" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Grid.RowSpan="2"
|
||||
Background="#FF202020"
|
||||
CornerRadius="3,1,0,3" />
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="#FF202020"
|
||||
CornerRadius="0,1,0,3" />
|
||||
<Path
|
||||
Grid.Column="1"
|
||||
Data="M 0,0 L 10,10 H 0 Z"
|
||||
Fill="#FF202020"
|
||||
StrokeThickness="0" />
|
||||
<Border
|
||||
x:Name="Header"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Margin="0,0,0,0"
|
||||
Padding="10,0,3,0"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="{x:Null}">
|
||||
<ContentPresenter
|
||||
Margin="5,0,0,3"
|
||||
VerticalAlignment="Stretch"
|
||||
Content="{TemplateBinding Header}"
|
||||
ContentSource="Header"
|
||||
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
|
||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||
RecognizesAccessKey="True"
|
||||
RenderTransformOrigin="0,0.5"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextElement.FontSize="16">
|
||||
<ContentPresenter.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||
<SkewTransform AngleX="0" AngleY="0" />
|
||||
<RotateTransform Angle="0" />
|
||||
<TranslateTransform X="0" Y="0" />
|
||||
</TransformGroup>
|
||||
</ContentPresenter.RenderTransform>
|
||||
</ContentPresenter>
|
||||
</Border>
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Grid.RowSpan="1"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="2"
|
||||
Padding="5,5,5,5">
|
||||
<ContentPresenter
|
||||
Margin="0,0,0,0"
|
||||
Content="{TemplateBinding Content}"
|
||||
ContentStringFormat="{TemplateBinding ContentStringFormat}"
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Border>
|
||||
<Path
|
||||
x:Name="isDirtyShape"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="0"
|
||||
Width="18.21"
|
||||
Height="17.336"
|
||||
Margin="0,0,41.007,3"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Data="M8.0969173,7.7938912 L7.3260856,1.6313261E-55 10.960733,0.056791361 9.8816968,7.8372078 17.130865,4.505709 18.209901,7.969982 10.336028,9.4841573 16.015164,15.065028 13.005222,17.336183 9.0298264,10.44961 4.7503484,17.141891 1.9107803,14.614571 7.6195467,9.5947088 4.3790577E-47,7.8281079 1.0589099,4.5910004 z"
|
||||
RenderTransformOrigin="0.5,0.5"
|
||||
StrokeThickness="0">
|
||||
<Path.Fill>
|
||||
<LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
|
||||
<GradientStop Offset="0" Color="#FFFB6F0E" />
|
||||
<GradientStop Offset="1" Color="#FF8C400A" />
|
||||
</LinearGradientBrush>
|
||||
</Path.Fill>
|
||||
<Path.RenderTransform>
|
||||
<TransformGroup>
|
||||
<ScaleTransform ScaleX="0" ScaleY="0" />
|
||||
<SkewTransform AngleX="0" AngleY="0" />
|
||||
<RotateTransform Angle="0" />
|
||||
<TranslateTransform X="0" Y="0" />
|
||||
</TransformGroup>
|
||||
</Path.RenderTransform>
|
||||
</Path>
|
||||
<Button
|
||||
x:Name="button_close"
|
||||
Grid.Row="0"
|
||||
Grid.RowSpan="2"
|
||||
Grid.Column="0"
|
||||
Grid.ColumnSpan="1"
|
||||
Width="20"
|
||||
Height="20"
|
||||
Margin="3,3,3,3"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding CloseCommand}"
|
||||
Style="{DynamicResource CloseButtonStyle}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="{DynamicResource MainGroupBoxForegroundBrush}" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="FontFamily" Value="Microsoft Sans Serif" />
|
||||
<Setter Property="FontSize" Value="11" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
@@ -67,12 +67,13 @@ namespace BeWo.View.Controls.AI
|
||||
{
|
||||
var viewmodel = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm);
|
||||
viewmodel.ItemAccepted += ItemAccepted;
|
||||
viewmodel.RequestCloseFinal += (s, e) => viewmodel.ResetSelection();
|
||||
viewmodel.Closed += (s, e) => viewmodel.ResetSelection();
|
||||
ViewModel.AllPromptsViewModel = viewmodel;
|
||||
|
||||
var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm, true);
|
||||
viewmodel2.ItemAccepted += ItemAccepted;
|
||||
popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.ResetSelection();
|
||||
popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.CloseFinalCommand.Execute(null);
|
||||
viewmodel2.Closed += (s, e) => viewmodel2.ResetSelection();
|
||||
var view2 = new AiPromptbausteinComplexSelectionFavoritenView(viewmodel2);
|
||||
viewmodel2.SelectedFolder = viewmodel2.Folders.VMList[0];
|
||||
view2.Padding = new Thickness(3);
|
||||
|
||||
@@ -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>
|
||||
@@ -414,22 +416,16 @@
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<GroupBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="0,7,0,0"
|
||||
Padding="0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Header="Bibliothek"
|
||||
Style="{StaticResource ObjectEditGroupBox}">
|
||||
<TreeView
|
||||
<TreeView
|
||||
x:Name="treeView"
|
||||
Grid.Row="1"
|
||||
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}"
|
||||
@@ -439,18 +435,18 @@
|
||||
PreviewMouseRightButtonDown="OnPreviewMouseRightButtonDown"
|
||||
SelectedItemChanged="treeView_SelectedItemChanged"
|
||||
TreeViewItem.Selected="treeView_Selected">
|
||||
<TreeView.Resources>
|
||||
<Style x:Key="igoal_treeitemstyle" TargetType="TreeViewItem">
|
||||
<Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</TreeView.Resources>
|
||||
<TreeView.InputBindings>
|
||||
<KeyBinding Key="Delete" Command="{Binding DeleteFolderCommand}" />
|
||||
<KeyBinding Key="Enter" Command="{Binding OpenEditFolderDialogCommand}" />
|
||||
<KeyBinding Key="N" Command="{Binding OpenAddFolderDialogCommand}" />
|
||||
<!--<KeyBinding
|
||||
<TreeView.Resources>
|
||||
<Style x:Key="igoal_treeitemstyle" TargetType="TreeViewItem">
|
||||
<Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
|
||||
<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />
|
||||
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</TreeView.Resources>
|
||||
<TreeView.InputBindings>
|
||||
<KeyBinding Key="Delete" Command="{Binding DeleteFolderCommand}" />
|
||||
<KeyBinding Key="Enter" Command="{Binding OpenEditFolderDialogCommand}" />
|
||||
<KeyBinding Key="N" Command="{Binding OpenAddFolderDialogCommand}" />
|
||||
<!--<KeyBinding
|
||||
Key="C"
|
||||
Command="{Binding CopyFolderCommand}"
|
||||
Modifiers="Ctrl" />
|
||||
@@ -458,33 +454,33 @@
|
||||
Key="V"
|
||||
Command="{Binding PasteFolderCommand}"
|
||||
Modifiers="Ctrl" />-->
|
||||
</TreeView.InputBindings>
|
||||
<TreeView.ContextMenu>
|
||||
<ContextMenu>
|
||||
<ContextMenu.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="Height" Value="24" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</ContextMenu.Resources>
|
||||
<MenuItem
|
||||
</TreeView.InputBindings>
|
||||
<TreeView.ContextMenu>
|
||||
<ContextMenu>
|
||||
<ContextMenu.Resources>
|
||||
<ResourceDictionary>
|
||||
<Style TargetType="{x:Type Image}">
|
||||
<Setter Property="Height" Value="24" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
</ContextMenu.Resources>
|
||||
<MenuItem
|
||||
Command="{Binding OpenAddFolderDialogCommand}"
|
||||
Header="Neuer Ordner"
|
||||
ToolTip="Shortcut: N">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Add24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Add24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem
|
||||
Command="{Binding OpenEditFolderDialogCommand}"
|
||||
Header="Bearbeiten"
|
||||
ToolTip="Shortcut: Enter">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Rename24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<!--<Separator />
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Rename24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<!--<Separator />
|
||||
<MenuItem
|
||||
Command="{Binding CopyFolderCommand}"
|
||||
Header="Kopieren"
|
||||
@@ -501,19 +497,18 @@
|
||||
<Image Source="..\..\..\Ressources\Icons\Paste24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>-->
|
||||
<Separator />
|
||||
<MenuItem
|
||||
<Separator />
|
||||
<MenuItem
|
||||
Command="{Binding DeleteFolderCommand}"
|
||||
Header="Löschen"
|
||||
ToolTip="Shortcut: Entf">
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Delete24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</TreeView.ContextMenu>
|
||||
</TreeView>
|
||||
</GroupBox>
|
||||
<MenuItem.Icon>
|
||||
<Image Source="..\..\..\Ressources\Icons\Delete24.png" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</TreeView.ContextMenu>
|
||||
</TreeView>
|
||||
<GridSplitter
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
@@ -524,7 +519,7 @@
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Grid.ColumnSpan="2">
|
||||
<Grid.Resources>
|
||||
<!--<Grid.Resources>
|
||||
<Style TargetType="Grid">
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding ElementName=treeView, Path=SelectedItem}" Value="{x:Null}">
|
||||
@@ -532,7 +527,7 @@
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
</Grid.Resources>-->
|
||||
<TabControl
|
||||
x:Name="tabcontrol_1"
|
||||
Padding="0"
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
Grid.Column="2"
|
||||
IsEnabled="False"
|
||||
Style="{StaticResource TextEditNumber}"
|
||||
Text="{Binding Oid}" />
|
||||
Text="{Binding Oid, Mode=OneWay}" />
|
||||
<Label
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
@@ -154,7 +154,7 @@
|
||||
Grid.Column="2"
|
||||
MaxLength="1024"
|
||||
Style="{StaticResource TextBoxNoticeLarge}"
|
||||
Text="{Binding Notice}"
|
||||
Text="{Binding Notice, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
@@ -230,24 +230,19 @@ namespace BeWo.View.Detail.Accounting
|
||||
|
||||
var dialog = new GkvAbrechnungDialogViewModel(vm);
|
||||
|
||||
dialog.RequestCloseFinal += (s, ee) => Detail_Window_Closing(s, new CancelEventArgs());
|
||||
dialog.Closing += (s, ee) => Detail_Window_Closing(s, new CancelEventArgs());
|
||||
|
||||
BeWoApp.MainControl.WindowService.ShowGkvAbrechnungDetailWindow(dialog);
|
||||
}
|
||||
|
||||
private void Detail_Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
var bewo_window = sender as AnimatedBeWoWindow;
|
||||
var detail_control = bewo_window.GroupBoxContent as GkvAbrechnungDetailControl;
|
||||
|
||||
var vm = detail_control.DataContext as GkvAbrechnungLightVM;
|
||||
var dialog = sender as GkvAbrechnungDialogViewModel;
|
||||
var vm = dialog.Abrechnung;
|
||||
|
||||
vm.CheckAllInvoiceBases();
|
||||
|
||||
var checkbox_checked = detail_control.Checkbox_Bezahlt.IsChecked;
|
||||
var textbox_text = detail_control.txt_Notice.Text;
|
||||
|
||||
vm.Notice = textbox_text;
|
||||
//vm.Notice = textbox_text;
|
||||
|
||||
if (vm.IsDirty)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
x:FieldModifier="public"
|
||||
MouseDoubleClick="RootGroupBox_OnMouseDoubleClick"
|
||||
MouseLeftButtonDown="RootGroupBox_OnMouseLeftButtonDown"
|
||||
Style="{DynamicResource PopUpWindowStyle}">
|
||||
Style="{DynamicResource PopUpWindowStyle2}">
|
||||
<GroupBox.CommandBindings>
|
||||
<CommandBinding Command="ApplicationCommands.Close" Executed="CommandBinding_Close_Executed" />
|
||||
<CommandBinding Command="ApplicationCommands.Save" Executed="CommandBinding_Save_Executed" />
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace BeWo.View.Windows
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => Close()));
|
||||
//CommandBindings.Add(new CommandBinding(ApplicationCommands.Close, (s, e) => Close()));
|
||||
|
||||
if(ServiceFacade.IsWaiting())
|
||||
StartWaiting();
|
||||
@@ -169,7 +169,7 @@ namespace BeWo.View.Windows
|
||||
|
||||
public void Window_Closed(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void StartWaiting()
|
||||
|
||||
@@ -245,7 +245,7 @@ namespace BeWo.ViewModel
|
||||
|
||||
public AiPromptbausteinFolderVM Parent { get; set; }
|
||||
|
||||
public FontWeight FontWeight => !IsNew && Parent is null ? FontWeights.SemiBold : FontWeights.Medium;
|
||||
public FontWeight FontWeight => !IsNew && (Parent is null || Parent.Parent is null) ? FontWeights.SemiBold : FontWeights.Medium;
|
||||
public bool HasSubFolders => SubFolders is object && SubFolders.Count > 0;
|
||||
|
||||
public int TotalPromptCount
|
||||
|
||||
@@ -26,8 +26,6 @@ namespace BeWo.ViewModel.Light
|
||||
|
||||
public static string PropertyName_ErstelltAm = "ErstelltAm";
|
||||
|
||||
private long _Oid;
|
||||
private long _Version;
|
||||
private string _Notice;
|
||||
|
||||
private long _OrganisationOid;
|
||||
@@ -118,31 +116,11 @@ namespace BeWo.ViewModel.Light
|
||||
public DateTime ErstelltAmDate => ErstelltAm.Date;
|
||||
public long Oid
|
||||
{
|
||||
get { return this._Oid; }
|
||||
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(this._Oid, value))
|
||||
{
|
||||
this._Oid = value;
|
||||
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Oid, value), nameof(Oid));
|
||||
this.FirePropertyChanged(nameof(Oid));
|
||||
}
|
||||
}
|
||||
get => DataContract.Oid;
|
||||
}
|
||||
public long Version
|
||||
{
|
||||
get { return this._Version; }
|
||||
|
||||
set
|
||||
{
|
||||
if (this.AreDifferent(this._Version, value))
|
||||
{
|
||||
this._Version = value;
|
||||
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Version, value), nameof(Version));
|
||||
this.FirePropertyChanged(nameof(Version));
|
||||
}
|
||||
}
|
||||
get => DataContract.Version;
|
||||
}
|
||||
public string Notice
|
||||
{
|
||||
@@ -352,7 +330,7 @@ namespace BeWo.ViewModel.Light
|
||||
|
||||
public override void UpdateByDataContract(GkvAbrechnungLightDC pDataContract)
|
||||
{
|
||||
Version = pDataContract.Version;
|
||||
DataContract = pDataContract;
|
||||
|
||||
Notice = pDataContract.Notice;
|
||||
|
||||
@@ -373,9 +351,6 @@ namespace BeWo.ViewModel.Light
|
||||
|
||||
_ErstelltAm = pDataContract.ErstelltAm;
|
||||
|
||||
_Oid = pDataContract.Oid;
|
||||
_Version = pDataContract.Version;
|
||||
|
||||
_Notice = pDataContract.Notice;
|
||||
|
||||
_Betrag = pDataContract.Betrag;
|
||||
@@ -402,8 +377,6 @@ namespace BeWo.ViewModel.Light
|
||||
}
|
||||
protected override GkvAbrechnungLightDC MapToDataContract(GkvAbrechnungLightDC pDataContract, bool doCommit)
|
||||
{
|
||||
pDataContract.Version = _Version;
|
||||
|
||||
pDataContract.Notice = _Notice;
|
||||
pDataContract.Betrag = _Betrag;
|
||||
pDataContract.Bezahlt = _Bezahlt;
|
||||
@@ -421,7 +394,6 @@ namespace BeWo.ViewModel.Light
|
||||
return;
|
||||
}
|
||||
|
||||
Version = dc.Version;
|
||||
Protokolle = dc.Protokolle.ToList();
|
||||
|
||||
IsReady2Send = dc.IsReady2Send;
|
||||
|
||||
@@ -970,11 +970,13 @@ 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.Insert(0, fav_vm);
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ namespace BeWo.ViewModel.View.AI
|
||||
{
|
||||
Folders = new AiPromptbausteinFolderListVM();
|
||||
}
|
||||
|
||||
//Closing += (s, e) => ResetSelection();
|
||||
}
|
||||
public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType) : this()
|
||||
{
|
||||
@@ -84,7 +86,7 @@ namespace BeWo.ViewModel.View.AI
|
||||
public AiPromptbausteinSelectionComplexViewModel(AiActionType aiActionType, AiPromptbausteinFolderListVM viewModel, bool isFavorite = false, bool canOpen = true) : this(aiActionType)
|
||||
{
|
||||
LoadedActionType = aiActionType;
|
||||
Folders = viewModel;
|
||||
UpdateVMList(viewModel);
|
||||
IsFavorite = isFavorite;
|
||||
CanOpenContextMenu = canOpen;
|
||||
}
|
||||
@@ -154,6 +156,9 @@ namespace BeWo.ViewModel.View.AI
|
||||
public AiPromptbausteinFolderListVM Folders { get; private set; }
|
||||
public AiActionType LoadedActionType { get; set; }
|
||||
|
||||
public AiPromptbausteinFolderVM FavoritenFolder => Folders.VMList[0];
|
||||
public AiPromptbausteinFolderVM RootFolders => Folders.VMList[1];
|
||||
|
||||
public bool HasFavoriten
|
||||
{
|
||||
get
|
||||
@@ -163,7 +168,7 @@ namespace BeWo.ViewModel.View.AI
|
||||
return true;
|
||||
#endif
|
||||
|
||||
return Folders.Count > 3 && (Folders.VMList[0].Prompts.Count > 0 || Folders.VMList[0].Routines.Count > 0);
|
||||
return Folders.Count > 1 && (FavoritenFolder.Prompts.Count > 0 || FavoritenFolder.Routines.Count > 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,10 +180,8 @@ namespace BeWo.ViewModel.View.AI
|
||||
|
||||
SelectedFolder = null;
|
||||
|
||||
// Favoriten-Popup: Favoriten (VMList[0]), sonst "Eigene" (VMList[1]) vorauswählen.
|
||||
var target = IsFavorite
|
||||
? (Folders.VMList.Count > 0 ? Folders.VMList[0] : null)
|
||||
: (Folders.VMList.Count > 1 ? Folders.VMList[1] : null);
|
||||
// Favoriten-Popup:
|
||||
var target = IsFavorite ? FavoritenFolder : RootFolders;
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
@@ -211,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)
|
||||
@@ -220,17 +223,23 @@ namespace BeWo.ViewModel.View.AI
|
||||
|
||||
FirePropertyChanged(nameof(Folders));
|
||||
|
||||
if (Folders.VMList.Count > 0 && Folders.VMList[0].DataContract.Oid == -5)
|
||||
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];
|
||||
Favoriten = Folders.VMList[0].SubFolders.VMList[0];
|
||||
|
||||
if (IsFavorite)
|
||||
SelectedFolder = Favoriten;
|
||||
}
|
||||
|
||||
// "Eigene" (VMList[1]) im normalen Modus vorauswählen.
|
||||
if (!IsFavorite && Folders.VMList.Count > 1)
|
||||
Folders.VMList[1].IsSelected = true;
|
||||
if (!IsFavorite &&
|
||||
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;
|
||||
|
||||
FirePropertyChanged(nameof(HasFavoriten));
|
||||
}
|
||||
|
||||
@@ -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; }
|
||||
@@ -81,7 +82,8 @@ namespace BeWo.ViewModel.View.Administration
|
||||
public AbstractBaseVM SelectedItem
|
||||
{
|
||||
get => _SelectedItem;
|
||||
set {
|
||||
set
|
||||
{
|
||||
var success = SetProperty(ref _SelectedItem, value, nameof(SelectedItem));
|
||||
|
||||
if (!success)
|
||||
@@ -169,7 +171,7 @@ namespace BeWo.ViewModel.View.Administration
|
||||
OpenAddRoutineDialogCommand.RaiseCanExecuteChanged();
|
||||
OpenEditRoutineDialogCommand.RaiseCanExecuteChanged();
|
||||
DeleteRoutineCommand.RaiseCanExecuteChanged();
|
||||
ChangeFavoritenStateRoutineCommand.RaiseCanExecuteChanged();
|
||||
ChangeFavoritenStateRoutineCommand.RaiseCanExecuteChanged();
|
||||
}
|
||||
public void UpdateItemCommands()
|
||||
{
|
||||
@@ -185,13 +187,11 @@ namespace BeWo.ViewModel.View.Administration
|
||||
listvm =>
|
||||
{
|
||||
Folders = listvm;
|
||||
if (Folders.VMList.Count > 0 && Folders.VMList[0].DataContract.Oid == -5)
|
||||
{
|
||||
Favoriten = Folders.VMList[0];
|
||||
}
|
||||
|
||||
if (Folders.VMList.Count > 1)
|
||||
Folders.VMList[1].IsSelected = true;
|
||||
if (RootFolders.SubFolders.VMList[0].DataContract.Oid == -1)
|
||||
{
|
||||
RootFolders.SubFolders.VMList[0].IsSelected = true;
|
||||
}
|
||||
|
||||
FirePropertyChanged(nameof(Folders));
|
||||
});
|
||||
|
||||
@@ -1,25 +1,35 @@
|
||||
using DevExpress.Mvvm;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace BeWo.ViewModel.View
|
||||
{
|
||||
public class DialogViewModel : WindowViewModel
|
||||
{
|
||||
public event EventHandler RequestCloseFinal;
|
||||
public event EventHandler Closing;
|
||||
public event EventHandler Closed;
|
||||
|
||||
public DialogViewModel() : base()
|
||||
public DelegateCommand CloseCommand { get; set; }
|
||||
public DelegateCommand CloseFinalCommand { get; set; }
|
||||
|
||||
protected DialogViewModel() : base()
|
||||
{
|
||||
|
||||
CloseCommand = new DelegateCommand(Close, canClose, false);
|
||||
CloseFinalCommand = new DelegateCommand(CloseFinal, canClose, false);
|
||||
}
|
||||
|
||||
protected virtual void Close()
|
||||
{
|
||||
RequestCloseFinal?.Invoke(this, EventArgs.Empty);
|
||||
Closing?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual void CloseFinal()
|
||||
{
|
||||
Closed?.Invoke(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
protected virtual bool canClose()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user