From the course: Microsoft XAML: 3 Type Converters and Resources

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Use some type converters

Use some type converters

From the course: Microsoft XAML: 3 Type Converters and Resources

Start my 1-month free trial

Use some type converters

- [Narrator] There are a lot of Type Converters available in the WPF assemblies that make it easier for you to write your XAML. I thought I'd show you some of those Type Converters before I show you the XAML syntax. I wrote this application called ShowTypeConverters, here's what it looks like. I'll debug the application. And what it does, is there's a list box on the left side of the screen, I've written some code that uses reflection to look in the WPF assemblies and find all the types that derive from the base class Type Converter and they're listed here. And when you click on one of them, like the FontSizeConverter, you'll see that it adds it to this list box on the right side of the screen. So there's that FontSizeConverter and a LengthConverter, there's something called a ThicknessConverter also I have converters for working with brushes, takes a string and turns it into a brush or takes a string and turns it into a color. And at the very bottom of the list you'll see the…

Contents