There is already a built-in PropertyValueChanged event. I got it to work; however, some fonts don't update the stretch and style.
Thanks for the help!
Thanks for the help!
private void testPropertyGrid_PropertyValueChanged( object sender, Xceed.Wpf.Toolkit.PropertyGrid.PropertyValueChangedEventArgs e )
{
if ( e.OldValue != e.NewValue )
{
try
{
// A lot of code just to update a font in a control.
testStringTextBox.FontFamily = preferences.EditorFont.Family;
testStringTextBox.FontSize = preferences.EditorFont.FontSize;
testStringTextBox.FontStretch = preferences.EditorFont.Stretch;
testStringTextBox.FontStyle = preferences.EditorFont.Style;
testStringTextBox.FontWeight = preferences.EditorFont.Weight;
}
catch(Exception ex)
{
MessageBox.Show( ex.Message, "Exception Error", MessageBoxButton.OK, MessageBoxImage.Error );
}
}
}