Geeks With Blogs
Silverlighting... Ramblings on Silverlight and occasionally WPF

The <LineBreak></LineBreak> tags allow you to insert line breaks at desired location of content inside a TextBlock.

Consider the following example,

<UserControl x:Class="Demo.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
  <Grid x:Name="LayoutRoot" >
<TextBlock>The function of the DescriptionViewer
 <LineBreak></LineBreak>control in
  Silverlight is to display some
 <LineBreak></LineBreak>information as a description and
 <LineBreak></LineBreak>track error state for an associated
 <LineBreak></LineBreak>control.</TextBlock></Grid>
 </UserControl>


To see how the LineBreak tags work, also test the above code without the LineBreak tags. Then you will understand the difference.

Posted on Sunday, July 4, 2010 9:47 AM Silverlight | Back to top


Comments on this post: How to use line breaks in TextBlock controls

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Mamta | Powered by: GeeksWithBlogs.net