ygoe / TxTranslation

Tx Translation & Localisation for .NET and WPF
GNU General Public License v3.0
28 stars 12 forks source link

Added support for templating paramaters in Wpf/XAML #19

Closed vukovinski closed 2 years ago

vukovinski commented 3 years ago

Problem: Localization text template paramaters were not supported with XAML.

I have introduced support for up to 3 pairs of template parameter names and values.

<TextBlock 
       Text="{Tx:T Key=test.params.xaml,
            PlaceholderKey1=extra, PlaceholderBinding1={Binding Path=Extra},
            PlaceholderKey2=amp, PlaceholderBinding2={Binding Path=Amp}}">
</TextBlock>

Which would localize the template:

show {extra} text with {amp}

I don't think any functionality is broken by this addition. Maybe the example .txd file should not be included in the merge.