<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : GENERAL: XAML Markup TextBlock.Style as attribute</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : XAML Snippets : GENERAL: XAML Markup TextBlock.Style as attribute]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 18:54:35 +0000</pubDate>
  <lastBuildDate>Tue, 17 Jun 2008 06:31:18 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=11053</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[GENERAL: XAML Markup TextBlock.Style as attribute : yeap. also right :) ]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11053&amp;PID=36855&amp;title=general-xaml-markup-textblock-style-as-attribute#36855</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11053<br /><strong>Posted:</strong> 17 June 2008 at 6:31am<br /><br />yeap. also right :)]]>
   </description>
   <pubDate>Tue, 17 Jun 2008 06:31:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11053&amp;PID=36855&amp;title=general-xaml-markup-textblock-style-as-attribute#36855</guid>
  </item> 
  <item>
   <title><![CDATA[GENERAL: XAML Markup TextBlock.Style as attribute : Thanks for explanation.As far...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11053&amp;PID=36850&amp;title=general-xaml-markup-textblock-style-as-attribute#36850</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4251">mnowaczy</a><br /><strong>Subject:</strong> 11053<br /><strong>Posted:</strong> 17 June 2008 at 5:27am<br /><br />Thanks for explanation.<br><br>As far as this style is global for page I don't want to define it many times in different panels. I made such workaround :)<br><br>&lt;StackPanel&gt;<br>&lt;StackPanel.Resources&gt;<br>&nbsp;&nbsp; &lt;Style TargetType="TextBlock" BasedOn="{StaticResource Txt_1}"/&gt;<br>&lt;/StackPanel.Resources&gt;<br>&nbsp;&nbsp; &lt;TextBlock&gt;sample 1&lt;/TextBlock&gt;<br>&nbsp;&nbsp; &lt;TextBlock&gt;sample 2&lt;/TextBlock&gt;<br>&lt;/StackPanel&gt;<br>]]>
   </description>
   <pubDate>Tue, 17 Jun 2008 05:27:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11053&amp;PID=36850&amp;title=general-xaml-markup-textblock-style-as-attribute#36850</guid>
  </item> 
  <item>
   <title><![CDATA[GENERAL: XAML Markup TextBlock.Style as attribute : Hi,  Some properties in XAML...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11053&amp;PID=36826&amp;title=general-xaml-markup-textblock-style-as-attribute#36826</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11053<br /><strong>Posted:</strong> 17 June 2008 at 12:28am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Some properties in XAML are "Attached", some "Inherited". This can work for FontWeight - its Attached and Inherited property, but can't for Style property.</DIV><DIV>&nbsp;</DIV><DIV>Here valid XAML for your task:</DIV><DIV>&nbsp;</DIV><DIV>&lt;Page xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'&gt;</DIV><DIV><BR>&lt;StackPanel&gt;<BR>&lt;StackPanel.Resources&gt;<BR>&lt;Style TargetType="TextBlock"&gt;<BR>&nbsp;&nbsp; &lt;Setter Property="Padding" Value="0,5,0,5"/&gt;<BR>&lt;/Style&gt;<BR>&lt;/StackPanel.Resources&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;TextBlock&gt;sample 1&lt;/TextBlock&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;TextBlock&gt;sample 2&lt;/TextBlock&gt;<BR>&lt;/StackPanel&gt;</DIV><DIV>&lt;/Page&gt;</DIV>]]>
   </description>
   <pubDate>Tue, 17 Jun 2008 00:28:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11053&amp;PID=36826&amp;title=general-xaml-markup-textblock-style-as-attribute#36826</guid>
  </item> 
  <item>
   <title><![CDATA[GENERAL: XAML Markup TextBlock.Style as attribute : I have style defined im my Page...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11053&amp;PID=36786&amp;title=general-xaml-markup-textblock-style-as-attribute#36786</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4251">mnowaczy</a><br /><strong>Subject:</strong> 11053<br /><strong>Posted:</strong> 16 June 2008 at 9:08am<br /><br />I have style defined im my Page resources like this:<BR>&lt;Style x:Key="Txt_1" TargetType="TextBlock"&gt;<BR>&nbsp;&nbsp; &lt;Setter Property="Padding" Value="0,5,0,5"/&gt;<BR>&lt;/Style&gt;<BR><BR>then I use it for elements in stack panel and it works well:<BR>&lt;StackPanel&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;TextBlock Style="{StaticResource Txt_1}"&gt;sample 1&lt;/TextBlock&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;TextBlock Style="{StaticResource Txt_1}"&gt;sample 2&lt;/TextBlock&gt;<BR>&lt;/StackPanel&gt;<BR><BR>As long as I want all TextBlock inside StackPanel to be the same style I tried this:<BR>&lt;StackPanel TextBlock.Style="{StaticResource Txt_1}"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;TextBlock&gt;sample 1&lt;/TextBlock&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;TextBlock&gt;sample 2&lt;/TextBlock&gt;<BR>&lt;/StackPanel&gt;<BR><BR>This approach works well with for example "FontWeight" property but not with "Style". I use your MarkupPad to test it.<BR>]]>
   </description>
   <pubDate>Mon, 16 Jun 2008 09:08:53 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11053&amp;PID=36786&amp;title=general-xaml-markup-textblock-style-as-attribute#36786</guid>
  </item> 
 </channel>
</rss>