Button wird teilweise im Debuggen Grau

This commit is contained in:
2026-05-07 13:14:24 +02:00
parent 06a3ee7772
commit 5fb2425947

View File

@@ -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)
{