Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Shape link (Read 4188 times)
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Shape link
Mar 31st, 2009 at 3:05pm
Print Post  
Hi,

Can i define a link to shape, that when i click on the shape its open the link inside
(for example : http://mindfusion.eu)

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape link
Reply #1 - Mar 31st, 2009 at 3:09pm
Print Post  
Hi,

You could navigate to the link from the NodeClicked event handler.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Shape link
Reply #2 - Mar 31st, 2009 at 3:14pm
Print Post  
Ok..
I knew this way..

But i want to know if there is way to set the shape to link.(blue text with underline).
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape link
Reply #3 - Apr 1st, 2009 at 8:36am
Print Post  
It's not possible unless you create a custom node type or use a control hosted in ControlNode. We'll have to expose some properties of the TextBlock used to display text to enable this for ShapeNodes.
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Shape link
Reply #4 - Apr 1st, 2009 at 9:01am
Print Post  
Can you send me an example?

Thanks
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape link
Reply #5 - Apr 1st, 2009 at 1:23pm
Print Post  
in xaml:
Code
Select All
<UserControl x:Class="DiagramLiteTest.HyperlinkControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="400" Height="300">
	<Grid x:Name="LayoutRoot" Background="White">
		<TextBlock Name="textBlock" TextDecorations="Underline"
			Foreground="Blue" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
	</Grid>
</UserControl>
 



in the codebehind:
Code
Select All
public partial class HyperlinkControl : UserControl
{
	public HyperlinkControl()
	{
		InitializeComponent();
	}

	public string Url
	{
		get { return textBlock.Text; }
		set { textBlock.Text = value; }
	}
}
 



and then you can add hyperlink nodes to the diagram as below:

Code
Select All
HyperlinkControl hlink = new HyperlinkControl();
hlink.Url = "www.google.com";
ControlNode hnode = new ControlNode(diagram, hlink);
diagram.Nodes.Add(hnode);
hnode.Bounds = new Rect(0, 0, 100, 100);
 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
maor
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 79
Joined: Mar 24th, 2009
Re: Shape link
Reply #6 - Apr 1st, 2009 at 1:26pm
Print Post  
Hi,

Its look good.. thanks

so i need to create the class HyperlinkControl : UserControl?

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Shape link
Reply #7 - Apr 1st, 2009 at 1:28pm
Print Post  
Yep, or wait for us to add some ShapeNode property to let you set TextDecorations of the internal textblock.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint