Exemplo n.º 1
0
 private static PropertyChangedCallback TextPropertyChangedCallback()
 {
     return(new PropertyChangedCallback(
                (d, e) =>
     {
         MvvmTextEditor textBoxHost = d as MvvmTextEditor;
         if (textBoxHost != null && textBoxHost.fastColoredTextBox != null)
         {
             textBoxHost.fastColoredTextBox.Text = textBoxHost.GetValue(e.Property) as string;
         }
     }));
 }
Exemplo n.º 2
0
 private static PropertyChangedCallback TextSizePropertyChangedCallback()
 {
     return(new PropertyChangedCallback(
                (d, e) =>
     {
         MvvmTextEditor textBoxHost = d as MvvmTextEditor;
         if (textBoxHost != null && textBoxHost.fastColoredTextBox != null)
         {
             var oldName = textBoxHost.fastColoredTextBox.Font.Name;
             var size = Convert.ToSingle(textBoxHost.GetValue(e.Property));
             textBoxHost.fastColoredTextBox.Font = new System.Drawing.Font(oldName, size, System.Drawing.FontStyle.Bold);
         }
     }));
 }