Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to use NodeListView control? (Read 2610 times)
chris
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 57
Joined: Feb 1st, 2008
How to use NodeListView control?
Oct 14th, 2008 at 10:19pm
Print Post  
How to use code to add a new shape node with a bitmap and add it to a NodeListView control?

Thanks a lot.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to use NodeListView control?
Reply #1 - Oct 15th, 2008 at 11:54am
Print Post  
ShapeNode node = new ShapeNode(diagram);
node.Bounds = new Rect(2, 2, 20, 20);
node.Image = some_image;
node.ImageAlign = ImageAlign.Fit;
node.Shape = Shapes.Rectangle;

NodeListView.SetLabel(node, "xx");
nodeListView.Items.Add(node);

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


I love YaBB 1G - SP1!

Posts: 57
Joined: Feb 1st, 2008
Re: How to use NodeListView control?
Reply #2 - Oct 15th, 2008 at 2:09pm
Print Post  
Thanks.
That's what I need.
  
Back to top
 
IP Logged
 
IgorS
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 13
Joined: Sep 22nd, 2008
Re: How to use NodeListView control?
Reply #3 - Oct 17th, 2008 at 11:19am
Print Post  
By the way. Can NodeListView be horisontal? I tried to put nodes into WrapPanel, but it caused runtime exception...  Thanks.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How to use NodeListView control?
Reply #4 - Oct 20th, 2008 at 8:32am
Print Post  
Try this:

Code
Select All
listView.ItemsPanel = (ItemsPanelTemplate)XamlReader.Load(XmlReader.Create(new StringReader(@"
<ItemsPanelTemplate xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation'
xmlns:my='clr-namespace:MindFusion.Diagramming.Wpf;assembly=MindFusion.Diagramming.Wpf'>
<StackPanel Orientation='Horizontal'
VerticalAlignment='Center'
HorizontalAlignment='Center'/>
</ItemsPanelTemplate>")));
 



or set the item template in xaml Wink

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint