tags:

views:

60

answers:

1

I have a methode in a static class and this expected two parameters and return a string.

Now should I like from my View (without ViewModel) bind this result. Is this possible?

Pseudocode:

xmlns:lang="clr-namespace:LanguageModule;assembly=LanguageModule"

<TextBlock Text="{x:Static lang:Translate[firstParameter, secondParameter]}"/>
+2  A: 

You might want to check out the ObjectDataProvider

Use the MethodName property to call a method and use the MethodParameters property to pass parameters to the method. You can then bind to the results of the method.

Here is an example article how to bind to a static method:

http://www.thomasclaudiushuber.com/blog/2008/01/10/bind-to-methods-with-objectdataprovider/

HTH

Arcturus
wow, thx thats a great solution
Mario Priebe