Removed "**Note**" string from [!NOTES] (#17)
This commit is contained in:
Родитель
af7c899bb2
Коммит
43699b3f2f
|
@ -101,9 +101,9 @@ if (Application.Current.Properties.ContainsKey("id"))
|
|||
Always check for the presence of the key before accessing it to prevent unexpected errors.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note:** the `Properties` dictionary can only serialize
|
||||
>primitive types for storage. Attempting to store other types (such as
|
||||
>`List<string>`) can fail silently.
|
||||
> The `Properties` dictionary can only serialize
|
||||
> primitive types for storage. Attempting to store other types (such as
|
||||
> `List<string>`) can fail silently.
|
||||
|
||||
<!-- bugzilla 28657 -->
|
||||
|
||||
|
@ -212,7 +212,7 @@ public class MainActivity :
|
|||
```
|
||||
|
||||
> [!NOTE]
|
||||
> **Note:** There is a newer [`FormsAppCompatActivity`](~/xamarin-forms/platform/android/appcompat.md)
|
||||
> There is a newer [`FormsAppCompatActivity`](~/xamarin-forms/platform/android/appcompat.md)
|
||||
> base class that can be used to better support Android Material Design.
|
||||
> This will become the default Android template in future, but you can follow
|
||||
> [these instructions](~/xamarin-forms/platform/android/appcompat.md)
|
||||
|
|
|
@ -100,7 +100,7 @@ At runtime, the behavior will respond to interaction with the control, according
|
|||
[ ![](attached-images/screenshots-sml.png "Sample Application with Attached Behavior")](attached-images/screenshots.png "Sample Application with Attached Behavior")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Attached behaviors are written for a specific control type (or a superclass that can apply to many controls), and they should only be added to a compatible control. Attempting to attach a behavior to an incompatible control will result in unknown behavior, and depends on the behavior implementation.
|
||||
> Attached behaviors are written for a specific control type (or a superclass that can apply to many controls), and they should only be added to a compatible control. Attempting to attach a behavior to an incompatible control will result in unknown behavior, and depends on the behavior implementation.
|
||||
|
||||
### Removing an Attached Behavior from a Control
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ public class NumericValidationBehavior : Behavior<Entry>
|
|||
The `NumericValidationBehavior` derives from the [`Behavior<T>`](https://developer.xamarin.com/api/type/Xamarin.Forms.Behavior%3CT%3E/) class, where `T` is an [`Entry`](https://developer.xamarin.com/api/type/Xamarin.Forms.Entry/). The [`OnAttachedTo`](https://developer.xamarin.com/api/member/Xamarin.Forms.Behavior%3CT%3E.OnAttachedTo/p/Xamarin.Forms.BindableObject/) method registers an event handler for the [`TextChanged`](https://developer.xamarin.com/api/event/Xamarin.Forms.Entry.TextChanged/) event, with the [`OnDetachingFrom`](https://developer.xamarin.com/api/member/Xamarin.Forms.Behavior%3CT%3E.OnDetachingFrom/p/Xamarin.Forms.BindableObject/) method de-registering the `TextChanged` event to prevent memory leaks. The core functionality of the behavior is provided by the `OnEntryTextChanged` method, which parses the value entered by the user into the `Entry`, and sets the [`TextColor`](https://developer.xamarin.com/api/property/Xamarin.Forms.Entry.TextColor/) property to red if the value isn't a `double`.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Xamarin.Forms does not set the `BindingContext` of a behavior, because behaviors can be shared and applied to multiple controls through styles.
|
||||
> Xamarin.Forms does not set the `BindingContext` of a behavior, because behaviors can be shared and applied to multiple controls through styles.
|
||||
|
||||
## Consuming a Xamarin.Forms Behavior
|
||||
|
||||
|
@ -107,7 +107,7 @@ At runtime the behavior will respond to interaction with the control, according
|
|||
[ ![](creating-images/screenshots-sml.png "Sample Application with Xamarin.Forms Behavior")](creating-images/screenshots.png "Sample Application with Xamarin.Forms Behavior")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Behaviors are written for a specific control type (or a superclass that can apply to many controls), and they should only be added to a compatible control. Attempting to attach a behavior to an incompatible control will result in an exception being thrown.
|
||||
> Behaviors are written for a specific control type (or a superclass that can apply to many controls), and they should only be added to a compatible control. Attempting to attach a behavior to an incompatible control will result in an exception being thrown.
|
||||
|
||||
### Consuming a Xamarin.Forms Behavior with a Style
|
||||
|
||||
|
@ -177,7 +177,7 @@ The [`Style`](https://developer.xamarin.com/api/type/Xamarin.Forms.Style/) can b
|
|||
For more information about styles, see [Styles](~/xamarin-forms/user-interface/styles/index.md).
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: While you can add bindable properties to a behavior that is set or queried in XAML, if you do create behaviors that have state they should not be shared between controls in a `Style` in a `ResourceDictionary`.
|
||||
> While you can add bindable properties to a behavior that is set or queried in XAML, if you do create behaviors that have state they should not be shared between controls in a `Style` in a `ResourceDictionary`.
|
||||
|
||||
### Removing a Behavior from a Control
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ The process for creating the custom renderer class is as follows:
|
|||
1. Add an `ExportRenderer` attribute to the page renderer class to specify that it will be used to render the Xamarin.Forms page. This attribute is used to register the custom renderer with Xamarin.Forms.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: It is optional to provide a page renderer in each platform project. If a page renderer isn't registered, then the default renderer for the page will be used.
|
||||
> It is optional to provide a page renderer in each platform project. If a page renderer isn't registered, then the default renderer for the page will be used.
|
||||
|
||||
The following diagram illustrates the responsibilities of each project in the sample application, along with the relationship between them:
|
||||
|
||||
|
@ -244,7 +244,7 @@ On the Windows Phone platform, a typed reference to the native page being used o
|
|||
When implementing a custom renderer that derives from `PageRenderer` on the Windows Runtime, the `ArrangeOverride` method should also be implemented to arrange the page controls, because the base renderer doesn't know what to do with them. Otherwise, a blank page results. Therefore, in this example the `ArrangeOverride` method calls the `Arrange` method on the `Page` instance.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: It's important to stop and dispose of the objects that provide access to the camera in a Windows Phone 8.1 WinRT application. Failure to do so can interfere with other applications that attempt to access the device's camera. For more information, see the `CleanUpCaptureResourcesAsync` method in the Windows Phone project in the sample solution, and [Quickstart: Capturing video by using the MediaCapture API](https://msdn.microsoft.com/library/windows/apps/xaml/dn642092.aspx).
|
||||
> It's important to stop and dispose of the objects that provide access to the camera in a Windows Phone 8.1 WinRT application. Failure to do so can interfere with other applications that attempt to access the device's camera. For more information, see the `CleanUpCaptureResourcesAsync` method in the Windows Phone project in the sample solution, and [Quickstart: Capturing video by using the MediaCapture API](https://msdn.microsoft.com/library/windows/apps/xaml/dn642092.aspx).
|
||||
|
||||
### Creating the Page Renderer on UWP
|
||||
|
||||
|
@ -293,7 +293,7 @@ The call to the base class's `OnElementChanged` method instantiates a `Framework
|
|||
When implementing a custom renderer that derives from `PageRenderer` on UWP, the `ArrangeOverride` method should also be implemented to arrange the page controls, because the base renderer doesn't know what to do with them. Otherwise, a blank page results. Therefore, in this example the `ArrangeOverride` method calls the `Arrange` method on the `Page` instance.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: It's important to stop and dispose of the objects that provide access to the camera in a UWP application. Failure to do so can interfere with other applications that attempt to access the device's camera. For more information, see [Display the camera preview](https://msdn.microsoft.com/windows/uwp/audio-video-camera/simple-camera-preview-access).
|
||||
> It's important to stop and dispose of the objects that provide access to the camera in a UWP application. Failure to do so can interfere with other applications that attempt to access the device's camera. For more information, see [Display the camera preview](https://msdn.microsoft.com/windows/uwp/audio-video-camera/simple-camera-preview-access).
|
||||
|
||||
## Summary
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ The process for creating the custom renderer class is as follows:
|
|||
1. Add an `ExportRenderer` attribute to the custom renderer class to specify that it will be used to render the Xamarin.Forms control. This attribute is used to register the custom renderer with Xamarin.Forms.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: It is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used.
|
||||
> It is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used.
|
||||
|
||||
The following diagram illustrates the responsibilities of each project in the sample application, along with the relationships between them:
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ The process for creating the custom renderer class is as follows:
|
|||
1. Add an `ExportRenderer` attribute to the custom renderer class to specify that it will be used to render the Xamarin.Forms custom control. This attribute is used to register the custom renderer with Xamarin.Forms.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: For most Xamarin.Forms elements, it is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used. However, custom renderers are required in each platform project when rendering a [View](https://developer.xamarin.com/api/type/Xamarin.Forms.View/) element.
|
||||
> For most Xamarin.Forms elements, it is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used. However, custom renderers are required in each platform project when rendering a [View](https://developer.xamarin.com/api/type/Xamarin.Forms.View/) element.
|
||||
|
||||
The following diagram illustrates the responsibilities of each project in the sample application, along with the relationships between them:
|
||||
|
||||
|
@ -312,7 +312,7 @@ This functionality is achieved as follows:
|
|||
- Resources are released.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The `WKWebView` class is only supported in iOS 8 and later.
|
||||
> The `WKWebView` class is only supported in iOS 8 and later.
|
||||
|
||||
### Creating the Custom Renderer on Android
|
||||
|
||||
|
@ -407,7 +407,7 @@ public class JSBridge : Java.Lang.Object
|
|||
The class must derive from `Java.Lang.Object`, and methods that are exposed to JavaScript must be decorated with the `[JavascriptInterface]` and `[Export]` attributes. Therefore, when the `invokeCSharpAction` JavaScript function is injected into the web page and is executed, it will call the `JSBridge.InvokeAction` method due to being decorated with the `[JavascriptInterface]` and `[Export("invokeAction")]` attributes. In turn, the `InvokeAction` method invokes the `HybridWebView.InvokeAction` method, which will invoked the registered action to display the pop-up.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Projects that use the `[Export]` attribute must include a reference to `Mono.Android.Export`, or a compiler error will result.
|
||||
> Projects that use the `[Export]` attribute must include a reference to `Mono.Android.Export`, or a compiler error will result.
|
||||
|
||||
Note that the `JSBridge` class maintains a `WeakReference` to the `HybridWebViewRenderer` class. This is to avoid creating a circular reference between the two classes. For more information see [Weak References](https://msdn.microsoft.com/library/ms404247(v=vs.110).aspx) on MSDN.
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ The `MyEntry` control is an `Entry` control where the `BackgroundColor` is set t
|
|||
The `local` namespace prefix can be anything. However, the `namespace` and `assembly` values must match the details of the custom control. Once the namespace is declared, the prefix is used to reference the custom control.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Defining the `xmlns` is much simpler in PCLs than Shared Projects. A PCL is compiled into an assembly so it's easy to determine what the `assembly=CustomRenderer` value should be. When using Shared Projects, all the shared assets (including the XAML) are compiled into each of the referencing projects, which means that if the iOS, Android, and Windows Phone projects have their own *assembly names* it is impossible to to write the `xmlns` declaration because the value needs to be different for each application. Custom controls in XAML for Shared Projects will require every application project to be configured with the same assembly name.
|
||||
> Defining the `xmlns` is much simpler in PCLs than Shared Projects. A PCL is compiled into an assembly so it's easy to determine what the `assembly=CustomRenderer` value should be. When using Shared Projects, all the shared assets (including the XAML) are compiled into each of the referencing projects, which means that if the iOS, Android, and Windows Phone projects have their own *assembly names* it is impossible to to write the `xmlns` declaration because the value needs to be different for each application. Custom controls in XAML for Shared Projects will require every application project to be configured with the same assembly name.
|
||||
|
||||
The `MyEntry` custom control is then rendered on each platform, with a gray background, as shown in the following screenshots:
|
||||
|
||||
|
@ -65,7 +65,7 @@ The process for creating a custom renderer class is as follows:
|
|||
1. Add an `ExportRenderer` attribute to the custom renderer class to specify that it will be used to render the Xamarin.Forms control. This attribute is used to register the custom renderer with Xamarin.Forms.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: For most Xamarin.Forms elements, it is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used. However, custom renderers are required in each platform project when rendering a [View](https://developer.xamarin.com/api/type/Xamarin.Forms.View/) or [ViewCell](https://developer.xamarin.com/api/type/Xamarin.Forms.ViewCell/) element.
|
||||
> For most Xamarin.Forms elements, it is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used. However, custom renderers are required in each platform project when rendering a [View](https://developer.xamarin.com/api/type/Xamarin.Forms.View/) or [ViewCell](https://developer.xamarin.com/api/type/Xamarin.Forms.ViewCell/) element.
|
||||
|
||||
The topics in this series will provide demonstrations and explanations of this process for different Xamarin.Forms elements.
|
||||
|
||||
|
|
|
@ -145,7 +145,7 @@ The process for creating the custom renderer class is as follows:
|
|||
1. Add an `ExportRenderer` attribute to the custom renderer class to specify that it will be used to render the Xamarin.Forms custom control. This attribute is used to register the custom renderer with Xamarin.Forms.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: It is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the cell's base class will be used.
|
||||
> It is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the cell's base class will be used.
|
||||
|
||||
The following diagram illustrates the responsibilities of each project in the sample application, along with the relationships between them:
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ The process for creating the custom renderer class is as follows:
|
|||
1. Add an `ExportRenderer` attribute to the custom renderer class to specify that it will be used to render the Xamarin.Forms custom map. This attribute is used to register the custom renderer with Xamarin.Forms.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: It is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used.
|
||||
> It is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used.
|
||||
|
||||
The following diagram illustrates the responsibilities of each project in the sample application, along with the relationships between them:
|
||||
|
||||
|
|
|
@ -111,7 +111,7 @@ The process for creating the custom renderer class is as follows:
|
|||
1. Add an `ExportRenderer` attribute to the custom renderer class to specify that it will be used to render the Xamarin.Forms custom control. This attribute is used to register the custom renderer with Xamarin.Forms.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: For most Xamarin.Forms elements, it is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used. However, custom renderers are required in each platform project when rendering a [View](https://developer.xamarin.com/api/type/Xamarin.Forms.View/) element.
|
||||
> For most Xamarin.Forms elements, it is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used. However, custom renderers are required in each platform project when rendering a [View](https://developer.xamarin.com/api/type/Xamarin.Forms.View/) element.
|
||||
|
||||
The following diagram illustrates the responsibilities of each project in the sample application, along with the relationships between them:
|
||||
|
||||
|
@ -314,7 +314,7 @@ namespace CustomRenderer.WinPhone81
|
|||
Provided that the `Control` property is `null`, a new `CaptureElement` is instantiated and the `InitializeAsync` method is called, which uses the `MediaCapture` API to provide the preview stream from the camera. The `SetNativeControl` method is then called to assign a reference to the `CaptureElement` instance to the `Control` property. The `CaptureElement` control exposes a `Tapped` event that's handled by the `OnCameraPreviewTapped` method to stop and start the video preview when it's tapped. The `Tapped` event is subscribed to when the custom renderer is attached to a new Xamarin.Forms element, and unsubscribed from only when the element the renderer is attached to changes.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: It's important to stop and dispose of the objects that provide access to the camera in a Windows Phone or UWP application. Failure to do so can interfere with other applications that attempt to access the device's camera. For more information, see and [Quickstart: Capturing video by using the MediaCapture API](https://msdn.microsoft.com/library/windows/apps/xaml/dn642092.aspx) for Windows Runtime applications, and [Display the camera preview](https://msdn.microsoft.com/windows/uwp/audio-video-camera/simple-camera-preview-access) for UWP applications.
|
||||
> It's important to stop and dispose of the objects that provide access to the camera in a Windows Phone or UWP application. Failure to do so can interfere with other applications that attempt to access the device's camera. For more information, see and [Quickstart: Capturing video by using the MediaCapture API](https://msdn.microsoft.com/library/windows/apps/xaml/dn642092.aspx) for Windows Runtime applications, and [Display the camera preview](https://msdn.microsoft.com/windows/uwp/audio-video-camera/simple-camera-preview-access) for UWP applications.
|
||||
|
||||
## Summary
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ The process for creating the custom renderer class is as follows:
|
|||
1. Add an `ExportRenderer` attribute to the custom renderer class to specify that it will be used to render the Xamarin.Forms custom cell. This attribute is used to register the custom renderer with Xamarin.Forms.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: For most Xamarin.Forms elements, it is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used. However, custom renderers are required in each platform project when rendering a [ViewCell](https://developer.xamarin.com/api/type/Xamarin.Forms.ViewCell/) element.
|
||||
> For most Xamarin.Forms elements, it is optional to provide a custom renderer in each platform project. If a custom renderer isn't registered, then the default renderer for the control's base class will be used. However, custom renderers are required in each platform project when rendering a [ViewCell](https://developer.xamarin.com/api/type/Xamarin.Forms.ViewCell/) element.
|
||||
|
||||
The following diagram illustrates the responsibilities of each project in the sample application, along with the relationships between them:
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ namespace DependencyServiceSample
|
|||
Coding against this interface in the shared code will allow the Xamarin.Forms app to access the power management APIs on each platform.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Classes implementing the Interface must have a parameterless constructor to work with the `DependencyService`. Constructors can't be defined by interfaces.
|
||||
> Classes implementing the Interface must have a parameterless constructor to work with the `DependencyService`. Constructors can't be defined by interfaces.
|
||||
|
||||
<a name="iOS_Implementation" />
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ The application using `DependencyService` will have the following structure:
|
|||
![](device-orientation-images/orientation-diagram.png "DependencyService Application Structure")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note:** It is possible to detect whether the device is in portrait or landscape orientation in shared code, as demonstrated in [Device Orientation]/guides/xamarin-forms/user-interface/layouts/device-orientation/#changes-in-orientation). The method described in this article uses native features to get more information about orientation, including whether the device is upside down.
|
||||
> It is possible to detect whether the device is in portrait or landscape orientation in shared code, as demonstrated in [Device Orientation]/guides/xamarin-forms/user-interface/layouts/device-orientation/#changes-in-orientation). The method described in this article uses native features to get more information about orientation, including whether the device is upside down.
|
||||
|
||||
<a name="Creating_the_Interface" />
|
||||
|
||||
|
@ -53,7 +53,7 @@ namespace DependencyServiceSample.Abstractions
|
|||
Coding against this interface in the shared code will allow the Xamarin.Forms app to access the device orientation APIs on each platform.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Classes implementing the interface must have a parameterless constructor to work with the `DependencyService`.
|
||||
> Classes implementing the interface must have a parameterless constructor to work with the `DependencyService`.
|
||||
|
||||
<a name="iOS_Implementation" />
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ The [sample UsingDependencyService solution](https://developer.xamarin.com/sampl
|
|||
[ ![iOS and Android solution](introduction-images/solution-sml.png "DependencyService Sample Solution Structure")](introduction-images/solution.png "DependencyService Sample Solution Structure")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note:** You **must** provide an implementation in every platform project. If no Interface implementation is registered, then the `DependencyService` will be unable to resolve the `Get<T>()` method at runtime.
|
||||
> You **must** provide an implementation in every platform project. If no Interface implementation is registered, then the `DependencyService` will be unable to resolve the `Get<T>()` method at runtime.
|
||||
|
||||
|
||||
## Related Links
|
||||
|
|
|
@ -40,7 +40,7 @@ public interface ITextToSpeech
|
|||
Coding against this interface in the shared code will allow the Xamarin.Forms app to access the speech APIs on each platform.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Classes implementing the interface must have a parameterless constructor to work with the `DependencyService`.
|
||||
> Classes implementing the interface must have a parameterless constructor to work with the `DependencyService`.
|
||||
|
||||
<a name="iOS_Implementation" />
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ The process for creating an effect in each platform-specific project is as follo
|
|||
The effect can then be consumed by attaching it to the appropriate control.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: It's optional to provide an effect in each platform project. Attempting to use an effect when one isn't registered will return a non-null value that does nothing.
|
||||
> It's optional to provide an effect in each platform project. Attempting to use an effect when one isn't registered will return a non-null value that does nothing.
|
||||
|
||||
The sample application demonstrates a `FocusEffect` that changes the background color of a control when it gains focus. The following diagram illustrates the responsibilities of each project in the sample application, along with the relationships between them:
|
||||
|
||||
|
@ -191,7 +191,7 @@ The process for consuming an effect from a Xamarin.Forms Portable Class Library
|
|||
1. Attach the effect to the control by adding it to the control's [`Effects`](https://developer.xamarin.com/api/property/Xamarin.Forms.Element.Effects/) collection.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: An effect instance can only be attached to a single control. Therefore, an effect must be resolved twice to use it on two controls.
|
||||
> An effect instance can only be attached to a single control. Therefore, an effect must be resolved twice to use it on two controls.
|
||||
|
||||
## Consuming the Effect in XAML
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ The process for creating effect parameters that respond to runtime property chan
|
|||
Parameters can then be passed to the effect by adding the attached properties, and property values, to the appropriate control. In addition, parameters can be changed at runtime by specifying a new attached property value.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: An attached property is a special type of bindable property, defined in one class but attached to other objects, and recognizable in XAML as attributes that contain a class and a property name separated by a period. For more information, see [Attached Properties](~/xamarin-forms/xaml/attached-properties.md).
|
||||
> An attached property is a special type of bindable property, defined in one class but attached to other objects, and recognizable in XAML as attributes that contain a class and a property name separated by a period. For more information, see [Attached Properties](~/xamarin-forms/xaml/attached-properties.md).
|
||||
|
||||
The sample application demonstrates a `ShadowEffect` that adds a shadow to the text displayed by a [`Label`](https://developer.xamarin.com/api/type/Xamarin.Forms.Label/) control. In addition, the color of the shadow can be changed at runtime. The following diagram illustrates the responsibilities of each project in the sample application, along with the relationships between them:
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ Swiping from right to left again moves to the third page, while swiping from lef
|
|||
|
||||
<!--
|
||||
> [!NOTE]
|
||||
> **Note**: The [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) has been deprecated, and will be removed from Xamarin.Forms in a future release. Instead, the [`CarouselView`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselView/) should be used to provide a gallery-like view, where users can swipe from side to side to move through a collection of items.
|
||||
> The [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) has been deprecated, and will be removed from Xamarin.Forms in a future release. Instead, the [`CarouselView`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselView/) should be used to provide a gallery-like view, where users can swipe from side to side to move through a collection of items.
|
||||
-->
|
||||
|
||||
## Creating a CarouselPage
|
||||
|
@ -45,7 +45,7 @@ Two approaches can be used to create a [`CarouselPage`](https://developer.xamari
|
|||
With both approaches, the `CarouselPage` will then display each page in turn, with a swipe interaction moving to the next page to be displayed. This navigation experience will feel natural and familiar to Windows Phone users.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: A [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) can only be populated with [`ContentPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage/) instances, or `ContentPage` derivatives.
|
||||
> A [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) can only be populated with [`ContentPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage/) instances, or `ContentPage` derivatives.
|
||||
|
||||
<a name="Populating_a_CarouselPage_with_a_Page_Collection" />
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class MainPageCS : CarouselPage
|
|||
Each [`ContentPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage/) simply displays a [`Label`](https://developer.xamarin.com/api/type/Xamarin.Forms.Label/) for a particular color and a [`BoxView`](https://developer.xamarin.com/api/type/Xamarin.Forms.BoxView/) of that color.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) does not support UI virtualization. Therefore, performance may be affected if the `CarouselPage` contains too many child elements.
|
||||
> The [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) does not support UI virtualization. Therefore, performance may be affected if the `CarouselPage` contains too many child elements.
|
||||
|
||||
If a [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) is embedded into the [`Detail`](https://developer.xamarin.com/api/property/Xamarin.Forms.MasterDetailPage.Detail/) page of a [`MasterDetailPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.MasterDetailPage/), the [`MasterDetailPage.IsGestureEnabled`](https://developer.xamarin.com/api/field/Xamarin.Forms.MasterDetailPage.IsGestureEnabledProperty/) property should be set to `false` to prevent gesture conflicts between the `CarouselPage` and the `MasterDetailPage`.
|
||||
|
||||
|
@ -235,7 +235,7 @@ public class MainPageCS : CarouselPage
|
|||
Each [`ContentPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage/) simply displays a [`Label`](https://developer.xamarin.com/api/type/Xamarin.Forms.Label/) for a particular color and a [`BoxView`](https://developer.xamarin.com/api/type/Xamarin.Forms.BoxView/) of that color.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) does not support UI virtualization. Therefore, performance may be affected if the `CarouselPage` contains too many child elements.
|
||||
> The [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) does not support UI virtualization. Therefore, performance may be affected if the `CarouselPage` contains too many child elements.
|
||||
|
||||
If a [`CarouselPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.CarouselPage/) is embedded into the [`Detail`](https://developer.xamarin.com/api/property/Xamarin.Forms.MasterDetailPage.Detail/) page of a [`MasterDetailPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.MasterDetailPage/), the [`MasterDetailPage.IsGestureEnabled`](https://developer.xamarin.com/api/field/Xamarin.Forms.MasterDetailPage.IsGestureEnabledProperty/) property should be set to `false` to prevent gesture conflicts between the `CarouselPage` and the `MasterDetailPage`.
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ The [`TabbedPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.TabbedPa
|
|||
[`ContentPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage/) instance, and the second tab is a [`NavigationPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.NavigationPage/) containing a `ContentPage` instance.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The [`TabbedPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.TabbedPage/) does not support UI virtualization. Therefore, performance may be affected if the `TabbedPage` contains too many child elements.
|
||||
> The [`TabbedPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.TabbedPage/) does not support UI virtualization. Therefore, performance may be affected if the `TabbedPage` contains too many child elements.
|
||||
|
||||
The following screenshots show the `TodayPage` [`ContentPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage/) instance, which is shown on the *Today* tab:
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ This method replaces the active [`ControlTemplate`](https://developer.xamarin.co
|
|||
![](creating-images/aqua-theme.png "Aqua Control Template")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: On a `ContentPage`, the `Content` property can be assigned and the `ControlTemplate` property can also be set. When this occurs, if the `ControlTemplate` contains a `ContentPresenter` instance, the content assigned to the `Content` property will be presented by the `ContentPresenter` within the `ControlTemplate`.
|
||||
> On a `ContentPage`, the `Content` property can be assigned and the `ControlTemplate` property can also be set. When this occurs, if the `ControlTemplate` contains a `ContentPresenter` instance, the content assigned to the `Content` property will be presented by the `ContentPresenter` within the `ControlTemplate`.
|
||||
|
||||
### Setting a ControlTemplate with a Style
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public async Task<List<TodoItem>> RefreshDataAsync ()
|
|||
The `SelectAsync` method returns a response containing a collection of items and associated attributes that match the query expression. The query expression ensures that only items that match the user's email address will be retrieved. For more information about query expressions, see [Using Select to Create Amazon SimpleDB Queries](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/UsingSelect.html) on Amazon's website.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Be careful to follow the quoting rules when constructing the query expression. For more information, see [Select Quoting Rules](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/QuotingRulesSelect.html) on Amazon's website.
|
||||
> Be careful to follow the quoting rules when constructing the query expression. For more information, see [Select Quoting Rules](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/QuotingRulesSelect.html) on Amazon's website.
|
||||
|
||||
## Summary
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ _Azure Active Directory B2C is a cloud identity management solution for consumer
|
|||
![](~/media/shared/preview.png "This API is currently pre-release")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The [Microsoft Authentication Library](https://www.nuget.org/packages/Microsoft.Identity.Client) is still in preview, but is suitable for use in a production environment. However, there may be breaking changes to the API, internal cache format, and other mechanisms of the library, which may impact your application.
|
||||
> The [Microsoft Authentication Library](https://www.nuget.org/packages/Microsoft.Identity.Client) is still in preview, but is suitable for use in a production environment. However, there may be breaking changes to the API, internal cache format, and other mechanisms of the library, which may impact your application.
|
||||
|
||||
## Overview
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ _Azure Active Directory B2C is a cloud identity management solution for consumer
|
|||
![](~/media/shared/preview.png "This API is currently pre-release")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The [Microsoft Authentication Library](https://www.nuget.org/packages/Microsoft.Identity.Client) is still in preview, but is suitable for use in a production environment. However, there may be breaking changes to the API, internal cache format, and other mechanisms of the library, which may impact your application.
|
||||
> The [Microsoft Authentication Library](https://www.nuget.org/packages/Microsoft.Identity.Client) is still in preview, but is suitable for use in a production environment. However, there may be breaking changes to the API, internal cache format, and other mechanisms of the library, which may impact your application.
|
||||
|
||||
## Overview
|
||||
|
||||
|
@ -34,12 +34,12 @@ The process for integrating the Azure Active Directory B2C identity management s
|
|||
1. Use the [Microsoft Authentication Library](https://www.nuget.org/packages/Microsoft.Identity.Client) (MSAL) in your mobile application to initiate an authentication workflow with your Azure Active Directory B2C tenant.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: As well as integrating Azure Active Directory B2C identity management into mobile applications, MSAL can also be used to integrate Azure Active Directory identity management into mobile applications. This can be accomplished by registering a mobile application with Azure Active Directory at the [Application Registration Portal](https://apps.dev.microsoft.com/). The registration process assigns an **Application ID** that uniquely identifies your application, which should be specified when using MSAL. For more information, see [How to register an app with the v2.0 endpoint](/azure/active-directory/develop/active-directory-v2-app-registration/), and [Authenticate Your Mobile Apps Using Microsoft Authentication Library](https://blog.xamarin.com/authenticate-mobile-apps-using-microsoft-authentication-library/) on the Xamarin blog.
|
||||
> As well as integrating Azure Active Directory B2C identity management into mobile applications, MSAL can also be used to integrate Azure Active Directory identity management into mobile applications. This can be accomplished by registering a mobile application with Azure Active Directory at the [Application Registration Portal](https://apps.dev.microsoft.com/). The registration process assigns an **Application ID** that uniquely identifies your application, which should be specified when using MSAL. For more information, see [How to register an app with the v2.0 endpoint](/azure/active-directory/develop/active-directory-v2-app-registration/), and [Authenticate Your Mobile Apps Using Microsoft Authentication Library](https://blog.xamarin.com/authenticate-mobile-apps-using-microsoft-authentication-library/) on the Xamarin blog.
|
||||
|
||||
MSAL uses the device's web browser to perform authentication. This improves the usability of an application, as users only need to sign-in once per device, improving conversion rates of sign-in and authorization flows in the application. The device browser also provides improved security. After the user completes the authentication process, control will return to the application from the web browser tab. This is achieved by registering a custom URL scheme for the redirect URL that's returned from the authentication process, and then detecting and handling the custom URL once it's sent. For more information about choosing a custom URL scheme, see [Choosing a native app redirect URI](/azure/active-directory-b2c/active-directory-b2c-app-registration#choosing-a-native-app-redirect-uri/).
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The mechanism for registering a custom URL scheme with the operating system and handling the scheme is specific to each platform.
|
||||
> The mechanism for registering a custom URL scheme with the operating system and handling the scheme is specific to each platform.
|
||||
|
||||
Each request that is sent to an Azure Active Directory B2C tenant specifies a *policy*. Policies describe consumer identity experiences such as sign-up, or sign-in. For example, a sign-up policy allows the behavior of the Azure Active Directory B2C tenant to be configured through the following settings:
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ The ASMX service provides the following operations:
|
|||
For more information about the data model used in the application, see [Modeling the data](~/xamarin-forms/data-cloud/walkthrough.md).
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The sample application consumes the Xamarin-hosted ASMX service that provides read-only access to the web service. Therefore, the operations that create, update, and delete data will not alter the data consumed in the application. However, a hostable version of the ASMX service is available in the **TodoASMXService** folder in the accompanying sample application. This hostable version of the ASMX service permits full create, update, read, and delete access to the data.
|
||||
> The sample application consumes the Xamarin-hosted ASMX service that provides read-only access to the web service. Therefore, the operations that create, update, and delete data will not alter the data consumed in the application. However, a hostable version of the ASMX service is available in the **TodoASMXService** folder in the accompanying sample application. This hostable version of the ASMX service permits full create, update, read, and delete access to the data.
|
||||
|
||||
A *proxy* must be generated to consume the ASMX service, which allows the application to connect to the service. The proxy is constructed by consuming service metadata that defines the methods and associated service configuration. This metadata is exposed in the form of a Web Services Description Language (WSDL) document that is generated by the web service. The proxy is built by adding a web reference for the web service to the platform-specific projects.
|
||||
|
||||
|
|
|
@ -137,7 +137,7 @@ public async Task<List<TodoItem>> RefreshDataAsync ()
|
|||
The `SelectAsync` method accepts a `SelectRequest` instance as a parameter, which specifies a `Select` query expression in it's `SelectExpression` property. The format of the query expression is similar to the format of the standard SQL `SELECT` statement. For more information about the query expression, see [Using Select to Create Amazon SimpleDB Queries](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/UsingSelect.html) on Amazon's website.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Be careful to follow the quoting rules when constructing the query expression. For more information, see [Select Quoting Rules](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/QuotingRulesSelect.html) on Amazon's website.
|
||||
> Be careful to follow the quoting rules when constructing the query expression. For more information, see [Select Quoting Rules](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/QuotingRulesSelect.html) on Amazon's website.
|
||||
|
||||
The `SelectAsync` method returns a response containing a collection of items and associated attributes that match the query expression. This collection is then converted to a `List` of `TodoItem` instances for display.
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ The WCF service provides the following operations:
|
|||
For more information about the data model used in the application, see [Modeling the data](~/xamarin-forms/data-cloud/walkthrough.md).
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The sample application consumes the Xamarin-hosted WCF service that provides read-only access to the web service. Therefore, the operations that create, update, and delete data will not alter the data consumed in the application. However, a hostable version of the ASMX service is available in the **TodoWCFService** folder in the accompanying sample application. This hostable version of the WCF service permits full create, update, read, and delete access to the data.
|
||||
> The sample application consumes the Xamarin-hosted WCF service that provides read-only access to the web service. Therefore, the operations that create, update, and delete data will not alter the data consumed in the application. However, a hostable version of the ASMX service is available in the **TodoWCFService** folder in the accompanying sample application. This hostable version of the WCF service permits full create, update, read, and delete access to the data.
|
||||
|
||||
A *proxy* must be generated to consume a WCF service, which allows the application to connect to the service. The proxy is constructed by consuming service metadata that define the methods and associated service configuration. This metadata is exposed in the form of a Web Services Description Language (WSDL) document that is generated by the web service. The proxy can be built by using the Microsoft WCF Web Service Reference Provider in Visual Studio 2017 to add a service reference for the web service to a .NET Standard Library. An alternative to creating the proxy using the Microsoft WCF Web Service Reference Provider in Visual Studio 2017 is to use the ServiceModel Metadata Utility Tool (svcutil.exe). For more information, see [ServiceModel Metadata Utility Tool (Svcutil.exe)](/dotnet/framework/wcf/servicemodel-metadata-utility-tool-svcutil-exe/).
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ public override bool FinishedLaunching(UIApplication app, NSDictionary options)
|
|||
When an iOS application registers with APNS it must specify the types of push notifications it would like to receive. The `RegisterUserNotificationSettings` method registers the types of notifications the application can receive, with the `RegisterForRemoteNotifications` method registering to receive push notifications from APNS.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Failing to call the `RegisterUserNotificationSettings` method will result in push notifications being silently received by the application.
|
||||
> Failing to call the `RegisterUserNotificationSettings` method will result in push notifications being silently received by the application.
|
||||
|
||||
<a name="ios_registration_response" />
|
||||
|
||||
|
@ -142,7 +142,7 @@ public override void RegisteredForRemoteNotifications(UIApplication application,
|
|||
This method creates a simple notification message template as JSON, and registers the device to receive template notifications from the notification hub.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The `FailedToRegisterForRemoteNotifications` override should be implemented to handle situations such as no network connection. This is important because users might start the application while offline.
|
||||
> The `FailedToRegisterForRemoteNotifications` override should be implemented to handle situations such as no network connection. This is important because users might start the application while offline.
|
||||
|
||||
<a name="ios_process_incoming" />
|
||||
|
||||
|
@ -173,7 +173,7 @@ public override void DidReceiveRemoteNotification(
|
|||
The `userInfo` dictionary contains the `aps` key, whose value is the `alert` dictionary with the remaining notification data. This dictionary is retrieved, with the `string` notification message being displayed in a dialog box.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: If an application isn't running when a push notification arrives, the application will be launched but the `DidReceiveRemoteNotification` method won't process the notification. Instead, get the notification payload and respond appropriately from the `WillFinishLaunching` or `FinishedLaunching` overrides.
|
||||
> If an application isn't running when a push notification arrives, the application will be launched but the `DidReceiveRemoteNotification` method won't process the notification. Instead, get the notification payload and respond appropriately from the `WillFinishLaunching` or `FinishedLaunching` overrides.
|
||||
|
||||
For more information about APNS, see [Push Notifications in iOS](~/ios/platform/user-notifications/deprecated/remote-notifications-in-ios.md).
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ The `IMobileServiceSyncTable.PushAsync` method operates on the sync context, rat
|
|||
Pull is performed by the `IMobileServiceSyncTable.PullAsync` method on a single table. The first parameter to the `PullAsync` method is a query name that is used only on the mobile device. Providing a non-null query name results in the Azure Mobile Client SDK performing an *incremental sync*, where each time a pull operation returns results, the latest `updatedAt` timestamp from the results is stored in the local system tables. Subsequent pull operations then only retrieve records after that timestamp. Alternatively, *full sync* can be achieved by passing `null` as the query name, which results in all records being retrieved on each pull operation. Following any sync operation, received data is inserted into the local store.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: If a pull is executed against a table that has pending local updates, the pull will first execute a push on the sync context. This minimizes conflicts between changes that are already queued and new data from the Azure Mobile Apps instance.
|
||||
> If a pull is executed against a table that has pending local updates, the pull will first execute a push on the sync context. This minimizes conflicts between changes that are already queued and new data from the Azure Mobile Apps instance.
|
||||
|
||||
The `SyncAsync` method also includes a basic implementation for handling conflicts when the same record has changed in both the local store and in the Azure Mobile Apps instance. When the conflict is that data has been updated both in the local store and in the Azure Mobile Apps instance, the `SyncAsync` method updates the data in the local store from the data stored in the Azure Mobile Apps instance. When any other conflict occurs, the `SyncAsync` method discards the local change. This handles the scenario where a local change exists for data that's been deleted from the Azure Mobile Apps instance.
|
||||
|
||||
|
@ -146,7 +146,7 @@ await todoTable.PurgeAsync(todoTable.Where(item => item.Done));
|
|||
A call to `PurgeAsync` also triggers a push operation. Therefore, any items that are marked as complete locally will be sent to the Azure Mobile Apps instance before being removed from the local store. However, if there are operations pending synchronization with the Azure Mobile Apps instance, the purge will throw an `InvalidOperationException` unless the `force` parameter is set to `true`. An alternative strategy is to examine the `IMobileServiceSyncContext.PendingOperations` property, which returns the number of pending operations that haven't been pushed to the Azure Mobile Apps instance, and only perform the purge if the property is zero.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Invoking `PurgeAsync` with the `force` parameter set to `true` will lose any pending changes.
|
||||
> Invoking `PurgeAsync` with the `force` parameter set to `true` will lose any pending changes.
|
||||
|
||||
## Initiating Synchronization
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ The eShopOnContainers mobile app communicates with the identity microservice, wh
|
|||
- Accessing a resource with IdentityServer is achieved by the mobile app requesting an *access* token, which allows access to an API resource. Clients request access tokens and forward them to the API. Access tokens contain information about the client, and the user (if present). APIs then use that information to authorize access to their data.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: A client must be registered with IdentityServer before it can request tokens.
|
||||
> A client must be registered with IdentityServer before it can request tokens.
|
||||
|
||||
### Adding IdentityServer to a Web Application
|
||||
|
||||
|
|
|
@ -109,7 +109,7 @@ Create the Phoneword application as follows:
|
|||
}
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Attempting to build the application at this point will result in errors that will be fixed later.
|
||||
> Attempting to build the application at this point will result in errors that will be fixed later.
|
||||
|
||||
Save the changes to **MainPage.xaml.cs** by pressing **CTRL+S**, and close the file.
|
||||
|
||||
|
@ -561,7 +561,7 @@ Create the Phoneword application as follows:
|
|||
}
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Attempting to build the application at this point will result in errors that will be fixed later.
|
||||
> Attempting to build the application at this point will result in errors that will be fixed later.
|
||||
|
||||
Save the changes to **MainPage.xaml.cs** by choosing **File > Save** (or by pressing **⌘ + S**), and close the file.
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ Forms.SetFlags("FastRenderers_Experimental");
|
|||
```
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Fast renderers are only applicable to the app compat Android backend, so this setting will be ignored on pre-app compat activities.
|
||||
> Fast renderers are only applicable to the app compat Android backend, so this setting will be ignored on pre-app compat activities.
|
||||
|
||||
Performance improvements will vary for each application, depending upon the complexity of the layout. For example, performance improvements of x2 are possible when scrolling through a [`ListView`](https://developer.xamarin.com/api/type/Xamarin.Forms.ListView/) containing thousands of rows of data, where the cells in each row are made of controls that use fast renderers, which results in visibly smoother scrolling.
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ And this is the same code after upgrading the project to use `FormsAppCompatActi
|
|||
[ ![](images/post-appcompat-sml.png "Todo Sample Application With AppCompat and Theming")](images/post-appcompat.png "Todo Sample Application With AppCompat and Theming")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: When using `FormsAppCompatActivity`, the [base classes for some Android custom renderers](~/xamarin-forms/app-fundamentals/custom-renderer/renderers.md) will be different.
|
||||
> When using `FormsAppCompatActivity`, the [base classes for some Android custom renderers](~/xamarin-forms/app-fundamentals/custom-renderer/renderers.md) will be different.
|
||||
|
||||
|
||||
## Related Links
|
||||
|
|
|
@ -27,7 +27,7 @@ Each `TodoItem` instance created by the user is indexed. Platform-specific searc
|
|||
For more information about using an SQLite database, see [Working with a Local Database](~/xamarin-forms/app-fundamentals/databases.md).
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Xamarin.Forms application indexing and deep linking functionality is only available on the iOS and Android platforms, and requires iOS 9 and API 23 respectively.
|
||||
> Xamarin.Forms application indexing and deep linking functionality is only available on the iOS and Android platforms, and requires iOS 9 and API 23 respectively.
|
||||
|
||||
## Setup
|
||||
|
||||
|
@ -102,7 +102,7 @@ Application.Current.AppLinks.RegisterLink (appLink);
|
|||
This adds the [`AppLinkEntry`](https://developer.xamarin.com/api/type/Xamarin.Forms.AppLinkEntry/) instance to the application's [`AppLinks`](https://developer.xamarin.com/api/property/Xamarin.Forms.Application.AppLinks/) collection.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The `RegisterLink` method can also be used to update the content that's been indexed for a page.
|
||||
> The `RegisterLink` method can also be used to update the content that's been indexed for a page.
|
||||
|
||||
Once an [`AppLinkEntry`](https://developer.xamarin.com/api/type/Xamarin.Forms.AppLinkEntry/) instance has been registered for indexing, it can appear in search results. The following screenshot shows indexed content appearing in search results on the iOS platform:
|
||||
|
||||
|
@ -119,7 +119,7 @@ Application.Current.AppLinks.DeregisterLink (appLink);
|
|||
This removes the [`AppLinkEntry`](https://developer.xamarin.com/api/type/Xamarin.Forms.AppLinkEntry/) instance from the application's [`AppLinks`](https://developer.xamarin.com/api/property/Xamarin.Forms.Application.AppLinks/) collection.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: On Android it's not possible to remove indexed content from search results.
|
||||
> On Android it's not possible to remove indexed content from search results.
|
||||
|
||||
<a name="responding" />
|
||||
|
||||
|
@ -207,7 +207,7 @@ In addition, values for the following keys can be specified:
|
|||
- `shouldAddToPublicIndex` – a `string` of either `true` or `false` that controls whether or not to add the indexed content to Apple's public cloud index, which can then be presented to users who haven't installed the application on their iOS device. However, just because content has been set for public indexing, it doesn't mean that it will be automatically added to Apple's public cloud index. For more information, see [Public Search Indexing](~/ios/platform/search/nsuseractivity.md). Note that this key should be set to `false` when adding personal data to the [`KeyValues`](https://developer.xamarin.com/api/property/Xamarin.Forms.IAppLinkEntry.KeyValues/) collection.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The `KeyValues` collection isn't used on the Android platform.
|
||||
> The `KeyValues` collection isn't used on the Android platform.
|
||||
|
||||
For more information about Handoff, see [Introduction to Handoff](~/ios/platform/handoff.md).
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ The process for consuming a Xamarin.Forms [`ContentPage`](https://developer.xama
|
|||
Xamarin.Forms must be initialized by calling the `Forms.Init` method before a native project can construct a [`ContentPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage/)-derived page. Choosing when to do this primarily depends on when it's most convenient in your application flow – it could be performed at application startup, or just before the `ContentPage`-derived page is constructed. In this article, and the accompanying sample applications, the `Forms.Init` method is called at application startup.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The **NativeForms** sample application solution does not contain any Xamarin.Forms projects. Instead, it consists of a Xamarin.iOS project, a Xamarin.Android project, and a UWP project. Each project is a native project that uses Native Forms to consume [`ContentPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage/)-derived pages. However, there's no reason why the native projects couldn't consume `ContentPage`-derived pages from a PCL, .NET Standard Library, or Shared Project.
|
||||
> The **NativeForms** sample application solution does not contain any Xamarin.Forms projects. Instead, it consists of a Xamarin.iOS project, a Xamarin.Android project, and a UWP project. Each project is a native project that uses Native Forms to consume [`ContentPage`](https://developer.xamarin.com/api/type/Xamarin.Forms.ContentPage/)-derived pages. However, there's no reason why the native projects couldn't consume `ContentPage`-derived pages from a PCL, .NET Standard Library, or Shared Project.
|
||||
|
||||
When using Native Forms, Xamarin.Forms features such as [`DependencyService`](https://developer.xamarin.com/api/type/Xamarin.Forms.DependencyService/), [`MessagingCenter`](https://developer.xamarin.com/api/type/Xamarin.Forms.MessagingCenter/), and the data binding engine, all still work.
|
||||
|
||||
|
@ -153,7 +153,7 @@ The `OnCreate` method performs the following tasks:
|
|||
For more information about Fragments, see [Fragments](~/android/platform/fragments/index.md).
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: In addition to the `CreateFragment` extension method, Xamarin.Forms also includes a `CreateSupportFragment` method. The `CreateFragment` method creates a `Android.App.Fragment` that can be used in applications that target API 11 and greater. The `CreateSupportFragment` method creates a `Android.Support.V4.App.Fragment` that can be used in applications that target API versions prior to 11.
|
||||
> In addition to the `CreateFragment` extension method, Xamarin.Forms also includes a `CreateSupportFragment` method. The `CreateFragment` method creates a `Android.App.Fragment` that can be used in applications that target API 11 and greater. The `CreateSupportFragment` method creates a `Android.Support.V4.App.Fragment` that can be used in applications that target API versions prior to 11.
|
||||
|
||||
Once the `OnCreate` method has executed, the UI defined in the Xamarin.Forms `PhonewordPage` class will be displayed, as shown in the following screenshot:
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ The [`Typeface.Create`](https://developer.xamarin.com/api/member/Android.Graphic
|
|||
The [`FontFamily`](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.media.fontfamily) constructor is used to set the [`TextBlock.FontFamily`](https://msdn.microsoft.com/library/windows/apps/windows.ui.xaml.controls.textblock.fontfamily) property to a new `FontFamily` on the Universal Windows Platform (UWP). The `FontFamily` name is specified by the method argument that is a child of the `x:Arguments` attribute.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Arguments must match the types required by the constructor or factory method.
|
||||
> Arguments must match the types required by the constructor or factory method.
|
||||
|
||||
The following screenshots show the result of specifying factory method and constructor arguments to set the font on different native views:
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ The result is that page content can be positioned on an area of the screen that
|
|||
[![](ios-images/safe-area-layout.png "Safe Area Layout Guide")](ios-images/safe-area-layout-large.png "Safe Area Layout Guide")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The safe area defined by Apple is used in Xamarin.Forms to set the [`Page.Padding`](https://developer.xamarin.com/api/property/Xamarin.Forms.Page.Padding/) property, and will override any previous values of this property that have been set.
|
||||
> The safe area defined by Apple is used in Xamarin.Forms to set the [`Page.Padding`](https://developer.xamarin.com/api/property/Xamarin.Forms.Page.Padding/) property, and will override any previous values of this property that have been set.
|
||||
|
||||
The safe area can be customized by retrieving its [`Thickness`](https://developer.xamarin.com/api/type/Xamarin.Forms.Thickness/) value with the `Page.SafeAreaInsets` method from the [`Xamarin.Forms.PlatformConfiguration.iOSSpecific`](https://developer.xamarin.com/api/namespace/Xamarin.Forms.PlatformConfiguration.iOSSpecific/) namespace. It can then be modified as required and re-assigned to the `Padding` property in the page constructor or [`OnAppearing`](https://developer.xamarin.com/api/member/Xamarin.Forms.Page.OnAppearing()/) override:
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ If you have installed the correct development options in Visual Studio,
|
|||
|
||||
|
||||
> [!NOTE]
|
||||
> **Note:** Xamarin.Forms 1.x and 2.x support _Windows Phone 8 Silverlight_
|
||||
> Xamarin.Forms 1.x and 2.x support _Windows Phone 8 Silverlight_
|
||||
> application development, however this project type has been deprecated.
|
||||
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ The following arguments are specified in the `Commit` method:
|
|||
The overall effect is to create an animation that increases the [`Scale`](https://developer.xamarin.com/api/property/Xamarin.Forms.VisualElement.Scale/) property of an [`Image`](https://developer.xamarin.com/api/type/Xamarin.Forms.Image/) from 1 to 2, over 2 seconds (2000 milliseconds), using the [`Linear`](https://developer.xamarin.com/api/field/Xamarin.Forms.Easing.Linear/) easing function. Each time the animation completes, its `Scale` property is reset to 1 and the animation repeats.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Concurrent animations, that run independently of each other can be constructed by creating an `Animation` object for each animation, and then calling the `Commit` method on each animation.
|
||||
> Concurrent animations, that run independently of each other can be constructed by creating an `Animation` object for each animation, and then calling the `Commit` method on each animation.
|
||||
|
||||
<a name="child" />
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ The following screenshots show the translation in progress on each platform:
|
|||
![](simple-images/translateto.png "Translation Animation")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: If an element is initially laid out off screen and then translated onto the screen, after translation the element's input layout remains off screen and the user can't interact with it. Therefore, it's recommended that a view should be laid out in its final position, and then any required translations performed.
|
||||
> If an element is initially laid out off screen and then translated onto the screen, after translation the element's input layout remains off screen and the user can't interact with it. Therefore, it's recommended that a view should be laid out in its final position, and then any required translations performed.
|
||||
|
||||
### Fading
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ This article will guide you through creating apps that take advantage of device
|
|||
When using Xamarin.Forms, the supported method of controlling device orientation is to use the settings for each individual project.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: As of Xamarin.Forms 1.5.0 there is a bug which prevents custom renderer-based attempts to control orientation to fail. See [this discussion](https://forums.xamarin.com/discussion/46653/forcing-landscape-for-a-single-page-in-ios#latest)this discussion in the Xamarin forums for more information.
|
||||
> As of Xamarin.Forms 1.5.0 there is a bug which prevents custom renderer-based attempts to control orientation to fail. See [this discussion](https://forums.xamarin.com/discussion/46653/forcing-landscape-for-a-single-page-in-ios#latest)this discussion in the Xamarin forums for more information.
|
||||
|
||||
### iOS
|
||||
|
||||
|
@ -119,7 +119,7 @@ Note that Windows Phone supports landscape views in both (as seen from portrait)
|
|||
Xamarin.Forms does not offer any native events for notifying your app of orientation changes in shared code. However, the `SizeChanged` event of the `Page` fires when either the width or height of the `Page` changes. When the width of the `Page` is greater than the height, the device is in landscape mode. For more information, see [Display an Image based on Screen Orientation](https://developer.xamarin.com/recipes/cross-platform/xamarin-forms/controls/screen-orientation/).
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: There is an existing, free NuGet package for receiving notifications of orientation changes in shared code. See the [GitHub repo](https://github.com/aliozgur/Xamarin.Plugins/tree/master/DeviceOrientation) for more information.
|
||||
> There is an existing, free NuGet package for receiving notifications of orientation changes in shared code. See the [GitHub repo](https://github.com/aliozgur/Xamarin.Plugins/tree/master/DeviceOrientation) for more information.
|
||||
|
||||
Alternatively, it's possible to override the [`OnSizeAllocated`](https://developer.xamarin.com/api/member/Xamarin.Forms.Page.OnSizeAllocated(System.Double,System.Double)/) method on a `Page`, inserting any layout change logic there. The `OnSizeAllocated` method is called whenever a `Page` is allocated a new size, which happens whenver the device is rotated. Note that the base implementation of `OnSizeAllocated` performs important layout functions, so it is important to call the base implementation in the override:
|
||||
|
||||
|
@ -172,7 +172,7 @@ It is possible to design interfaces using the built-in layouts so that they tran
|
|||
The above rules also apply when implementing interfaces for multiple screen sizes and are generally considered best-practice. The rest of this guide will explain specific examples of responsive layouts using each of the primary layouts in Xamarin.Forms.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: For clarity, the following sections demonstrate how to implement responsive layouts using just one type of `Layout` at a time. In practice, it is often simpler to mix `Layout`s to achieve a desired layout using the simpler or most intuitive `Layout` for each component.
|
||||
> For clarity, the following sections demonstrate how to implement responsive layouts using just one type of `Layout` at a time. In practice, it is often simpler to mix `Layout`s to achieve a desired layout using the simpler or most intuitive `Layout` for each component.
|
||||
|
||||
### StackLayout
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ Row and column information is stored in `Grid`'s `RowDefinitions` & `ColumnDefin
|
|||
- **Absolute** – sizes columns and rows with specific, fixed height and width values. Specified as a value and `GridUnitType.Absolute` in C# and as `#` in XAML, with `#` being your desired value.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The width values for columns are set as `*`` by default in Xamarin.Forms, which ensures that the column will fill the available space.
|
||||
> The width values for columns are set as `*`` by default in Xamarin.Forms, which ensures that the column will fill the available space.
|
||||
|
||||
Consider an app that needs three rows and two columns. The bottom row needs to be exactly 200px tall and the top row needs to be twice as tall as the middle row. The left column needs to be wide enough to fit the content and the right column needs to fill the remaining space.
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ The resulting nested view hierarchy can be examined with [Xamarin Inspector](~/t
|
|||
Layout compression, which is available for Xamarin.Forms applications on the iOS and Android platforms, aims to flatten the view nesting by removing specified layouts from the visual tree, which can improve page-rendering performance. The performance benefit that's delivered varies depending on the complexity of a page, the version of the operating system being used, and the device on which the application is running. However, the biggest performance gains will be seen on older devices.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: While this article focuses on the results of applying layout compression on Android, it's equally applicable to iOS.
|
||||
> While this article focuses on the results of applying layout compression on Android, it's equally applicable to iOS.
|
||||
|
||||
## Layout Compression
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ var stackLayout = new StackLayout {
|
|||
```
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: `Thickness` values can be negative, which typically clips or overdraws the content.
|
||||
> `Thickness` values can be negative, which typically clips or overdraws the content.
|
||||
|
||||
## Summary
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ Note the following aspects of the above layout:
|
|||
- The box's `y` coordinate is defined as half the height of the parent, -100.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Because of the way constraints are defined, it is possible to make more complex layouts in C# than can be specified with XAML.
|
||||
> Because of the way constraints are defined, it is possible to make more complex layouts in C# than can be specified with XAML.
|
||||
|
||||
Both of the examples above define constraints as `RelativeToParent` – that is, their values are relative to the parent element. It is also possible to define constraints as relative to another view. This allows for more intuitive (to the developer) layouts and can make the intent of your layout code more readily apparent.
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ This article covers:
|
|||
## Usage
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: `ScrollView`s should not be nested. In addition, `ScrollView`s should not be nested with other controls that provide scrolling, like `ListView` and `WebView`.
|
||||
> `ScrollView`s should not be nested. In addition, `ScrollView`s should not be nested with other controls that provide scrolling, like `ListView` and `WebView`.
|
||||
|
||||
`ScrollView` exposes a `Content` property which can be set to a single view or layout. Consider this example of a layout with a very large boxView, followed by an `Entry`:
|
||||
|
||||
|
|
|
@ -226,7 +226,7 @@ The [`OnBindingContextChanged`](https://developer.xamarin.com/api/member/Xamarin
|
|||
Alternatively, UI controls can bind to the [`BindableProperty`](https://developer.xamarin.com/api/type/Xamarin.Forms.BindableProperty/) instances to display their values, which removes the need to override the `OnBindingContextChanged` method.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: When overriding `OnBindingContextChanged`, ensure that the base class's `OnBindingContextChanged` method is called so that registered delegates receive the `BindingContextChanged` event.
|
||||
> When overriding `OnBindingContextChanged`, ensure that the base class's `OnBindingContextChanged` method is called so that registered delegates receive the `BindingContextChanged` event.
|
||||
|
||||
In XAML, binding the custom cell type to data can be achieved as shown in the following code example:
|
||||
|
||||
|
|
|
@ -269,8 +269,8 @@ XAML:
|
|||
|
||||
![](customizing-list-appearance-images/separator-custom.png "ListView with Green Row Separators")
|
||||
|
||||
**NOTE**: setting either of these properties on Android after
|
||||
loading the `ListView` incurs a large performance penalty.
|
||||
> [!NOTE]
|
||||
> Setting either of these properties on Android after loading the `ListView` incurs a large performance penalty.
|
||||
|
||||
<a name="Row_Heights" />
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ public enum ListViewCachingStrategy
|
|||
```
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The Universal Windows Platform (UWP) ignores the [`RetainElement`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RetainElement/) caching strategy, because it always uses caching to improve performance. Therefore, by default it behaves as if the [`RecycleElement`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RecycleElement/) caching strategy is applied.
|
||||
> The Universal Windows Platform (UWP) ignores the [`RetainElement`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RetainElement/) caching strategy, because it always uses caching to improve performance. Therefore, by default it behaves as if the [`RecycleElement`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RecycleElement/) caching strategy is applied.
|
||||
|
||||
### RetainElement
|
||||
|
||||
|
@ -97,14 +97,14 @@ On iOS and Android, if cells use custom renderers, they must ensure that propert
|
|||
When a [`ListView`](https://developer.xamarin.com/api/type/Xamarin.Forms.ListView/) uses a [`DataTemplateSelector`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplateSelector/) to select a [`DataTemplate`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplate/), the [`RecycleElement`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RecycleElement/) caching strategy does not cache `DataTemplate`s. Instead, a `DataTemplate` is selected for each item of data in the list.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The [`RecycleElement`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RecycleElement/) caching strategy has a pre-requisite, introduced in Xamarin.Forms 2.4, that when a [`DataTemplateSelector`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplateSelector/) is asked to select a [`DataTemplate`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplate/) that each `DataTemplate` must return the same [`ViewCell`](https://developer.xamarin.com/api/type/Xamarin.Forms.ViewCell/) type. For example, given a [`ListView`](https://developer.xamarin.com/api/type/Xamarin.Forms.ListView/) with a `DataTemplateSelector` that can return either `MyDataTemplateA` (where `MyDataTemplateA` returns a `ViewCell` of type `MyViewCellA`), or `MyDataTemplateB` (where `MyDataTemplateB` returns a `ViewCell` of type `MyViewCellB`), when `MyDataTemplateA` is returned it must return `MyViewCellA` or an exception will be thrown.
|
||||
> The [`RecycleElement`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RecycleElement/) caching strategy has a pre-requisite, introduced in Xamarin.Forms 2.4, that when a [`DataTemplateSelector`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplateSelector/) is asked to select a [`DataTemplate`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplate/) that each `DataTemplate` must return the same [`ViewCell`](https://developer.xamarin.com/api/type/Xamarin.Forms.ViewCell/) type. For example, given a [`ListView`](https://developer.xamarin.com/api/type/Xamarin.Forms.ListView/) with a `DataTemplateSelector` that can return either `MyDataTemplateA` (where `MyDataTemplateA` returns a `ViewCell` of type `MyViewCellA`), or `MyDataTemplateB` (where `MyDataTemplateB` returns a `ViewCell` of type `MyViewCellB`), when `MyDataTemplateA` is returned it must return `MyViewCellA` or an exception will be thrown.
|
||||
|
||||
### RecycleElementAndDataTemplate
|
||||
|
||||
The [`RecycleElementAndDataTemplate`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RecycleElementAndDataTemplate/) caching strategy builds on the [`RecycleElement`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RecycleElement/) caching strategy by additionally ensuring that when a [`ListView`](https://developer.xamarin.com/api/type/Xamarin.Forms.ListView/) uses a [`DataTemplateSelector`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplateSelector/) to select a [`DataTemplate`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplate/), `DataTemplate`s are cached by the type of item in the list. Therefore, `DataTemplate`s are selected once per item type, instead of once per item instance.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The [`RecycleElementAndDataTemplate`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RecycleElementAndDataTemplate/) caching strategy has a pre-requisite that the `DataTemplate`s returned by the [`DataTemplateSelector`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplateSelector/) must use the [`DataTemplate`](https://developer.xamarin.com/api/constructor/Xamarin.Forms.DataTemplate.DataTemplate/p/System.Type/) constructor that takes a `Type`.
|
||||
> The [`RecycleElementAndDataTemplate`](https://developer.xamarin.com/api/field/Xamarin.Forms.ListViewCachingStrategy.RecycleElementAndDataTemplate/) caching strategy has a pre-requisite that the `DataTemplate`s returned by the [`DataTemplateSelector`](https://developer.xamarin.com/api/type/Xamarin.Forms.DataTemplateSelector/) must use the [`DataTemplate`](https://developer.xamarin.com/api/constructor/Xamarin.Forms.DataTemplate.DataTemplate/p/System.Type/) constructor that takes a `Type`.
|
||||
|
||||
### Setting the Caching Strategy
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ After following those instructions, paste the API key in the
|
|||
Without a valid API key the maps control will display as a grey box on Android.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Remember to generate another key using the keystore file that is used to sign the Release version of any application that is uploaded to the Google Play store. The key you generate for development and debugging will not work and the app downloaded from Google Play will have broken map display. Also remember to regenerate the key if the app's **Package Name** changes.
|
||||
> Remember to generate another key using the keystore file that is used to sign the Release version of any application that is uploaded to the Google Play store. The key you generate for development and debugging will not work and the app downloaded from Google Play will have broken map display. Also remember to regenerate the key if the app's **Package Name** changes.
|
||||
|
||||
You'll also need to enable appropriate permissions by
|
||||
right-clicking on the Android project and selecting
|
||||
|
|
|
@ -61,7 +61,7 @@ The `baseStyle` targets [`View`](https://developer.xamarin.com/api/type/Xamarin.
|
|||
[![](inheritance-images/style-inheritance.png)](inheritance-images/style-inheritance-large.png)
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: An implicit style can be derived from an explicit style, but an explicit style can't be derived from an implicit style.
|
||||
> An implicit style can be derived from an explicit style, but an explicit style can't be derived from an implicit style.
|
||||
|
||||
### Respecting the Inheritance Chain
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ var text = MyEntry.Text;
|
|||
```
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The width of an `Entry` can be defined by setting its `WidthRequest` property. Do not depend on the width of an `Entry` being defined based on the value of its `Text` property.
|
||||
> The width of an `Entry` can be defined by setting its `WidthRequest` property. Do not depend on the width of an `Entry` being defined based on the value of its `Text` property.
|
||||
|
||||
### Keyboards
|
||||
|
||||
|
|
|
@ -34,7 +34,8 @@ WebView comes with support for the following types of content:
|
|||
- HTML strings – WebView can show HTML strings from memory.
|
||||
- Local Files – WebView can present any of the content types above embedded in the app.
|
||||
|
||||
**Note**: `WebView` on Windows and Windows Phone does not support Silverlight, Flash or any ActiveX controls, even if they are supported by Internet Explorer on that platform.
|
||||
> [!NOTE]
|
||||
> `WebView` on Windows and Windows Phone does not support Silverlight, Flash or any ActiveX controls, even if they are supported by Internet Explorer on that platform.
|
||||
|
||||
### Websites
|
||||
|
||||
|
@ -46,14 +47,15 @@ var browser = new WebView {
|
|||
};
|
||||
```
|
||||
|
||||
**Note**: URLs must be fully formed with the protocol specified (i.e. it must have "http://" or "https://" prepended to it).
|
||||
> [!NOTE]
|
||||
> URLs must be fully formed with the protocol specified (i.e. it must have "http://" or "https://" prepended to it).
|
||||
|
||||
#### iOS and ATS
|
||||
|
||||
Since version 9, iOS will only allow your application to communicate with servers that implement best-practice security by default. Values must be set in `Info.plist` to enable communication with insecure servers.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note:** If your application requires a connection to an insecure website, you should always enter the domain as an exception using `NSExceptionDomains` instead of turning ATS off completely using `NSAllowsArbitraryLoads`. `NSAllowsArbitraryLoads` should only be used in extreme emergency situations.
|
||||
> If your application requires a connection to an insecure website, you should always enter the domain as an exception using `NSExceptionDomains` instead of turning ATS off completely using `NSAllowsArbitraryLoads`. `NSAllowsArbitraryLoads` should only be used in extreme emergency situations.
|
||||
|
||||
The following demonstrates how to enable a specific domain (in this case xamarin.com) to bypass ATS requirements:
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ The first [`Label`](https://developer.xamarin.com/api/type/Xamarin.Forms.Label/)
|
|||
[![](resource-dictionaries-images/screenshots-sml.png "Consuming ResourceDictionary Resources")](resource-dictionaries-images/screenshots.png "Consuming ResourceDictionary Resources")
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Resources that are specific to a single page shouldn't be included in an application level resource dictionary, as such resources will then be parsed at application startup instead of when required by a page. For more information, see [Reduce the Application Resource Dictionary Size](~/xamarin-forms/deploy-test/performance.md).
|
||||
> Resources that are specific to a single page shouldn't be included in an application level resource dictionary, as such resources will then be parsed at application startup instead of when required by a page. For more information, see [Reduce the Application Resource Dictionary Size](~/xamarin-forms/deploy-test/performance.md).
|
||||
|
||||
## Overriding Resources
|
||||
|
||||
|
@ -171,7 +171,7 @@ When merged [`ResourceDictionary`](https://developer.xamarin.com/api/type/Xamari
|
|||
1. The resources contained in the resource dictionaries that were merged via the `MergedDictionaries` collection, in the order they are listed in the `MergedDictionaries` property.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: Searching resource dictionaries can be a computationally intensive task if an application contains multiple, large resource dictionaries. Therefore, ensure that each page in an application only uses resource dictionaries that are appropriate to the page, to avoid unnecessary searching.
|
||||
> Searching resource dictionaries can be a computationally intensive task if an application contains multiple, large resource dictionaries. Therefore, ensure that each page in an application only uses resource dictionaries that are appropriate to the page, to avoid unnecessary searching.
|
||||
|
||||
## Summary
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ in a Xamarin.Forms `ContentPage`:
|
|||
```
|
||||
|
||||
> [!NOTE]
|
||||
> **Note:** requiring the xmlns `a:` prefix on the XAML Standard controls is a limitation of the current preview.
|
||||
> Requiring the xmlns `a:` prefix on the XAML Standard controls is a limitation of the current preview.
|
||||
|
||||
|
||||
## Related Links
|
||||
|
|
|
@ -54,7 +54,7 @@ In this example, compile-time checking of the XAML for the `HomePage`
|
|||
class will be performed and errors reported as part of the compilation process.
|
||||
|
||||
> [!NOTE]
|
||||
> **Note**: The `XamlCompilation` attribute and the `XamlCompilationOptions` enumeration reside in the `Xamarin.Forms.Xaml0` namespace, which must be imported to use them.
|
||||
> The `XamlCompilation` attribute and the `XamlCompilationOptions` enumeration reside in the `Xamarin.Forms.Xaml0` namespace, which must be imported to use them.
|
||||
|
||||
|
||||
## Related Links
|
||||
|
|
Загрузка…
Ссылка в новой задаче