You'll need to use x:Shared="False"
when declaring the Path
resource:
<Path x:Key="ArrowPath" x:Shared="False" Fill="Black" Data="M 0 0 L 0 20 L 10 10 Z"/>
Otherwise, the same Path
object will be used, which will change the Path
's visual parent over and over again (until it stops for the last ArrowButton
). Setting x:Shared="False"
will create a new instance of the Path
object each time it's consumed, which will solve your problem.
Make sure you also read the restrictions on where x:Shared
can be used in WPF, listed at the bottom of the linked page.