Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Resource name is displayed instead of the resource text

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support
View previous topic :: View next topic  
Author Message
waltersb



Joined: 12 Jun 2012
Posts: 5

PostPosted: Thu Jul 05, 2012 8:19 am    Post subject: Resource name is displayed instead of the resource text Reply with quote

I have the following Problem:
I use the datagrid from WPFToolkit
Code:

<Window ResxExtension.DefaultResxName="Lokalisierungstest.MainWindow"
        Language="{UICulture}"
        x:Uid="Window_1"
        x:Class="Lokalisierungstest.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:dg="clr-namespace:Microsoft.Windows.Controls;assembly=WPFToolkit"
        Title="{Resx Window_Title}"
        Height="350"
        Width="525"
        WindowStartupLocation="CenterScreen">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="*" />
      <RowDefinition Height="35" />
    </Grid.RowDefinitions>
    <dg:DataGrid Grid.Row="1">
      <dg:DataGrid.Columns>
        <dg:DataGridTextColumn Header="{Resx dg:DataGridTextColumn_Header1}" />
        <dg:DataGridTextColumn Header="{Resx dg:DataGridTextColumn_Header2}" />
        <dg:DataGridTextColumn Header="{Resx dg:DataGridTextColumn_Header3}" />
      </dg:DataGrid.Columns>
    </dg:DataGrid>
  </Grid>
</Window>


Globalizer detected the header attribut in the DataGridTextColumns correctly and replaced the text by "{Resx...}"
Unfortunately when I start the application the headers of the data grid looks like this:

#dg:DataGridTextColumn_Header1 | #dg:DataGridTextColumn_Header2 | dg:DataGridTextColumn_Header3

It seems that the resources are not found and therefore the resource names are displayed.
But the xxx.resources.dll exists and all other texts are displayed correctly.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Thu Jul 05, 2012 11:03 pm    Post subject: Reply with quote

If the DataGridTextColumn objects are not implemented as DependencyObjects then you may need to set the ResxName property for these elements explicitly (rather than relying on the DefaultResxName set for the Window) ie

Code:
<dg:DataGridTextColumn Header="{Resx ResxName= =Lokalisierungstest.MainWindow,  Key=dg:DataGridTextColumn_Header1}" />


In the Globalizer XAML settings you can create a special "Scan and Convert Properties" rule for this Control Type and set the "Set ResxName" property so that if you have other instances of the same control this is done automatically when they are converted to use Resx.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
gunters63



Joined: 25 Jan 2011
Posts: 21

PostPosted: Wed Aug 08, 2012 3:20 pm    Post subject: Reply with quote

I have the same problem with GridViewColumn Header.

Code:
                        <GridViewColumn Header="{Resx ResxName=SonicTC.View.Workflow.Views.VersionablesView, Key=GridViewColumn_Header9}"
                                        DisplayMemberBinding="{Binding CreationUser, Mode=OneWay}"
                                        behaviors:GridViewColumnResize.Width="Auto" />


works

Code:
                        <GridViewColumn Header="{Resx Key=GridViewColumn_Header9}"
                                        DisplayMemberBinding="{Binding CreationUser, Mode=OneWay}"
                                        behaviors:GridViewColumnResize.Width="Auto" />


with ResxExtension.DefaultResxName set does not.

But GridViewColumn derives from DependencyObject.

GridViewColumn isn't part of the visual tree, so you normally cannot use Binding (although there are tricks to make it work), even though the Header property is a DependencyProperty. If the Resx markup extension uses data binding internally thats probably the problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Globalizer Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group