private void SubscribeToCommittingBatch()
{
if (!_isWaitingForPresent)
{
// Suppose this D3DImage is not on the main UI thread. This thread will
// never commit a batch so we don't want to add an event handler to it
// since it will never get removed
MediaContext mediaContext = MediaContext.From(Dispatcher);
if (_duceResource.IsOnChannel(mediaContext.Channel))
{
mediaContext.CommittingBatch += _sendPresentDelegate;
_isWaitingForPresent = true;
}
}
}