Posted 11 years ago by Dario Fruk
Version: 3.5.0421
Platform: Windows Forms Controls
Environment: Windows Vista (64-bit)
Avatar
If "ToggleButton" element is hidden (collapsed) in ControlTemplate for AnimatedExpander, setting IsExpanded property will throw InvalidOperationException with message "'arrow' name cannot be found in the name scope of 'System.Windows.Controls.ControlTemplate'."

If "ToggleButton" element is deleted AnimatedExpander works without a problem.

[Modified at 03/27/2008 04:59 AM]

Comments (3)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Dario,

Could you put together a tiny project that shows this happening and email it over so we can debug it? Thanks!


Actipro Software Support

Posted 11 years ago by Dario Fruk
Avatar
No problem...
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Dario,

I think the problem is because when you have the button collapsed, you prevent any of its templated content (including the "arrow" path) from being in the visual tree. The trigger in the control template kicks in that looks for the "arrow" from the event. But since "arrow" has not been loaded (due to the collapsed state) it throws that exception.

This is a core WPF thing, not really anything we can control. Also note that if you set it to Hidden it works fine. So I'm pretty sure my guess is correct.

Perhaps you need to assign a different template when collapsed to work around this.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 15 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.