Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic NodeListView (Read 2674 times)
fireboy
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Dec 17th, 2009
NodeListView
Mar 1st, 2010 at 3:50pm
Print Post  
Hi,
I've got several questions about NodeListView control:
1. How do I change the item template? I want the text to be below the image, not to the right. I tried extracting the current item template using Expression Blend, but it comes up empty.
2. Is it possible to display the shape during the drag and drop operation? Right now nothing is shown and the shape only appears when the mouse button is released.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView
Reply #1 - Mar 1st, 2010 at 4:00pm
Print Post  
Hi,

1. Currently the ItemTemplate is defined through a Style that has the following setter:

Code
Select All
<Setter Property="ItemTemplate">
	<Setter.Value>
		<DataTemplate>
			<StackPanel Orientation="Horizontal">
				<Border BorderThickness='0,0,5,0'>
					<ContentPresenter Content="{Binding}" />
				</Border>
				<!--Binding to custom attached properties does not work, use Tag or ToolTip for label-->
				<TextBlock Text='{Binding Tag}' VerticalAlignment='Center' TextAlignment='Center'/>
			</StackPanel>
		</DataTemplate>
	</Setter.Value>
</Setter> 



2. It's not possible at this time.

Stoyan
  
Back to top
 
IP Logged
 
fireboy
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 17
Joined: Dec 17th, 2009
Re: NodeListView
Reply #2 - Mar 1st, 2010 at 4:47pm
Print Post  
Thank you for your reply.
I changed the item template to the following XAML, but now all the items are aligned to the left. I want them to be centered in the control. Is there anything else that is set through styles that is preventing desired behavior? I tried different ways, but nothing changes.

Code
Select All
	  <DataTemplate x:Key="ShapeItemTemplate">
		<StackPanel>
		    <Border BorderThickness='0,0,5,0'>
			  <ContentPresenter Content="{Binding}" />
		    </Border>
		    <!--Binding to custom attached properties does not work, use Tag or ToolTip for label-->
		    <TextBlock Text='{Binding Tag}' TextAlignment='Center'/>
		</StackPanel>
	  </DataTemplate>
 

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NodeListView
Reply #3 - Mar 1st, 2010 at 6:45pm
Print Post  
Try this:

Code
Select All
<my:NodeListView Grid.Column="1">
	<my:NodeListView.ItemContainerStyle>
		<Style TargetType="ListBoxItem">
			<Setter Property="HorizontalContentAlignment" Value="Stretch" />
		</Style>
	</my:NodeListView.ItemContainerStyle>
	<my:NodeListView.ItemTemplate>
		<DataTemplate>
			... 



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


I love YaBB 1G - SP1!

Posts: 17
Joined: Dec 17th, 2009
Re: NodeListView
Reply #4 - Mar 2nd, 2010 at 9:29am
Print Post  
It works now, thank you!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint