Esempio n. 1
0
        protected override void OnRenderSizeChanged(SizeChangedInfo size_info)
        {
            m_resized = true;
            base.OnRenderSizeChanged(size_info);
            D3DImage.Invalidate();

            // Invalidate after the last resize
            if (!m_resize_invalidate_pending)
            {
                m_resize_invalidate_pending = true;
                var resize_issue = ++m_resize_issue;
                Dispatcher_.BeginInvokeDelayed(FinalInvalidate, TimeSpan.FromMilliseconds(1), DispatcherPriority.Background);
                void FinalInvalidate()
                {
                    m_resize_invalidate_pending = false;
                    if (resize_issue != m_resize_issue || Window == null)
                    {
                        return;
                    }
                    Invalidate();
                }
            }
        }