共用方式為


PerceptionControlSession.TrySetPropertyAsync(String, Object) 方法

定義

建立屬性變更要求。 此要求會以非同步方式處理,而且不保證會成功。 應該檢查屬性變更結果,以判斷是否實際接受屬性變更,如果不是,則表示屬性變更不受接受的原因。

public:
 virtual IAsyncOperation<PerceptionFrameSourcePropertyChangeResult ^> ^ TrySetPropertyAsync(Platform::String ^ name, Platform::Object ^ value) = TrySetPropertyAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<PerceptionFrameSourcePropertyChangeResult> TrySetPropertyAsync(winrt::hstring const& name, IInspectable const& value);
/// [Windows.Foundation.Metadata.RemoteAsync]
/// [Windows.Foundation.Metadata.Deprecated("PerceptionControlSession may be unavailable after Windows Creator Update.  Please refer to Windows.Media.Capture.Frames APIs on MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
IAsyncOperation<PerceptionFrameSourcePropertyChangeResult> TrySetPropertyAsync(winrt::hstring const& name, IInspectable const& value);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<PerceptionFrameSourcePropertyChangeResult> TrySetPropertyAsync(string name, object value);
[Windows.Foundation.Metadata.RemoteAsync]
[Windows.Foundation.Metadata.Deprecated("PerceptionControlSession may be unavailable after Windows Creator Update.  Please refer to Windows.Media.Capture.Frames APIs on MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 262144, "Windows.Foundation.UniversalApiContract")]
public IAsyncOperation<PerceptionFrameSourcePropertyChangeResult> TrySetPropertyAsync(string name, object value);
function trySetPropertyAsync(name, value)
Public Function TrySetPropertyAsync (name As String, value As Object) As IAsyncOperation(Of PerceptionFrameSourcePropertyChangeResult)

參數

name
String

Platform::String

winrt::hstring

要變更的屬性名稱。

value
Object

Platform::Object

IInspectable

新的屬性值。

傳回

這個方法會以非同步方式傳回屬性變更要求的結果。

屬性

適用於