summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml2
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/EventTrigger.xml62
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/MasterDetailPage.xml2
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/Trigger.xml74
-rw-r--r--docs/Xamarin.Forms.Core/Xamarin.Forms/TriggerAction`1.xml41
-rw-r--r--docs/Xamarin.Forms.Maps/Xamarin.Forms.Maps/MapSpan.xml2
6 files changed, 161 insertions, 22 deletions
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml
index e4704d04..43acd6e8 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/Device.xml
@@ -426,7 +426,7 @@ button.HeightRequest = Device.OnPlatform (20,30,30);
</ReturnValue>
<Docs>
<summary>Gets the <see cref="T:Xamarin.Forms.TargetPlatform" /> indicating the OS Xamarin.Forms is working on.</summary>
- <value>A <see cref="Xamarin.Forms.TargetPlatform" /> that indicates the current OS.</value>
+ <value>A <see cref="T:Xamarin.Forms.TargetPlatform" /> that indicates the current OS.</value>
<remarks>
</remarks>
</Docs>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/EventTrigger.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/EventTrigger.xml
index 460d81a0..5220c469 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/EventTrigger.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/EventTrigger.xml
@@ -21,25 +21,51 @@
<Docs>
<summary>Class that represents a triggering event and a list of <see cref="T:Xamarin.Forms.TriggerAction" /> objects that will be invoked when the event is raised.</summary>
<remarks>
- <para>XAML for Xamarin.Forms supports the following property for the <see cref="T:Xamarin.Forms.EventTrigger" /> class:</para>
- <list type="table">
- <listheader>
- <term>Property</term>
- <description>Value</description>
- </listheader>
- <item>
- <term>Event</term>
- <description>
- <para>The name of the event to which to respond.</para>
- </description>
- </item>
- <item>
- <term>Object name</term>
- <description>
- <para>The qualified name of a <see cref="T:Xamarin.Forms.TriggerAction`1" /> implementation that has been defined by the application developer. This object is instantiated and its <see cref="M:Xamarin.Forms.TriggerAction`1.Invoke" /> method is called when the triggering event is raised. Attributes on this tag set corresponding proptery values on the <see cref="T:Xamarin.Forms.TriggerAction`1" /> implementation</para> before the <see cref="M:Xamarin.Forms.TriggerAction`1.Invoke" /> method is called.</description>
- </item>
- </list>
+ <example>
+ <para>The example below shows how developers can use an event trigger to respond to events and update the value of a control property.</para>
+ <para>With the <c>ColorTriggerAction</c> class below defined in the <c>TriggerDemo</c> namespace:</para>
+ <code lang="C#"><![CDATA[public class ColorTriggerAction : TriggerAction<Entry>
+{
+ protected override void Invoke(Entry sender)
+ {
+ Color[] color ={ Color.Red,
+ Color.Orange,
+ Color.Yellow,
+ Color.Green,
+ Color.Blue,
+ Color.Indigo,
+ Color.Violet };
+ sender.TextColor = color[sender.Text.Length % color.Length];
+ }
+}]]></code>
+ <para>the developer can use the XAML below to create a page that cycles the colors of a <see cref="T:Xamarin.Forms.Entry" /> text area through the colors of the rainbow as the user enters text.</para>
+ <code lang="XAML"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ xmlns:local="clr-namespace:TriggerDemo"
+ x:Class="TriggerDemo.TriggerDemoPage">
+ <StackLayout VerticalOptions="Center">
+ <Label Text="Do you see colors?"
+ VerticalOptions="Center"
+ HorizontalOptions="Center" />
+ <Entry Placeholder="Type stuff here."
+ VerticalOptions="Center"
+ HorizontalOptions="Center"
+ BackgroundColor="Black">
+ <Entry.Triggers>
+ <EventTrigger Event="TextChanged" >
+ <local:ColorTriggerAction />
+ </EventTrigger>
+ </Entry.Triggers>
+ </Entry>
+ </StackLayout>
+</ContentPage>]]></code>
+ </example>
</remarks>
+ <altmember cref="T:Xamarin.Forms.Setter" />
+ <altmember cref="T:Xamarin.Forms.PropertyCondition" />
+ <altmember cref="T:Xamarin.Forms.DataTrigger" />
+ <altmember cref="T:Xamarin.Forms.Trigger" />
</Docs>
<Members>
<Member MemberName=".ctor">
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/MasterDetailPage.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/MasterDetailPage.xml
index 54dafaad..d405f094 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/MasterDetailPage.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/MasterDetailPage.xml
@@ -553,7 +553,7 @@ namespace FormsGallery
</ReturnValue>
<Parameters />
<Docs>
- <summary>Method that is called when the <see cref="P:Xamarin.Forms.Element.Parent" /> property of this <see cref="Xamarin.Forms.MasterDetailPage" /> is set.</summary>
+ <summary>Method that is called when the <see cref="P:Xamarin.Forms.Element.Parent" /> property of this <see cref="T:Xamarin.Forms.MasterDetailPage" /> is set.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/Trigger.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/Trigger.xml
index 3bde4c70..1be2ca38 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/Trigger.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/Trigger.xml
@@ -26,7 +26,79 @@
</Attributes>
<Docs>
<summary>Class that represents a property condition and an action that is performed when the condition is met.</summary>
- <remarks>To be added.</remarks>
+ <remarks>
+ <para>The <see cref="T:Xamarin.Forms.Trigger" /> class is suitable for checking the values of any property on the control to which it has been added. That is, its default binding context is the control to which it has been added. To bind on controls other than the parent, developers should use the <see cref="T:Xamarin.Forms.DataTrigger" /> class, instead.</para>
+ <example>
+ <para>The XML example below prompts the user to type in the secret, which is, "The text color is red". When the user has typed the secret, the Entry text changes color to red. The code is turned back to the default color if the user then edits the text to differ from the secret. This example shows how to bind to the enclosing control with a trigger.</para>
+ <code lang="XML"><![CDATA[
+<?xml version="1.0" encoding="utf-8"?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ xmlns:local="clr-namespace:TriggerDemo"
+ x:Class="TriggerDemo.TriggerDemoPage">
+ <StackLayout VerticalOptions="Center">
+ <Label Text="Tell me the secret"
+ VerticalOptions="Center"
+ HorizontalOptions="Center" />
+ <Entry Placeholder="Type the secret here."
+ VerticalOptions="Center"
+ HorizontalOptions="Center">
+ <Entry.Triggers>
+ <Trigger TargetType="Entry"
+ Property="Text"
+ Value="The text color is red">
+ <Setter Property="TextColor" Value="Red" />
+ </Trigger>
+ </Entry.Triggers>
+ </Entry>
+ </StackLayout>
+</ContentPage>
+
+]]></code>
+ </example>
+ <example>
+ <para>The example below shows how developers can use a trigger to respond to events and update the value of a control property by using <see cref="T:Xamarin.Forms.TriggerAction{T}" /> classes. The example prompts the user to answer a question about the color of the text, and then calls <c>ColorTriggerAction</c> to turn the text red when the user types "The text color is red". Developers should note that, while this example does not change the text back to the default color when the user continues to edit the string, the developer could additionally implement and specify an exit action to obtain that result.</para>
+ <para>With the ColorTriggerAction class below defined in the <c>TriggerDemo</c> namespace:</para>
+ <code lang="C#"><![CDATA[public class ColorTriggerAction : TriggerAction<Entry>
+{
+ protected override void Invoke(Entry sender)
+ {
+ sender.TextColor = Color.Red;
+ }
+}]]></code>
+ <para>the developer can use the XAML below to create the page that responds to the secret string by changing the color of the <see cref="T:Xamarin.Forms.Entry" /> text area to red.</para>
+ <code lang="XAML"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ xmlns:local="clr-namespace:TriggerDemo"
+ x:Class="TriggerDemo.TriggerDemoPage">
+ <StackLayout VerticalOptions="Center">
+ <Label Text="What color is &quot;The text&quot;?"
+ VerticalOptions="Center"
+ HorizontalOptions="Center" />
+ <Entry Placeholder="Type answer here."
+ VerticalOptions="Center"
+ HorizontalOptions="Center"
+ BackgroundColor="White">
+ <Entry.Triggers>
+ <Trigger TargetType="Entry"
+ Property="Text"
+ Value="The text is red" >
+ <Trigger.EnterActions>
+ <local:ColorTriggerAction />
+ </Trigger.EnterActions>
+ </Trigger>
+ </Entry.Triggers>
+ </Entry>
+ </StackLayout>
+</ContentPage>
+]]></code>
+ </example>
+ </remarks>
+ <altmember cref="T:Xamarin.Forms.Setter" />
+ <altmember cref="T:Xamarin.Forms.PropertyCondition" />
+ <altmember cref="T:Xamarin.Forms.DataTrigger" />
+ <altmember cref="T:Xamarin.Forms.TriggerAction" />
</Docs>
<Members>
<Member MemberName=".ctor">
diff --git a/docs/Xamarin.Forms.Core/Xamarin.Forms/TriggerAction`1.xml b/docs/Xamarin.Forms.Core/Xamarin.Forms/TriggerAction`1.xml
index f1748b04..611400ca 100644
--- a/docs/Xamarin.Forms.Core/Xamarin.Forms/TriggerAction`1.xml
+++ b/docs/Xamarin.Forms.Core/Xamarin.Forms/TriggerAction`1.xml
@@ -24,7 +24,48 @@
<typeparam name="T">The type of which the <see cref="P:Xamarin.Forms.TriggerAction`1.AttachedObject" /> property must be an instance.</typeparam>
<summary>A generic base class for user-defined actions that are performed when a trigger condition is met.</summary>
<remarks>
+ <example>
+ <para>The example below shows how developers can use a trigger to respond to events and update the value of a control property by using <see cref="T:Xamarin.Forms.TriggerAction{T}" /> classes. The example prompts the user to answer a question about the color of the text, and then calls <c>ColorTriggerAction</c> to turn the text red when the user types "The text color is red". Developers should note that, while this example does not change the text back to the default color when the user continues to edit the string, the developer could additionally implement and specify an exit action to obtain that result.</para>
+ <para>With the ColorTriggerAction class below defined in the <c>TriggerDemo</c> namespace:</para>
+ <code lang="C#"><![CDATA[public class ColorTriggerAction : TriggerAction<Entry>
+{
+ protected override void Invoke(Entry sender)
+ {
+ sender.TextColor = Color.Red;
+ }
+}]]></code>
+ <para>the developer can use the XAML below to create the page that responds to the secret string by changing the color of the <see cref="T:Xamarin.Forms.Entry" /> text area to red.</para>
+ <code lang="XAML"><![CDATA[<?xml version="1.0" encoding="utf-8"?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ xmlns:local="clr-namespace:TriggerDemo"
+ x:Class="TriggerDemo.TriggerDemoPage">
+ <StackLayout VerticalOptions="Center">
+ <Label Text="What color is &quot;The text&quot;?"
+ VerticalOptions="Center"
+ HorizontalOptions="Center" />
+ <Entry Placeholder="Type answer here."
+ VerticalOptions="Center"
+ HorizontalOptions="Center"
+ BackgroundColor="White">
+ <Entry.Triggers>
+ <Trigger TargetType="Entry"
+ Property="Text"
+ Value="The text is red" >
+ <Trigger.EnterActions>
+ <local:ColorTriggerAction />
+ </Trigger.EnterActions>
+ </Trigger>
+ </Entry.Triggers>
+ </Entry>
+ </StackLayout>
+</ContentPage>
+]]></code>
+ </example>
</remarks>
+ <altmember cref="T:Xamarin.Forms.Setter" />
+ <altmember cref="T:Xamarin.Forms.PropertyCondition" />
+ <altmember cref="T:Xamarin.Forms.DataTrigger" />
</Docs>
<Members>
<Member MemberName=".ctor">
diff --git a/docs/Xamarin.Forms.Maps/Xamarin.Forms.Maps/MapSpan.xml b/docs/Xamarin.Forms.Maps/Xamarin.Forms.Maps/MapSpan.xml
index 72c50b80..a8031e0c 100644
--- a/docs/Xamarin.Forms.Maps/Xamarin.Forms.Maps/MapSpan.xml
+++ b/docs/Xamarin.Forms.Maps/Xamarin.Forms.Maps/MapSpan.xml
@@ -140,7 +140,7 @@
<Docs>
<param name="center">To be added.</param>
<param name="radius">To be added.</param>
- <summary>Returns a <see cref="Xamarin.Forms.Maps.MapSpan" /> that displays the area that is defined by <paramref name="center" /> and <paramref name="radius" />.</summary>
+ <summary>Returns a <see cref="T:Xamarin.Forms.Maps.MapSpan" /> that displays the area that is defined by <paramref name="center" /> and <paramref name="radius" />.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>