none
ResourceDictionary.MergedDictionaries doesn't allow x:Shared RRS feed

  • Question

  • When I create a Resource dictionary with a Merged dictionary I'm unable to use x:Shared as expected:

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

        <ResourceDictionary.MergedDictionaries>

            <ResourceDictionary>

                <StackPanel x:Key="content" x:Shared="false">

                    <TextBlock Text="From Ribbon" />

                </StackPanel>

            </ResourceDictionary>

        </ResourceDictionary.MergedDictionaries>

       

    </ResourceDictionary>

    This results in a XamlParseException: Shared attribute in namespace 'http://schemas.microsoft.com/winfx/2006/xaml' can be used only in compiled resource dictionaries.

    This is a compiled resource dictionary.  Why doesn't this code work?
    Wednesday, November 26, 2008 7:20 PM

Answers

  • I'm guessing because this isn't a compiled resource dictionary. It's a resource dictionary within a compiled resource dictionary.
    Controls for WPF and Windows Forms at http://www.divelements.co.uk
    • Marked as answer by Marco Zhou Monday, December 1, 2008 2:57 AM
    Wednesday, November 26, 2008 7:28 PM