Windows store app ResourceLoader at design time

后端 未结 2 1810
一个人的身影
一个人的身影 2021-02-14 03:07

I\'ve started creating a Windows Store App for Windows 8.1 and now I encountered a problem concerning localization.

I would like to display a string resource from a .res

2条回答
  •  礼貌的吻别
    2021-02-14 03:41

    This is an old thread, but since Nate provided such an elegant solution to the problem for Win8.1 I figured I'd ask here...

    After much investigation and experimentation, Nate's solution does not appear to work for UWP apps for Win10 under VS2017 Community. The LocalizedString approach works just fine at runtime, but it appears

    App.ResourceLoader.GetForViewIndependentUse().GetString(key);
    

    refuses to return anything except String.Empty during design time. I've done a lot of experimenting and things like

    ResourceContext.GetForViewIndependentUse().QualifierValues
    

    Seem to be identical between runtime (working) and design time (not working).

    I was wondering if anyone has encountered this and solved it. Nate? :)

提交回复
热议问题