samc
Topic Author
Posts: 69
Joined: 21 Aug 2019, 19:22

Localization and ChangePropertyAction

16 Nov 2023, 19:06

I'm trying to change the text of a target using a ChangeProeprtyAction like this:
<b:ChangePropertyAction TargetName="Status" PropertyName="Text" Value="{noesis:Loc Text.FrontEnd.AddFriend.Label.InvalidFormat}"/>
However, this seems to always make the text into an empty string.

Is there another / valid way to do this?

thanks,
sam
 
User avatar
sfernandez
Site Admin
Posts: 2908
Joined: 22 Dec 2011, 19:20

Re: Localization and ChangePropertyAction

17 Nov 2023, 19:38

The current implementation of Loc extension only works for properties of FrameworkElements in the tree, because it uses the dictionary from the LocExtension.Resources inherited property. Could you please report this in our bugtracker, we want to analyze how we could add support for that.

In the meantime, could you try doing the following:
<TextBlock x:Name="txt" ... Tag="{noesis:Loc Text.FrontEnd.AddFriend.Label.InvalidFormat}"/>
...
    <b:ChangePropertyAction TargetName="Status" PropertyName="Text" Value="{Binding Tag, ElementName=txt}"/>

Who is online

Users browsing this forum: Ahrefs [Bot] and 1 guest