Option Strict On
Option Explicit On

Imports System
Imports System.Collections.Specialized
Imports System.Diagnostics
Imports System.IO
Imports System.Windows.Forms
Imports Nexamas.UI.Controls
Imports Nexamas.UI.Composition
Imports Nexamas.UI.FileSystem
Imports Nexamas.UI.General
Imports Nexamas.UI.Rendering
Imports Nexamas.UI.Theming
Imports Nexamas.UI.Values
Imports Nexamas.UI.Layout
Imports SkiaSharp

Namespace Nexamas.UI.Components


    Partial Public NotInheritable Class MASFilePickerControl
#Region "Lifetime"

        Protected Overrides Sub Dispose(disposing As Boolean)
            If disposing AndAlso Not _disposedLocal Then
                _disposedLocal = True

                DestroyController()

                Try
                    RemoveHandler _primaryButton.Click, AddressOf OnPrimaryButtonClick
                Catch masCaughtException34 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException34)
                End Try
                Try
                    RemoveHandler _cancelButton.Click, AddressOf OnCancelButtonClick
                Catch masCaughtException35 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException35)
                End Try

                Try
                    RemoveHandler _navigationBar.UpRequested, AddressOf OnNavigationUpRequested
                Catch masCaughtException36 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException36)
                End Try
                Try
                    RemoveHandler _navigationBar.RefreshRequested, AddressOf OnNavigationRefreshRequested
                Catch masCaughtException37 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException37)
                End Try
                Try
                    RemoveHandler _navigationBar.BackRequested, AddressOf OnNavigationBackRequested
                Catch masCaughtException38 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException38)
                End Try
                Try
                    RemoveHandler _navigationBar.ForwardRequested, AddressOf OnNavigationForwardRequested
                Catch masCaughtException39 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException39)
                End Try

                Try
                    UnregisterChild(_navigationBar)
                Catch masCaughtException40 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException40)
                End Try
                Try
                    UnregisterChild(_primaryButton)
                Catch masCaughtException41 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException41)
                End Try
                Try
                    UnregisterChild(_cancelButton)
                Catch masCaughtException42 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException42)
                End Try
                Try
                    UnregisterChild(_footerLabel)
                Catch masCaughtException43 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException43)
                End Try


                Try
                    _primaryButton.Dispose()
                Catch masCaughtException44 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException44)
                End Try
                Try
                    _cancelButton.Dispose()
                Catch masCaughtException45 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException45)
                End Try
                Try
                    _navigationBar.Dispose()
                Catch masCaughtException46 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException46)
                End Try

                Try
                    _footerLabel.Dispose()
                Catch masCaughtException47 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException47)
                End Try

                Try
                    _contentRenderer.Dispose()
                Catch masCaughtException48 As Exception
                    Nexamas.UI.Diagnostics.MASExceptionSilencer.SwallowDisposeCleanup(masCaughtException48)
                End Try

            End If

            MyBase.Dispose(disposing)
        End Sub




#End Region

    End Class

End Namespace
