private static void OnTextMarginChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { TextBlock textBlock = (TextBlock)o; Thickness desiredTextMargin = (Thickness)e.NewValue; Thickness marginForTextMargin2 = MyTextMargin.GetRealMarginForTextMargin2(textBlock, desiredTextMargin); textBlock.Margin = marginForTextMargin2; }
private static void OnTextMarginChanged(DependencyObject o, DependencyPropertyChangedEventArgs e) { TextBlock textBlock = (TextBlock)o; // ISSUE: explicit reference operation Thickness newValue = (Thickness)e.NewValue; Thickness marginForTextMargin2 = MyTextMargin.GetRealMarginForTextMargin2(textBlock, newValue); ((FrameworkElement)textBlock).Margin = marginForTextMargin2; }