Click here to Skip to main content
15,900,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hey guys, i run in some serious problem on my project.
in my app.xaml, i have ResourceDictionary
which contain ResourceDictionary.MergedDictionaries. in the MergerDictionaries, i have bounch of ResourceDictionary reference to the source, like that:
XML
<ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/EW;component/Resources/Dictionary/TextBlockStyle.xaml"/>
                <ResourceDictionary Source="/EW;component/Resources/Dictionary/RoundConrner.xaml"/>

XML
</ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>


Now, i added an ObjectDataProvider to the app.xaml and this odp needs to come with a key:
<ObjectDataProvider x:Key="odpSettings" ObjectType="{x:Type src:UserPreference}"/>
The problem is that when i put the odp with key, i have to set a key also to the ResourceDictionary, like that:
XML
<ResourceDictionary x:Key="RD">


when i'm trying to load a ResourceDictionary from aonther window, i get an error saying the resource could not been found:

TextBox x:Name="txtEmail" Margin="99,170,105,0" TextWrapping="Wrap"
HorizontalContentAlignment="Center" Foreground="#FF4C4949"
FontWeight="Thin"
Text="email:" GotFocus="txtEmail_GotFocus" LostFocus="txtEmail_LostFocus"
Style="{StaticResource TextBlockStyle}" Width="207" FontSize="12"

any advice on how to call the resourceDictionary with the key?

What I have tried:

i tried setting the ObjectDataProvider inside the resourceDictionary but then i get a message saying the ODP couldnt be found. please help me!!!!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900