I have several icons which are declared in Window.Resources. They show up fine the first time they need to appear (eg: a Menu is clicked, the MenuItem icon works), but after ano
That's because your resource is an Image
, which is a Control
. Control
s can only have one parent so it's effectively being re-parented in each MenuItem
on the fly.
Your options are:
Image
and instead use ImageSource
or even a string
containing the URI of the image.x:Shared
XAML attribute. This will create multiple Image
controls as needed.