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

#pragma once

#include "pybase.h"
static_assert(winrt::check_version(PYWINRT_VERSION, "3.2.1"), "Mismatched Py/WinRT headers.");
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Interop.h>

#include <winrt/Windows.UI.Xaml.Data.h>

namespace py::proj::Windows::UI::Xaml::Data
{
}

namespace py
{
    template<>
    inline constexpr const char* buffer_format<winrt::Windows::UI::Xaml::Data::BindingMode> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::UI::Xaml::Data::RelativeSourceMode> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::UI::Xaml::Data::UpdateSourceTrigger> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::UI::Xaml::Data::LoadMoreItemsResult> = "T{I:count:}";


    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::BindingMode>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.BindingMode";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "BindingMode";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::RelativeSourceMode>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.RelativeSourceMode";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "RelativeSourceMode";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::UpdateSourceTrigger>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.UpdateSourceTrigger";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "UpdateSourceTrigger";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::Binding>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.Binding";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "Binding";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::BindingBase>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.BindingBase";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "BindingBase";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::BindingExpression>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.BindingExpression";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "BindingExpression";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::BindingExpressionBase>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.BindingExpressionBase";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "BindingExpressionBase";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::BindingOperations>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.BindingOperations";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "BindingOperations";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::CollectionViewSource>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.CollectionViewSource";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "CollectionViewSource";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::CurrentChangingEventArgs>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.CurrentChangingEventArgs";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "CurrentChangingEventArgs";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::ItemIndexRange>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.ItemIndexRange";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "ItemIndexRange";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::PropertyChangedEventArgs>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.PropertyChangedEventArgs";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "PropertyChangedEventArgs";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::RelativeSource>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.RelativeSource";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "RelativeSource";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::ICollectionView>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._ICollectionView";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_ICollectionView";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::ICollectionViewFactory>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._ICollectionViewFactory";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_ICollectionViewFactory";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::ICollectionViewGroup>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._ICollectionViewGroup";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_ICollectionViewGroup";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::ICustomProperty>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._ICustomProperty";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_ICustomProperty";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::ICustomPropertyProvider>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._ICustomPropertyProvider";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_ICustomPropertyProvider";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::IItemsRangeInfo>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._IItemsRangeInfo";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_IItemsRangeInfo";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::INotifyPropertyChanged>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._INotifyPropertyChanged";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_INotifyPropertyChanged";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::ISelectionInfo>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._ISelectionInfo";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_ISelectionInfo";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::ISupportIncrementalLoading>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._ISupportIncrementalLoading";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_ISupportIncrementalLoading";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::IValueConverter>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data._IValueConverter";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "_IValueConverter";
    };

    template<>
    struct py_type<winrt::Windows::UI::Xaml::Data::LoadMoreItemsResult>
    {
        static constexpr std::string_view from_tuple = "winrt._winrt_windows_ui_xaml_data.LoadMoreItemsResult_from_tuple";
        static constexpr std::string_view qualified_name = "winrt.windows.ui.xaml.data.LoadMoreItemsResult";
        static constexpr const char* module_name = "winrt.windows.ui.xaml.data";
        static constexpr const char* type_name = "LoadMoreItemsResult";
    };
}

#if __has_include("py.Windows.Foundation.h")
#include "py.Windows.Foundation.h"
#endif

#if __has_include("py.Windows.Foundation.Collections.h")
#include "py.Windows.Foundation.Collections.h"
#endif

#if __has_include("py.Windows.UI.Xaml.h")
#include "py.Windows.UI.Xaml.h"
#endif

#if __has_include("py.Windows.UI.Xaml.Interop.h")
#include "py.Windows.UI.Xaml.Interop.h"
#endif

namespace py::impl::Windows::UI::Xaml::Data
{
    struct CurrentChangingEventHandler
    {
        static winrt::Windows::UI::Xaml::Data::CurrentChangingEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Foundation::IInspectable const& param0, winrt::Windows::UI::Xaml::Data::CurrentChangingEventArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };

    struct PropertyChangedEventHandler
    {
        static winrt::Windows::UI::Xaml::Data::PropertyChangedEventHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::Foundation::IInspectable const& param0, winrt::Windows::UI::Xaml::Data::PropertyChangedEventArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };
}

namespace py::wrapper::Windows::UI::Xaml::Data
{
    using Binding = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::Binding>;
    using BindingBase = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::BindingBase>;
    using BindingExpression = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::BindingExpression>;
    using BindingExpressionBase = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::BindingExpressionBase>;
    using BindingOperations = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::BindingOperations>;
    using CollectionViewSource = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::CollectionViewSource>;
    using CurrentChangingEventArgs = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::CurrentChangingEventArgs>;
    using ItemIndexRange = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::ItemIndexRange>;
    using PropertyChangedEventArgs = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::PropertyChangedEventArgs>;
    using RelativeSource = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::RelativeSource>;
    using ICollectionView = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::ICollectionView>;
    using ICollectionViewFactory = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::ICollectionViewFactory>;
    using ICollectionViewGroup = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::ICollectionViewGroup>;
    using ICustomProperty = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::ICustomProperty>;
    using ICustomPropertyProvider = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::ICustomPropertyProvider>;
    using IItemsRangeInfo = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::IItemsRangeInfo>;
    using INotifyPropertyChanged = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::INotifyPropertyChanged>;
    using ISelectionInfo = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::ISelectionInfo>;
    using ISupportIncrementalLoading = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::ISupportIncrementalLoading>;
    using IValueConverter = py::winrt_wrapper<winrt::Windows::UI::Xaml::Data::IValueConverter>;
    using LoadMoreItemsResult = py::winrt_struct_wrapper<winrt::Windows::UI::Xaml::Data::LoadMoreItemsResult>;
}

namespace py
{
    template <>
    struct delegate_python_type<winrt::Windows::UI::Xaml::Data::CurrentChangingEventHandler>
    {
        using type = py::impl::Windows::UI::Xaml::Data::CurrentChangingEventHandler;
    };

    template <>
    struct delegate_python_type<winrt::Windows::UI::Xaml::Data::PropertyChangedEventHandler>
    {
        using type = py::impl::Windows::UI::Xaml::Data::PropertyChangedEventHandler;
    };

}
