环境
[1]Visual Studio 2013
[2]Win Store App 8.1
正文
XAML部分内容
<RichEditBox x:Name="reb" Background="#FF0F243E" BorderThickness="0" Margin="4"/>
C#部分内容
public async Task Model2View()
{
Uri dataUri = new Uri("ms-appx:///Assets/rtf/preface.rtf");//Build Action为Content
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
if (file != null)
{
Windows.Storage.Streams.IRandomAccessStream randAccStream =
await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
// Load the file into the Document property of the RichEditBox.
reb.Document.LoadFromStream(Windows.UI.Text.TextSetOptions.FormatRtf, randAccStream);
reb.IsReadOnly = true;
}
}
551




被折叠的 条评论
为什么被折叠?



