c# - Windows Phone 8 region-neutral resource file from external assembly -
i have windows phone 8 app project , portable library project resources used in phone app. it's developed in visual studio 2013 ultimate.
i try use region-neutral resource files (e.g. appresources.en.resx instead of appresources.en-gb.resx).
if place region-neutral resource files in phone app project works fine.
if place resource files in portable library project default resource file used application.
if use region-specific naming (appresources.en-gb.resx) resources files in portable library project ok too.
class access resources:
public class localizedstrings { private static appresources _localizedresources = new appresources(); public appresources localizedresources { { return _localizedresources; } } }
reference class in app.xaml:
<application.resources> <res:localizedstrings xmlns:res="clr-namespace:project.phone.app;assembly=project.phone.app" x:key="localizedstrings"/> </application.resources>
example above resources located in phone app project. "project.phone.app" changed "project.library.localizedresources" in case when resources located in portable library project.
usage:
<textblock text="{binding path=localizedresources.applicationtitle, source={staticresource localizedstrings}}" style="{staticresource phonetextnormalstyle}"/>
Comments
Post a Comment