diff --git a/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs b/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs index c91d88dd4..82716549a 100644 --- a/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs +++ b/BeWo/View/Controls/AI/AiPromptbausteinButton.xaml.cs @@ -38,7 +38,7 @@ namespace BeWo.View.Controls.AI public partial class AiPromptbausteinButton : UserControl { public static readonly DependencyProperty CanExecuteProperty = - DependencyProperty.Register("CanExecute", typeof(bool), typeof(AiPromptbausteinButton), new PropertyMetadata(true, OnCanExecuteChanged)); + DependencyProperty.Register("CanExecute", typeof(bool), typeof(AiPromptbausteinButton), new PropertyMetadata(false, OnCanExecuteChanged)); public static readonly DependencyProperty StateProperty = DependencyProperty.Register("State", typeof(AiPromptbausteinButtonState), typeof(AiPromptbausteinButton), new PropertyMetadata(AiPromptbausteinButtonState.Normal, OnStateChanged)); @@ -134,7 +134,11 @@ namespace BeWo.View.Controls.AI private void UpdateState(AiPromptbausteinButtonState state) { if (state == AiPromptbausteinButtonState.Normal && !CanExecute) - state = AiPromptbausteinButtonState.Disabled; + { + State = AiPromptbausteinButtonState.Disabled; + return; + } + switch (state) {