Steps können Invalid sein -> Senden blockt + UI
This commit is contained in:
@@ -35,6 +35,11 @@ namespace BeWo.ViewModel
|
||||
set => SetProperty(ref _ReferenceVersion, value, nameof(ReferenceVersion), () => DataContract.ReferenceVersion);
|
||||
}
|
||||
|
||||
public bool IsValid
|
||||
{
|
||||
get => DataContract.IsValid;
|
||||
}
|
||||
|
||||
protected override void InitByDataContract(AiPromptbausteinRoutineStepDC pDataContract)
|
||||
{
|
||||
_Position = pDataContract.Position;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using BeWo.ViewModel.ListViewModel;
|
||||
using BS.Shared;
|
||||
using BS.Shared.DataContracts;
|
||||
@@ -89,6 +90,10 @@ namespace BeWo.ViewModel
|
||||
public string FavoritenHeader => IsFavorite ? "Favorit entfernen" : "Favorit hinzufügen";
|
||||
|
||||
public override bool IsDirty => base.IsDirty || Steps.IsDirty;
|
||||
public bool IsValid
|
||||
{
|
||||
get => Steps.Count > 0 && Steps.VMList.All(x => x.IsValid);
|
||||
}
|
||||
|
||||
protected override void InitByDataContract(AiPromptbausteinRoutineDC pDataContract)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,10 @@ namespace BeWo.ViewModel.View.AI
|
||||
|
||||
private IBeWoWindowService WindowService { get; set; }
|
||||
|
||||
public bool IsFavorite { get; set; }
|
||||
public DelegateCommand SendCommand { get; set; }
|
||||
public AiActionType AiActionType { get; set; }
|
||||
|
||||
public AiPromptbausteinFolderVM Favoriten { get; set; }
|
||||
public AiPromptbausteinFolderVM CopiedFolder { get; set; }
|
||||
public AiPromptbausteinPromptVM CopiedPrompt { get; set; }
|
||||
@@ -103,12 +107,6 @@ namespace BeWo.ViewModel.View.AI
|
||||
CanEditPromptbausteine = BeWoApp.HasLoggedOnUserRight(UserRightType.AiModulePromptbausteineEdit);
|
||||
}
|
||||
|
||||
public bool IsFavorite { get; set; }
|
||||
|
||||
public DelegateCommand SendCommand { get; set; }
|
||||
|
||||
public AiActionType AiActionType { get; set; }
|
||||
|
||||
public AiPromptbausteinFolderVM SelectedFolder
|
||||
{
|
||||
get => _SelectedFolder;
|
||||
@@ -164,7 +162,7 @@ namespace BeWo.ViewModel.View.AI
|
||||
}
|
||||
public bool CanSend()
|
||||
{
|
||||
return SelectedItem is object;
|
||||
return SelectedItem is AiPromptbausteinPromptVM || (SelectedItem is AiPromptbausteinRoutineVM routine && routine.IsValid);
|
||||
}
|
||||
public void InitVMList()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user