Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/Wpf.Ui/Markup/Design.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@
/// </example>
public static class Design
{
private const string DesignProcessName = "devenv";
private static readonly string[] DesignProcesses =
[
"devenv",
"dotnet",
"RiderWpfPreviewerLauncher64"
];

private static bool? _inDesignMode;

Expand All @@ -29,13 +34,13 @@
/// </summary>
private static bool InDesignMode =>
_inDesignMode ??=
(bool)

Check warning on line 37 in src/Wpf.Ui/Markup/Design.cs

View workflow job for this annotation

GitHub Actions / build

Operator '(bool)' should not appear at the end of a line. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1003.md)

Check warning on line 37 in src/Wpf.Ui/Markup/Design.cs

View workflow job for this annotation

GitHub Actions / build

Operator '(bool)' should not appear at the end of a line. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1003.md)
DependencyPropertyDescriptor
.FromProperty(DesignerProperties.IsInDesignModeProperty, typeof(FrameworkElement))
.Metadata.DefaultValue
|| System
|| DesignProcesses.Any(process => System
.Diagnostics.Process.GetCurrentProcess()
.ProcessName.StartsWith(DesignProcessName, StringComparison.Ordinal);
.ProcessName.StartsWith(process, StringComparison.Ordinal));

public static readonly DependencyProperty BackgroundProperty = DependencyProperty.RegisterAttached(
"Background",
Expand Down
Loading