当前位置: 首页>>代码示例>>C#>>正文


C# TextBlock.GetValue方法代码示例

本文整理汇总了C#中System.Windows.Controls.TextBlock.GetValue方法的典型用法代码示例。如果您正苦于以下问题:C# TextBlock.GetValue方法的具体用法?C# TextBlock.GetValue怎么用?C# TextBlock.GetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.TextBlock的用法示例。


在下文中一共展示了TextBlock.GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: IsRequiredForFormPropertyTest

		public void IsRequiredForFormPropertyTest ()
		{
			Assert.IsNotNull (AutomationProperties.IsRequiredForFormProperty, "#0");

			TextBlock block = new TextBlock ();
			block.SetValue (AutomationProperties.IsRequiredForFormProperty, true);
			Assert.AreEqual (AutomationProperties.GetIsRequiredForForm (block),
				block.GetValue (AutomationProperties.IsRequiredForFormProperty), "#1");

			Assert.IsTrue (AutomationProperties.GetIsRequiredForForm (block), "#2");
			Assert.IsTrue ((bool) block.GetValue (AutomationProperties.IsRequiredForFormProperty), "#3");
		}
开发者ID:dfr0,项目名称:moon,代码行数:12,代码来源:AutomationPropertiesTest.cs

示例2: SimpleUIUsingResourceDictionary

        public SimpleUIUsingResourceDictionary()
        {
            var stack = new StackPanel();
            Content = stack;

            var textBlock = new TextBlock();
            textBlock.SetResourceReference(TextBlock.StyleProperty, SimpleResourceDictionary.TextBlockStyleKey);
            textBlock.SetBinding(TextBlock.TextProperty, new Binding("FirstName"));
            stack.Children.Add(textBlock);

            var local = textBlock.GetValue(TextBlock.StyleProperty);

            textBlock = new TextBlock();
            textBlock.SetBinding(TextBlock.TextProperty, new Binding("LstName")); //purposefully misspelled
            stack.Children.Add(textBlock);
        }
开发者ID:ssethi,项目名称:TestFrameworks,代码行数:16,代码来源:SimpleUIUsingResourceDictionary.cs

示例3: GetWeibo

 public static WeiboStatus GetWeibo(TextBlock textblock)
 {
     return textblock.GetValue(WeiboProperty) as WeiboStatus;
 }
开发者ID:heartszhang,项目名称:WeiZhi3,代码行数:4,代码来源:TextRender.cs

示例4: RecreateInlines

 private static void RecreateInlines(TextBlock t, IEnumerable<Inline> list)
 {
     RecreateInlines(t, (Inline) t.GetValue(PrefixInlineListProperty), list);
 }
开发者ID:ericschultz,项目名称:gui,代码行数:4,代码来源:TextBlockExtensions.cs

示例5: GetInlinesList

 public static IEnumerable<Inline> GetInlinesList(TextBlock element)
 {
     return (IEnumerable<Inline>) element.GetValue(InlinesListProperty);
 }
开发者ID:ericschultz,项目名称:gui,代码行数:4,代码来源:TextBlockExtensions.cs

示例6: GetHighlightBrush

 public static Brush GetHighlightBrush(TextBlock element)
 {
     return (Brush)element.GetValue(HighlightBrushProperty);
 }
开发者ID:algolia,项目名称:HTMLBinding,代码行数:4,代码来源:WP8HTMLBinding.cs

示例7: GetIsTextTrimmed

 public static bool GetIsTextTrimmed(TextBlock target) => (bool) target.GetValue(IsTextTrimmedProperty);
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:1,代码来源:TextBlockTrimmedTooltip.cs

示例8: GetInline

 public static string GetInline(TextBlock element)
 {
     return (element != null) ? element.GetValue(ArticleContentProperty) as string : string.Empty;
 }
开发者ID:kazukioishi,项目名称:Uzuki,代码行数:4,代码来源:HyperlinkText.cs

示例9: LabeledByPropertyTest

		public void LabeledByPropertyTest ()
		{
			Assert.IsNotNull (AutomationProperties.LabeledByProperty, "#0");

			TextBlock block = new TextBlock ();
			TextBlock labeledBy = new TextBlock();
			block.SetValue (AutomationProperties.LabeledByProperty, labeledBy);
			Assert.AreEqual (AutomationProperties.GetLabeledBy (block),
				block.GetValue(AutomationProperties.LabeledByProperty), "#1");

			Assert.AreSame (labeledBy, AutomationProperties.GetLabeledBy (block), "#2");
			Assert.AreSame (labeledBy, block.GetValue (AutomationProperties.LabeledByProperty), "#3");
		}
开发者ID:dfr0,项目名称:moon,代码行数:13,代码来源:AutomationPropertiesTest.cs

示例10: GetInlineList

        /// <summary>
        ///     The get inline list.
        /// </summary>
        /// <param name="element">
        ///     The element.
        /// </param>
        /// <returns>
        ///     The <see cref="string" />.
        /// </returns>
        public static string GetInlineList(TextBlock element)
        {
            if (element != null)
                return element.GetValue(ArticleContentProperty) as string;

            return string.Empty;
        }
开发者ID:Khayde,项目名称:slimCat,代码行数:16,代码来源:TextBlockHelper.cs

示例11: GetFormattedText

 /// <summary>
 /// Retrieves the value of the <see cref="FormattedTextProperty"/> dependency property of
 /// the specified text block.
 /// </summary>
 /// <param name="obj">The text block whose property's value should be obtained.</param>
 /// <returns>The value of the property.</returns>
 public static string GetFormattedText(TextBlock obj)
 {
     return (string)obj.GetValue(FormattedTextProperty);
 }
开发者ID:musashibg,项目名称:untangle-game,代码行数:10,代码来源:HyperlinkTextBehavior.cs

示例12: GetTextForegroundRespondsToSelection

 public static bool GetTextForegroundRespondsToSelection(TextBlock obj)
 {
     return (bool)obj.GetValue(TextForegroundRespondsToSelectionProperty);
 }
开发者ID:squaredinfinity,项目名称:Foundation,代码行数:4,代码来源:Highlight.cs

示例13: GetValueFormat

 /// <summary>
 /// Gets the value format dependency property that is set on the given text block if any.
 /// </summary>
 /// <param name="obj">The text block element.</param>
 /// <returns>The value format dependency property that is set on the given text block if any.</returns>
 public static ValueFormat GetValueFormat(TextBlock obj)
 {
     return (ValueFormat)obj.GetValue(ValueFormatProperty);
 }
开发者ID:Xomega-Net,项目名称:XomegaFramework,代码行数:9,代码来源:DataPropertyItemBinding.cs

示例14: GetText

 public static string GetText(TextBlock element)
 {
     return (string)element.GetValue(TextProperty);
 }
开发者ID:algolia,项目名称:HTMLBinding,代码行数:4,代码来源:WP8HTMLBinding.cs

示例15: InsertTokens

 private static void InsertTokens(TextBlock textblock, WeiboStatus status, TextRenderContext ctx)
 {
     if (textblock == null)
         return;
     if ((bool)textblock.GetValue(DesignerProperties.IsInDesignModeProperty))
         return;
     if (status == null)
         return;
     textblock.Inlines.Clear();
     var ic = new List<Inline>();
     foreach (var sent in status.tokens)
     {
         InsertToken(ic, sent,ctx);
     }
     textblock.Inlines.AddRange(ic);
     if (textblock.Inlines.Count == 0)
         textblock.Visibility = Visibility.Collapsed;
 }
开发者ID:heartszhang,项目名称:WeiZhi3,代码行数:18,代码来源:TextRender.cs


注:本文中的System.Windows.Controls.TextBlock.GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。