Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. The Property 'Content' is set more than once - I cant see were I am doing this

The Property 'Content' is set more than once - I cant see were I am doing this

Scheduled Pinned Locked Moved WPF
wpfhelpwcfdata-structures
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paul Harsent
    wrote on last edited by
    #1

    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>
    
    P A 2 Replies Last reply
    0
    • P Paul Harsent

      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>
      
      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      You've added two pieces of content to PanoramaItem; in other words, you've added the StackPanel and the ListBox. I assume you mean for the ListBox to be part of the StackPanel - if so, move it insided the StackPanel 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

      My blog | My articles | MoXAML PowerToys | Onyx

      P 1 Reply Last reply
      0
      • P Pete OHanlon

        You've added two pieces of content to PanoramaItem; in other words, you've added the StackPanel and the ListBox. I assume you mean for the ListBox to be part of the StackPanel - if so, move it insided the StackPanel 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

        My blog | My articles | MoXAML PowerToys | Onyx

        P Offline
        P Offline
        Paul Harsent
        wrote on last edited by
        #3

        I wanted two pannels inside my PanoramaItem The StackPannel will hold fix pre set info The ListBox 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 P 2 Replies Last reply
        0
        • P Paul Harsent

          I wanted two pannels inside my PanoramaItem The StackPannel will hold fix pre set info The ListBox 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 Offline
          I Offline
          Ian Shlasko
          wrote on last edited by
          #4

          Put 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)

          1 Reply Last reply
          0
          • P Paul Harsent

            I wanted two pannels inside my PanoramaItem The StackPannel will hold fix pre set info The ListBox 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

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            If 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

            My blog | My articles | MoXAML PowerToys | Onyx

            1 Reply Last reply
            0
            • P Paul Harsent

              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>
              
              A Offline
              A Offline
              Abhinav S
              wrote on last edited by
              #6

              I guess you need to move the listbox into another PanoramaItem.

              The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups