locked
Windows store app ResourceLoader at design time RRS feed

  • Question

  • 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 .resw file at design time, but every attempt to do so has failed, even though it works at runtime.

    When using the x:Uid attribute, I still have to supply the Text property (i.e. for a TextBlock) and I don't like to write the text twice.

    I also tried creating a property for the string on the viewmodel and then bind to this:

    public string Title
    {
        get { return ResourceLoader.GetForCurrentView("Strings").GetString("MainView_Title"); }
    }
    

    This is working at runtime, but at design time it is blank.

    So the question is, is there a way to display resources from a .resw file in the XAML-designer?

    Thanks for your help,
    Lucas

    Friday, November 15, 2013 3:51 PM

Answers

  • Hi Lucas,

    I'm not aware of any good way to do so. I haven't tried actually loading it in design-time code like you are doing in your view model, but given your results I suspect the design-time environment doesn't have enough context to load the strings.

    --Rob

    Saturday, November 16, 2013 5:34 AM
    Moderator