SubViewModel.Text Binding

This commit is contained in:
2026-05-26 14:04:31 +02:00
parent f38bec4cf5
commit b45b3c76fd
6 changed files with 62 additions and 37 deletions

View File

@@ -42,7 +42,12 @@ namespace BeWo.ViewModel.Controls.AI
public AiChatButtonState ButtonState
{
get => buttonState;
set => SetProperty(ref buttonState, value, nameof(ButtonState));
set {
if (!SetProperty(ref buttonState, value, nameof(ButtonState)))
return;
FirePropertyChanged(nameof(IsContextSizeTooBig));
}
}
public Func<AiViewContextDC> GetAiVisualContext { get; set; }
@@ -53,6 +58,8 @@ namespace BeWo.ViewModel.Controls.AI
public DelegateCommand OpenAllPromptsPopupCommand { get; protected set; }
public DelegateCommand OpenFavoritePromptsPopupCommand { get; protected set; }
public bool IsContextSizeTooBig => ButtonState == AiChatButtonState.Warning;
public AiChatButtonViewModel(AiActionType aiActionType)
{
ActionType = aiActionType;
@@ -92,7 +99,7 @@ namespace BeWo.ViewModel.Controls.AI
}
}
private void OpenConversationPopup()
private protected void OpenConversationPopup()
{
var context = GetAiVisualContext();
@@ -101,12 +108,12 @@ namespace BeWo.ViewModel.Controls.AI
BeWoApp.MainControl.WindowService.Show(chat_viewmodel);
}
private void OpenAllPromptsPopup()
private protected void OpenAllPromptsPopup()
{
BeWoApp.MainControl.WindowService.Show(AllPromptsViewModel);
}
private void OpenFavoritePromptsPopup()
private protected void OpenFavoritePromptsPopup()
{
IsFavoritenOpen = true;
FirePropertyChanged(nameof(IsFavoritenOpen));

View File

@@ -51,6 +51,11 @@ namespace BeWo.ViewModel.Controls.AI
};
UndoAiActionCommand= new DelegateCommand(UndoAiAction);
RedoAiActionCommand= new DelegateCommand(RedoAiAction);
Func<bool> canExecute = () => !string.IsNullOrEmpty(CurrentValue);
OpenAllPromptsPopupCommand = new DelegateCommand(OpenAllPromptsPopup, canExecute);
OpenConversationPopupCommand = new DelegateCommand(OpenConversationPopup, canExecute);
OpenFavoritePromptsPopupCommand = new DelegateCommand(OpenFavoritePromptsPopup, canExecute);
}
public void ClearHistory()

View File

@@ -217,6 +217,9 @@ namespace BeWo.ViewModel.ListViewModel
set
{
PrototypeVM.Notice = value;
AiChatButtonDocumentationViewModel.CurrentValue = value;
FirePropertyChanged(nameof(AktuellerDokutext));
//FirePropertyChanged(nameof(IsAiDocuButtonCanExecute));
//FirePropertyChanged(nameof(IsRedoButtonVisible));
//FirePropertyChanged(nameof(IsUndoButtonVisible));