summaryrefslogtreecommitdiff
path: root/docs/Xamarin.Forms.Core/Xamarin.Forms/Layout`1.xml
blob: 0f9adbb256a8b870883f63ab27d2b8195423f070 (plain)
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<Type Name="Layout&lt;T&gt;" FullName="Xamarin.Forms.Layout&lt;T&gt;">
  <TypeSignature Language="C#" Value="public abstract class Layout&lt;T&gt; : Xamarin.Forms.Layout, Xamarin.Forms.IViewContainer&lt;T&gt; where T : View" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract beforefieldinit Layout`1&lt;(class Xamarin.Forms.View) T&gt; extends Xamarin.Forms.Layout implements class Xamarin.Forms.IViewContainer`1&lt;!T&gt;" />
  <AssemblyInfo>
    <AssemblyName>Xamarin.Forms.Core</AssemblyName>
    <AssemblyVersion>1.0.0.0</AssemblyVersion>
    <AssemblyVersion>1.1.0.0</AssemblyVersion>
    <AssemblyVersion>1.2.0.0</AssemblyVersion>
    <AssemblyVersion>1.3.0.0</AssemblyVersion>
    <AssemblyVersion>1.4.0.0</AssemblyVersion>
    <AssemblyVersion>1.5.0.0</AssemblyVersion>
    <AssemblyVersion>2.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <TypeParameters>
    <TypeParameter Name="T">
      <Constraints>
        <BaseTypeName>Xamarin.Forms.View</BaseTypeName>
      </Constraints>
    </TypeParameter>
  </TypeParameters>
  <Base>
    <BaseTypeName>Xamarin.Forms.Layout</BaseTypeName>
  </Base>
  <Interfaces>
    <Interface>
      <InterfaceName>Xamarin.Forms.IViewContainer&lt;T&gt;</InterfaceName>
    </Interface>
  </Interfaces>
  <Attributes>
    <Attribute>
      <AttributeName>Xamarin.Forms.ContentProperty("Children")</AttributeName>
    </Attribute>
  </Attributes>
  <Docs>
    <typeparam name="T">The subclass of <see cref="T:Xamarin.Forms.View" /> the layout contains.</typeparam>
    <summary>A base implementation of a layout with undefined behavior and multiple children.</summary>
    <remarks>
      <para>
        <see cref="T:Xamarin.Forms.Layout`1" />s contain <see cref="P:Xamarin.Forms.Layout`1.Children" /> that are of the type <c>T</c> with which the <see cref="T:Xamarin.Forms.Layout`1" /> was specified. This <c>T</c> must be of type <see cref="T:Xamarin.Forms.View" />. Since <see cref="T:Xamarin.Forms.Layout" />s are subclasses of <see cref="T:Xamarin.Forms.View" />, this means that layouts may be nested, contain scrolling regions, etc.  
      </para>
      <para>The following image shows the relationship between <see cref="T:Xamarin.Forms.View" />, <see cref="T:Xamarin.Forms.Layout" />, <see cref="T:Xamarin.Forms.Layout`1" />, and important subtypes.</para>
      <para>
        <img href="Element.Hierarchy.png" />
      </para>
      <para>
          The following example shows adding and removing elements from a layout.
          </para>
      <example>
        <code lang="C#"><![CDATA[
  void UpdateItems (Layout<View> layout, IEnumerable newItems)
  {
    layout.Children.Clear ();
    foreach (var item in newItems) {
      layout.Children.Add (item);
    }
  }
          ]]></code>
      </example>
    </remarks>
  </Docs>
  <Members>
    <Member MemberName=".ctor">
      <MemberSignature Language="C#" Value="protected Layout ();" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
      <MemberType>Constructor</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <Parameters />
      <Docs>
        <summary>Provides the base initialization for objects derived from the Layout&lt;T&gt; class.</summary>
        <remarks>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="Children">
      <MemberSignature Language="C#" Value="public System.Collections.Generic.IList&lt;T&gt; Children { get; }" />
      <MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IList`1&lt;!T&gt; Children" />
      <MemberType>Property</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Collections.Generic.IList&lt;T&gt;</ReturnType>
      </ReturnValue>
      <Docs>
        <summary>Gets an IList&lt;View&gt; of child element of the Layout.</summary>
        <value>A IList&lt;View&gt;. The default is an empty list.</value>
        <remarks>
          <para>
            The Children collection of a Layout contains all the children added throught the public add/remove interface. Internal children will not be exposed through this collection.
          </para>
          <para>
              The following shows the creation of a layout, setting a property, and adding the children in the object initializer.
              </para>
          <example>
            <code lang="C#"><![CDATA[
  var stack = new StackLayout {
    Spacing = 20,
    Children = {
      new Label {Text = "Hello World!"},
      new Button {Text = "Click Me!"}
    }
  };
              ]]></code>
          </example>
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="OnAdded">
      <MemberSignature Language="C#" Value="protected virtual void OnAdded (T view);" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnAdded(!T view) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="view" Type="T" />
      </Parameters>
      <Docs>
        <param name="view">The view which was added.</param>
        <summary>Invoked when a child is added to the layout. Implement this method to add class handling for this event.</summary>
        <remarks>This method is different from <see cref="M:Xamarin.Forms.Element.OnChildAdded (Xamarin.Forms.Element element)" /> in that it provides a typed child consistent with the type of the Layout&lt;T&gt;.</remarks>
      </Docs>
    </Member>
    <Member MemberName="OnChildAdded">
      <MemberSignature Language="C#" Value="protected override void OnChildAdded (Xamarin.Forms.Element child);" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnChildAdded(class Xamarin.Forms.Element child) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="child" Type="Xamarin.Forms.Element" />
      </Parameters>
      <Docs>
        <param name="child">To be added.</param>
        <summary>Application developers can override this method to respond when a child is added.</summary>
        <remarks>Application developers who override this method must call base.OnChildAdded before performing any other actions in their override.</remarks>
      </Docs>
    </Member>
    <Member MemberName="OnChildRemoved">
      <MemberSignature Language="C#" Value="protected override void OnChildRemoved (Xamarin.Forms.Element child);" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void OnChildRemoved(class Xamarin.Forms.Element child) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="child" Type="Xamarin.Forms.Element" />
      </Parameters>
      <Docs>
        <param name="child">To be added.</param>
        <summary>Application developers can override this method to respond when a child is removed.</summary>
        <remarks>Application developers who override this method must call base.OnChildRemoved before performing any other actions in their override.</remarks>
      </Docs>
    </Member>
    <Member MemberName="OnRemoved">
      <MemberSignature Language="C#" Value="protected virtual void OnRemoved (T view);" />
      <MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void OnRemoved(!T view) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>1.0.0.0</AssemblyVersion>
        <AssemblyVersion>1.1.0.0</AssemblyVersion>
        <AssemblyVersion>1.2.0.0</AssemblyVersion>
        <AssemblyVersion>1.3.0.0</AssemblyVersion>
        <AssemblyVersion>1.4.0.0</AssemblyVersion>
        <AssemblyVersion>1.5.0.0</AssemblyVersion>
        <AssemblyVersion>2.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>System.Void</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="view" Type="T" />
      </Parameters>
      <Docs>
        <param name="view">The view which was removed.</param>
        <summary>Invoked when a child is removed from the layout. Implement this method to add class handling for this event.</summary>
        <remarks>This method is different from <see cref="M:Xamarin.Forms.Element.OnChildRemoved (Xamarin.Forms.Element element)" /> in that it provides a typed child consistent with the type of the Layout&lt;T&gt;.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>