Cancelling Collapsing of Xamarin Community Toolkit's Expander

Nathan Sokalski 4,121 Reputation points

When the user taps the header of the Expander from Xamarin Community Toolkit (, it shows or hides the content, as expected. However, when the user taps the header to collapse the Expander, I want to confirm it by displaying a message, and possibly cancel the collapsing. The 2 events triggered when tapping the header are Tapped & PropertyChanging, and I am not sure what I could do in either of these to cancel the collapsing. I could try to add code to these events to set the IsExpanded property, but this would be inefficient and would most likely cause a strange looking UI (showing & hiding the content multiple time, and possibly triggering extra unwanted events). Any ideas? Thanks.

A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,302 questions
{count} votes