Option Strict On
Option Explicit On

Imports System
Imports System.Collections.Generic
Imports System.Collections.ObjectModel
Imports System.Windows.Forms
Imports Nexamas.UI.Architecture
Imports Nexamas.UI.Composition
Imports Nexamas.UI.Controls
Imports Nexamas.UI.General
Imports Nexamas.UI.Layout
Imports Nexamas.UI.Motion
Imports Nexamas.UI.Rendering
Imports Nexamas.UI.TextRendering
Imports Nexamas.UI.Theming
Imports Nexamas.UI.Values
Imports SkiaSharp

Namespace Nexamas.UI.Components

    Partial Public NotInheritable Class MASContentCarousel
#Region "Lifetime / readiness"

        Protected Overrides Sub OnDetached()
            MyBase.OnDetached()
            CancelSelectionMotion()
            ResetPointerState()
        End Sub


        Protected Overrides Sub Dispose(disposing As Boolean)
            If disposing Then
                Try
                    CancelSelectionMotion()
                Catch masCaughtException1 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException1, "MASContentCarousel.Dispose.CancelSelectionMotion")
                End Try

                Try
                    _primitives.Dispose()
                Catch masCaughtException2 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException2, "MASContentCarousel.Dispose.Primitives")
                End Try
            End If

            MyBase.Dispose(disposing)
        End Sub


        Friend Function CreateContentCarouselReadinessManifest() As MASContentCarouselReadinessManifest
            Return MASContentCarouselReadinessManifest.CreateDefault()
        End Function


#End Region
    End Class

End Namespace
