DataProviderRequest class
An object of this type is passed to the DataProviderHandler delegate.
Syntax
Attributes
- DualApiPartitionAttribute()
- MarshalingBehaviorAttribute(Agile)
- VersionAttribute(NTDDI_WIN8)
Members
The DataProviderRequest class has these types of members:
Methods
The DataProviderRequest class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.
| Method | Description |
|---|---|
| GetDeferral | Returns a DataProviderDeferral object. |
| SetData | Sets the content of the DataPackage to be shared with a target app. |
Properties
The DataProviderRequest class has these properties.
| Property | Access type | Description |
|---|---|---|
| Read-only | Gets the deadline for finishing a delayed rendering operation. If execution goes beyond that deadline, the results of delayed rendering are ignored. | |
| Read-only | Specifies the format id. |
Remarks
Use this object when you need to delay, or defer, a share for a few milliseconds. To learn more, check out How to delay sharing.
Windows Phone 8
This API is not implemented and will throw an exception if called.
Examples
async void OnDeferredImageRequestedHandler(DataProviderRequest request) { // Here we provide updated Bitmap data using delayed rendering if (this.imageStream != null) { DataProviderDeferral deferral = request.GetDeferral(); try { InMemoryRandomAccessStream inMemoryStream = new InMemoryRandomAccessStream(); // Decode the image BitmapDecoder imageDecoder = await BitmapDecoder.CreateAsync(this.imageStream); // Re-encode the image at 50% width and height BitmapEncoder imageEncoder = await BitmapEncoder.CreateForTranscodingAsync(inMemoryStream, imageDecoder); imageEncoder.BitmapTransform.ScaledWidth = (uint)(imageDecoder.OrientedPixelHeight * 0.5); imageEncoder.BitmapTransform.ScaledHeight = (uint)(imageDecoder.OrientedPixelHeight * 0.5); await imageEncoder.FlushAsync(); request.SetData(RandomAccessStreamReference.CreateFromStream(inMemoryStream)); } catch (Exception ex) { // Handle the exception } finally { deferral.Complete(); } } }
Requirements
|
Minimum supported client | Windows 8 [Windows Store apps, desktop apps] |
|---|---|
|
Minimum supported server | Windows Server 2012 [Windows Store apps, desktop apps] |
|
Minimum supported phone | Windows Phone 8 |
|
Namespace |
|
|
Metadata |
|
Build date: 2/25/2013