public Form1()
{
InitializeComponent();
// Create a WPF application
var app = new System.Windows.Application();
// Load the ressources
var resources = System.Windows.Application.LoadComponent(
new Uri("Styles.xaml", UriKind.Relative))
as System.Windows.ResourceDictionary
// Merge it on application level
app.Resources.MergedDictionaries.Add(resources);
}