Example #1
0
 private void DoNotifyStyleChanged <TStyle>(StyleCollection <TStyle> styleCollection, TStyle style) where TStyle : class, IStyle
 {
     if (styleCollection == null)
     {
         throw new ArgumentNullException("styleCollection");
     }
     if (style == null)
     {
         throw new ArgumentNullException("style");
     }
     // create and set new PreviewStyle if the style is in the currently active design
     if (styleCollection.ContainsPreviewStyle(style))
     {
         TStyle previewStyle = styleCollection.GetPreviewStyle(style);
         Debug.Assert(previewStyle != null);
         ToolCache.NotifyStyleChanged(previewStyle);
     }
     ToolCache.NotifyStyleChanged(style);
 }