日期:2014-05-18  浏览次数:21159 次

急急,求助解决方案(WPF 开发)
项目总是报如下的错:

System.InvalidOperationException : Specified value of type 'System.Windows.Media.SolidColorBrush' must have IsFrozen set to false to modify.
  at System.Windows.Freezable.WritePreamble()
  at System.Windows.Freezable.remove_Changed(EventHandler value)
  at System.Windows.ResourceReferenceExpression.ResourceReferenceExpressionWeakContainer.RemoveChangedHandler()
  at System.Windows.ResourceReferenceExpression.ResourceReferenceExpressionWeakContainer.InvalidateTargetSubProperty(Object sender, EventArgs args)
  at System.Windows.Freezable.FireChanged()
  at System.Windows.Freezable.Freeze(Boolean isChecking)
  at System.Windows.Freezable.Freeze()
  at System.Windows.Freezable.System.Windows.ISealable.Seal()
  at System.Windows.StyleHelper.SealIfSealable(Object value)
  at System.Windows.DeferredResourceReference.GetValue(BaseValueSourceInternal valueSource)
  at System.Windows.DeferredAppResourceReference.GetValue(BaseValueSourceInternal valueSource)
  at System.Windows.DependencyObject.GetEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, RequestFlags requests)
  at System.Windows.DependencyObject.GetValueEntry(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, RequestFlags requests)
  at System.Windows.DependencyObject.GetValue(DependencyProperty dp)
  at System.Windows.Controls.Border.get_Background()
  at System.Windows.Controls.Border.OnRender(DrawingContext dc)
  at System.Windows.UIElement.Arrange(Rect finalRect)
  at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
  at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
  at System.Windows.UIElement.Arrange(Rect finalRect)
  at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
  at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
  at System.Windows.UIElement.Arrange(Rect finalRect)
  at System.Windows.Controls.StackPanel.ArrangeOverride(Size arrangeSize)
  at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
  at System.Windows.UIElement.Arrange(Rect finalRect)
  at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
  at System.Windows.Controls.ItemsPresenter.ArrangeOverride(Size arrangeSize)
  at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
  at System.Windows.UIElement.Arrange(Rect finalRect)
  at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
  at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
  at System.Windows.UIElement.Arrange(Rect finalRect)
  at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
  at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
  at System.Windows.UIElement.Arrange(Rect finalRect)
  at System.Windows.Controls.StackPanel.ArrangeOverride(Size arrangeSize)
  at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
  at System.Windows.UIElement.Arrange(Rect finalRect)
  at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
  at System.Windows.Controls.ItemsPresenter.ArrangeOverride(Size arrangeSize)
  at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
  at System.Windows.UIElement.Arrange(Rect finalRect)
  at System.Windows.Controls.ScrollContentPresenter.ArrangeOverride(Size arrangeSize)
  at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
  at System.Windows.UIElement.Arrange(Rect finalRect)