2009-09-03 13 views
0

FlowDocumentをウィンドウ内に表示する最も拡張可能な方法を見つけることを試みています - ちょうどFlowDocumentです。私は持っています:FlowDocumentScrollViewerはスクロールしません

次に、ウィンドウのコンストラクタで、私はXAML(コード内)からロードするビューアのドキュメントを設定します。 XAMLは含まれています

<FlowDocument xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Background="{x:Null}" 
      FontSize="12" FontFamily="Segoe UI" PagePadding="2"> 
<BlockUIContainer> 
    <BlockUIContainer.Resources> 
     <Style TargetType="{x:Type TextBlock}"> 
      <Setter Property="TextWrapping" Value="Wrap"/> 
     </Style> 
    </BlockUIContainer.Resources> 
    <StackPanel MaxWidth="200"> 
     <TextBlock Text="{Binding DefinedWord}" FontWeight="Bold" /> 
     <ListBox ItemsSource="{Binding Definitions}" 
       Style="{StaticResource InvisibleListBox}" Margin="0" 
       ScrollViewer.HorizontalScrollBarVisibility="Disabled" 
       ScrollViewer.VerticalScrollBarVisibility="Disabled" 
       ScrollViewer.CanContentScroll="false"> 
... 

どんなに私がしようとするもの、FlowDocumentScrollViewerはスクロールしませんし、私は、文書の切り捨て部分を見ることができません。それはBlockUIContainerと何か関係がありますか、それとも他に何か不足していますか?

答えて

0

私は最終的にListBoxItemActualWidthListBoxItemテンプレート内のテキストブロックのWidthを結合、その後、IsHitTestVisible="false"にドキュメント内ListBoxを設定することで、この作業を得ました。

関連する問題