Search code examples
c#silverlightsystem.drawing

Set font style without System.Drawing


I'm facing a awkward problem. I can't set the FontStyle of a text. This is annoying me cause until now I'm not able to understand why the System. Drawing is missing, why I can't import her (At least I think I shouldn't).

The context is I'm in a silverlight application, setting the font color and style of a dynamic tree.

I'm using System.Windows.Media.SolidColorBrush to the Foreground, but I trying to set the FontStyle without success. And all google that I try answer the simple: 'use System.Drawing'

What I'm missing here?


Solution

  • You should not try to create a new FontStyle struct, but use the static properties of FontStyles: FontStyles.Italic or FontStyles.Normal.