Link to home
Start Free TrialLog in
Avatar of mastiSoft
mastiSoft

asked on

problem with resource dictionary

if I write like this in App.xaml
 <Application.Resources>
        <Style x:Key="CustomWindow" TargetType="{x:Type Window}">
        </Style>

        <ResourceDictionary x:Key="lng" Source="lang/eng_lang.xaml">
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="lang/eng_lang.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>

    </Application.Resources>
   then when I use  <Label Content="{DynamicResource SelUn}" the SelUn cannot be resolved.

If I remove
    <Style x:Key="CustomWindow" TargetType="{x:Type Window}">
        </Style>
and it will be only :
 <Application.Resources>
        <ResourceDictionary Source="lang/eng_lang.xaml">
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="lang/eng_lang.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>

<Label Content="{DynamicResource SelUn}"  shows the correct string but I need use others styles in app.xml
How can I point into my code for <Label Content= the x:Key for the resource dictionary? I think this is the problem.
ASKER CERTIFIED SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mastiSoft
mastiSoft

ASKER

how I resolve this ?
2.PNG
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi. I understand the point, thank you .
Thank you very much.