![]() |
Markup text-wrapping weirdness |
Post Reply ![]() |
Author | |
nikb ![]() Newbie ![]() Joined: 20 September 2008 Status: Offline Points: 4 |
![]() ![]() ![]() ![]() ![]() Posted: 20 May 2009 at 8:48pm |
Hello,
I've been trying to get the proper markup for a tooltip for the last few hours, and no matter what I try, I just can't get it to work right. Here's the markup I'm using: <StackPanel Margin='1' Orientation='Horizontal' MaxWidth='300'> <Image Source='282'/> <TextBlock Padding='7, 6, 30, 7' TextWrapping='Wrap'> <Run FontWeight='Bold'>Lorem ipsum</Run><LineBreak/> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </TextBlock> </StackPanel> Now, what I would expect to have happen is this: A tooltip with the image on the left side. To its right, the text "Lorem ipsum" in bold, and followed by the full "Lorem ipsum" text, which will wrap over as many lines necessary to display properly. Alas, the full "Lorem ipsum" text does not get wrapped over multiple lines. Instead gets clipped. I've tried a number of variations with horizontal and vertical stack panels, all to no avail. Any feedback would be greatly appreciated. |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
its StackPanel designed behavior. Use Grid:
<Grid Margin='1' MaxWidth='300'>
<Grid.ColumnDefinitions> <ColumnDefinition Width='Auto'/> <ColumnDefinition Width='*'/> </Grid.ColumnDefinitions> <Image Grid.Column='0' Source='282'/> <TextBlock Grid.Column='1' Padding='7, 6, 30, 7' TextWrapping='Wrap'> <Run FontWeight='Bold'>Lorem ipsum</Run><LineBreak/> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </TextBlock> </Grid> |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |