// WARNING: Please don't edit this file. It was generated by Python/WinRT v2.3.0

#include "py.Microsoft.UI.Xaml.Navigation.h"

namespace py::cpp::Microsoft::UI::Xaml::Navigation
{
    // ----- FrameNavigationOptions class --------------------

    static PyObject* _new_FrameNavigationOptions(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        auto arg_count = PyTuple_Size(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Microsoft::UI::Xaml::Navigation::FrameNavigationOptions instance{};
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_FrameNavigationOptions(py::wrapper::Microsoft::UI::Xaml::Navigation::FrameNavigationOptions* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* FrameNavigationOptions_get_TransitionInfoOverride(py::wrapper::Microsoft::UI::Xaml::Navigation::FrameNavigationOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.FrameNavigationOptions", L"TransitionInfoOverride");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.TransitionInfoOverride());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int FrameNavigationOptions_put_TransitionInfoOverride(py::wrapper::Microsoft::UI::Xaml::Navigation::FrameNavigationOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.FrameNavigationOptions", L"TransitionInfoOverride");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Microsoft::UI::Xaml::Media::Animation::NavigationTransitionInfo>(arg);

            self->obj.TransitionInfoOverride(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* FrameNavigationOptions_get_IsNavigationStackEnabled(py::wrapper::Microsoft::UI::Xaml::Navigation::FrameNavigationOptions* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.FrameNavigationOptions", L"IsNavigationStackEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.IsNavigationStackEnabled());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int FrameNavigationOptions_put_IsNavigationStackEnabled(py::wrapper::Microsoft::UI::Xaml::Navigation::FrameNavigationOptions* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.FrameNavigationOptions", L"IsNavigationStackEnabled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            self->obj.IsNavigationStackEnabled(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* _assign_array_FrameNavigationOptions(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Xaml::Navigation::FrameNavigationOptions>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_FrameNavigationOptions(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Xaml::Navigation::FrameNavigationOptions>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_FrameNavigationOptions[] = {
        { "_assign_array_", _assign_array_FrameNavigationOptions, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_FrameNavigationOptions), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_FrameNavigationOptions[] = {
        { "transition_info_override", reinterpret_cast<getter>(FrameNavigationOptions_get_TransitionInfoOverride), reinterpret_cast<setter>(FrameNavigationOptions_put_TransitionInfoOverride), nullptr, nullptr },
        { "is_navigation_stack_enabled", reinterpret_cast<getter>(FrameNavigationOptions_get_IsNavigationStackEnabled), reinterpret_cast<setter>(FrameNavigationOptions_put_IsNavigationStackEnabled), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_FrameNavigationOptions[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_FrameNavigationOptions) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_FrameNavigationOptions) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_FrameNavigationOptions) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_FrameNavigationOptions) },
        { }
    };

    static PyType_Spec type_spec_FrameNavigationOptions = {
        "winrt._winrt_microsoft_ui_xaml_navigation.FrameNavigationOptions",
        sizeof(py::wrapper::Microsoft::UI::Xaml::Navigation::FrameNavigationOptions),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_FrameNavigationOptions};

    // ----- NavigatingCancelEventArgs class --------------------

    static PyObject* _new_NavigatingCancelEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_NavigatingCancelEventArgs(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* NavigatingCancelEventArgs_get_Cancel(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigatingCancelEventArgs", L"Cancel");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.Cancel());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int NavigatingCancelEventArgs_put_Cancel(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigatingCancelEventArgs", L"Cancel");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            self->obj.Cancel(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* NavigatingCancelEventArgs_get_NavigationMode(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigatingCancelEventArgs", L"NavigationMode");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.NavigationMode());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* NavigatingCancelEventArgs_get_NavigationTransitionInfo(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigatingCancelEventArgs", L"NavigationTransitionInfo");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.NavigationTransitionInfo());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* NavigatingCancelEventArgs_get_Parameter(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigatingCancelEventArgs", L"Parameter");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.Parameter());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* NavigatingCancelEventArgs_get_SourcePageType(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigatingCancelEventArgs", L"SourcePageType");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.SourcePageType());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_NavigatingCancelEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_NavigatingCancelEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_NavigatingCancelEventArgs[] = {
        { "_assign_array_", _assign_array_NavigatingCancelEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_NavigatingCancelEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_NavigatingCancelEventArgs[] = {
        { "cancel", reinterpret_cast<getter>(NavigatingCancelEventArgs_get_Cancel), reinterpret_cast<setter>(NavigatingCancelEventArgs_put_Cancel), nullptr, nullptr },
        { "navigation_mode", reinterpret_cast<getter>(NavigatingCancelEventArgs_get_NavigationMode), nullptr, nullptr, nullptr },
        { "navigation_transition_info", reinterpret_cast<getter>(NavigatingCancelEventArgs_get_NavigationTransitionInfo), nullptr, nullptr, nullptr },
        { "parameter", reinterpret_cast<getter>(NavigatingCancelEventArgs_get_Parameter), nullptr, nullptr, nullptr },
        { "source_page_type", reinterpret_cast<getter>(NavigatingCancelEventArgs_get_SourcePageType), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_NavigatingCancelEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_NavigatingCancelEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_NavigatingCancelEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_NavigatingCancelEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_NavigatingCancelEventArgs) },
        { }
    };

    static PyType_Spec type_spec_NavigatingCancelEventArgs = {
        "winrt._winrt_microsoft_ui_xaml_navigation.NavigatingCancelEventArgs",
        sizeof(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigatingCancelEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_NavigatingCancelEventArgs};

    // ----- NavigationEventArgs class --------------------

    static PyObject* _new_NavigationEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Microsoft::UI::Xaml::Navigation::NavigationEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Microsoft::UI::Xaml::Navigation::NavigationEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_NavigationEventArgs(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* NavigationEventArgs_get_Uri(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationEventArgs", L"Uri");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.Uri());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int NavigationEventArgs_put_Uri(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationEventArgs* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationEventArgs", L"Uri");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<winrt::Windows::Foundation::Uri>(arg);

            self->obj.Uri(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* NavigationEventArgs_get_Content(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationEventArgs", L"Content");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.Content());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* NavigationEventArgs_get_NavigationMode(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationEventArgs", L"NavigationMode");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.NavigationMode());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* NavigationEventArgs_get_NavigationTransitionInfo(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationEventArgs", L"NavigationTransitionInfo");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.NavigationTransitionInfo());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* NavigationEventArgs_get_Parameter(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationEventArgs", L"Parameter");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.Parameter());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* NavigationEventArgs_get_SourcePageType(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationEventArgs", L"SourcePageType");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.SourcePageType());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_NavigationEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Xaml::Navigation::NavigationEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_NavigationEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Xaml::Navigation::NavigationEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_NavigationEventArgs[] = {
        { "_assign_array_", _assign_array_NavigationEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_NavigationEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_NavigationEventArgs[] = {
        { "uri", reinterpret_cast<getter>(NavigationEventArgs_get_Uri), reinterpret_cast<setter>(NavigationEventArgs_put_Uri), nullptr, nullptr },
        { "content", reinterpret_cast<getter>(NavigationEventArgs_get_Content), nullptr, nullptr, nullptr },
        { "navigation_mode", reinterpret_cast<getter>(NavigationEventArgs_get_NavigationMode), nullptr, nullptr, nullptr },
        { "navigation_transition_info", reinterpret_cast<getter>(NavigationEventArgs_get_NavigationTransitionInfo), nullptr, nullptr, nullptr },
        { "parameter", reinterpret_cast<getter>(NavigationEventArgs_get_Parameter), nullptr, nullptr, nullptr },
        { "source_page_type", reinterpret_cast<getter>(NavigationEventArgs_get_SourcePageType), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_NavigationEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_NavigationEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_NavigationEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_NavigationEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_NavigationEventArgs) },
        { }
    };

    static PyType_Spec type_spec_NavigationEventArgs = {
        "winrt._winrt_microsoft_ui_xaml_navigation.NavigationEventArgs",
        sizeof(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_NavigationEventArgs};

    // ----- NavigationFailedEventArgs class --------------------

    static PyObject* _new_NavigationFailedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_NavigationFailedEventArgs(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* NavigationFailedEventArgs_get_Handled(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationFailedEventArgs", L"Handled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.Handled());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int NavigationFailedEventArgs_put_Handled(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationFailedEventArgs", L"Handled");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return -1;
            }

            auto param0 = py::convert_to<bool>(arg);

            self->obj.Handled(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* NavigationFailedEventArgs_get_Exception(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationFailedEventArgs", L"Exception");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.Exception());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* NavigationFailedEventArgs_get_SourcePageType(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.NavigationFailedEventArgs", L"SourcePageType");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.SourcePageType());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_NavigationFailedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_NavigationFailedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_NavigationFailedEventArgs[] = {
        { "_assign_array_", _assign_array_NavigationFailedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_NavigationFailedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_NavigationFailedEventArgs[] = {
        { "handled", reinterpret_cast<getter>(NavigationFailedEventArgs_get_Handled), reinterpret_cast<setter>(NavigationFailedEventArgs_put_Handled), nullptr, nullptr },
        { "exception", reinterpret_cast<getter>(NavigationFailedEventArgs_get_Exception), nullptr, nullptr, nullptr },
        { "source_page_type", reinterpret_cast<getter>(NavigationFailedEventArgs_get_SourcePageType), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_NavigationFailedEventArgs[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_NavigationFailedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_NavigationFailedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_NavigationFailedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_NavigationFailedEventArgs) },
        { }
    };

    static PyType_Spec type_spec_NavigationFailedEventArgs = {
        "winrt._winrt_microsoft_ui_xaml_navigation.NavigationFailedEventArgs",
        sizeof(py::wrapper::Microsoft::UI::Xaml::Navigation::NavigationFailedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_NavigationFailedEventArgs};

    // ----- PageStackEntry class --------------------

    static PyObject* _new_PageStackEntry(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        auto arg_count = PyTuple_Size(args);
        if (arg_count == 3)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::UI::Xaml::Interop::TypeName>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::IInspectable>(args, 1);
                auto param2 = py::convert_to<winrt::Microsoft::UI::Xaml::Media::Animation::NavigationTransitionInfo>(args, 2);

                winrt::Microsoft::UI::Xaml::Navigation::PageStackEntry instance{param0, param1, param2};
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_PageStackEntry(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* PageStackEntry_ClearValue(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Xaml.DependencyObject", L"ClearValue", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Xaml::DependencyProperty>(args, 0);

                self->obj.ClearValue(param0);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_GetAnimationBaseValue(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Xaml.DependencyObject", L"GetAnimationBaseValue", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Xaml::DependencyProperty>(args, 0);

                return py::convert(self->obj.GetAnimationBaseValue(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_GetValue(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Xaml.DependencyObject", L"GetValue", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Xaml::DependencyProperty>(args, 0);

                return py::convert(self->obj.GetValue(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_ReadLocalValue(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Xaml.DependencyObject", L"ReadLocalValue", 1);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(1);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Xaml::DependencyProperty>(args, 0);

                return py::convert(self->obj.ReadLocalValue(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_RegisterPropertyChangedCallback(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Xaml.DependencyObject", L"RegisterPropertyChangedCallback", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Xaml::DependencyProperty>(args, 0);
                auto param1 = py::convert_to<winrt::Microsoft::UI::Xaml::DependencyPropertyChangedCallback>(args, 1);

                return py::convert(self->obj.RegisterPropertyChangedCallback(param0, param1));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_SetValue(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Xaml.DependencyObject", L"SetValue", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Xaml::DependencyProperty>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::Foundation::IInspectable>(args, 1);

                self->obj.SetValue(param0, param1);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_UnregisterPropertyChangedCallback(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 2)
        {
            try
            {
                static std::optional<bool> is_overload_present{};

                if (!is_overload_present.has_value())
                {
                    is_overload_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Microsoft.UI.Xaml.DependencyObject", L"UnregisterPropertyChangedCallback", 2);
                }

                if (!is_overload_present.value())
                {
                    py::set_arg_count_version_error(2);
                    return nullptr;
                }

                auto param0 = py::convert_to<winrt::Microsoft::UI::Xaml::DependencyProperty>(args, 0);
                auto param1 = py::convert_to<int64_t>(args, 1);

                self->obj.UnregisterPropertyChangedCallback(param0, param1);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_get_NavigationTransitionInfo(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.PageStackEntry", L"NavigationTransitionInfo");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.NavigationTransitionInfo());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_get_Parameter(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.PageStackEntry", L"Parameter");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.Parameter());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_get_SourcePageType(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.PageStackEntry", L"SourcePageType");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.SourcePageType());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_get_SourcePageTypeProperty(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.Navigation.PageStackEntry", L"SourcePageTypeProperty");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(winrt::Microsoft::UI::Xaml::Navigation::PageStackEntry::SourcePageTypeProperty());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_get_Dispatcher(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.DependencyObject", L"Dispatcher");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.Dispatcher());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PageStackEntry_get_DispatcherQueue(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry* self, void* /*unused*/) noexcept
    {
        try
        {
            static std::optional<bool> is_property_present{};

            if (!is_property_present.has_value())
            {
                is_property_present = winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Microsoft.UI.Xaml.DependencyObject", L"DispatcherQueue");
            }

            if (!is_property_present.value())
            {
                PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
                return nullptr;
            }

            return py::convert(self->obj.DispatcherQueue());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _assign_array_PageStackEntry(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Microsoft::UI::Xaml::Navigation::PageStackEntry>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_PageStackEntry(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Microsoft::UI::Xaml::Navigation::PageStackEntry>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PageStackEntry[] = {
        { "clear_value", reinterpret_cast<PyCFunction>(PageStackEntry_ClearValue), METH_VARARGS, nullptr },
        { "get_animation_base_value", reinterpret_cast<PyCFunction>(PageStackEntry_GetAnimationBaseValue), METH_VARARGS, nullptr },
        { "get_value", reinterpret_cast<PyCFunction>(PageStackEntry_GetValue), METH_VARARGS, nullptr },
        { "read_local_value", reinterpret_cast<PyCFunction>(PageStackEntry_ReadLocalValue), METH_VARARGS, nullptr },
        { "register_property_changed_callback", reinterpret_cast<PyCFunction>(PageStackEntry_RegisterPropertyChangedCallback), METH_VARARGS, nullptr },
        { "set_value", reinterpret_cast<PyCFunction>(PageStackEntry_SetValue), METH_VARARGS, nullptr },
        { "unregister_property_changed_callback", reinterpret_cast<PyCFunction>(PageStackEntry_UnregisterPropertyChangedCallback), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_PageStackEntry, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PageStackEntry), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_PageStackEntry[] = {
        { "navigation_transition_info", reinterpret_cast<getter>(PageStackEntry_get_NavigationTransitionInfo), nullptr, nullptr, nullptr },
        { "parameter", reinterpret_cast<getter>(PageStackEntry_get_Parameter), nullptr, nullptr, nullptr },
        { "source_page_type", reinterpret_cast<getter>(PageStackEntry_get_SourcePageType), nullptr, nullptr, nullptr },
        { "dispatcher", reinterpret_cast<getter>(PageStackEntry_get_Dispatcher), nullptr, nullptr, nullptr },
        { "dispatcher_queue", reinterpret_cast<getter>(PageStackEntry_get_DispatcherQueue), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_PageStackEntry[] = {
        { Py_tp_new, reinterpret_cast<void*>(_new_PageStackEntry) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_PageStackEntry) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_PageStackEntry) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_PageStackEntry) },
        { }
    };

    static PyType_Spec type_spec_PageStackEntry = {
        "winrt._winrt_microsoft_ui_xaml_navigation.PageStackEntry",
        sizeof(py::wrapper::Microsoft::UI::Xaml::Navigation::PageStackEntry),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PageStackEntry};

    static PyGetSetDef getset_PageStackEntry_Static[] = {
        { "source_page_type_property", reinterpret_cast<getter>(PageStackEntry_get_SourcePageTypeProperty), nullptr, nullptr, nullptr },
        { }
    };

    static PyMethodDef methods_PageStackEntry_Static[] = {
        { }
    };

    static PyType_Slot type_slots_PageStackEntry_Static[] = 
    {
        { Py_tp_base, reinterpret_cast<void*>(&PyType_Type) },
        { Py_tp_getset, reinterpret_cast<void*>(getset_PageStackEntry_Static) },
        { Py_tp_methods, reinterpret_cast<void*>(methods_PageStackEntry_Static) },
        { }
    };

    static PyType_Spec type_spec_PageStackEntry_Static =
    {
        "winrt._winrt_microsoft_ui_xaml_navigation.PageStackEntry_Static",
        static_cast<int>(PyType_Type.tp_basicsize),
        static_cast<int>(PyType_Type.tp_itemsize),
        Py_TPFLAGS_DEFAULT,
        type_slots_PageStackEntry_Static
    };

    // ----- Microsoft.UI.Xaml.Navigation Initialization --------------------

    PyDoc_STRVAR(module_doc, "Microsoft.UI.Xaml.Navigation");

    static PyModuleDef module_def = {
        PyModuleDef_HEAD_INIT,
        "_winrt_microsoft_ui_xaml_navigation",
        module_doc,
        0,
        nullptr,
        nullptr,
        nullptr,
        nullptr,
        nullptr};
} // py::cpp::Microsoft::UI::Xaml::Navigation

PyMODINIT_FUNC PyInit__winrt_microsoft_ui_xaml_navigation(void) noexcept
{
    using namespace py::cpp::Microsoft::UI::Xaml::Navigation;

    if (py::import_winrt_runtime() == -1)
    {
        return nullptr;
    }

    py::pyobj_handle module{PyModule_Create(&module_def)};

    if (!module)
    {
        return nullptr;
    }

    auto object_type = py::get_object_type();
    if (!object_type)
    {
        return nullptr;
    }

    py::pyobj_handle object_bases{PyTuple_Pack(1, object_type)};

    if (!object_bases)
    {
        return nullptr;
    }

    py::pytype_handle FrameNavigationOptions_type{py::register_python_type(module.get(), &type_spec_FrameNavigationOptions, object_bases.get(), nullptr)};
    if (!FrameNavigationOptions_type)
    {
        return nullptr;
    }

    py::pytype_handle NavigatingCancelEventArgs_type{py::register_python_type(module.get(), &type_spec_NavigatingCancelEventArgs, object_bases.get(), nullptr)};
    if (!NavigatingCancelEventArgs_type)
    {
        return nullptr;
    }

    py::pytype_handle NavigationEventArgs_type{py::register_python_type(module.get(), &type_spec_NavigationEventArgs, object_bases.get(), nullptr)};
    if (!NavigationEventArgs_type)
    {
        return nullptr;
    }

    py::pytype_handle NavigationFailedEventArgs_type{py::register_python_type(module.get(), &type_spec_NavigationFailedEventArgs, object_bases.get(), nullptr)};
    if (!NavigationFailedEventArgs_type)
    {
        return nullptr;
    }

    py::pyobj_handle type_PageStackEntry_Static{PyType_FromSpec(&type_spec_PageStackEntry_Static)};
    if (!type_PageStackEntry_Static)
    {
        return nullptr;
    }

    py::pytype_handle PageStackEntry_type{py::register_python_type(module.get(), &type_spec_PageStackEntry, object_bases.get(), reinterpret_cast<PyTypeObject*>(type_PageStackEntry_Static.get()))};
    if (!PageStackEntry_type)
    {
        return nullptr;
    }


    return module.detach();
}
