Cette documentation est archivée et n’est pas conservée.

DisableDpiAwarenessAttribute, classe

Allows WPF applications to disable dots per inch (dpi) awareness for all user interface elements.

Espace de noms: System.Windows.Media
Assembly : WindowsBase (dans windowsbase.dll)
Espace de noms XML :  http://schemas.microsoft.com/winfx/2006/xaml/presentation

[AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=false)] 
public sealed class DisableDpiAwarenessAttribute : Attribute
/** @attribute AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=false) */ 
public final class DisableDpiAwarenessAttribute extends Attribute
AttributeUsageAttribute(AttributeTargets.Assembly, AllowMultiple=false) 
public final class DisableDpiAwarenessAttribute extends Attribute
<DisableDpiAwarenessAttribute .../>

By default, WPF applications are dpi aware, which affects how user interface layout is calculated. However, an application can disable dpi awareness by adding the DisableDpiAwarenessAttribute to the application assembly.

Remarque AttentionAttention :

It is not recommended that you set this attribute for your application, unless you need all user interface elements of your application to be non-dpi aware.

The following example shows how to disable Dpi awareness for the WPF application by declaring DisableDpiAwarenessAttribute at the assembly level.

// Disable Dpi awareness in the application assembly.
[assembly: System.Windows.Media.DisableDpiAwareness]

System.Object
   System.Attribute
    System.Windows.Media.DisableDpiAwarenessAttribute

Les membres statiques publics (Shared en Visual Basic) de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.

Microsoft .NET Framework 3.0 est pris en charge sur Windows Vista, Microsoft Windows XP SP2 et Windows Server 2003 SP1.

.NET Framework

Prise en charge dans : 3.0
Afficher: