SubViewModel.Text Binding
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user