Determines whether the child is allowed to consume a piece of content. If the content is blocked, this method will display a “content blocked by Family Safety” dialog with options to request a parental override. Applications are expected to take no action if this method returns false.
public:
IAsyncOperation<bool>^ RequestContentAccessAsync(
RatedContentDescription^ ratedContentDescription
)
ratedContentDescription
Type: RatedContentDescription
Describes the content for which access is being requested.
Type: IAsyncOperation<Boolean>
Returns an IAsyncOperation<TResult> object that represents the state of the asynchronous operation. Completion of the asynchronous operation is signaled by using a handler that is passed to the IAsyncOperation<TResult>.Completed property. When the asynchronous operation is complete, the result of the operation can be retrieved by using the IAsyncOperation<TResult>.GetResults method.
The result is true if the app can display the content, and false if the app should take no action.
public async Task PlayMovie(RatedContentInfo content)
{
if (await RatedContentRestrictions.Default.RequestContentAccessAsync(content))
{
// Play the content
}
}
Namespace: Windows.Media.ContentRestrictions
Metadata: windows.winmd
RatedContentRestrictions Class