Option Strict On
Option Explicit On

Imports System
Imports System.Windows.Forms
Imports Nexamas.UI.Architecture
Imports Nexamas.UI.Components
Imports Nexamas.UI.Composition
Imports Nexamas.UI.General
Imports Nexamas.UI.Layout
Imports Nexamas.UI.Rendering
Imports Nexamas.UI.TextRendering
Imports Nexamas.UI.Theming
Imports Nexamas.UI.Values
Imports SkiaSharp

Namespace Nexamas.UI.Controls


    Partial Public NotInheritable Class MASButton
#Region "State"

        Protected Overrides Sub OnEnabledChanged()
            If Not CanRenderAsEnabled() Then
                StopPressMotion(clearPressed:=True)
            End If

            ApplyResult(_interactionController.HandleEnabledChanged(_state, CanRenderAsEnabled()))
        End Sub

        Private Sub ApplyResult(result As MASButtonInteractionResult)
            _state = result.State

            If result.ShouldInvalidate Then
                InvalidateVisual()
            End If
        End Sub

#End Region

    End Class

End Namespace
