The Property 'Content' is set more than once - I cant see were I am doing this
-
Hi, Im new to coding in XAML and silverlight. I keep getting the error The Property 'Content' is set more than once. This error came up after I added in the top stack pannel. This is prob a very simple error to fix but I can see where I am setting the content again.
<controls:PanoramaItem Header=""> <StackPanel Height="100" HorizontalAlignment="Left" Margin="107,260,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="200"> <Image Height="112" HorizontalAlignment="Left" Margin="12,184,0,0" Name="userProfilePhoto" Source="{Binding UserProfileImage}" Stretch="Fill" VerticalAlignment="Top" Width="111" /> <TextBlock Height="44" HorizontalAlignment="Left" Margin="129,184,0,0" Name="userProfileName" Text="TextBlock" VerticalAlignment="Top" Width="297" /> <Image Height="77" HorizontalAlignment="Left" Margin="350,219,0,0" Name="userProfileMood" Stretch="Fill" VerticalAlignment="Top" Width="76" /> <TextBlock Height="157" HorizontalAlignment="Left" Margin="129,219,0,0" Name="userProfileStatus" Text="TextBlock" VerticalAlignment="Top" Width="221" /> </StackPanel> <ListBox Margin="0,150,0,0" ItemsSource="{Binding Items}" Height="402"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="0,0,0,17" Width="432" > <!--<Rectangle Height="100" Width="100" Fill="#FFE5001b" Margin="12,0,9,0"/>--> <TextBlock Text="{Binding DatePosted}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" /> <TextBlock Text="{Binding PostText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /> <TextBlock Text="{Binding UserText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <!--Double line list with text wrapping--> </controls:PanoramaItem>
-
Hi, Im new to coding in XAML and silverlight. I keep getting the error The Property 'Content' is set more than once. This error came up after I added in the top stack pannel. This is prob a very simple error to fix but I can see where I am setting the content again.
<controls:PanoramaItem Header=""> <StackPanel Height="100" HorizontalAlignment="Left" Margin="107,260,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="200"> <Image Height="112" HorizontalAlignment="Left" Margin="12,184,0,0" Name="userProfilePhoto" Source="{Binding UserProfileImage}" Stretch="Fill" VerticalAlignment="Top" Width="111" /> <TextBlock Height="44" HorizontalAlignment="Left" Margin="129,184,0,0" Name="userProfileName" Text="TextBlock" VerticalAlignment="Top" Width="297" /> <Image Height="77" HorizontalAlignment="Left" Margin="350,219,0,0" Name="userProfileMood" Stretch="Fill" VerticalAlignment="Top" Width="76" /> <TextBlock Height="157" HorizontalAlignment="Left" Margin="129,219,0,0" Name="userProfileStatus" Text="TextBlock" VerticalAlignment="Top" Width="221" /> </StackPanel> <ListBox Margin="0,150,0,0" ItemsSource="{Binding Items}" Height="402"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="0,0,0,17" Width="432" > <!--<Rectangle Height="100" Width="100" Fill="#FFE5001b" Margin="12,0,9,0"/>--> <TextBlock Text="{Binding DatePosted}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" /> <TextBlock Text="{Binding PostText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /> <TextBlock Text="{Binding UserText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <!--Double line list with text wrapping--> </controls:PanoramaItem>
You've added two pieces of content to
PanoramaItem
; in other words, you've added theStackPanel
and theListBox
. I assume you mean for the ListBox to be part of the StackPanel - if so, move it insided theStackPanel
tags.I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
You've added two pieces of content to
PanoramaItem
; in other words, you've added theStackPanel
and theListBox
. I assume you mean for the ListBox to be part of the StackPanel - if so, move it insided theStackPanel
tags.I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
I wanted two pannels inside my
PanoramaItem
TheStackPannel
will hold fix pre set info TheListBox
will hold a groups of info which should be listed. somethings like that. How would I go about doing that, so that is isnt illegal. Am I using the wrong items? Thanks -
I wanted two pannels inside my
PanoramaItem
TheStackPannel
will hold fix pre set info TheListBox
will hold a groups of info which should be listed. somethings like that. How would I go about doing that, so that is isnt illegal. Am I using the wrong items? ThanksPut a Grid (Or some other kind of panel) in the PanoramaItem, and put the StackPanel and ListBox in the Grid.
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels) -
I wanted two pannels inside my
PanoramaItem
TheStackPannel
will hold fix pre set info TheListBox
will hold a groups of info which should be listed. somethings like that. How would I go about doing that, so that is isnt illegal. Am I using the wrong items? ThanksIf you aren't intending to do something like change the visibility of the StackPanel, is there any reason you need two containers? If there is, wrap the StackPanel and ListBox in any of the containers that you want, such as a Grid.
I'm not a stalker, I just know things. Oh by the way, you're out of milk.
Forgive your enemies - it messes with their heads
-
Hi, Im new to coding in XAML and silverlight. I keep getting the error The Property 'Content' is set more than once. This error came up after I added in the top stack pannel. This is prob a very simple error to fix but I can see where I am setting the content again.
<controls:PanoramaItem Header=""> <StackPanel Height="100" HorizontalAlignment="Left" Margin="107,260,0,0" Name="stackPanel1" VerticalAlignment="Top" Width="200"> <Image Height="112" HorizontalAlignment="Left" Margin="12,184,0,0" Name="userProfilePhoto" Source="{Binding UserProfileImage}" Stretch="Fill" VerticalAlignment="Top" Width="111" /> <TextBlock Height="44" HorizontalAlignment="Left" Margin="129,184,0,0" Name="userProfileName" Text="TextBlock" VerticalAlignment="Top" Width="297" /> <Image Height="77" HorizontalAlignment="Left" Margin="350,219,0,0" Name="userProfileMood" Stretch="Fill" VerticalAlignment="Top" Width="76" /> <TextBlock Height="157" HorizontalAlignment="Left" Margin="129,219,0,0" Name="userProfileStatus" Text="TextBlock" VerticalAlignment="Top" Width="221" /> </StackPanel> <ListBox Margin="0,150,0,0" ItemsSource="{Binding Items}" Height="402"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Margin="0,0,0,17" Width="432" > <!--<Rectangle Height="100" Width="100" Fill="#FFE5001b" Margin="12,0,9,0"/>--> <TextBlock Text="{Binding DatePosted}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}" /> <TextBlock Text="{Binding PostText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /> <TextBlock Text="{Binding UserText}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}" /> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <!--Double line list with text wrapping--> </controls:PanoramaItem>