diff --git a/src/Avalonia.Controls/Design.cs b/src/Avalonia.Controls/Design.cs index 3a67e554ac..894240a09f 100644 --- a/src/Avalonia.Controls/Design.cs +++ b/src/Avalonia.Controls/Design.cs @@ -48,14 +48,14 @@ namespace Avalonia.Controls } public static readonly AttachedProperty PreviewWithProperty = AvaloniaProperty - .RegisterAttached("PreviewWith", typeof (Design)); + .RegisterAttached("PreviewWith", typeof (Design)); - public static void SetPreviewWith(IStyle target, Control control) + public static void SetPreviewWith(Style target, Control control) { target.SetValue(PreviewWithProperty, control); } - public static Control GetPreviewWith(IStyle target) + public static Control GetPreviewWith(Style target) { return target.GetValue(PreviewWithProperty); } diff --git a/src/Avalonia.DesignerSupport/DesignWindowLoader.cs b/src/Avalonia.DesignerSupport/DesignWindowLoader.cs index d1958ac9bf..6dca479d38 100644 --- a/src/Avalonia.DesignerSupport/DesignWindowLoader.cs +++ b/src/Avalonia.DesignerSupport/DesignWindowLoader.cs @@ -36,8 +36,7 @@ namespace Avalonia.DesignerSupport var styles = loaded as Styles; if (styles != null) { - var substitute = Design.GetPreviewWith(styles) ?? - styles.Select(Design.GetPreviewWith).FirstOrDefault(s => s != null); + var substitute = styles.OfType