Gu.Localization icon indicating copy to clipboard operation
Gu.Localization copied to clipboard

Attached property for translation

Open JohanLarsson opened this issue 7 years ago • 1 comments

<TextBlock>
    <Run Text="{l:Static p:Resources.Status}" />
    <Run Text=": " />
    <Run Foreground="{Binding Status,
                              Converter={x:Static converters:StatusToBrushConverter.Default}}"
         Tag="{Binding Status,
                       Converter={x:Static converters:StatusToTranslationConverter.Default}}"
         Text="{Binding RelativeSource={RelativeSource Self},
                        Path=Tag.Translated,
                        Mode=OneWay}" />
</TextBlock>

To stay typed instead of using Tag. Question is what to name it?

JohanLarsson avatar Nov 15 '17 08:11 JohanLarsson

Maybe something like: {l:Translate Binding={Binding Status}}

  • optional parameter ResourceManager
  • handle binding with converter that returns a translation

JohanLarsson avatar Nov 16 '17 16:11 JohanLarsson