unused
This commit is contained in:
@@ -179,15 +179,9 @@
|
||||
<Compile Include="ViewModel\View\DialogViewModel.cs" />
|
||||
<Compile Include="ViewModel\View\Gkv\GkvAbrechnungDialogViewModel.cs" />
|
||||
<Compile Include="ViewModel\View\WindowViewModel.cs" />
|
||||
<Compile Include="View\Controls\AI\AiConversationButton.xaml.cs">
|
||||
<DependentUpon>AiConversationButton.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Controls\AI\AiChatButton.xaml.cs">
|
||||
<DependentUpon>AiChatButton.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Controls\AI\AiPromptbausteinButton.xaml.cs">
|
||||
<DependentUpon>AiPromptbausteinButton.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="View\Controls\AI\AiPromptbausteinLibraryControl.xaml.cs">
|
||||
<DependentUpon>AiPromptbausteinLibraryControl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -312,18 +306,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="View\Controls\AI\AiConversationButton.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="View\Controls\AI\AiChatButton.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="View\Controls\AI\AiPromptbausteinButton.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="View\Controls\AI\AiPromptbausteinLibraryControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="BeWo.View.Controls.AI.AiConversationButton"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ai="clr-namespace:BeWo.View.Detail.AI"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:draw="clr-namespace:System.Drawing;assembly=System.Drawing"
|
||||
xmlns:local="clr-namespace:BeWo.View.Controls.AI"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="root"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<StackPanel
|
||||
Margin="0"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<StackPanel.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="..\..\..\Styles\ModernOrangeBlack.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</StackPanel.Resources>
|
||||
<Button
|
||||
x:Name="btnOpenAi4"
|
||||
Height="30"
|
||||
Margin="0"
|
||||
Background="Transparent"
|
||||
Click="btnOpenAi4_Click"
|
||||
Content="{StaticResource AiDesignsIconKIChatWeissOrange}"
|
||||
Style="{StaticResource NavigationToolbarButtonStyle}"
|
||||
ToolTip="KI Chat öffnen"
|
||||
ToolTipService.ShowOnDisabled="True" />
|
||||
<Button
|
||||
x:Name="btnOpenAi5"
|
||||
Height="30"
|
||||
Margin="10,0,0,0"
|
||||
Background="Transparent"
|
||||
Click="btnOpenAi5_Click"
|
||||
Content="{StaticResource AiDesignsIconKIFunktionWeissGruen}"
|
||||
MouseRightButtonUp="btnOpenAi5_MouseRightButtonUp"
|
||||
Style="{StaticResource NavigationToolbarButtonStyle}"
|
||||
ToolTip="KI Chat mit Prompt-Baustein starten"
|
||||
ToolTipService.ShowOnDisabled="True">
|
||||
<!--<Button.InputBindings>
|
||||
<MouseBinding Command="{Binding AiPromptOpenFavoriteCommand, ElementName=root}" Gesture="RightClick" />
|
||||
<MouseBinding Command="{Binding AiPromptOpenAllCommand, ElementName=root}" Gesture="LeftClick" />
|
||||
</Button.InputBindings>-->
|
||||
</Button>
|
||||
<Image
|
||||
x:Name="imgWarning"
|
||||
Height="20"
|
||||
Margin="10,0,0,0"
|
||||
Source="{Binding Source={x:Static draw:SystemIcons.Warning}, Converter={StaticResource IconToImageSourceConverter}, Mode=OneWay}"
|
||||
Visibility="Visible">
|
||||
<!-- Visibility="{Binding ElementName=btnOpenAi4, Path=Visibility}" -->
|
||||
|
||||
<Image.ToolTip>
|
||||
Die aktuelle Ansicht beinhaltet zu viele Daten.
|
||||
Es können keine neuen Chats zu dieser Ansicht erstellt werden.
|
||||
</Image.ToolTip>
|
||||
</Image>
|
||||
</StackPanel>
|
||||
<!--<Popup
|
||||
x:Name="popup_promptbaustein_all"
|
||||
Width="600"
|
||||
Height="400"
|
||||
Placement="Top"
|
||||
PlacementTarget="{Binding ElementName=btnOpenAi5}"
|
||||
StaysOpen="False">
|
||||
<Border x:Name="border_promptbaustein_al" BorderThickness="1" />
|
||||
</Popup>-->
|
||||
<Popup
|
||||
x:Name="popup_promptbaustein_favoriten"
|
||||
Placement="Top"
|
||||
PlacementTarget="{Binding ElementName=btnOpenAi5}"
|
||||
StaysOpen="False">
|
||||
<Border x:Name="border_promptbaustein_favoriten" BorderThickness="1" />
|
||||
</Popup>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,196 +0,0 @@
|
||||
using BeWo.ServiceProxy;
|
||||
using BeWo.View.Detail.AI;
|
||||
using BeWo.ViewModel;
|
||||
using BeWo.ViewModel.View.AI;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using DevExpress.Mvvm;
|
||||
using DevExpress.Pdf.Native.BouncyCastle.Asn1.BC;
|
||||
using DevExpress.Web.Internal.XmlProcessor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace BeWo.View.Controls.AI
|
||||
{
|
||||
public enum AiConversationButtonState
|
||||
{
|
||||
Hidden,
|
||||
Normal,
|
||||
Loading,
|
||||
Warning,
|
||||
Disabled
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interaktionslogik für AIConversationButton.xaml
|
||||
/// </summary>
|
||||
public partial class AiConversationButton : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty StateProperty =
|
||||
DependencyProperty.Register("State", typeof(AiConversationButtonState), typeof(AiConversationButton), new PropertyMetadata(AiConversationButtonState.Normal, OnStateChanged));
|
||||
|
||||
public static readonly DependencyProperty ActionTypeProperty =
|
||||
DependencyProperty.Register("ActionType", typeof(AiActionType), typeof(AiConversationButton), new PropertyMetadata(AiActionType.ServiceRecord, OnActionTypeChanged));
|
||||
|
||||
|
||||
public event RoutedEventHandler OpenAiWindowClick;
|
||||
|
||||
public event EventHandler<AbstractBaseVM> ItemAccepted;
|
||||
|
||||
public AiConversationButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
public AiConversationButtonState State
|
||||
{
|
||||
get { return (AiConversationButtonState)GetValue(StateProperty); }
|
||||
set { SetValue(StateProperty, value); }
|
||||
}
|
||||
public AiActionType ActionType
|
||||
{
|
||||
get { return (AiActionType)GetValue(ActionTypeProperty); }
|
||||
set { SetValue(ActionTypeProperty, value); }
|
||||
}
|
||||
|
||||
public AiPromptbausteinSelectionComplexViewModel AllPromptsViewModel { get; set; }
|
||||
|
||||
public string Tooltip { get; set; }
|
||||
public bool IsButtonEnabled { get; set; }
|
||||
public bool IsButton2Enabled { get; set; }
|
||||
public bool IsButtonVisible { get; set; }
|
||||
public bool IsButton2Visible { get; set; }
|
||||
public bool IsWarningSignVisible { get; set; }
|
||||
|
||||
public void AiPromptOpenAll()
|
||||
{
|
||||
//popup_promptbaustein_all.IsOpen = true;
|
||||
//OpenAiPromptClick?.Invoke(this, e);
|
||||
BeWoApp.MainControl.WindowService.Show(AllPromptsViewModel);
|
||||
}
|
||||
public void AiPromptOpenFavorite()
|
||||
{
|
||||
popup_promptbaustein_favoriten.IsOpen = true;
|
||||
}
|
||||
|
||||
private void UpdateState()
|
||||
{
|
||||
switch (State)
|
||||
{
|
||||
case AiConversationButtonState.Hidden:
|
||||
Tooltip = string.Empty;
|
||||
IsButtonEnabled = false;
|
||||
IsButton2Enabled = false;
|
||||
IsButtonVisible = false;
|
||||
IsButton2Visible = false;
|
||||
IsWarningSignVisible = false;
|
||||
break;
|
||||
case AiConversationButtonState.Normal:
|
||||
Tooltip = string.Empty;
|
||||
IsButtonEnabled = true;
|
||||
IsButton2Enabled = true;
|
||||
IsButtonVisible = true;
|
||||
IsButton2Visible = true;
|
||||
IsWarningSignVisible = false;
|
||||
break;
|
||||
case AiConversationButtonState.Loading:
|
||||
Tooltip = "Lädt";
|
||||
IsButtonEnabled = false;
|
||||
IsButton2Enabled = false;
|
||||
IsButtonVisible = true;
|
||||
IsButton2Visible = true;
|
||||
IsWarningSignVisible = false;
|
||||
break;
|
||||
case AiConversationButtonState.Warning:
|
||||
Tooltip = string.Empty;
|
||||
IsButtonEnabled = true;
|
||||
IsButton2Enabled = false;
|
||||
IsButtonVisible = true;
|
||||
IsButton2Visible = false;
|
||||
IsWarningSignVisible = true;
|
||||
break;
|
||||
case AiConversationButtonState.Disabled:
|
||||
Tooltip = string.Empty;
|
||||
IsButtonEnabled = false;
|
||||
IsButton2Enabled = false;
|
||||
IsButtonVisible = true;
|
||||
IsButton2Visible = true;
|
||||
IsWarningSignVisible = false;
|
||||
break;
|
||||
}
|
||||
|
||||
btnOpenAi5.ToolTip = btnOpenAi4.ToolTip = ToolTip;
|
||||
btnOpenAi4.IsEnabled = IsButtonEnabled;
|
||||
btnOpenAi5.IsEnabled = IsButton2Enabled;
|
||||
btnOpenAi4.Visibility = IsButtonVisible ? Visibility.Visible : Visibility.Collapsed;
|
||||
btnOpenAi5.Visibility = IsButton2Visible ? Visibility.Visible : Visibility.Collapsed;
|
||||
imgWarning.Visibility = IsWarningSignVisible ? Visibility.Visible : Visibility.Collapsed;
|
||||
}
|
||||
private static void OnActionTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var control = (AiConversationButton)d;
|
||||
var actionType = (AiActionType)e.NewValue;
|
||||
if (BeWoApp.AppSettings.ShowAI && BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineView))
|
||||
{
|
||||
ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.GetAiPromptbausteinFolder(actionType), folders => control.InitPromptbausteine(actionType, folders));
|
||||
}
|
||||
|
||||
}
|
||||
private static void OnStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var control = (AiConversationButton)d;
|
||||
control.UpdateState();
|
||||
}
|
||||
private void btnOpenAi4_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
OpenAiWindowClick?.Invoke(this, e);
|
||||
}
|
||||
private void btnOpenAi5_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AiPromptOpenAll();
|
||||
}
|
||||
private void btnOpenAi5_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
AiPromptOpenFavorite();
|
||||
}
|
||||
private void InitPromptbausteine(AiActionType actionType, List<AiPromptbausteinFolderDC> folders)
|
||||
{
|
||||
VMFactory.CreateAiPromptbausteinFolderListVM(folders, (listvm) =>
|
||||
{
|
||||
var viewmodel = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm);
|
||||
viewmodel.ItemAccepted += ItemAccepted;
|
||||
viewmodel.RequestCloseFinal += (s, e) => viewmodel.ResetSelection();
|
||||
AllPromptsViewModel = viewmodel;
|
||||
|
||||
var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm, true);
|
||||
viewmodel2.ItemAccepted += ItemAccepted;
|
||||
popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.ResetSelection();
|
||||
var view2 = new AiPromptbausteinComplexSelectionFavoritenView(viewmodel2);
|
||||
viewmodel2.SelectedFolder = viewmodel2.Folders.VMList[0];
|
||||
view2.Padding = new Thickness(3);
|
||||
view2.Background = FindResource("ObjectEditBackgroundBrush") as System.Windows.Media.Brush;
|
||||
border_promptbaustein_favoriten.Child = view2;
|
||||
|
||||
viewmodel.VMListReloaded += (s, e) => viewmodel2.ReloadVMList(false);
|
||||
|
||||
//AiPromptOpenAllCommand = new DelegateCommand(AiPromptOpenAll);
|
||||
//AiPromptOpenFavoriteCommand = new DelegateCommand(AiPromptOpenFavorite);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="BeWo.View.Controls.AI.AiPromptbausteinButton"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ai="clr-namespace:BeWo.View.Detail.AI"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:draw="clr-namespace:System.Drawing;assembly=System.Drawing"
|
||||
xmlns:local="clr-namespace:BeWo.View.Controls.AI"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
x:Name="root"
|
||||
mc:Ignorable="d">
|
||||
<Grid>
|
||||
<StackPanel
|
||||
Margin="0"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<StackPanel.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="..\..\..\Styles\ModernOrangeBlack.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</StackPanel.Resources>
|
||||
<Button
|
||||
x:Name="btnOpenAi5"
|
||||
Margin="0"
|
||||
Click="btnOpenAi5_Click"
|
||||
Content="{StaticResource AiDesignsIconKIFunktionWeissGruen}"
|
||||
MouseRightButtonUp="btnOpenAi5_MouseRightButtonUp"
|
||||
Style="{StaticResource PrimaryButton}"
|
||||
ToolTip="KI Chat mit Prompt-Baustein starten"
|
||||
ToolTipService.ShowOnDisabled="True">
|
||||
<!--<Button.InputBindings>
|
||||
<MouseBinding Command="{Binding AiPromptOpenFavoriteCommand, ElementName=root}" Gesture="RightClick" />
|
||||
<MouseBinding Command="{Binding AiPromptOpenAllCommand, ElementName=root}" Gesture="LeftClick" />
|
||||
</Button.InputBindings>-->
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<!--<Popup
|
||||
x:Name="popup_promptbaustein_all"
|
||||
Width="600"
|
||||
Height="400"
|
||||
Placement="Top"
|
||||
PlacementTarget="{Binding ElementName=btnOpenAi5}"
|
||||
StaysOpen="False">
|
||||
<Border x:Name="border_promptbaustein_al" BorderThickness="1" />
|
||||
</Popup>-->
|
||||
<Popup
|
||||
x:Name="popup_promptbaustein_favoriten"
|
||||
Placement="Top"
|
||||
PlacementTarget="{Binding ElementName=btnOpenAi5}"
|
||||
StaysOpen="False">
|
||||
<Border x:Name="border_promptbaustein_favoriten" BorderThickness="1" />
|
||||
</Popup>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -1,187 +0,0 @@
|
||||
using BeWo.ServiceProxy;
|
||||
using BeWo.View.Detail.AI;
|
||||
using BeWo.ViewModel;
|
||||
using BeWo.ViewModel.View.AI;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts.Feature.AI;
|
||||
using DevExpress.Mvvm;
|
||||
using DevExpress.Utils.Mdi;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace BeWo.View.Controls.AI
|
||||
{
|
||||
public enum AiPromptbausteinButtonState
|
||||
{
|
||||
Hidden,
|
||||
Normal,
|
||||
Loading,
|
||||
Disabled
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interaktionslogik für AiPromptbausteinButton.xaml
|
||||
/// </summary>
|
||||
public partial class AiPromptbausteinButton : UserControl
|
||||
{
|
||||
public static readonly DependencyProperty CanExecuteProperty =
|
||||
DependencyProperty.Register("CanExecute", typeof(bool), typeof(AiPromptbausteinButton), new PropertyMetadata(true, OnCanExecuteChanged));
|
||||
|
||||
public static readonly DependencyProperty StateProperty =
|
||||
DependencyProperty.Register("State", typeof(AiPromptbausteinButtonState), typeof(AiPromptbausteinButton), new PropertyMetadata(AiPromptbausteinButtonState.Normal, OnStateChanged));
|
||||
|
||||
public static readonly DependencyProperty ActionTypeProperty =
|
||||
DependencyProperty.Register("ActionType", typeof(AiActionType), typeof(AiPromptbausteinButton), new PropertyMetadata(AiActionType.ServiceRecord, OnActionTypeChanged));
|
||||
|
||||
public event EventHandler<AbstractBaseVM> ItemAccepted;
|
||||
|
||||
public AiPromptbausteinSelectionComplexViewModel AllPromptsViewModel { get; set; }
|
||||
|
||||
public AiPromptbausteinButton()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public AiPromptbausteinButtonState State
|
||||
{
|
||||
get { return (AiPromptbausteinButtonState)GetValue(StateProperty); }
|
||||
set { SetValue(StateProperty, value); }
|
||||
}
|
||||
public AiActionType ActionType
|
||||
{
|
||||
get { return (AiActionType)GetValue(ActionTypeProperty); }
|
||||
set { SetValue(ActionTypeProperty, value); }
|
||||
}
|
||||
|
||||
public bool CanExecute
|
||||
{
|
||||
get { return (bool)GetValue(CanExecuteProperty); }
|
||||
set { SetValue(CanExecuteProperty, value); }
|
||||
}
|
||||
|
||||
private static void OnStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var control = (AiPromptbausteinButton)d;
|
||||
var state = (AiPromptbausteinButtonState)e.NewValue;
|
||||
control.UpdateState(state);
|
||||
}
|
||||
private static void OnActionTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var control = (AiPromptbausteinButton)d;
|
||||
var actionType = (AiActionType)e.NewValue;
|
||||
control.UpdateActionType(actionType);
|
||||
}
|
||||
private static void OnCanExecuteChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var control = (AiPromptbausteinButton)d;
|
||||
var canExecute = (bool)e.NewValue;
|
||||
control.UpdateCanExecute(canExecute);
|
||||
}
|
||||
|
||||
public void AiPromptOpenAll()
|
||||
{
|
||||
BeWoApp.MainControl.WindowService.Show(AllPromptsViewModel);
|
||||
}
|
||||
public void AiPromptOpenFavorite()
|
||||
{
|
||||
popup_promptbaustein_favoriten.IsOpen = true;
|
||||
}
|
||||
|
||||
private void btnOpenAi5_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AiPromptOpenAll();
|
||||
}
|
||||
private void btnOpenAi5_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
AiPromptOpenFavorite();
|
||||
}
|
||||
|
||||
private void InitPromptbausteine(AiActionType actionType, List<AiPromptbausteinFolderDC> folders)
|
||||
{
|
||||
VMFactory.CreateAiPromptbausteinFolderListVM(folders, (listvm) =>
|
||||
{
|
||||
var viewmodel = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm);
|
||||
viewmodel.ItemAccepted += ItemAccepted;
|
||||
viewmodel.RequestCloseFinal += (s, e) => viewmodel.ResetSelection();
|
||||
AllPromptsViewModel = viewmodel;
|
||||
|
||||
var viewmodel2 = new AiPromptbausteinSelectionComplexViewModel(actionType, listvm, true);
|
||||
viewmodel2.ItemAccepted += ItemAccepted;
|
||||
popup_promptbaustein_favoriten.Closed += (s, e) => viewmodel2.ResetSelection();
|
||||
var view2 = new AiPromptbausteinComplexSelectionFavoritenView(viewmodel2);
|
||||
viewmodel2.SelectedFolder = viewmodel2.Folders.VMList[0];
|
||||
view2.Padding = new Thickness(3);
|
||||
view2.Background = FindResource("ObjectEditBackgroundBrush") as System.Windows.Media.Brush;
|
||||
border_promptbaustein_favoriten.Child = view2;
|
||||
State = AiPromptbausteinButtonState.Normal;
|
||||
|
||||
viewmodel.VMListReloaded += (s, e) => viewmodel2.ReloadVMList(false);
|
||||
});
|
||||
}
|
||||
private void UpdateState(AiPromptbausteinButtonState state)
|
||||
{
|
||||
if (state == AiPromptbausteinButtonState.Normal && !CanExecute)
|
||||
state = AiPromptbausteinButtonState.Disabled;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case AiPromptbausteinButtonState.Hidden:
|
||||
root.Visibility = Visibility.Collapsed;
|
||||
root.IsEnabled = true;
|
||||
btnOpenAi5.IsEnabled = true;
|
||||
break;
|
||||
case AiPromptbausteinButtonState.Normal:
|
||||
root.Visibility = Visibility.Visible;
|
||||
root.IsEnabled = true;
|
||||
btnOpenAi5.IsEnabled = true;
|
||||
break;
|
||||
case AiPromptbausteinButtonState.Loading:
|
||||
root.Visibility = Visibility.Visible;
|
||||
root.IsEnabled = false;
|
||||
btnOpenAi5.IsEnabled = false;
|
||||
break;
|
||||
case AiPromptbausteinButtonState.Disabled:
|
||||
root.Visibility = Visibility.Visible;
|
||||
root.IsEnabled = true;
|
||||
btnOpenAi5.IsEnabled = false;
|
||||
break;
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
break;
|
||||
}
|
||||
}
|
||||
private void UpdateActionType(AiActionType actionType)
|
||||
{
|
||||
ActionType = actionType;
|
||||
|
||||
if (!BeWoApp.AppSettings.ShowAI || !BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineView))
|
||||
{
|
||||
State = AiPromptbausteinButtonState.Hidden;
|
||||
return;
|
||||
}
|
||||
|
||||
State = AiPromptbausteinButtonState.Loading;
|
||||
ServiceFacade.DoAiEnhancedServiceAsnyc(x => x.GetAiPromptbausteinFolder(actionType), folders => InitPromptbausteine(actionType, folders));
|
||||
}
|
||||
private void UpdateCanExecute(bool canExecute)
|
||||
{
|
||||
if (canExecute)
|
||||
State = AiPromptbausteinButtonState.Normal;
|
||||
else
|
||||
State = AiPromptbausteinButtonState.Disabled;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user