-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathCheckBox.xml
198 lines (186 loc) · 13.7 KB
/
CheckBox.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<Type Name="CheckBox" FullName="System.Windows.Controls.CheckBox">
<TypeSignature Language="C#" Value="public class CheckBox : System.Windows.Controls.Primitives.ToggleButton" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi CheckBox extends System.Windows.Controls.Primitives.ToggleButton" FrameworkAlternate="netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<TypeSignature Language="DocId" Value="T:System.Windows.Controls.CheckBox" />
<TypeSignature Language="VB.NET" Value="Public Class CheckBox
Inherits ToggleButton" />
<TypeSignature Language="F#" Value="type CheckBox = class
 inherit ToggleButton" />
<TypeSignature Language="C++ CLI" Value="public ref class CheckBox : System::Windows::Controls::Primitives::ToggleButton" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit CheckBox extends System.Windows.Controls.Primitives.ToggleButton" FrameworkAlternate="windowsdesktop-10.0;windowsdesktop-3.0;windowsdesktop-3.1;windowsdesktop-5.0;windowsdesktop-6.0;windowsdesktop-7.0;windowsdesktop-8.0;windowsdesktop-9.0" />
<AssemblyInfo>
<AssemblyName>PresentationFramework</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>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Controls.Primitives.ToggleButton</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.ComponentModel.DefaultEvent("CheckStateChanged")]</AttributeName>
<AttributeName Language="F#">[<System.ComponentModel.DefaultEvent("CheckStateChanged")>]</AttributeName>
</Attribute>
<Attribute>
<AttributeName Language="C#">[System.Windows.Localizability(System.Windows.LocalizationCategory.CheckBox)]</AttributeName>
<AttributeName Language="F#">[<System.Windows.Localizability(System.Windows.LocalizationCategory.CheckBox)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Represents a control that a user can select and clear.</summary>
<remarks>
<format type="text/markdown"><. To see the parts and states that are specific to the <xref:System.Windows.Controls.CheckBox>, see [CheckBox Styles and Templates](/dotnet/framework/wpf/controls/checkbox-styles-and-templates).
Dependency properties for this control might be set by the control's default style. If a property is set by a default style, the property might change from its default value when the control appears in the application. The default style is determined by which desktop theme is used when the application is running.
[!INCLUDE[setting-a-visual-property](~/includes/visual-property-note.md)]
## Examples
The following example creates a <xref:System.Windows.Controls.CheckBox> and handles the <xref:System.Windows.Controls.Primitives.ToggleButton.Checked>, <xref:System.Windows.Controls.Primitives.ToggleButton.Unchecked>, and <xref:System.Windows.Controls.Primitives.ToggleButton.Indeterminate> events.
:::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/CheckBox/Overview/Window1.xaml" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Controls/CheckBox/Overview/Window1.xaml.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/CheckBox_Snippets/VisualBasic/Window1.xaml.vb" id="Snippet5":::
]]></format>
</remarks>
<related type="ExternalDocumentation" href="https://go.microsoft.com/fwlink/?LinkID=160053">WPF Controls Gallery Sample</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public CheckBox ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.CheckBox.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 CheckBox();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</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>
<AssemblyVersion>10.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 the <see cref="T:System.Windows.Controls.CheckBox" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnAccessKey">
<MemberSignature Language="C#" Value="protected override void OnAccessKey (System.Windows.Input.AccessKeyEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnAccessKey(class System.Windows.Input.AccessKeyEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.CheckBox.OnAccessKey(System.Windows.Input.AccessKeyEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnAccessKey (e As AccessKeyEventArgs)" />
<MemberSignature Language="F#" Value="override this.OnAccessKey : System.Windows.Input.AccessKeyEventArgs -> unit" Usage="checkBox.OnAccessKey e" />
<MemberSignature Language="C++ CLI" Value="protected:
 override void OnAccessKey(System::Windows::Input::AccessKeyEventArgs ^ e);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</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>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Input.AccessKeyEventArgs" />
</Parameters>
<Docs>
<param name="e">The <see cref="T:System.Windows.Input.AccessKeyEventArgs" /> that contains the event data.</param>
<summary>Called when the access key for a <see cref="T:System.Windows.Controls.CheckBox" /> is invoked.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnCreateAutomationPeer">
<MemberSignature Language="C#" Value="protected override System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance class System.Windows.Automation.Peers.AutomationPeer OnCreateAutomationPeer() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.CheckBox.OnCreateAutomationPeer" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Function OnCreateAutomationPeer () As AutomationPeer" />
<MemberSignature Language="F#" Value="override this.OnCreateAutomationPeer : unit -> System.Windows.Automation.Peers.AutomationPeer" Usage="checkBox.OnCreateAutomationPeer " />
<MemberSignature Language="C++ CLI" Value="protected:
 override System::Windows::Automation::Peers::AutomationPeer ^ OnCreateAutomationPeer();" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</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>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Windows.Automation.Peers.AutomationPeer</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Creates an <see cref="T:System.Windows.Automation.Peers.AutomationPeer" /> for the <see cref="T:System.Windows.Controls.CheckBox" />.</summary>
<returns>An <see cref="T:System.Windows.Automation.Peers.AutomationPeer" /> for the <see cref="T:System.Windows.Controls.CheckBox" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="OnKeyDown">
<MemberSignature Language="C#" Value="protected override void OnKeyDown (System.Windows.Input.KeyEventArgs e);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnKeyDown(class System.Windows.Input.KeyEventArgs e) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.CheckBox.OnKeyDown(System.Windows.Input.KeyEventArgs)" />
<MemberSignature Language="VB.NET" Value="Protected Overrides Sub OnKeyDown (e As KeyEventArgs)" />
<MemberSignature Language="F#" Value="override this.OnKeyDown : System.Windows.Input.KeyEventArgs -> unit" Usage="checkBox.OnKeyDown e" />
<MemberSignature Language="C++ CLI" Value="protected:
 override void OnKeyDown(System::Windows::Input::KeyEventArgs ^ e);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationFramework</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>
<AssemblyVersion>10.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="e" Type="System.Windows.Input.KeyEventArgs" />
</Parameters>
<Docs>
<param name="e">The <see cref="T:System.Windows.Input.KeyEventArgs" /> that contains the event data.</param>
<summary>Responds to a <see cref="T:System.Windows.Controls.CheckBox" /><see cref="E:System.Windows.UIElement.KeyDown" /> event.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This implementation marks the <xref:System.Windows.UIElement.KeyDown> event as handled by setting the <xref:System.Windows.RoutedEventArgs.Handled%2A> property of the event data to `true` when the user presses the plus or the minus key.
This method sets <xref:System.Windows.Controls.Primitives.ToggleButton.IsChecked%2A> to `true` when the user presses the plus key and to `false` when the user presses the minus key.
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>If you override <see cref="M:System.Windows.Controls.CheckBox.OnKeyDown(System.Windows.Input.KeyEventArgs)" />, always call the base implementation in your <see cref="M:System.Windows.Controls.CheckBox.OnKeyDown(System.Windows.Input.KeyEventArgs)" /> implementation. Failure to call the base implementation prevents base classes from handling the event with a class handler, which might change the run-time behavior of the final class. You can call the base implementation either before or after your special handling, depending on your requirements.</para>
</block>
</Docs>
</Member>
</Members>
</Type>