Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ListView and Binding Shapes. (Read 1776 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
ListView and Binding Shapes.
Mar 3rd, 2010 at 10:02am
Print Post  
Hi

I have following in my xaml file -
<Grid.Resources>
<DataTemplate x:Key="MyItemTemplate" >
<StackPanel Orientation="Vertical">
<diag:ShapeNode Bounds="0,0,50,50" Shape="{Binding ShapeType}" HorizontalAlignment="Center" />
<TextBlock Text="{Binding Name}" HorizontalAlignment="Center" />
</StackPanel>
</DataTemplate>
</Grid.Resources>

and xaml object uses following -

<ListBox ItemsSource="{Binding MyCustomItem}" ItemTemplate="{StaticResource MyItemTemplate}" />

In code behind I have following code -


public IList<MyItem> MyCustomItem
{
get
{
return new List<MyItem>() { new MyItem() { Name = "Rajesh", ShapeType=Shapes.Rectangle },

new MyItem() { Name = "Niranjan", ShapeType=Shapes.PunchedCard } };
}
}

public class MyItem
{
public string Name { get; set; }
public Shape ShapeType { get; set; }
}

The above code fails to get loaded.
If I replace the Shape="{Binding ShapeType}"  with Shape="Rectangle" it works as expected.
Also change the ListBox to diag:NodeListView gives same error.

Will you please help me in this issue.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ListView and Binding Shapes.
Reply #1 - Mar 3rd, 2010 at 1:30pm
Print Post  
Hi,

Binding does not work because Shape is not a dependency property. We'll try to make it a dependency property for the next release.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: ListView and Binding Shapes.
Reply #2 - Mar 3rd, 2010 at 4:15pm
Print Post  
Hi Rajesh,

Now Shape is a dependency property in this version:
https://mindfusion.eu/_beta/diaglite14_sp.zip

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