微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Windows 8商店应用程序:在flipview控件中使用多个RichTextColumns

我试图在翻页视图中以两种语言(并排)显示两列富文本。 如何在RichTextColumns中创build两个列并将其绑定到两个不同的数据源?

翻转视图控件看起来像这样:

FlipView x:Name =“flipView”AutomationProperties.AutomationId =“ItemsFlipView”AutomationProperties.Name =“Item Details”TabIndex =“1”Grid.RowSpan =“2”ItemsSource =“{Binding Source = {StaticResource itemsViewSource}}”>

<FlipView.ItemContainerStyle> <Style targettype="FlipViewItem"> <Setter Property="Margin" Value="0,137,0"/> </Style> </FlipView.ItemContainerStyle> <FlipView.ItemTemplate> <DataTemplate> <!-- UserControl chosen as the templated item because it supports visual state management Loaded/unloaded events explicitly subscribe to view state updates from the page --> <UserControl Loaded="StartLayoutUpdates" Unloaded="StopLayoutUpdates"> <ScrollViewer x:Name="scrollViewer" {StaticResource horizontalscrollviewerStyle}" Grid.Row="1"> <Grid> <!-- Content is allowed to flow across as many columns as needed --> <common:RichTextColumns x:Name="richTextColumns" Margin="117,117,47"> <RichTextBlock x:Name="richTextBlock" Width="560" {StaticResource ItemRichTextStyle}" IsTextSelectionEnabled="False"> <Paragraph> <Run FontSize="26.667" FontWeight="Light" Text="ምዕራፍ "/> <Run FontSize="26.667" FontWeight="Light" Text="{Binding ChapterNumber }"/> <LineBreak/> <!--<Run FontWeight="normal" Text="{Binding Subtitle}"/>--> </Paragraph> <Paragraph> <Run FontWeight="SemiLight" Text="{Binding ChapterContent}"/> </Paragraph> </RichTextBlock> <!-- Additional columns are created from this template --> <common:RichTextColumns.ColumnTemplate> <DataTemplate> <RichTextBlockOverflow Width="560" Margin="80,0"> <RichTextBlockOverflow.RenderTransform> <TranslateTransform X="-1" Y="4"/> </RichTextBlockOverflow.RenderTransform> </RichTextBlockOverflow> </DataTemplate> </common:RichTextColumns.ColumnTemplate> </common:RichTextColumns> <visualstatemanager.VisualStateGroups> <!-- Visual states reflect the application's view state inside the FlipView --> <VisualStateGroup x:Name="ApplicationViewStates"> <VisualState x:Name="FullScreenLandscape"/> <VisualState x:Name="Filled"/> <!-- Respect the narrower 100-pixel margin convention for portrait --> <VisualState x:Name="FullScreenPortrait"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="richTextColumns" Storyboard.TargetProperty="Margin"> <discreteObjectKeyFrame KeyTime="0" Value="97,87,57"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="image" Storyboard.TargetProperty="MaxHeight"> <discreteObjectKeyFrame KeyTime="0" Value="400"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> <!-- When snapped,the content is reformatted and scrolls vertically --> <VisualState x:Name="Snapped"> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="richTextColumns" Storyboard.TargetProperty="Margin"> <discreteObjectKeyFrame KeyTime="0" Value="17,17,57"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="scrollViewer" Storyboard.TargetProperty="Style"> <discreteObjectKeyFrame KeyTime="0" Value="{StaticResource VerticalScrollViewerStyle}"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="richTextBlock" Storyboard.TargetProperty="Width"> <discreteObjectKeyFrame KeyTime="0" Value="280"/> </ObjectAnimationUsingKeyFrames> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="image" Storyboard.TargetProperty="MaxHeight"> <discreteObjectKeyFrame KeyTime="0" Value="160"/> </ObjectAnimationUsingKeyFrames> </Storyboard> </VisualState> </VisualStateGroup> </visualstatemanager.VisualStateGroups> </Grid> </ScrollViewer> </UserControl> </DataTemplate> </FlipView.ItemTemplate> </FlipView>`

midl找不到C预处理器cl.exe

什么时候应该在HKCR Interface中注册我的COM接口?

是否有可能把昏暗的Windows 8背景图片

构build项目时的权限问题

如何在汇编语言中运行独立的代码

Syntax不能在gVim windows7中工作

Windows事件查看器保存在我的EXE文件上的一个

如何在Windows上升级Git?

C ++ 11:如何实现快速,轻量和公平的同步资源访问

显示进程写入硬盘驱动器的工具?

如果列将要显示两个单独的信息,你是不是可以创建两个单独的richtextcolumns,把它们放在grid中,然后在flipview中。 这样你可以绑定每个RichTextColumn到你想要的源。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐