Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Button on node (Read 6815 times)
educosta
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 5th, 2009
Button on node
Nov 5th, 2009 at 10:44am
Print Post  
Hi,

I need put a button on node, for example click on link.


http://healthguides.mapofmedicine.com/choices/map-open/acute_coronary_syndrome5....


It is possible?

tks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Button on node
Reply #1 - Nov 5th, 2009 at 10:58am
Print Post  
Hi,

You could create UserControls and host them inside ControlNodes. With version 1.2 you can override the ShapeNode's control template to add a button; it's now in beta tests:
https://mindfusion.eu/_beta/DiagramLite.1.2.beta.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
educosta
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 5th, 2009
Re: Button on node
Reply #2 - Nov 5th, 2009 at 11:27am
Print Post  
Good tutorial 3 in beta 1.2.

When version 1.2 will be released??
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Button on node
Reply #3 - Nov 5th, 2009 at 11:39am
Print Post  
Today 8)
  
Back to top
 
IP Logged
 
educosta
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 5th, 2009
Re: Button on node
Reply #4 - Nov 5th, 2009 at 11:50am
Print Post  
Good,


Another question, in the tutorial 3 of beta 1.2
It's possible set the default node is OrgChartNode?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Button on node
Reply #5 - Nov 5th, 2009 at 12:01pm
Print Post  
You must use a custom Behavior class for this. For example, derive from LinkNodesBehavior, override CreateNode() to return a new OrgChartNode(), and set diagram.CustomBehavior = instance of your behavior class.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
educosta
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 5th, 2009
Re: Button on node
Reply #6 - Nov 5th, 2009 at 5:38pm
Print Post  
Hi,


Using the example 3 from beta 1.2, i add the button on node, but who i code the button click?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Button on node
Reply #7 - Nov 6th, 2009 at 8:28am
Print Post  
Hi,

You could add a Click handler from the OnApplyTemplate override:

Code
Select All
<StackPanel Margin="4,8,0,0"  Orientation="Vertical" Grid.Column="1">
	<TextBlock Text="{TemplateBinding Title}" FontWeight="800" />
	...
	<Button x:Name="b" Content="click me" />
</StackPanel>

public override void OnApplyTemplate()
{
	base.OnApplyTemplate();
	var b = GetTemplateChild("b") as Button;
	if (b != null)
		b.Click += b_Click;
}

void b_Click(object sender, RoutedEventArgs e)
{
	Debug.WriteLine("click");
}
 



It might also be possible to set Click="b_Click" in the Xaml, but I could not make this work.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
educosta
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 5th, 2009
Re: Button on node
Reply #8 - Nov 6th, 2009 at 11:31am
Print Post  
tks Stoyo.

Another question.


In the tutorial 3, if i change the defaultshape don't work, but if i change the node shape work.

What is this?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Button on node
Reply #9 - Nov 6th, 2009 at 11:38am
Print Post  
DefaultShape is set only if you use the ShapeNode(Diagram) constructor. In such case the ShapeNode is initialized from several default-value properties of the diagram, e.g. ShapeBrush and ShapeHandlesStyle.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
educosta
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 14
Joined: Nov 5th, 2009
Re: Button on node
Reply #10 - Nov 6th, 2009 at 11:49am
Print Post  
What you recommend to define defaultshape when i use custom shapenode?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Button on node
Reply #11 - Nov 6th, 2009 at 12:03pm
Print Post  
If your custom nodes will all have the same shape, you could set it from the constructor, disregarding the diagram's DefaultShape.

Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint