Xamarin.Forms.DependencyFetchTarget Enumeration
Enumeration specifying whether DependencyService.Get should return a reference to a global or new instance.

Syntax

public enum DependencyFetchTarget

Remarks

The following example shows how Xamarin.Forms.DependencyFetchTarget can be used to specify a new instance:

C# Example

var secondFetch = DependencyService.Get<IDependencyTest> (DependencyFetchTarget.NewInstance);
          

Members

Member NameDescription
GlobalInstanceReturn a global instance.
NewInstanceReturn a new instance.

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0