private void capGrabber_NewFrameArrived(object sender, EventArgs e)
{
// Make sure to be thread safe
if (Dispatcher != null)
{
Dispatcher.Invoke(DispatcherPriority.Render, (SendOrPostCallback) delegate
{
if (BitmapSource != null)
{
BitmapSource.Invalidate();
UpdateFramerate();
}
}, null);
}
}