-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
DisableDpiAwarenessAttribute.xml
81 lines (74 loc) · 4.51 KB
/
DisableDpiAwarenessAttribute.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<Type Name="DisableDpiAwarenessAttribute" FullName="System.Windows.Media.DisableDpiAwarenessAttribute">
<TypeSignature Language="C#" Value="public sealed class DisableDpiAwarenessAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit DisableDpiAwarenessAttribute extends System.Attribute" />
<TypeSignature Language="DocId" Value="T:System.Windows.Media.DisableDpiAwarenessAttribute" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class DisableDpiAwarenessAttribute
Inherits Attribute" />
<TypeSignature Language="F#" Value="type DisableDpiAwarenessAttribute = class
 inherit Attribute" />
<TypeSignature Language="C++ CLI" Value="public ref class DisableDpiAwarenessAttribute sealed : Attribute" />
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false)]</AttributeName>
<AttributeName Language="F#">[<System.AttributeUsage(System.AttributeTargets.Assembly, AllowMultiple=false)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Allows WPF applications to disable dots per inch (dpi) awareness for all user interface elements.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
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 <xref:System.Windows.Media.DisableDpiAwarenessAttribute> to the application assembly.
> [!CAUTION]
> 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.
## Examples
The following example shows how to disable Dpi awareness for the WPF application by declaring <xref:System.Windows.Media.DisableDpiAwarenessAttribute> at the assembly level.
:::code language="csharp" source="~/snippets/csharp/System.Windows.Media/DisableDpiAwarenessAttribute/Overview/Window1.xaml.cs" id="Snippetdisabledpiawarenessattribute1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/DisableDpiAwareness/visualbasic/window1.xaml.vb" id="Snippetdisabledpiawarenessattribute1":::
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public DisableDpiAwarenessAttribute ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Media.DisableDpiAwarenessAttribute.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 DisableDpiAwarenessAttribute();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>WindowsBase</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<Parameters />
<Docs>
<summary>Initializes a new instance of <see cref="T:System.Windows.Media.DisableDpiAwarenessAttribute" />.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>