Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design properties multi IDE support #1380

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
@@ -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;

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

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

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

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",

Unchanged files with check annotations Beta

_resources.MergedDictionaries.Add(themesDictionary);
_resources.MergedDictionaries.Add(controlsDictionary);
}
catch { }

Check warning on line 98 in src/Wpf.Ui/UiApplication.cs

GitHub Actions / build

Check warning on line 98 in src/Wpf.Ui/UiApplication.cs

GitHub Actions / build

}
return _application?.Resources ?? _resources;
}
set

Check warning on line 103 in src/Wpf.Ui/UiApplication.cs

GitHub Actions / build

Check warning on line 103 in src/Wpf.Ui/UiApplication.cs

GitHub Actions / build

{
if (_application is not null)
{
return Color.FromArgb(255, values[2], values[1], values[0]);
}
catch { }

Check warning on line 379 in src/Wpf.Ui/Interop/UnsafeNativeMethods.cs

GitHub Actions / build

Check warning on line 379 in src/Wpf.Ui/Interop/UnsafeNativeMethods.cs

GitHub Actions / build

}
}
int rowCountInCacheBefore = (int)(cacheBeforeInPixel / GetHeight(ChildSize));
int rowCountInCacheAfter =
(
(int)

Check warning on line 428 in src/Wpf.Ui/Controls/VirtualizingWrapPanel/VirtualizingWrapPanel.cs

GitHub Actions / build

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

Check warning on line 428 in src/Wpf.Ui/Controls/VirtualizingWrapPanel/VirtualizingWrapPanel.cs

GitHub Actions / build

Operator '(int)' should not appear at the end of a line. (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/blob/master/documentation/SA1003.md)
Math.Ceiling(
(offsetInPixel + viewportHeight + cacheAfterInPixel) / GetHeight(ChildSize)
)