Пример #1
0
 protected virtual void OnPartReady()
 {
     if (PartReady != null)
     {
         PartReadyEventArgs args = new PartReadyEventArgs();
         args.Part = _currentPart;
         PartReady(this, args);
     }
 }
Пример #2
0
        private void _reader_PartReady(object sender, PartReadyEventArgs e)
        {
            //let's get this events back on the UI thread
            Stream frameStream = new MemoryStream(e.Part);

            App.Current.Dispatcher.Invoke(new Action(() =>
            {
                _currentFrame = new BitmapImage();
                _currentFrame.BeginInit();
                _currentFrame.StreamSource = frameStream;
                _currentFrame.EndInit();
                OnImageReady();
            }));
        }