-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathUserControl.xml
116 lines (104 loc) · 8.27 KB
/
UserControl.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
<Type Name="UserControl" FullName="System.Windows.Controls.UserControl">
<TypeSignature Language="C#" Value="public class UserControl : System.Windows.Controls.ContentControl" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi UserControl extends System.Windows.Controls.ContentControl" 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.UserControl" />
<TypeSignature Language="VB.NET" Value="Public Class UserControl
Inherits ContentControl" />
<TypeSignature Language="F#" Value="type UserControl = class
 inherit ContentControl" />
<TypeSignature Language="C++ CLI" Value="public ref class UserControl : System::Windows::Controls::ContentControl" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit UserControl extends System.Windows.Controls.ContentControl" 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.ContentControl</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides a simple way to create a control.</summary>
<remarks>
<format type="text/markdown"><.
If you do need to create a new control, the simplest way is to create a class that derives from <xref:System.Windows.Controls.UserControl>. Before you do so, consider that your control will not support templates and therefore will not support complex customization. However, deriving from <xref:System.Windows.Controls.UserControl> is a suitable model if you want to build your control by adding existing elements to it, similar to how you build an application, and if you do not need to support complex customization. (If you want to use templates with your control, derive from <xref:System.Windows.Controls.Control> instead.) For more information about the different models for authoring controls, see [Control Authoring Overview](/dotnet/framework/wpf/controls/control-authoring-overview).
A <xref:System.Windows.Controls.UserControl> is a <xref:System.Windows.Controls.ContentControl>, which means that it can contain a single object of any type (such as a string, an image, or a panel). For more information, see the <xref:System.Windows.Controls.ContentControl> class.
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.
## Examples
The following example shows how to create a simple `NumericUpDown` <xref:System.Windows.Controls.UserControl>.
:::code language="xaml" source="~/snippets/csharp/System.Windows.Controls/UserControl/Overview/NumericUpDown.xaml" id="Snippetmarkup":::
The following shows the logic of this <xref:System.Windows.Controls.UserControl>:
:::code language="csharp" source="~/snippets/csharp/System.Windows.Controls/UserControl/Overview/NumericUpDown.xaml.cs" id="Snippetcodebehind":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/UserControlNumericUpDown/visualbasic/numericupdown.xaml.vb" id="Snippetcodebehind":::
For more information, see [Control Authoring Overview](/dotnet/framework/wpf/controls/control-authoring-overview).
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public UserControl ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Controls.UserControl.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:
 UserControl();" />
<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.UserControl" /> class.</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.UserControl.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="userControl.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 and returns an <see cref="T:System.Windows.Automation.Peers.AutomationPeer" /> for this <see cref="T:System.Windows.Controls.UserControl" />.</summary>
<returns>A new <see cref="T:System.Windows.Automation.Peers.UserControlAutomationPeer" /> for this <see cref="T:System.Windows.Controls.UserControl" />.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>