diff --git a/source/uwp/SharedRenderer/lib/ActionHelpers.cpp b/source/uwp/SharedRenderer/lib/ActionHelpers.cpp index f6567c10da..79b2e9bd07 100644 --- a/source/uwp/SharedRenderer/lib/ActionHelpers.cpp +++ b/source/uwp/SharedRenderer/lib/ActionHelpers.cpp @@ -764,12 +764,13 @@ namespace AdaptiveCards::Rendering::Xaml_Rendering::ActionHelpers case winrt::FallbackType::Content: action = action.FallbackContent(); + actionType = action.ActionType(); XamlHelpers::WarnForFallbackContentElement(renderContext, actionTypeString, action.ActionTypeString()); break; // Go again case winrt::FallbackType::None: default: - throw winrt::hresult_error(E_FAIL); + throw winrt::hresult_error(E_FALLBACK_NOT_FOUND); } } } @@ -889,18 +890,30 @@ namespace AdaptiveCards::Rendering::Xaml_Rendering::ActionHelpers if (currentButtonIndex < maxActions && mode == winrt::AdaptiveCards::ObjectModel::Xaml_OM::ActionMode::Primary) { - // If we have fewer than the maximum number of actions and this action's mode is primary, make a button - actionControl = CreateActionButtonInActionSet(adaptiveCard, - adaptiveActionSet, - action, - currentButtonIndex, - actionsPanel, - showCardsStackPanel, - columnDefinitions, - renderContext, - renderArgs); - - currentButtonIndex++; + try + { + // If we have fewer than the maximum number of actions and this action's mode is primary, make a button + actionControl = CreateActionButtonInActionSet(adaptiveCard, + adaptiveActionSet, + action, + currentButtonIndex, + actionsPanel, + showCardsStackPanel, + columnDefinitions, + renderContext, + renderArgs); + + currentButtonIndex++; + } + catch (winrt::hresult_error const& ex) + { + // We want to continue if the error is E_FALLBACK_NOT_FOUND + // There was no fallback mechanism for this action, but we need to render the rest of the ActionSet + if (ex.code() != E_FALLBACK_NOT_FOUND) + { + throw ex; + } + } } else if (currentButtonIndex >= maxActions && (mode == winrt::AdaptiveCards::ObjectModel::Xaml_OM::ActionMode::Primary) && !overflowMaxActions) diff --git a/source/uwp/SharedRenderer/lib/pch.h b/source/uwp/SharedRenderer/lib/pch.h index c893b8e81a..ed827558c3 100644 --- a/source/uwp/SharedRenderer/lib/pch.h +++ b/source/uwp/SharedRenderer/lib/pch.h @@ -22,6 +22,7 @@ #define FACILITY_ADAPTIVECARDS 0xADA #define ERRORBASE_ADAPTIVECARDS 0x1000 #define E_PERFORM_FALLBACK MAKE_HRESULT(1, FACILITY_ADAPTIVECARDS, ERRORBASE_ADAPTIVECARDS) +#define E_FALLBACK_NOT_FOUND MAKE_HRESULT(2, FACILITY_ADAPTIVECARDS, ERRORBASE_ADAPTIVECARDS) #include "dll\CppWinRTIncludes.h"