none
RichTextBlockOverflow Dinamico RRS feed

  • Pergunta

  • Tem alguma maneira de fazer um RichTextBlockOverflow de maneira dinamica?

    Estou usando o codigo:

    <Grid Grid.Column="1" Margin="0,0,0,40" VerticalAlignment="Top" HorizontalAlignment="Left">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <RichTextBlock Grid.Column="0" OverflowContentTarget="{Binding ElementName=A01}" FontSize="{Binding Value, ElementName=fontSizeSlider}" TextAlignment="Justify"
                                       Margin="20,0,0,0" FontFamily="Segoe UI" Foreground="#DE040404" MaxWidth="315" HorizontalAlignment="Left" IsTextSelectionEnabled="False" >
                            <Paragraph>
                                <Run x:Name="runNoticia" Text="Noticia" FontSize="18" FontFamily="Cambria" ></Run>
                            </Paragraph>
    
                        </RichTextBlock>
                        <RichTextBlockOverflow x:Name="A01" Grid.Column="2" OverflowContentTarget="{Binding ElementName=A02}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A02" Grid.Column="3" OverflowContentTarget="{Binding ElementName=A03}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A03" Grid.Column="4" OverflowContentTarget="{Binding ElementName=A04}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A04" Grid.Column="5" OverflowContentTarget="{Binding ElementName=A05}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A05" Grid.Column="6" OverflowContentTarget="{Binding ElementName=A06}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A06" Grid.Column="7" OverflowContentTarget="{Binding ElementName=A07}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A07" Grid.Column="8" OverflowContentTarget="{Binding ElementName=A08}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A08" Grid.Column="9" OverflowContentTarget="{Binding ElementName=A09}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A09" Grid.Column="10" OverflowContentTarget="{Binding ElementName=A10}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A10" Grid.Column="11" OverflowContentTarget="{Binding ElementName=A11}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A11" Grid.Column="12" OverflowContentTarget="{Binding ElementName=A12}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A12" Grid.Column="13" OverflowContentTarget="{Binding ElementName=A13}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A13" Grid.Column="14" OverflowContentTarget="{Binding ElementName=A14}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A14" Grid.Column="15" OverflowContentTarget="{Binding ElementName=A15}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A15" Grid.Column="16" OverflowContentTarget="{Binding ElementName=A16}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A16" Grid.Column="17" OverflowContentTarget="{Binding ElementName=A17}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A17" Grid.Column="18" OverflowContentTarget="{Binding ElementName=A18}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A18" Grid.Column="19" OverflowContentTarget="{Binding ElementName=A19}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A19" Grid.Column="20" OverflowContentTarget="{Binding ElementName=A20}" Margin="20,0,20,0" MaxWidth="315"/>
                        <RichTextBlockOverflow x:Name="A20" Grid.Column="21" Margin="20,0,20,0" MaxWidth="315"/>
    
    
                    </Grid>


    Porem, nem sempre é o suficiente, e gostaria de criar isso de uma maneira dinamica, onde se eu precisasse de 2 colunas teria 2 colunas, se precisasse de 30 teria 30..

    Consegui deixar minha duvida claro? Qualquer coisa, comenta que eu tento esclarecer...

    • Editado Ed Araujo segunda-feira, 13 de maio de 2013 19:03
    segunda-feira, 13 de maio de 2013 18:52

Todas as Respostas