Pergunta

I came through this What is the best way to localize a WPF application, sans LocBAML? . But, this didn't answer what I'm looking for.

I'm creating a CustomControl in WPF. I would like to provide localization support. The control contains, images, strings etc.,

Any help would be greatly appreciated.

Thanks

Foi útil?

Solução

I think the document linked in this post contains a lot of information about localization in WPF. In the end, it is up to you to decide which mechanism to use.

Since you are talking about a custom control, I would consider to give it a Culture dependency property which the consumer of your control can use to specify the desired culture. This way, the consumer can use your localized control, relatively independent of the localization strategy he/she chose.

Outras dicas

I'd suggest using Resx, try integrating into a WPF application with the TranslationByMarkupExtension example. http://www.wpftutorial.net/LocalizeMarkupExtension.html

LocBaml was a very odd thing for Microsoft to put out there and isn't better, or even complete.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top