Never used lambdas before and I can't understand where I'd have to add it.
My Error is "Show: Ambigious call to overloaded function"
Show() can take 2 types CustomizeToast and CustomizeToastAsync. So I guess I need to specify CustomizeToast somewhere but I can't for the life of me see where.
This is my current code:
ToastContentBuilder()
.AddText(L"Hello World!")
.Show([](ToastNotification const& toast) -> void
{
toast.Tag(L"1");
});
Error:
error C2668: 'winrt::impl::consume_Microsoft_Toolkit_Uwp_Notifications_IToastContentBuilderClass<winrt::Microsoft::Toolkit::Uwp::Notifications::IToastContentBuilderClass>::Show': ambiguous call to overloaded function
Microsoft.Toolkit.Uwp.Notifications.0.h(2159,60): message : could be 'auto winrt::impl::consume_Microsoft_Toolkit_Uwp_Notifications_IToastContentBuilderClass<winrt::Microsoft::Toolkit::Uwp::Notifications::IToastContentBuilderClass>::Show(const winrt::Microsoft::Toolkit::Uwp::Notifications::CustomizeToastAsync &) const'
Microsoft.Toolkit.Uwp.Notifications.0.h(2158,31): message : or 'auto winrt::impl::consume_Microsoft_Toolkit_Uwp_Notifications_IToastContentBuilderClass<winrt::Microsoft::Toolkit::Uwp::Notifications::IToastContentBuilderClass>::Show(const winrt::Microsoft::Toolkit::Uwp::Notifications::CustomizeToast &) const'
message : while trying to match the argument list '(winrt::MyApplication::implementation::Toast::ShowToastNotification::<lambda_786678859ea03b85c00686eebdcb39db>)'
Project is an UWP project using the Microsoft.Toolkit.Uwp.Notifications
Showcan either take aCustomizeToastor aCustomizeToastAsyncand both can be constructed from the lambda, then the compiler cannot know which one to pick. I have to guess, but the complete compiler error should tell all this in a much more concise way. Without code and complete error message we can only guess