views:

24

answers:

1

When I modify my ressource file (.resx) add text or modify, the constructor of my ressource, always go to internal, and after that when i run my silverlight i have an error in my binding XAML.

It's there a way to avoid this scenario ? I need to go in the designer of my ressource, and put the constructor to public to solve the problem

I use my ressource like this in my xaml file

 <UserControl.Resources>
        <resources:LibraryItemDetailsView x:Key="LibraryItemDetailsViewResources"></resources:LibraryItemDetailsView>
    </UserControl.Resources>


<TextBlock FontSize="12" FontWeight="Bold" Text="{Binding Path=FileSelectedText3, Source={StaticResource LibraryItemDetailsViewResources}}"></TextBlock>
A: 

The reason for this is that you shouldn't be instantiating the class yourself. You should instead always use ConsoleApplication1.Resource1.ResourceManager which itself instantiates the class for you.

Here, ConsoleApplication1 is the name of your assembly and Resource1 the name of your resource file.

Pieter
Can you give me an example with binding ?
Cédric Boivin