c# - Why can't I localize my WPF program? -
this question has answer here:
i have wpf program, , when localize it, fails. entered created xml namespace, corresponds file location, in window
element:
xmlns:properties="clr-namespace:resxeditor.properties"
this how localizing each element:
<button content="{x:static properties:resources.filepickerbutton_addfile}" />
the designer works fine, , when choose resources.
, auto-complete pulls available items, when build application, crashes error message:
exception thrown: 'system.windows.markup.xamlparseexception' in presentationframework.dll
additional information: 'provide value on 'system.windows.markup.staticextension' threw exception.' line number '5' , line position '9'.
the line number , position correspond first x
in namespace have given above. tried searching message on web, , can't seem find anything.
after hour or of searching web, randomly happened try changing access modifier on resources.resx file internal
public
. so, open .resx file in visual studio editor, , change drop-down menu labeled "access modifier" "public", should other option besides "internal".
this change items in .designer file use public
access modifier. example of these items looks like:
/// <summary> /// looks localized string similar add files. /// </summary> public static string filepickerbutton_addfile { { return resourcemanager.getstring("filepickerbutton_addfile", resourceculture); } }
Comments
Post a Comment