Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 34401 |  Welcome, Guest!   Register  Login
  Home > Community Home >

XAML Tip: Setting Attached Properties from Code

  Posted on: 3/29/2012 1:36:39 PM | Views: 90

Recommend an Articles | Recommended Articles | Search Resources | Community Home |


Advertisements


Recently, a reader asked how they should go aboutsetting the Typography properties from code-behind.
The original question was about Silverlight, but the approachworks in WPF, Windows 8 and more.
Given the following markup:
<StackPanel>
<TextBlock x:Name="OriginalText"
FontSize="72"
FontFamily="Gabriola"
Text="Hello World!" />

<TextBlock x:Name="ExampleText"
FontSize="72"
FontFamily="Gabriola"
Text="Hello World!" />
</StackPanel>
You can set an attached property such asTypography.StylisticSet5 by using theSetValue method like this:
< ... Go to the complete details ...

Found interesting? Add this to:


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/20/2013 5:36:31 AM