WinRT replacement for System.ComponentModel.TypeConverter

Doesn't seem to be TypeConverteravailable for use. What is recommended to replace?

I was going to go and create my own class TypeConverterto replace it, but if there is a new or better way in WinRT, I would go along this route. There are also many other classes that I will need to recreate; like all default type converters.

+5
source share
2 answers

There is no TypeConverter class in WinRT , and the team has not announced plans to include it in a future version. You have several options.

1: , IValueConverter, .

2: , :

http://msdn.microsoft.com/en-US/library/xhbhezf4(v=vs.80).aspx

http://msdn.microsoft.com/en-US/library/z5z9kes2(v=vs.80).aspx

3:. TypeConverter.

4: (, , ). :

static public class ConverterExtensions
{
    static public string ToFixedString(this double value)
    {
        return value.ToString("D");
    }
}

:

double d = 123.45;
string str = d.ToFixedString(); // str now equals "123"
+2
0

All Articles