I would like Expander not to expand / crash when users click inside the header area. This is basically the same question as Q 1396153 , but I would appreciate a more favorable answer :)
Is there a non-invasive way to do this? I'm not sure exactly how to attach behavior to the contents of Expander.Header to prevent mouseclicks. I am ready to navigate through the contents outside the expander itself through a fixed grid layout, but I am not interested in the solution. Ideas?
XamlPad XAML example:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" >
<Expander>
<Expander.Header><TextBlock>
When I click this text,
I don't want to trigger expansion/collapse! Only when I click the
expander button do I want to trigger an expand/collapse!
</TextBlock></Expander.Header>
<Grid Background="Red" Height="100" Width="100" >
</Grid>
</Expander>
</Page>
source
share