Szerkesztés

Megosztás a következőn keresztül:


AttachablePropertyServices.TryGetProperty Method

Definition

Overloads

TryGetProperty(Object, AttachableMemberIdentifier, Object)

Attempts to get a value for the specified attachable property in the specified store. Does not throw an exception if the specific attachable property does not exist in the store.

TryGetProperty<T>(Object, AttachableMemberIdentifier, T)

Attempts to get a value for the specified attachable property in the specified store, returning a generic output form. Does not throw an exception if the specific attachable property does not exist in the store.

TryGetProperty(Object, AttachableMemberIdentifier, Object)

Attempts to get a value for the specified attachable property in the specified store. Does not throw an exception if the specific attachable property does not exist in the store.

public:
 static bool TryGetProperty(System::Object ^ instance, System::Xaml::AttachableMemberIdentifier ^ name, [Runtime::InteropServices::Out] System::Object ^ % value);
public static bool TryGetProperty (object instance, System.Xaml.AttachableMemberIdentifier name, out object value);
static member TryGetProperty : obj * System.Xaml.AttachableMemberIdentifier * obj -> bool
Public Shared Function TryGetProperty (instance As Object, name As AttachableMemberIdentifier, ByRef value As Object) As Boolean

Parameters

instance
Object

A specific attachable property store that implements IAttachedPropertyStore; or any non-null object to use a static default attachable property store.

name
AttachableMemberIdentifier

The identifier of the attachable property entry for which to get a value.

value
Object

Out parameter. When this method returns, contains the destination object for the value if name exists in the store and has a value.

Returns

true if an attachable property entry for name was found in the store and a value was posted to value; otherwise, false.

Applies to

TryGetProperty<T>(Object, AttachableMemberIdentifier, T)

Attempts to get a value for the specified attachable property in the specified store, returning a generic output form. Does not throw an exception if the specific attachable property does not exist in the store.

public:
generic <typename T>
 static bool TryGetProperty(System::Object ^ instance, System::Xaml::AttachableMemberIdentifier ^ name, [Runtime::InteropServices::Out] T % value);
public static bool TryGetProperty<T> (object instance, System.Xaml.AttachableMemberIdentifier name, out T value);
static member TryGetProperty : obj * System.Xaml.AttachableMemberIdentifier * 'T -> bool
Public Shared Function TryGetProperty(Of T) (instance As Object, name As AttachableMemberIdentifier, ByRef value As T) As Boolean

Type Parameters

T

The expected type of the output.

Parameters

instance
Object

A specific attachable property store that implements IAttachedPropertyStore; or any non-null object to access a static default attachable property store.

name
AttachableMemberIdentifier

The identifier of the attachable property entry for which to get a value.

value
T

Out parameter. When this method returns, contains the destination object for the value if name exists in the store and has a value.

Returns

true if an attachable property entry for name was found in the store and a value was posted to value; otherwise, false.

Applies to