how to add string with the style add into ResourceDictionary in wpf
<p>i want to add string with the style is added into ResourceDictionary, how this is possible</p>

<pre><code>Ex : string MyStyle = "&lt;Style x:Key='baseStyle' TargetType='{x:Type Button}'&gt;" +
    "&lt;Setter Property='FontSize' Value='12' /&gt;" +
    "&lt;Setter Property='Background' Value='Orange' /&gt;&lt;/Style&gt;";
</code></pre>

<p>i want to add this string into resourcedictionary</p>

<p>How?</p>

<pre><code>ResourceDictionary rd = new ResourceDictionary();
rd.MergedDictionaries.Clear();
rd.Add("MyStyle", MyStyle);
Application.Current.Resources.MergedDictionaries.Add(rd);
</code></pre>

<p>is not working....</p>
