Skip to content

DefaultPlatformModeDetector class

Defined in

Namespace: Splat Assembly: Splat.Drawing.dll Full name: Splat.DefaultPlatformModeDetector Modifiers: public

Summary

View source

Provides a default implementation for detecting whether the application is running in design mode.

Applies to

net10.0, net10.0-ios26.0, net10.0-android36.0, net10.0-maccatalyst26.0, net10.0-macos26.0, net10.0-tvos26.0, net10.0-windows10.0.19041, net10.0-windows10.0.17763, net9.0, net9.0-windows10.0.17763, net9.0-windows10.0.19041, net8.0, net8.0-windows10.0.19041, net8.0-windows10.0.17763, net462, net481

Class hierarchy
classDiagram
class DefaultPlatformModeDetector
class IPlatformModeDetector {
    <>
}
IPlatformModeDetector <|.. DefaultPlatformModeDetector

Implements: IPlatformModeDetector

Remarks

This class is typically used to determine if code is executing within a designer environment, such as Visual Studio or Blend, to enable or disable design-time specific logic. The detection result is memoized, so a process that starts outside a designer never re-runs the probes. Thread safety is not guaranteed.

Which probes are compiled depends on the target framework. Splat.Drawing sets UseWPF and UseWindowsForms for the .NET Framework and Windows-specific targets, so those builds call the WPF designer API directly instead of reflecting over it. The target-framework-neutral builds keep a reflective probe, because a Windows desktop application resolves to them when its own platform version predates the Windows-specific targets. The Android and Apple targets cannot host a XAML designer at all and compile no designer probe.

Constructors

NameSummary
.ctor

Methods

NameSummary
InDesignModeGets a value indicating whether the current library or application is running in a GUI design mode tool.
Inherited members