protected override void OnAttach(VideoBackend backend)
        {
            var videoPeripheral = (AutoRepaintingVideo)backend.Video;

            element     = videoPeripheral;
            lastRewrite = CustomDateTime.Now;
            EnsureAnalyserWidget();

            videoPeripheral.ConfigurationChanged += (w, h, f, e) => ApplicationExtensions.InvokeInUIThread(() => displayWidget.SetDisplayParameters(w, h, f, e));
            videoPeripheral.FrameRendered        += (f) => ApplicationExtensions.InvokeInUIThread(() => displayWidget.DrawFrame(f));

            displayWidget.InputAttached += i =>
            {
                if (i is IKeyboard)
                {
                    keyboardsComboBox.SelectedItem = i;
                }
                else if (i is IPointerInput)
                {
                    pointersComboBox.SelectedItem = i;
                }
            };

            if (backend.Frame != null)
            {
                // this must be called after setting `ConfigurationChanged` event;
                // otherwise the frame set here would be overrwritten by a new, empty, instance
                ApplicationExtensions.InvokeInUIThreadAndWait(() =>
                {
                    displayWidget.SetDisplayParameters(backend.Width, backend.Height, backend.Format, backend.Endianess);
                    displayWidget.DrawFrame(backend.Frame);
                });
            }
        }