.NET – How to pass the converter parameters to non-hard coding

It’s like:

For example, when a person’s name is an attribute of the class.

Update:

I have seen a solution , Tell me to inherit DependencyObject and implement IValueConverter.
I want to know if there is something simpler.

The answer is straightforward, but not what you want to hear.

You can only locate the binding on the DependencyProperty on the DependencyObject. The binding does not inherit from DO, so you cannot bind Converter parameters.

If you wish to pass other states to the converter, you may have to subclass the required objects and add new attributes

Like:

< /pre> 

For example, when a person's name is an attribute of the class.

Update:

I have seen a solution that tells me to inherit DependencyObject and implement IValueConverter.< br>I want to know if there is something simpler.

The answer is straightforward, but not what you want to hear.

You can only locate the binding on the DependencyProperty on the DependencyObject. The binding does not inherit from DO, so you cannot bind the converter parameters.

If you wish to pass other states to the converter, You may have to subclass the required objects and add new attributes

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 506 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.