4

String辞書からを使用しようとしています:

<?xml version="1.0" encoding="utf-8" ?>
<Dictionary EnglishName="English" CultureName="English" Culture="en-US">
...
<Value Id="ButtonSuppressFieldInformation" 
       ToolTip="Remove field" Name="Remove field number "/>
...
</Dictionary>

ConverterParamter複数の言語のサポートを有効にするには、次のようにします。

<Button>
    ...
    <AutomationProperties.Name>
        <MultiBinding 
                Converter="{StaticResource IndexedForAutomationId}" 
                ConverterParameter="{loc:Translate 
                      Uid=ButtonSuppressFieldInformation, Default=Delete field}">
            <Binding RelativeSource="{RelativeSource Self}" />
            <Binding ElementName="MyContactDirectoryView" 
                     Path="ListConditionToSearch" />
        </MultiBinding >
    </AutomationProperties.Name>
</Button>

ただし、表示されるのは数字(IndexedForAutomationId)のみで、は表示されstringません。

string作品の代わりに使用する"{loc:Translate Uid=ButtonSuppressFieldInformation, Default=Delete field}"

<MultiBinding Converter="{StaticResource IndexedForAutomationId}" 
              ConverterParameter="Delete field">

を表示しDelete field 0ます。

loc:TranslateConverterParameterとして使用する方法は何ですか?

4

1 に答える 1

1

この問題は多くの原因が原因である可能性があり、さらにいくつかのコードがここで本当に役立ちます。ただし、コンバーターのConvert()メソッドのブレークポイントから始めて、 IndexedForAutomationId1)内部バインディングから期待する値を取得するかどうかを確認し、2)コンバーター自体がディクショナリから正しい文字列を返しているかどうかを確認します。

WPFバインディングのデバッグ方法についても、これらのガイドラインを確認してください。

于 2013-03-26T13:10:53.237 に答える