how do you set a property of a control to an address of a function in xaml?

Posted by ambog36 on Stack Overflow See other posts from Stack Overflow or by ambog36
Published on 2010-03-19T20:10:45Z Indexed on 2010/03/19 20:11 UTC
Read the original article Hit count: 164

Hi, I have a control that has a "Filter" property that expects a function that defines how the contents of the control should be filtered. so far i am setting the filter in code behind as such:

MyControl.Filter = AddressOf Filters.MyFilter

In this example MyFilter is a shared function in the Filters class with the following signature:

Public Shared Function MyFilter(ByVal obj As Object, ByVal text As String) As Boolean

I would like to set this in xaml. I was thinking of setting the Filters.MyFilter as a static resource and setting it that way:

...Filter="{StaticResource myFilter}"/>

but i cant set Filters.MyFilter as a static resource. Any ideas on how to achieve this?

Thanks,

© Stack Overflow or respective owner

Related posts about wpf

Related posts about xaml