Skip to main content
Home Forums Silverlight Programming Programming with .NET - General <class> does not contain a definition for <property>
3 replies. Latest Post by silverlightdesigner on November 8, 2009.
(0)
silverli...
Member
4 points
19 Posts
11-07-2009 6:36 PM |
Hi,
I tried this question earlier and did not get a response, so I am trying again as I am still stuck!
I have a collection of string values that I am binding to some TextBlocks in a Silverlight project. The string values are showing up fine when I run the project. However, I added another string:
Link ="Some more stuff"
and Blend 3 throws an error, which says:
'OlympicMediaComponentOne.StoryInfo' does not contain a definition for 'Link'
Here is a code snippet:
In MainPage.xaml.cs:
{
InitializeComponent();
stories.Add(
ImageListBox.ItemsSource = stories;
DetailsPanel.ItemsSource = stories;
TransitionDetails.ItemsSource = stories;
In DetailPage.xaml I have this:
<StackPanel Orientation="Vertical" UseLayoutRounding="True" Margin="0" d:LayoutOverrides="HorizontalMargin" HorizontalAlignment="Left" VerticalAlignment="Top" Width="216" MinHeight="75"> <Grid> <TextBlock x:Name="DetailsHeadlineCrossFade" Foreground="White" FontFamily="Arial" FontSize="12" Margin="8,6,4,0" TextWrapping="Wrap" FontWeight="Bold" /> <TextBlock x:Name="DetailsHeadline" Text="{Binding Headline, Mode=OneWay}" Foreground="White" FontFamily="Arial" FontSize="12" Margin="8,6,4,0" TextWrapping="Wrap" FontWeight="Bold" /> </Grid> <Grid Margin="0,0,0,11"> <TextBlock x:Name="DetailsBodyCrossFade" Foreground="White" FontFamily="Arial" FontSize="10.667" Margin="8,4,4,0" TextWrapping="Wrap" /> <TextBlock x:Name="DetailsBody" Text="{Binding Body, Mode=OneWay}" Foreground="White" FontFamily="Arial" FontSize="10.667" LineHeight="13" Margin="8,4,8,0" TextWrapping="Wrap" /> </Grid> <Grid> <TextBlock x:Name="DetailsLinkCrossFade" Foreground="White" FontFamily="Arial" FontSize="10.667" Margin="8,4,8,0" TextWrapping="Wrap" /> <TextBlock x:Name="DetailsLink" Text="{Binding Link, Mode=OneWay}" Margin="8,0,0,0" FontFamily="Arial" FontSize="10.667" Foreground="White" TextWrapping="Wrap"/> </Grid> </StackPanel>
Can anyone tell me how to get this extra srting value recognized by Blend?
Thanks in advance.
Sergey.L...
Contributor
7250 points
1,351 Posts
11-07-2009 6:56 PM |
Hi Nick,
Show please a definition of StoryInfo class.
11-07-2009 7:04 PM |
All I did was this, which you can see in the original snippet:
private List<StoryInfo> stories;
11-08-2009 2:02 AM |
I found the error, the public string declaration in the StoryInfo() class was missing the set; cmd.