Doppelklick auf Prompt macht nun was
This commit is contained in:
@@ -80,7 +80,8 @@
|
||||
<Grid
|
||||
Margin="0,3,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
VerticalAlignment="Stretch"
|
||||
PreviewMouseDown="Grid_PreviewMouseDown_1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
||||
@@ -42,25 +42,15 @@ namespace BeWo.View.Detail.AI
|
||||
ViewModel.SelectedFolder = treeView.SelectedValue as AiPromptbausteinFolderVM;
|
||||
}
|
||||
|
||||
static TreeViewItem VisualUpwardSearch(DependencyObject source)
|
||||
private void Grid_PreviewMouseDown_1(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
while (source != null && !(source is TreeViewItem))
|
||||
source = VisualTreeHelper.GetParent(source);
|
||||
|
||||
return source as TreeViewItem;
|
||||
}
|
||||
|
||||
private void treeView_PreviewMouseDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
TreeViewItem treeViewItem = VisualUpwardSearch(e.OriginalSource as DependencyObject);
|
||||
|
||||
if (treeViewItem is null)
|
||||
if (!ViewModel.SendCommand.CanExecute(null))
|
||||
return;
|
||||
|
||||
if (e.ClickCount == 2)
|
||||
{
|
||||
if (ViewModel.CanSend())
|
||||
ViewModel.Send();
|
||||
ViewModel.SendCommand.Execute(null);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -215,7 +215,8 @@
|
||||
<Grid
|
||||
Margin="0,3,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Stretch">
|
||||
VerticalAlignment="Stretch"
|
||||
PreviewMouseDown="Grid_PreviewMouseDown_1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
||||
@@ -155,5 +155,17 @@ namespace BeWo.View.Detail.AI
|
||||
Process.Start(new ProcessStartInfo(e.Uri.AbsoluteUri));
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void Grid_PreviewMouseDown_1(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (!ViewModel.OpenEditPromptDialogCommand.CanExecute(null))
|
||||
return;
|
||||
|
||||
if (e.ClickCount == 2)
|
||||
{
|
||||
ViewModel.OpenEditPromptDialogCommand.Execute(null);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2843,6 +2843,11 @@ WHERE sc.Billable = 1 and sr.StartDate >= '{0:yyyy-MM-dd}' and sr.StartDate < '{
|
||||
|
||||
criteria.Add(Restrictions.IsNotNull(nameof(AiPromptbausteinPrompt.PromptId)));
|
||||
|
||||
if (aiActionType is AiActionType actionType)
|
||||
{
|
||||
criteria.Add(Restrictions.Eq(nameof(AiPromptbausteinPrompt.ActionType), actionType));
|
||||
}
|
||||
|
||||
return criteria.List<AiPromptbausteinPrompt>();
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ namespace BeWo.Service.Plugins
|
||||
{
|
||||
var client = new AiPromptsApiClient();
|
||||
var response = client.GetAiPrompts();
|
||||
return response.ToList();
|
||||
return response?.ToList() ?? new List<AiPromptbausteinPromptDC>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user