locked
C# problem! Resource dictionary must have an asocciate key! in the .xaml RRS feed

  • Question

  • <!--
        This file contains XAML styles that simplify application development.

        These are not merely convenient, but are required by most Visual Studio project and item templates.
        Removing, renaming, or otherwise modifying the content of these files may result in a project that
        does not build, or that will not build once additional pages are added.  If variations on these
        styles are desired it is recommended that you copy the content under a new name and modify your
        private copy.
    -->
    <ResourceDictionary   <-- here`s the error
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> 
        <!-- Non-brush values that vary across themes -->
        <ResourceDictionary.ThemeDictionaries>
            <ResourceDictionary x:Key="Default">
                <x:String x:Key="BackButtonGlyph">&#xE071;</x:String>
                <x:String x:Key="BackButtonSnappedGlyph">&#xE0BA;</x:String>
            </ResourceDictionary>

            <ResourceDictionary x:Key="HighContrast">
                <x:String x:Key="BackButtonGlyph">&#xE071;</x:String>
                <x:String x:Key="BackButtonSnappedGlyph">&#xE0C4;</x:String>
            </ResourceDictionary>
        </ResourceDictionary.ThemeDictionaries>
    Thursday, December 12, 2013 5:02 PM

Answers

  • Hi DaudHeist,

    I suggest you to create a new ResourceDictionary file to see if the same issue happens, I pasted your code into my local environment and nothing wrong. Or can you upload a demo for testing? It seems you assigned key attribute to all ResourceDictionary element.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, December 13, 2013 11:44 AM
    Moderator

All replies

  • This is a C# forum.  You have a problem with XAML, try a WPF forum.

    Paul Linton

    Thursday, December 12, 2013 9:35 PM
  • Hi,

    I have moved this thread to Windows Store App forum for better response.

    Thanks for your understanding.

    Best regards,
    Franklin


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 13, 2013 11:25 AM
    Moderator
  • Hi DaudHeist,

    I suggest you to create a new ResourceDictionary file to see if the same issue happens, I pasted your code into my local environment and nothing wrong. Or can you upload a demo for testing? It seems you assigned key attribute to all ResourceDictionary element.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, December 13, 2013 11:44 AM
    Moderator