Is it possible to localize DataPager's footer (Page X of Y) in Silvelright?
The strings seem to be located in resources embedded in the assembly of DataPager. So how should I localize it?
Unfortunately, almost nothing in the DataPager class is virtual and also many internal classes are used by it, so it is not possible (at least easily) to inherit DataPager and override the behavior.
So, there is another solution - changing the resources in the DLL.
The solution is based on this article.
Since the System.Controls.Data.dll is signed by MS, I needed to remove the signature (strong name). I used AdmiralDebilitate to remove it.
Disassemble the dll by command
ildasm /out=System.Controls.Data.il System.Controls.Data.dll
Use any resource editor (I used Resource.net) to open System.Windows.Controls.DataPager.PagerResources.resources.
Reassemble the assembly by command
ilasm /resource=System.Controls.Data.res /dll /output=System.Controls.Data.dll System.Controls.Data.il
Done.
There are two possible problems: