开发者

How do you apply a ValueConverter to a convention-based Caliburn.Micro binding?

How do you apply a ValueConverter to a convention-based Caliburn.Micro binding? or do you need to use the {Binding} syntax?

I know I could do this

<TextBlock
    Text="{Binding Foo, Converter=fooToBarConverter}" /&开发者_运维知识库gt;

but how do I apply that custom converter if I am using Caliburn.Micro's convention over configuration, like

<TextBlock
    x:Name="Foo" />

Thanks,


You need to replace the ConventionManager.ApplyValueConverter func. By default it only does athe bool => Visibility conversion. Also, you can replace the ApplyStringFormat func for conventional string formatting. Have a look in the ConventionManager to see how it works.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜