本文整理汇总了C#中Windows.UI.Xaml.Documents.Paragraph.SetValue方法的典型用法代码示例。如果您正苦于以下问题:C# Paragraph.SetValue方法的具体用法?C# Paragraph.SetValue怎么用?C# Paragraph.SetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Windows.UI.Xaml.Documents.Paragraph
的用法示例。
在下文中一共展示了Paragraph.SetValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateContentsView
private void UpdateContentsView(IEnumerable<LineViewModel> lines)
{
Uri severBaseUri = LightKindomHtmlClient.SeverBaseUri;
ContentTextBlock.Blocks.Clear();
bool prevLineBreakFlag = false;
foreach (var line in lines)
{
var para = new Paragraph();
para.SetValue(ParagrahViewModelProperty, line);
if (!line.IsImage || line.Content == null)
{
//if (line.HasComments)
// para.Inlines.Add(new InlineUIContainer
// {
// Child = new SymbolIcon { Symbol = Symbol.Message },
// Foreground = (SolidColorBrush)App.Current.Resources["AppAcentBrush"]
// });
var run = new Run { Text = line.Content };
para.Inlines.Add(new Run { Text = CommentIndicator, FontFamily = SegoeUISymbolFontFamily, Foreground = TransparentBrush });
para.Inlines.Add(run);
//para.TextIndent = ContentTextBlock.FontSize * 1;
prevLineBreakFlag = true;
para.Margin = new Thickness(0, 0, 0, 10);
}
else
{
//para.LineHeight = 2;
Size padding = new Size(ContentTextBlock.Padding.Left + ContentTextBlock.Padding.Right, ContentTextBlock.Padding.Top + ContentTextBlock.Padding.Bottom);
//bitmap.DownloadProgress +=
//var img = new Image
//{
// Source = bitmap,
// //MaxWidth = ContentColumns.ColumnWidth - padding.Width - 1,
// //Height = ContentColumns.ColumnHeight - padding.Height - PictureMargin,
// HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Stretch,
// VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Stretch,
// Stretch = Stretch.Uniform,
//};
//img.DataContext = img;
//Flyout.SetAttachedFlyout(img, this.Resources["ImagePreviewFlyout"] as Flyout);
//img.Tapped += Illustration_Tapped;
//GetLocalImageAsync(new Uri(severBaseUri, line.Content)).ContinueWith(async (task) =>
//{
// await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,()=>{
// if (task.IsFaulted || task.Result == null)
// {
// img.Source = new BitmapImage(new Uri(severBaseUri, line.Content));
// }
// else
// {
// var localUri = task.Result;
// img.Source = new BitmapImage(localUri);
// }
// });
//});
//var illustration = new Border
//{
// HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Stretch,
// VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Stretch,
// Width = ContentColumns.ColumnWidth - padding.Width - 1,
// Height = ContentColumns.ColumnHeight - padding.Height - PictureMargin,
// Background = null,
// BorderBrush = null,
// Child = img,
//};
var illustration = LineViewCCGTemplate.LoadContent() as IllustrationView;
illustration.DataContext = line;
illustration.Width = ContentColumns.ColumnWidth - padding.Width - 1;
illustration.Height = ContentColumns.ColumnHeight - padding.Height - PictureMargin;
illustration.LoadIllustrationLine(line);
//LoadItemIllustation(illustration, line);
(illustration.FindName("ImageContent") as Image).SizeChanged += Image_SizeChanged;
//var bitmap = (illustration.GetFirstDescendantOfType<Image>().Source as BitmapImage);
//var pb = illustration.GetFirstDescendantOfType<ProgressBar>();
//bitmap.SetValue(BitmapLoadingIndicatorProperty, pb);
var inlineImg = new InlineUIContainer
{
Child = illustration // img
};
//inlineImg.FontSize = 620;
para.TextAlignment = TextAlignment.Center;
if (prevLineBreakFlag)
{
para.Inlines.Add(new Run { Text = "\n" });
illustration.Margin = new Thickness(0, 5, 0, 0);
//img.Margin = new Thickness(0, 5, 0, 0);
}
else
{
para.Inlines.Add(new Run { Text = " \n", FontSize = 5 });
}
para.Inlines.Add(inlineImg);
prevLineBreakFlag = false;
}
//.........这里部分代码省略.........