我从MSDN文档中了解到,无法使用XAML属性导出属于RichTextBox一部分的图像。这很好,我可以通过选择并手动查看块来解决这个问题。使用xaml将图像载入silverlight richtextarea
我的问题是,如果我手动重新构建XAML以包含图像,RichTextBox是否能够从xaml加载它。
我已经实现了反射和手动XAML导出,它完美地工作,没有图像。
带图像它会产生这样的:
<Section xml:space="preserve" HasTrailingParagraphBreakOnPaste="False" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<Paragraph TextAlignment="Left" FontSize="20" FontFamily="Portable User Interface" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" Foreground="#FF000000" >
<Run Text="Test" FontSize="20" FontFamily="Portable User Interface" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" Foreground="#FF000000" />
</Paragraph>
<Paragraph TextAlignment="Left" FontSize="20" FontFamily="Portable User Interface" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" Foreground="#FF000000" >
<InlineUIContainer>
<Image Source="./desert.jpg" Height="150" Width="200" />
</InlineUIContainer>
<Run Text="" FontSize="20" FontFamily="Portable User Interface" FontWeight="Normal" FontStyle="Normal" FontStretch="Normal" Foreground="#FF000000" />
</Paragraph>
</Section>
其中我通过XAML属性和休息反馈到RTB! (唯一的例外是没有用的,只是一个IllegalArgmentException说“价值”。
如果你把刚才的InlineUIContainer节以其优良的!
我不能工作了,如果它有可能与图片拍摄地点是不对的问题或在RichTextBox只是没有在代码接受图像分开
的唯一原因,我认为这是可能的XAML是指定的图像,因为MSDN文档显示它:?http://msdn.microsoft.com/en-us/library/ee681613(VS.95).aspx
任何想法
Ta,
Andy。
如果我有时间,我想我可以得到符号Silverlight和调试到代码,只是不想花这多少时间就可以了! :( – Andy 2010-12-17 09:44:55