Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8001785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:10:48+00:00 2026-06-04T16:10:48+00:00

I have the following XAML in my Windows Phone app : <StackPanel Orientation=Horizontal> <Grid

  • 0

I have the following XAML in my Windows Phone app:

<StackPanel Orientation="Horizontal">
  <Grid x:Name="LayoutRoot">
    <Image Source="{Binding ImageUrl}" Height="80" HorizontalAlignment="Left" Margin="10,10,0,0" Stretch="Fill" VerticalAlignment="Top" Width="93" />
    <TextBlock name="NameBlock" Text="{Binding Name}" FontSize="30" Margin="150,20,0,0" TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300" />
    <TextBlock name="DescriptionBlock" Text="{Binding Description}" FontSize="25" Margin="150,150,0,0" TextWrapping="Wrap" HorizontalAlignment="Left"  VerticalAlignment="Top" Width="300" />
  </Grid>
</StackPanel>

Currently, I have the margin of the second TextBlock (DescriptionBlock) set to a static value. Now because I have the work wrapping of the first TextBlock (NameBlock) set to "Wrap", the height of the TextBlock is variable.

Does anyone know how to make the top-margin of DescriptionBlock equal to the automatic height of NameBlock? This would ensure that the second DescriptionBlock appears directly below the NameBlock, regardless of the length of the text of NameBlock.

Many thanks!
Brett

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:10:50+00:00Added an answer on June 4, 2026 at 4:10 pm

    This is what panels are for. Wrap the two text blocks in stack panel and it will stack the text blocks one above the other.

        <Grid x:Name="LayoutRoot">
            <Image Source="{Binding ImageUrl}" Height="80" HorizontalAlignment="Left" Margin="10,10,0,0" Stretch="Fill" VerticalAlignment="Top" Width="93" />
            <StackPanel Margin="150,20,0,0" Width="300">
                <TextBlock name="NameBlock" Text="{Binding Name}" FontSize="30"  TextWrapping="Wrap" HorizontalAlignment="Left" />
                <TextBlock name="DescriptionBlock" Text="{Binding Description}" FontSize="25" TextWrapping="Wrap" HorizontalAlignment="Left" />
            </StackPanel>
        </Grid>
    

    A panel that holds a single child is usually useless, so I removed the stack panel around the grid.

    If you’d like to continue using Grid you can define rows for it to size automatically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a Windows Phone app. I have the following XAML code: <Grid x:Name=ContentPanel
I'm developing a Windows Phone app. I have the following XAML: <!--ContentPanel --> <Grid
Say that I have the following piece of XAML: <Window> <StackPanel Orientation=Horizontal> <Label>Phone:</Label> <TextBlock
I have a windows phone 7 app with some xaml that looks like: <Grid
In my windows phone 7 app, I have the following code to handle the
I'm developing a Windows Phone application . I have defined this on App.xaml: <nav:UriMapping
I'm developing a Windows Phone app. I have the following C# code: private void
I have the following Listbox in my Windows Phone 7.5 app. Basically the ItemTemplate
I have the following xaml for changing the image for WPF button when mouse
I have the following App.xaml file: <Application x:Class=MiniDeviceConfig.App xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml StartupUri=MiniDeviceConfig.xaml> <Application.Resources> <ResourceDictionary> <ResourceDictionary.MergedDictionaries>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.