snipt

Ctrl+h for KB shortcuts

XML

Putting ResourceDictionary and Converter inside one local Resources

1
2
3
4
5
6
7
8
9
<Window.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="Resources\MyStyles.xaml" />
        </ResourceDictionary.MergedDictionaries>

        <local:MarginConverter x:Key="converter"/>
    </ResourceDictionary>
</Window.Resources>
https://snipt.net/embed/faf1854e7fbf98a912d08cf85b01cfc4/
/raw/faf1854e7fbf98a912d08cf85b01cfc4/
faf1854e7fbf98a912d08cf85b01cfc4
xml
XML
9
2019-05-25T09:42:54
True
False
False
Dec 05, 2013 at 05:51 AM
/api/public/snipt/98706/
putting-resourcedictionary-and-converter-inside-one-local-resources
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a> <a href="#L-8">8</a> <a href="#L-9">9</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nt">&lt;Window.Resources&gt;</span> </span><span id="L-2"><a name="L-2"></a> <span class="nt">&lt;ResourceDictionary&gt;</span> </span><span id="L-3"><a name="L-3"></a> <span class="nt">&lt;ResourceDictionary.MergedDictionaries&gt;</span> </span><span id="L-4"><a name="L-4"></a> <span class="nt">&lt;ResourceDictionary</span> <span class="na">Source=</span><span class="s">&quot;Resources\MyStyles.xaml&quot;</span> <span class="nt">/&gt;</span> </span><span id="L-5"><a name="L-5"></a> <span class="nt">&lt;/ResourceDictionary.MergedDictionaries&gt;</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a> <span class="nt">&lt;local:MarginConverter</span> <span class="na">x:Key=</span><span class="s">&quot;converter&quot;</span><span class="nt">/&gt;</span> </span><span id="L-8"><a name="L-8"></a> <span class="nt">&lt;/ResourceDictionary&gt;</span> </span><span id="L-9"><a name="L-9"></a><span class="nt">&lt;/Window.Resources&gt;</span> </span></pre></div> </td></tr></table>