Preventing a WPF Expander from expanding when header is clicked
问题 How can I prevent a WPF Expander from expanding when its header is clicked? I would like my Expander to expand or collapse only when the expand button itself is clicked. I imagine the answer has something to do with canceling a bubbled event. If possible I would like to implement the solution in XAML while avoiding retemplating the entire Expander . 回答1: The header is the button that creates the event, so you need to change the template for your Expander to just have the expander icon as the