Wpf 如何本地化流程文档

Wpf 如何本地化流程文档,wpf,localization,flowdocument,Wpf,Localization,Flowdocument,我想实现基于流文档的应用程序视图的上下文帮助。例如,用户按Ctrl+F1组合键,有关当前视图的上下文帮助将显示在此视图上。帮助内容必须本地化 窗口内标记可以如下所示: <Window x:Class="UdkppReports.Window2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/x

我想实现基于流文档的应用程序视图的上下文帮助。例如,用户按Ctrl+F1组合键,有关当前视图的上下文帮助将显示在此视图上。帮助内容必须本地化

窗口内标记可以如下所示:

<Window x:Class="UdkppReports.Window2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window2" Height="300" Width="300">
<Grid>
    <ContentControl x:Name="View"/>
    <ContentControl x:Name="Help" Visibility="Collapsed">
        <ContentControl.Style>
            <Style>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding CurrentView.HelpContent}" Value="{x:Null}">
                        <Setter Property="Grid.Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
        </ContentControl.Style>
    </ContentControl>
</Grid>

并进一步获取完整的类名,尝试动态创建帮助类的实例,并将View.HelpContent属性分配给该实例。这应该行得通,但可能是一种标准的流程文档本地化方法?

您是否尝试过使用LocBaml工具进行本地化?每个xaml元素都支持x:Uid属性,因此您可以使用。还有一篇关于MS考试70-502培训包本地化的文章。

我认为最好的方法是使用。
请看一下与本库作者关于流文档支持的讨论

我不尝试使用LocBAML,因为第一条消息中描述的我自己的想法似乎非常适合这项任务。
string lang = Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName;
string helpClassShortName = "SomeView_" + lang;