--- title: "How to: Use the FontSizeConverter Class" ms.date: "03/30/2017" helpviewer_keywords: - "FontSizeConverter objects [WPF]" - "typography [WPF], FontSizeConverter objects" ms.assetid: 3b0592bd-7223-4860-a108-a5d72f3a9178 --- # How to: Use the FontSizeConverter Class ## Example This example shows how to create an instance of and use it to change a font size. The example defines a custom method called `changeSize` that converts the contents of a , as defined in a separate [!INCLUDE[TLA#tla_xaml](../../../includes/tlasharptla-xaml-md.md)] file, to an instance of , and later into a . This method passes the to a object, which converts the of a to an instance of . This value is then passed back as the value of the property of the element. This example also defines a second custom method that is called `changeFamily`. This method converts the of the to a , and then passes that value to the property of the element. This example does not run. [!code-csharp[FontSizeConverter#1](~/samples/snippets/csharp/VS_Snippets_Wpf/FontSizeConverter/CSharp/Window1.xaml.cs#1)] ## See also -