Search Wiki:
Resource Page Description
A Custom Attached property for WPF (Paragrah and TextBlock) and Silverlight (TextBlock) elements that removes any <Run Text=" "/> automatically added by newlines in the InlineCollection.

WPF Usage

<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:synergist="clr-namespace:Synergist">
    <Paragraph synergist:Text.IgnoreWhiteSpace="true">
        <Run Text="gym"/>
        <Run Text="nasium"/>
        <LineBreak/>
        <Run Text="Hello"/>
    </Paragraph>
</FlowDocument>

Silverlight Usage

<UserControl x:Class="PreviewSilverlight.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:synergist="clr-namespace:Synergist"
    Loaded="UserControl_Loaded" MinHeight="100" MinWidth="100">
    <Grid x:Name="LayoutRoot" Background="White">
        <ScrollViewer Padding="5" x:Name="TextParent" VerticalScrollBarVisibility="Visible">
            <TextBlock synergist:Text.IgnoreWhiteSpace="true">
                <Run Text="gym"/>
                <Run Text="nasium"/>
            </TextBlock>
        </ScrollViewer>
    </Grid>
</UserControl
Last edited Jan 31 2009 at 1:44 AM  by mscherotter, version 4
Updating...
Page view tracker