Skip to content

Commit e4a3870

Browse files
Fixed crash in Toolkit SfButton due to VisualStateManager API changes in NET 11
1 parent 75ae4e7 commit e4a3870

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

maui/src/Button/SfButton.Methods.cs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -900,16 +900,7 @@ protected override void ChangeVisualState()
900900
#else
901901
string stateName = IsEnabled ? _isPressed ? "Pressed" : IsCheckable && IsChecked ? "Checked" : "Normal" : IsCheckable && IsChecked ? "Checked" : "Disabled";
902902
#endif
903-
var stateGroup = VisualStateManager.GetVisualStateGroups(this);
904-
var findName = "Normal";
905-
foreach (VisualStateGroup state in stateGroup)
906-
{
907-
foreach (var a in state.States)
908-
{
909-
findName = a.Name == stateName ? stateName : findName;
910-
}
911-
}
912-
VisualStateManager.GoToState(this, findName);
903+
VisualStateManager.GoToState(this, stateName);
913904
InvalidateDrawable();
914905
}
915906

0 commit comments

Comments
 (0)