View previous topic :: View next topic |
Author |
Message |
kevinkuebler
Joined: 19 Jan 2015 Posts: 20 Location: United States
|
Posted: Fri Oct 30, 2015 6:16 pm Post subject: Use of the Resx extension in a Trigger |
|
|
I've run into a scenario with the Resx markup extension similar to the binding problem. I want to be able to use it within a DataTrigger. The scenario is basically a Button element with a local style containing a number of triggers. The triggers are DataTriggers that set the text of the button based on some different properties.
Some of the triggers use an element binding to another control on the screen, some are bound to properties on the view model. Regardless, they each contain a Setter element to set the Text property value to the value of a {Resx} lookup.
Like a binding, this works great with the initial culture, but as soon as I change the culture at runtime it throws an exception "After a 'SetterBase' is in use (sealed), it cannot be modified." I assume this is a similar problem to the binding situation with the Resx extension. Is there a way to work around this problem similar to the <Resx> element for dealing with bindings?
Thanks,
Kevin |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
|
Back to top |
|
|
kevinkuebler
Joined: 19 Jan 2015 Posts: 20 Location: United States
|
Posted: Mon Nov 02, 2015 3:33 pm Post subject: |
|
|
Okay, thanks, that's what I assumed but wanted to verify. I came up with an alternate solution that eliminates the triggers and replaces it with a <Resx> binding element to an enum property and takes advantage of the ResouceEnumConverter - another really cool feature! |
|
Back to top |
|
|
|