Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Using NodeListView to show a list of Shapes, how do I make the Shapes smaller? (Read 3112 times)
Centron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Using NodeListView to show a list of Shapes, how do I make the Shapes smaller?
Mar 6th, 2015 at 9:41am
Print Post  
I am looking for a way to scale down the Shapes shown in a NodeListView so I can show more Shapes at the same time in a given UI space. How would I do that?
Also, can I use more than 1 column to show shapes, and/or can I change the orientation of the list from vertical to horizontal?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Using NodeListView to show a list of Shapes, how do I make the Shapes smaller?
Reply #1 - Mar 6th, 2015 at 10:32am
Print Post  
Set smaller node.Bounds values:

Code
Select All
<diag:NodeListView
	Name="nodeListView"
	ScrollViewer.HorizontalScrollBarVisibility="Disabled"
	Height="200" Width="400"
	SelectionMode="Single">
	<diag:ShapeNode Bounds="0,0,20,20" Shape="Actor" diag:NodeListView.Label="l1" />
	<diag:ShapeNode Bounds="0,0,20,20" Shape="Ellipse" diag:NodeListView.Label="l2" />
	<diag:ShapeNode Bounds="0,0,20,20" Shape="Decision" diag:NodeListView.Label="l3" />
</diag:NodeListView> 



NodeListView inherits from ListView and you could change its ItemsPanelTemplate to change orientation or add columns. You can find an example here:
http://mindfusion.eu/Forum/YaBB.pl?num=1365173782/1#1

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


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Re: Using NodeListView to show a list of Shapes, how do I make the Shapes smaller?
Reply #2 - Mar 6th, 2015 at 10:34am
Print Post  
It helps partially. I use MVVM bindings to set the ItemsSource, however. Would I have to adjust the ItemTemplate then?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Using NodeListView to show a list of Shapes, how do I make the Shapes smaller?
Reply #3 - Mar 6th, 2015 at 10:45am
Print Post  
The Xaml above shows actual nodes added to the node list, it does not change item templates. So you could set Bounds for the nodes in ItemsSource from code-behind as well.

If you meant ItemsPanelTemplate, it only lets you customize the layout of items in the view, regardless of whether they come from ItemsSource or Xaml content. You will have to adjust it to create horizontal layout, since neither base ListView nor NodeListView expose properties for orientation or columns.
« Last Edit: Mar 6th, 2015 at 12:00pm by Stoyo »  
Back to top
 
IP Logged
 
Centron
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 24
Joined: Feb 11th, 2015
Re: Using NodeListView to show a list of Shapes, how do I make the Shapes smaller?
Reply #4 - Mar 10th, 2015 at 10:30am
Print Post  
I solved the issue by setting the style for ShapeNode:

Code
Select All
<diag:NodeListView.Resources>
  <Style TargetType="diag:ShapeNode">
    <Setter Property="Bounds" Value="0,0,20,20" />
  </Style>
</diag:NodeListView.Resources>
 

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