Example #1
0
        /// <summary>
        ///     Applies the style.
        /// </summary>
        public static void ApplyStyle(IEditorFormatMap editorFormatMap, TextBox textBlock)
        {
            var typeface = editorFormatMap.GetTypeface();
            var fontSize = editorFormatMap.GetFontSize();

            if (typeface != null)
            {
                //Set format for text block
                textBlock.FontFamily  = typeface.FontFamily;
                textBlock.FontStyle   = typeface.Style;
                textBlock.FontStretch = typeface.Stretch;
                textBlock.FontWeight  = typeface.Weight;
                textBlock.FontSize    = fontSize;
            }
        }