Exception:“NamedObject”参数类型对格式属性“Background”无效。 参数名: value

报错信息 1
ArgumentException: “NamedObject”参数类型对格式属性“Background”无效。
参数名: value
--Message: “NamedObject”参数类型对格式属性“Background”无效。
参数名: value
--ParamName: value
StackTrace:
   在 System.Windows.Documents.TextRange.ApplyPropertyValue(DependencyProperty formattingProperty, Object value, Boolean applyToParagraphs, PropertyValueAction propertyValueAction)
   在 DynamicClass.Program.<>c__DisplayClass3a.<Exec>b__23(Object s, RoutedEventArgs e)
   在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   在 System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

版本:1.44.23 2025-11-16 15:13 Microsoft Windows NT 10.0.26200.0