xaml - How do I turn off a custom IValueConverter at design time? -


Text after "

How can I stop designing a custom IValueConverter ? Basically I want to write this:

  public class MethodBinder Implements IValueConverter Public Function In Convert Object (ByVal Value As Form, ByVal TargetType System.Type, ByVal Parameter Object Form In the form of ByVal Culture CultureInfo), there are IValueConverter.Convert [DESIGN_TIME] Then nothing returns the value implies nothing then return CallByName (value, CSTR (parameter), CallType.Method) return something Also the end ceremony The ConvertBack (ByVal value isnot then applies as object, inVal TargetType as System.Type, as byVal parameter object, as ByVal Culture CultureInfo) object as IValueConverter.ConvertBack New NotSupportedException End Function End Class The text after "throw  

I have worked around it, especially the incoming (default) value To give feedback on

In my example I was using the load in a library sequence to calculate the number of business days (using an expansion method) based on offset sent, this design will fail in time because the library Was not loaded.

But the default value for the control was 0, so

  public object convert (object value, type TargetType, object parameter, CultureInfo culture) {offset int = 0; If (value is double) offset = (int) (double) value; Date Time DT = Offset == 0? Date time Today.Date Daydaddy (Offset): DateTime Today.Det. Adbagenase (offset); Return string.format ("{0} ({1})", (offset), DT.ToString ("ddd-dd-MMM"); }  

This is not beautiful, but it was effective.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -