Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ImageComponent Clicked event not fired when part of ContainerNode (Read 1697 times)
VM
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Nov 7th, 2018
ImageComponent Clicked event not fired when part of ContainerNode
Nov 7th, 2018 at 3:09pm
Print Post  
I have a ContainerNode that contains a CompositeNode.
CompositeNode has a StackPanel with an ImageComponent;

The following code does not generate Clicked event:

ContainerNode containerNode = diagram.Factory.CreateContainerNode(rect);
CompositeNode toolbarNode = new CompositeNode(diagram);
diagram.Nodes.Add(toolbarNode);

StackPanel panel = new StackPanel() { Height = 18 };

ImageComponent imgCmp = new ImageComponent() { Image = Resource1.add_menu };
imgCmp.Clicked += (o, e) => { MessageBox.Show("imgCmp"); };                  

panel.Components.Add(imgCmp);
toolbarNode.Components.Add(panel);

containerNode.Add(toolbarNode);


If I replace an ImageComponent with ButtonComponent whose content is TextComponent the events are fired.

If I replace an ImageComponent with ButtonComponent whose content is ImageComponent the events are still not fired.


Thank you in advance,

Vadim
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3147
Joined: Oct 19th, 2005
Re: ImageComponent Clicked event not fired when part of ContainerNode
Reply #1 - Nov 7th, 2018 at 7:24pm
Print Post  
Hi,

Set imgCmp.IsInteractive = true; and it should raise the event.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
VM
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 3
Joined: Nov 7th, 2018
Re: ImageComponent Clicked event not fired when part of ContainerNode
Reply #2 - Nov 7th, 2018 at 7:37pm
Print Post  
Thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint