CodeCopy

September 15, 2009

Putting wfp styles in seperate resource files

Filed under: c#,wpf — sterndorff @ 09:17
Tags: , , ,

First define a seperate resource file. In this example /Templates/DefaultStyles.xaml:

<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <style x:Key="TextblockHeader">
        <setter Property="Control.FontWeight" Value="Bold"/>
        <setter Property="Control.FontSize" Value="14"/>
        <setter Property="Control.Margin" Value="10,5,10,5"/>
    </style>
</resourcedictionary>

The hard part is including this resource in your app/usercontrol.
(more…)

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.