Search code examples
uwpadaptive-cards

Perform OpenURL action using new AdaptiveCards.Renderer.UWP package


Before new nuged package with braking changes arrived, I was able to subscribe to actions and defined what app should do for OpenURL action:

renderer.Action += Renderer_Action;
..
private void Renderer_Action(AdaptiveCardRenderer sender, AdaptiveActionEventArgs args)
{
    var openUrlAction = args.Action as AdaptiveOpenUrlAction;
    if (openUrlAction != null)
    {...}
}

I was not able to find any Events at new AdaptiveCardRenderer, how should I listen and react to buttons clicks in this case?


Solution

  • Sorry about the breaking changes in the latest beta. The new API allows more flexibility by associating the Action event to the rendered card. When you call RenderAdaptiveCard(...) you get a RenderedAdaptiveCard object back. This object has the OnAction event