How to load a WPF resource dictionary at design-time

Viewed 6542

I have a WPF window in which some properties are defined as dynamic resources like this:

<Window x:Class="LocSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        MinHeight="350" MinWidth="525"
        Title="{DynamicResource ResourceKey=ResId_Title}"
        FlowDirection="{DynamicResource ResId_FlowDirection_Default}" >
    <Grid>
       <Label Content="{DynamicResource ResId_FirstName}" />  
    </Grid>
</Window>

The ResourceDictionary is loaded at runtime to reflect the language choice of the user. And to enable the user to switch the language on the fly.

This works fine at runtime, but at design-time, the resource-defined properties are not shown. It is clear to me that the designer can't show them, because they are not defined at design-time.

I need a way to load a default ResourceDictionary at design-time so that the designer can show anything.

1 Answers
Related